LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 05-12-2013, 09:45 AM   #1
arnold.kang
LQ Newbie
 
Registered: Mar 2013
Location: Chengdu.China
Distribution: fedora
Posts: 29

Rep: Reputation: Disabled
Smile get local ip address base on route table on linux (c language)


hi,
all. i'm writing a program recently. it will use host ip address. when the host have more than one net interface. the local ip address must dynamically choosed base on route table to destination. i know in BSD, there is a interface to get it . but in linux, no stand lib to call, (maybe i did not found). anyway, how can i implement in in C. any advice or code will be appreciate
 
Old 05-13-2013, 12:56 AM   #2
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,269

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
This may help http://beej.us/guide/bgnet/
 
Old 05-14-2013, 08:44 PM   #3
arnold.kang
LQ Newbie
 
Registered: Mar 2013
Location: Chengdu.China
Distribution: fedora
Posts: 29

Original Poster
Rep: Reputation: Disabled
thanks
 
  


Reply

Tags
network interface, programing


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
FIB forwarding information base route table ? fran1942 Fedora 0 09-12-2012 01:35 AM
550.5.1.1 Recipient address rejected: User unknown in local recipient table RCPT_TO said76 Ubuntu 1 09-24-2011 10:01 PM
"ip route flush table main" doesn't work correctly from rc.local? gleemer Linux - Networking 0 08-17-2011 05:03 PM
Linux route/routing table NoahJK Linux - Server 7 06-25-2010 01:43 PM
I am not able to add a new route to my route table using route command prashanth s j Linux - Networking 2 09-03-2005 04:34 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration