Re: Get name and ip-address for each interface
From: Jeremy Jackson
Date: Wed Apr 15 2009 - 15:40:29 EST
On Wed, 2009-04-15 at 19:05 +0000, Miquel van Smoorenburg wrote:
> Use recvmsg with IP_PKTINFO. For each packet received you'll also
> get information about the destination IP address and thus the interface
> it was received on.
> See for example src/lib/udpfromto.c from freeradius,
And to track what IPs and what interfaces there are, use netlink socket
to get updates when interfaces are reconfigured/added/removed.
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