]> hackdaworld.org Git - my-code/hdw-sniff.git/commitdiff
improved ieee802.11 sniffs
authorhackbard <hackbard>
Wed, 18 Sep 2002 20:26:57 +0000 (20:26 +0000)
committerhackbard <hackbard>
Wed, 18 Sep 2002 20:26:57 +0000 (20:26 +0000)
hdw-sniff.c

index d3b2ca8965f800f78389755ce3fb395865356dcb..13c56ab7fdd6b91dbffc8752b6302d0a79fcf285 100644 (file)
@@ -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;