LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-08-2013, 05:34 AM   #1
rabbi
LQ Newbie
 
Registered: Jun 2013
Posts: 6

Rep: Reputation: Disabled
where is the kernel routing table in the linux source code


Hi,

forgive me if it is a lame question. I am using fedora 14 and I have to bring some changes in the source code of the kernel routing table. i have downloaded the rpm of the source code and trying to modify the code. But I cant exactly find where the source code of the routing table is as the source code is huge..

I am new in linux...Please help me out

rabbi
 
Old 07-08-2013, 06:59 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
You don't mention what needs to be changed in the source code or why.

First thing that came to mind: You are using Fedora 14, which has reached EOL end 2011 (Fedora Version History). This version used kernel version 2.6.35.

Maybe your problems are solved when you start using an up-to-date and recent Fedora version (current one uses kernel version 3.9).

Last edited by druuna; 07-08-2013 at 07:25 AM. Reason: Spelling: changes -> changed
 
Old 07-08-2013, 07:47 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,333
Blog Entries: 12

Rep: Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729
The Interactive Kernel Map might help with your original question.

And druna is correct, upgrading to a supported system, if nothing else to have access to security updates, is an excellent idea.
 
Old 07-09-2013, 01:54 AM   #4
rabbi
LQ Newbie
 
Registered: Jun 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
ok..i guess my question was not clear..m sorry for that..actually i want the source code for the kernel route table....I mean kernel also maintains a route table to compute the next hop for the packet which also compute the topology, for example the $route -n command shows the kernel route table...my question was where can I find the source code for this table. In the lxr I found route.c file in linux/net/ipv4/route.c directory.....I am a bit confused if this is the code I am looking for...it would be very kind for me if anyone knows where in the code kernel keeps it rout table information.....

thanks in advance...and thanks for that map frankbell..that gave me some idea..

regards
Rabbi
 
Old 07-09-2013, 02:34 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
The route command is part of the net-tools package:

- net-tools (sourceforge)

Do make sure the package version is in line with your out-of-date Fedora 14.

Last edited by druuna; 07-09-2013 at 03:33 AM. Reason: Fixed weird sentence
 
Old 07-09-2013, 11:48 AM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,599

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Quote:
Originally Posted by rabbi View Post
ok..i guess my question was not clear..m sorry for that..actually i want the source code for the kernel route table....I mean kernel also maintains a route table to compute the next hop for the packet which also compute the topology, for example the $route -n command shows the kernel route table...my question was where can I find the source code for this table. In the lxr I found route.c file in linux/net/ipv4/route.c directory.....I am a bit confused if this is the code I am looking for...it would be very kind for me if anyone knows where in the code kernel keeps it rout table information.....

thanks in advance...and thanks for that map frankbell..that gave me some idea..

regards
Rabbi
You still aren't clear. Are you modifying how the tables are used, or just the contents of the table?

The table itself is dynamic. It is allocated as routes are identified, deallocated as routes deleted.
 
Old 07-09-2013, 02:46 PM   #7
rabbi
LQ Newbie
 
Registered: Jun 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
no, I am not modifying the table, neither the contents. I have to put a hook in the code tok extract the contents from it. I just want the location of the code of that kernel route table..I cant find it.

regards
 
Old 07-09-2013, 06:56 PM   #8
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,599

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
You don't need it. Just look in the /proc/net/route file.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Flushing Linux kernel routing table - server got shutdown shreeman Linux - Kernel 1 07-13-2009 06:51 AM
In Linux, How to read and modify Kernel IP routing table entries from a c program sakthivelbatusai Linux - Networking 1 03-29-2007 07:36 AM
Bypass kernel routing table hk_linux Linux - Networking 2 09-01-2006 10:55 AM
editing Kernel IP Routing Table hamish Linux - Networking 0 10-06-2003 05:22 AM


All times are GMT -5. The time now is 03:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration