]> hackdaworld.org Git - my-code/hdw-sniff.git/commitdiff
completed management support.
authorhackbard <hackbard>
Thu, 14 Nov 2002 00:40:02 +0000 (00:40 +0000)
committerhackbard <hackbard>
Thu, 14 Nov 2002 00:40:02 +0000 (00:40 +0000)
hdw-sniff.c

index 6ba9c829bb1b0ce8d539456ae608ffad61328a0a..816e778bf1fc1e4f7538bc8b9cb8f70e928e1b62 100644 (file)
@@ -167,17 +167,9 @@ void pcap_process(u_char *info,const struct pcap_pkthdr *pcap_header,
                                (i==15?"|\n":"|"));
        printf("    | v | t |  s-t  |t|f|m|r|p|m|w|o|\n");
        /* frame type */
-       if((w_hdr->frame_ctl & IEEE802_11_STYPE_BEACON)>0)
-               strcpy(tmp_buf,"beacon");
-       else if((w_hdr->frame_ctl & IEEE802_11_STYPE_ATIM)>0)
-               strcpy(tmp_buf,"announcement traffic indication message");
-       else if((w_hdr->frame_ctl & IEEE802_11_STYPE_DISASSOC)>0)
-               strcpy(tmp_buf,"disassociation");
-       else if((w_hdr->frame_ctl & IEEE802_11_STYPE_AUTH)>0)
-               strcpy(tmp_buf,"authentification");
-       else if((w_hdr->frame_ctl & IEEE802_11_STYPE_DEAUTH)>0)
-               strcpy(tmp_buf,"deauthentification");
-       else if((w_hdr->frame_ctl & IEEE802_11_STYPE_ASSOC_REQ)>0)
+       /* management */
+       if(!(w_hdr->frame_ctl & 0x0c)) {
+       if((w_hdr->frame_ctl & IEEE802_11_STYPE_ASSOC_REQ)>0)
                strcpy(tmp_buf,"association request");
        else if((w_hdr->frame_ctl & IEEE802_11_STYPE_ASSOC_RESP)>0)
                strcpy(tmp_buf,"association response");
@@ -189,7 +181,19 @@ void pcap_process(u_char *info,const struct pcap_pkthdr *pcap_header,
                strcpy(tmp_buf,"probe request");
        else if((w_hdr->frame_ctl & IEEE802_11_STYPE_PROBE_RESP)>0)
                strcpy(tmp_buf,"probe response");
-       else strcpy(tmp_buf,"unknown yet!");
+       else if((w_hdr->frame_ctl & IEEE802_11_STYPE_BEACON)>0)
+               strcpy(tmp_buf,"beacon");
+       else if((w_hdr->frame_ctl & IEEE802_11_STYPE_ATIM)>0)
+               strcpy(tmp_buf,"announcement traffic indication message");
+       else if((w_hdr->frame_ctl & IEEE802_11_STYPE_DISASSOC)>0)
+               strcpy(tmp_buf,"disassociation");
+       else if((w_hdr->frame_ctl & IEEE802_11_STYPE_AUTH)>0)
+               strcpy(tmp_buf,"authentification");
+       else if((w_hdr->frame_ctl & IEEE802_11_STYPE_DEAUTH)>0)
+               strcpy(tmp_buf,"deauthentification");
+       else strcpy(tmp_buf,"impossible situation \%) - go mail the author.");
+       }
+       else strcpy(tmp_buf,"control & monitor frame types not supported yet");
        /* print out frame type */
        printf("=> %s\n",tmp_buf);