given a pcap file, how to find if a src ip address is local or remote using jpcap
Pregunta
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?
Solución
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".
Otros consejos
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()
.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow