X-Git-Url: https://www.hackdaworld.org/gitweb/?a=blobdiff_plain;f=hdw-sniff.c;h=816e778bf1fc1e4f7538bc8b9cb8f70e928e1b62;hb=d77d3212b85b3a67ccf11abab94aa8ddc389cf04;hp=18148572ec9f867e6f51a896761807fe7adcf9a0;hpb=9ad5fae0187dba865b7f823e4a6453ee5fa1740c;p=my-code%2Fhdw-sniff.git diff --git a/hdw-sniff.c b/hdw-sniff.c index 1814857..816e778 100644 --- a/hdw-sniff.c +++ b/hdw-sniff.c @@ -167,29 +167,33 @@ 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"); - if((w_hdr->frame_ctl & IEEE802_11_STYPE_ATIM)>0) - strcpy(tmp_buf,"announcement traffic indication message"); - if((w_hdr->frame_ctl & IEEE802_11_STYPE_DISASSOC)>0) - strcpy(tmp_buf,"disassociation"); - if((w_hdr->frame_ctl & IEEE802_11_STYPE_AUTH)>0) - strcpy(tmp_buf,"authentification"); - if((w_hdr->frame_ctl & IEEE802_11_STYPE_DEAUTH)>0) - strcpy(tmp_buf,"deauthentification"); + /* management */ + if(!(w_hdr->frame_ctl & 0x0c)) { if((w_hdr->frame_ctl & IEEE802_11_STYPE_ASSOC_REQ)>0) strcpy(tmp_buf,"association request"); - if((w_hdr->frame_ctl & IEEE802_11_STYPE_ASSOC_RESP)>0) + else if((w_hdr->frame_ctl & IEEE802_11_STYPE_ASSOC_RESP)>0) strcpy(tmp_buf,"association response"); - if((w_hdr->frame_ctl & IEEE802_11_STYPE_REASSOC_REQ)>0) + else if((w_hdr->frame_ctl & IEEE802_11_STYPE_REASSOC_REQ)>0) strcpy(tmp_buf,"reassociation request"); - if((w_hdr->frame_ctl & IEEE802_11_STYPE_REASSOC_RESP)>0) + else if((w_hdr->frame_ctl & IEEE802_11_STYPE_REASSOC_RESP)>0) strcpy(tmp_buf,"reassociation response"); - if((w_hdr->frame_ctl & IEEE802_11_STYPE_PROBE_REQ)>0) + else if((w_hdr->frame_ctl & IEEE802_11_STYPE_PROBE_REQ)>0) strcpy(tmp_buf,"probe request"); - if((w_hdr->frame_ctl & IEEE802_11_STYPE_PROBE_RESP)>0) + else if((w_hdr->frame_ctl & IEEE802_11_STYPE_PROBE_RESP)>0) strcpy(tmp_buf,"probe response"); - else strcpy(tmp_buf,"unknown"); + 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);