LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Multiple addresses for a single NIC (http://www.linuxquestions.org/questions/programming-9/multiple-addresses-for-a-single-nic-72886/)

grub 07-15-2003 07:50 AM

Multiple addresses for a single NIC
 
I am having one network card, which is aliased for 4 different ip addresses.
How can I get the details of all the ip addressess using my C program.

Presently for eth0 if I do a ioctl, it returns one ipaddress. How to get the details about other ip address.

Thanks
Grub

shishir 08-04-2003 02:24 AM

try using ioctl with SIOCGICONF....flag and get the information of the interface in the structure ..struct ifreq ..


open a socket and pass the fd to ioctl...with the aformentioned flag ..should work


All times are GMT -5. The time now is 07:46 PM.