const u_char *package;
struct pcap_pkthdr pcap_header;
struct ethhdr *e_hdr;
+ struct ip *ip_hdr;
struct ieee802_11_hdr *w_hdr;
/* parse the arguments */
printf("%x%s",*(e_hdr->h_source+i),((i==ETH_ALEN-1)?"\n":":"));
if(ntohs(e_hdr->h_proto)==ETH_P_IP) {
printf("ip protocol: ");
- // printf("
+ ip_hdr=(struct ip *)(package+sizeof(struct ethhdr));
+ printf("version = %x ",ntohs(ip_hdr->ip_v:4));
+ printf("header length = %x\n",ntohs(ip_hdr->ip_hl:4));
}
printf("rest:\n");
for(i=sizeof(struct ethhdr);i<pcap_header.caplen;i++)