Re: [tcpdump-workers] Obtaining interface IP address and MAC address

2011-01-25 Thread roy hills
> The interfaces used to do both of the above are almost universal now: > SIOCGIFADDR and SIOCGIFHWADDR. I don't think SIOCGIFHWADDR is supported on MacOS or Windows. For MacOS and other BSD operating systems, I use sysctl with the MIB { CTL_NET, PF_ROUTE, 0, AF_LINK, NET_RT_IFLIST, 0 } and lo

Re: [tcpdump-workers] Obtaining interface IP address and MAC address

2011-01-24 Thread Guy Harris
On Jan 24, 2011, at 5:56 PM, Darren Reed wrote: > Why should it need to? > > The interfaces used to do both of the above are almost universal now: > SIOCGIFADDR and SIOCGIFHWADDR. So I can do those ioctls on Windows? Google says, for what it's worth: Your search - SIOCGIFADDR site:ms

Re: [tcpdump-workers] Obtaining interface IP address and MAC address

2011-01-24 Thread Darren Reed
roy hills wrote: I maintain an application that uses libpcap to receive frames, and uses its own link-specific functions to obtain interface details and send frames. I currently support packet socket (Linux), BPF (BSD) and DLPI (Solaris). I'd like to use libpcap to send as well as receive fra

Re: [tcpdump-workers] Obtaining interface IP address and MAC address with libpcap

2011-01-24 Thread Guy Harris
On Jan 24, 2011, at 3:49 AM, roy hills wrote: > Does libpcap allow me to get the interface IP address Yes - use pcap_findalldevs() and look for the interface in question; note, however, that you really mean "the interface's IP addresses", plural, as an interface could have more than one IPv4 a

[tcpdump-workers] Obtaining interface IP address and MAC address with libpcap

2011-01-24 Thread roy hills
I maintain an application that uses libpcap to receive frames, and uses its own link-specific functions to obtain interface details and send frames. I currently support packet socket (Linux), BPF (BSD) and DLPI (Solaris). I'd like to use libpcap to send as well as receive frames, and notice th