capture packets with libpcap.
i'm trying to capture packets between my computer and internet, then i copy codes from examples. now i get two questions about libpcap.
i wrote these:
and in my callbak function
u_int16_t handle_ethernet(u_char *args, const struct pcap_pkthdr *pkthdr, const u_char *packet)
struct ether_header *eptr;
1. when i connect to internet via ADSL modem and "ping google.com", the programm always prints "unknown", shouldn't it be "ip"? if not, what is it? and when i ping the ADSL modem like this--ping 192.168.1.1, it prints "ip".
2. how can i know what the destinaion ip and source ip is? in brief, i want to get this "from 188.8.131.52 to 184.108.40.206" while i "ping google.com", can i do that with libpcap?
Last edited by smn; 11-13-2003 at 07:17 PM.