From: hackbard Date: Wed, 13 Nov 2002 20:43:02 +0000 (+0000) Subject: framecontrol work X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=c2811e86568574868fb22f5c160d5929e1715359;p=my-code%2Fhdw-sniff.git framecontrol work --- diff --git a/hdw-sniff.c b/hdw-sniff.c index f6da20f..05db8bf 100644 --- a/hdw-sniff.c +++ b/hdw-sniff.c @@ -142,7 +142,8 @@ void pcap_process(u_char *info,const struct pcap_pkthdr *pcap_header, printf("pcap header:\n"); printf("capture_length: %d (dec.)\t",pcap_header->caplen); printf("length(off wire): %d (dec.)\n",pcap_header->len); - + + /* wireless stuff */ /* prism wlan ng headers */ if((my_info_struct->mmode-0x30==1) && (strncmp(my_info_struct->dev,"wlan",4)==0)) { @@ -151,26 +152,20 @@ void pcap_process(u_char *info,const struct pcap_pkthdr *pcap_header, printf("message code/length: %d/%d\n",ntohs(prism_hdr->msgcode), ntohs(prism_hdr->msglen)); printf("device: %s\n",prism_hdr->devname); - /* skip wlan_ng_prism header */ - // package=package+p_o; - /* ieee802.11 header */ printf("ieee802.11 header: (%d bytes)\n",w_o); w_hdr=(struct ieee802_11_hdr *)(package+p_o); - printf("debug:\n"); - for(i=0;i<16;i++) { - printf("%x -> ",1<frame_ctl) & (1<frame_ctl), - ntohs(w_hdr->duration_id)); + printf("fc: "); + for(i=0;i<16;i++) + printf("%s%d%s",(i==0?"|":""), + ((ntohs(w_hdr->frame_ctl) & (1<0?"1":"0"), + (i==15?"|\n":"")); + + printf("ion_id: %x\n",ntohs(w_hdr->duration_id)); printf("version check ... %s\n", ((ntohs(w_hdr->frame_ctl) & IEEE802_11_FCTL_VERS)==0x00)? "ok":"unknown"); - // printf("type: - /* skip ieee802.11 header */ - // package=package+w_o; } /* ieee802.3 */ @@ -207,21 +202,18 @@ void pcap_process(u_char *info,const struct pcap_pkthdr *pcap_header, ip_hdr->daddr&0xff<saddr), - // inet_ntoa(ip_hdr->daddr)); printf("ip_id = %x ",ntohs(ip_hdr->id)); printf("ip_offset = %x \n",ntohs(ip_hdr->frag_off)); printf("time2live = %x ip_proto = %x\n",ntohs(ip_hdr->ttl), ntohs(ip_hdr->protocol)); // printf("chksum: %x\n",ntohs(ip_hdr->ip_sum)); } - printf("all ethernet dump: (hex)\n"); - for(i=p_o+w_o+e_o;icaplen;i++) + printf("all dump: (hex)\n"); + for(i=p_o+w_o;icaplen;i++) printf("%x ",*(package+i)); printf("\n"); - printf("all ethernet dump: (char)\n"); - for(i=p_o+w_o+e_o;icaplen;i++) + printf("all dump: (char)\n"); + for(i=p_o+w_o;icaplen;i++) printf("%c ",*(package+i)); printf("\n"); }