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)) {
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<<i);
- printf("%x\n",(ntohs(w_hdr->frame_ctl) & (1<<i)));
- }
- printf("frame_control: %x duration_id: %x\n",ntohs(w_hdr->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<<i))>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 */
ip_hdr->daddr&0xff<<i,
(i==0?"\n":"."));
}
- // printf("ip_addresses: source = ");
- // printf("%s\tdestination = %s\n",inet_ntoa(ip_hdr->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;i<pcap_header->caplen;i++)
+ printf("all dump: (hex)\n");
+ for(i=p_o+w_o;i<pcap_header->caplen;i++)
printf("%x ",*(package+i));
printf("\n");
- printf("all ethernet dump: (char)\n");
- for(i=p_o+w_o+e_o;i<pcap_header->caplen;i++)
+ printf("all dump: (char)\n");
+ for(i=p_o+w_o;i<pcap_header->caplen;i++)
printf("%c ",*(package+i));
printf("\n");
}