From 95e482eef2af91c6bb150d4e92cb73503d6b8fb9 Mon Sep 17 00:00:00 2001 From: hackbard Date: Mon, 30 Sep 2002 00:59:35 +0000 Subject: [PATCH] introduced prism wlan ng header members --- hdw-sniff.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/hdw-sniff.c b/hdw-sniff.c index 0afd857..ab67722 100644 --- a/hdw-sniff.c +++ b/hdw-sniff.c @@ -85,9 +85,10 @@ void pcap_process(u_char *info,const struct pcap_pkthdr *pcap_header, const u_char *package) { /* local variables */ - struct ethhdr *e_hdr; - struct ip *ip_hdr; + struct linux_wlan_ng_prism_hdr *prism_hdr; struct ieee802_11_hdr *w_hdr; + struct ip *ip_hdr; + struct ethhdr *e_hdr; struct info_struct *my_info_struct; int i; @@ -98,23 +99,34 @@ void pcap_process(u_char *info,const struct pcap_pkthdr *pcap_header, printf("---> package %d ---- %s",my_info_struct->count, ctime((const time_t*)&(pcap_header->ts.tv_sec))); printf("pcap header:\n"); - printf("capture_length: %d (dec.)",pcap_header->caplen); + printf("capture_length: %d (dec.)\t",pcap_header->caplen); printf("length(off wire): %d (dec.)\n",pcap_header->len); - /* is ieee802.11 ? -- we assume yes :) */ + /* prism wlan ng headers */ if((my_info_struct->mmode-0x30==1) && (strncmp(my_info_struct->dev,"wlan",4)==0)) { + printf("prism header:\n"); + prism_hdr=(struct linux_wlan_ng_prism_hdr *)package; + printf("message code/length: %d/%d\n",ntohs(prism_hdr->msgcode), + ntohs(prism_hdr->msglen)); + printf("device: %s\n",prism_hdr->devname); + + /* ieee802.11 header */ printf("ieee802.11 header:\n"); + package+=sizeof(struct linux_wlan_ng_prism_hdr); w_hdr=(struct ieee802_11_hdr *)package; printf("debug:\n"); for(i=0;i<16;i++) { printf("%x -> ",1<frame_ctl & 1<frame_ctl) & (1<frame_ctl), 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+sizeof(struct ieee802_11_hdr); } -- 2.39.2