简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM