Networking Forums

Networking Forums > Computer Networking > Linux Networking > Getting the name of the outbound interface

Reply
Thread Tools Display Modes

Getting the name of the outbound interface

 
 
Grant H.
Guest
Posts: n/a

 
      04-21-2004, 06:08 AM
hi all,

i have the need in my program to determine, given an ip address, what
interface the packets will actually leave the box from. in otherwords,
something like a getdevicename(char *ipaddr) that walks the routing
table & returns an "eth0","eth1" etc. i know i usally take the
routing decision for granted & just leave it up to the kernel to take
care of that for me, but in this case, i need to somehow get that
info. i can quickly write a function like that mentioned above that
will, given an ip, walk the routing table, apply the netmasks & return
the interface name, but i was wondering if any of you guys had a more
clever way of getting this info. or if you're aware of some obscure
function call that does something like this.

thanks in advance!

-grant
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I am in need of a netsh script that will disable the "Local Area Connection" interface then re-enable that same interface. Spin Windows Networking 3 11-03-2005 12:58 AM
serial interface to ethernet interface Kenneth Sparre Linux Networking 9 11-01-2005 12:27 PM
Outbound Wierdness quortex@hotmail.com Linux Networking 2 09-14-2005 08:17 PM
forcing outbound address/interface? skinnay@gmail.com Linux Networking 1 05-21-2005 08:51 AM
Linux API to create logical interface on a physical interface? Zarko Coklin Linux Networking 2 07-18-2004 01:50 AM



1 2 3 4 5 6 7 8 9 10 11