tcpdump mailing list archives

Devices and adresses in libpcap


From: "David Rosal" <drosalri () gmail com>
Date: Sat, 12 Apr 2008 22:31:12 +0200

Hello.

Let me present myself: I am David Rosal, from Barcelona.

I have written a C++ wrapper for libpcap, called libpcap++.

I have implemented almost all pcap functions in the library, and now I am
trying to implement pcap_lookupnet(). But after reading the pcap man page
carefully, there's still something that I don't understand:

As far as I know, each network interface (for example eth0), can have
different adresses, because in pcap_findalldevs(), a pcap_if_t does not hold
a single pcap_addr_t but a linked list of all  addresses for each
interface/device.  But pcap_lookupnet() only returns one address for a given
device. So the question is: If pcap_lookupnet() only returns one address
(and its netmask), does it mean that it discards all the other addresses
for that device? Or does the addresses field of a pcap_if_t hold always only
one pcap_addr_t?

Well, I hope you'll understand what I am trying to say, despite my poor
english.

Thanks in advance for any help. And if you want to take a look at the code
of libpcap++ please browse the SVN repository as it is under rapid
development.

Cheers.

    ~David
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: