LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to make changes to network stack .c files (https://www.linuxquestions.org/questions/linux-networking-3/how-to-make-changes-to-network-stack-c-files-928794/)

peeyushpd 02-11-2012 06:27 AM

How to make changes to network stack .c files
 
Hi,

I want to make changes to the existing network stack code for some reason.
Please let me know where can I find the C files in my system to make any changes or what approach should I take for doing so.

Say I want to make some changes to the network layer. I want to add my module in the existing C code. How can I do that ? Where to find the relevant code ?

Thanks,
Peeyush

hydraMax 02-12-2012 01:58 AM

Not my area of expertise (yet) but I think most the network stack stuff is in the kernel. Download the kernel sources and look in the net directory. You can find directories for ipv4, mac80211, netfilter, and all kinds of other stuff. You will have to recompile and reinstall your kernel (or modules) to see your changes.

Kernel programming is no walk in the park though. You have to be very good with C and learn a lot about the kernel structures and memory locking techniques and so forth. I've got a book I'm going through right now, Essential Linux Device Drivers from Prentice Hall, which is very detailed.

peeyushpd 02-12-2012 02:45 AM

Quote:

Originally Posted by hydraMax (Post 4600275)
Not my area of expertise (yet) but I think most the network stack stuff is in the kernel. Download the kernel sources and look in the net directory. You can find directories for ipv4, mac80211, netfilter, and all kinds of other stuff. You will have to recompile and reinstall your kernel (or modules) to see your changes.

Kernel programming is no walk in the park though. You have to be very good with C and learn a lot about the kernel structures and memory locking techniques and so forth. I've got a book I'm going through right now, Essential Linux Device Drivers from Prentice Hall, which is very detailed.

Hey Thanks,
That gave me a direction to think. Yes for kernel structures I am referring the book "TCP/IP Illustrated, Volume 2 by W. Richard Stevens". All the best.

Thanks,
Peeyush


All times are GMT -5. The time now is 05:35 AM.