given a pcap file, how to find if a src ip address is local or remote using jpcap

StackOverflow https://stackoverflow.com/questions/10399143

  •  04-06-2021
  •  | 
  •  

Domanda

Given a pcap file, how can I find out which src ip addresses are local and which are remote using jpcap? Can any one guide me?

È stato utile?

Soluzione

You can't.

There's nothing intrinsic in a pcap entry to tell you whether the packet was inbound or outbound.

You'll need a configuration file to tell you which IPs are considered "local".

Altri suggerimenti

To determine whether an address is local to the machine on which your pcap-based application is running, the pcap_findalldevs() routine can be used to get a list of all interfaces on that machine, complete with lists of IPv4 and IPv6 addresses assigned to each of the interfaces. I don't know whether jpcap includes support for pcap_findalldevs().

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top