LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   where to find "syms.c" file in fedora core 3 and what are its uses (https://www.linuxquestions.org/questions/linux-networking-3/where-to-find-syms-c-file-in-fedora-core-3-and-what-are-its-uses-443957/)

chitranjan 05-11-2006 08:21 PM

where to find "syms.c" file in fedora core 3 and what are its uses
 
Hi folks,i am trying to build a "packet dropper" n working on fedora core3's 2.6.9-1.667 kernel.
for that i got some help from net and it says to bring changes in few files in source code like "\net\core\dev.c" and "\net\netsyms.c" and to install a module , i have also installed appropriate ".src.rpm " file to get kernel source code.but i could not find "netsyms.c" file at the location specified in that help.changes done in this file are like




net/netsyms.c (after line 544)

...
extern int (*test_function)(struct sk_buff *); /* new */
EXPORT_SYMBOL_NOVERS(test_function); /* new */
EXPORT_SYMBOL(register_gifconf);...


HERE TEST FUNCTION IS USED IN /net/dev.c

So someone please tell me how to get this file or some alternate file to put these changes there.it's a bit urgent!

BSchindler 05-13-2006 04:22 AM

Just asking about syms.c is not enough information! Lots and lots of packages have such a file.

What is the package and where did you get it?

chitranjan 05-13-2006 10:22 AM

Quote:

Originally Posted by BSchindler
Just asking about syms.c is not enough information! Lots and lots of packages have such a file.

What is the package and where did you get it?


hi BSchindler, thanks for showing ur intrest in my problem.the way u wrote i think u r acquainted with "netsym.c"(sorry i just wrote sym.c which is not correct),so can u tell me its use.as far as package is concerned i installed fedora core 3 kernel's version 2.6.9-1.667.src.rpm file from kernel.org site . i have installed it .now as specified by by the document which i got from net "netsym.c" file was supposed to be present at /usr/src/linux/net
location.it could be the case that person who wrote that document was using some different version or some other kernel. actually i am inserting a module in kernel and doing some changes in source code also and "netsym.c" file is needed to write the macro EXPORT_SYMBOL_NOVERS(x)in it to export kernel variables and user variables for modules to use them.

KINDLY RESPOND ME AS EARLY AS POSSIBLE I NEED TO SUBMIT THIS PROJECT AS A PART OF MY B.E degree's major project

btmiller 05-13-2006 05:42 PM

It looks like the netsyms.c file was removed sometime during the 2.5 development series and is not present in 2.6 kernels. I have a copy of 2.4.31 and it looks like all this file had were some EXPORT_SYMBOL directives to make public the network functions that were the interface to the rest of the kernel. Probably under 2.6 you should just put the EXPORT_SYMBOL directives into the source file containing the function or oine of the other sums files as appropriate. For a test function like you appear to have written, I would just put the EXPORT_SYMBOL into the C source file in which you wrote the function.

BTW marking your post as urgent isn't more likely to make people help you. If anythinbg, they're probably more likely to ignore you. The due date of your project is your problem.

BSchindler 05-14-2006 04:41 AM

Thanx btmiller,
I help lots of students with their projects and most of the time, when I am asked, they have put off the work until critical...core dump LOL

However, I did guess that this was a research project (just helped a PHd candidate with a design for VOiP phone, hardware and software and had to deal with this issue (packed dropping)).

Chitranjin, look at http://www.kernelnewbies.org/KernelHacking

chitranjan 05-14-2006 05:49 AM

Quote:

Originally Posted by BSchindler
Thanx btmiller,
I help lots of students with their projects and most of the time, when I am asked, they have put off the work until critical...core dump LOL

However, I did guess that this was a research project (just helped a PHd candidate with a design for VOiP phone, hardware and software and had to deal with this issue (packed dropping)).

Chitranjin, look at http://www.kernelnewbies.org/KernelHacking


thanka btmiller,
can u tell me what this EXPORT_NO_SYMBOLS macro
does ? as u told me to add EXPORT_SYMBOL_NOVERS(x) macro in c file in which test function is used .can i put it in the module where i am calling the test function and then install that module.

btmiller 05-14-2006 04:11 PM

I'm pretty sure that any EXPORT_SYMBOL macro must go somewhere in the main kernel source that has defined the symbol to be exported (i.e. something in the main kernel binary -- not a module -- must know about the symbol in order to export it). I'm about 90% sure of that, but I don't hack the kernel on a regular basis, so I'd advise checking out BSchindler's link for more details. You might also be interested in the 2nd edition of Robert Love's book Linux Kernel Development or the 3rd edition of Bovet and Cesati's Understanding the Linux Kernel. Both cover the 2.6 kernel and should have reasonable up-to-date information.


All times are GMT -5. The time now is 10:18 PM.