From: hackbard Date: Wed, 18 Sep 2002 20:26:57 +0000 (+0000) Subject: improved ieee802.11 sniffs X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11b73fc8a9d2b138de848cbd7362ff3315d47c0f;p=my-code%2Fhdw-sniff.git improved ieee802.11 sniffs --- diff --git a/hdw-sniff.c b/hdw-sniff.c index d3b2ca8..13c56ab 100644 --- a/hdw-sniff.c +++ b/hdw-sniff.c @@ -97,17 +97,21 @@ void pcap_process(u_char *info,const struct pcap_pkthdr *pcap_header, printf("\n"); printf("---> package %d ---- %s",my_info_struct->count, ctime((const time_t*)&(pcap_header->ts.tv_sec))); - printf("pcap header: "); - printf("capture length=%d ",pcap_header->caplen); - printf("length(off wire)=%d\n",pcap_header->len); + printf("pcap header:\n"); + printf("capture_length: %d (dec.)",pcap_header->caplen); + printf("length(off wire): %d (dec.)\n",pcap_header->len); /* is ieee802.11 ? -- we assume yes :) */ if((my_info_struct->mmode-0x30==1) && (strncmp(my_info_struct->dev,"wlan",4)==0)) { - printf("debug: ieee802.11\n"); + printf("ieee802.11 header:\n"); + w_hdr=(struct ieee802_11_hdr *)package; + printf("frame_control: %x duration_id: %x\n",ntohs(w_hdr->frame_ctl), + ntohs(w_hdr->duration_id)); + /* skip ieee802.11 header */ + package=package+sizeof(struct ieee802_11_hdr); } - /* ieee802.3 */ /* ethernet */ e_hdr=(struct ethhdr *)package;