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
  •  | 
  •  

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?

有帮助吗?

解决方案

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".

其他提示

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().

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top