tcpdump mailing list archives

Re: Get my own IP


From: Guy Harris <guy () alum mit edu>
Date: Fri, 23 Mar 2007 16:06:09 -0700


On Mar 23, 2007, at 3:35 PM, Luis Martin Garcia wrote:

Is there any way, using libpcap or not, to get the IP of a network
interface in a portable and easy way?

With newer versions of libpcap/WinPcap, you could try using pcap_findalldevs() and look for the interface in question on the list of interfaces it returns. If you find an entry for that interface, it might include IP addresses for that interface.
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: