Marc, > > Hi > > How can I (easily) find out, if a captured ip-packet was > received by my computer or sent? > > I tried this: > reading the ip-address of the networkadapter with > pcap_findalldevs() and compare it with the captured source- > and destination-ip-address. > but: > on some machines pcap_findalldevs() returns "0.0.0.0" as > ip-address of the adapter! why? so i cannot use the descripted method.
pcap_findalldevs() return 0.0.0.0 when it's not able to obtain any address for an adapter. You are probably using an old version of WinPcap. Those versions relied only on the registry to get adapters' information, and this made it impossible to obtain the address for some kind of adapters, like PPP ones. WinPcap 3.1beta uses the IP Helper API too, and should be more effective in this regard. In every case, since WinPcap doesn't provide a "direction" flag (because NDIS doesn't provide it), the best way to check if a packet is ingoing or outgoing is probably the MAC address rather than the IP adress. Loris > Any other suggestions? > > Thanks... > Marc > > > > > ================================================================== > This is the WinPcap users list. It is archived at > http://www.mail-archive.com/[email protected]/ > > To unsubscribe use > mailto: [EMAIL PROTECTED] > ================================================================== > ================================================================== This is the WinPcap users list. It is archived at http://www.mail-archive.com/[email protected]/ To unsubscribe use mailto: [EMAIL PROTECTED] ==================================================================
