Get name and ip-address for each interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello out there,
I got an interesting but challenging problem.
I want to create a daemon-process, which runs on a host with several
NICs. If the daemon gets a request from one of the interfaces, it
should, amongst others, send back the IP-address and/or MAC-address,
interface-name... of the interface from which the request came. And only
of that interface. No infos about local-interfaces and so on.

My approach so far was to invoke ioctl with the SIOCGIFCONF-request and
collect all informations about every active interface on the host. But I
need at least one unique identifier of the interface from which the
request came. With the interface-name for exeample I can call the/
/SIOCGIFADDR-request to get the IP-address.  How can I achive this.

Has anybody an idea.

Thanks in advance.



--
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux