if((select(pcap_fd+1,&pcap_fd_set,NULL,NULL,&fd_set_tv)) && (FD_ISSET(pcap_fd,&pcap_fd_set))) pcap_dispatch(pcap_handle,-1,pcap_process,(u_char *)&my_info_struct);
else if((hop_channel(&my_info_struct,foo_fd))==-1) {
if((select(pcap_fd+1,&pcap_fd_set,NULL,NULL,&fd_set_tv)) && (FD_ISSET(pcap_fd,&pcap_fd_set))) pcap_dispatch(pcap_handle,-1,pcap_process,(u_char *)&my_info_struct);
else if((hop_channel(&my_info_struct,foo_fd))==-1) {
/* prism wlan ng headers */
if((my_info_struct->mmode-0x30==1) &&
(strncmp(my_info_struct->dev,"wlan",4)==0)) {
/* prism wlan ng headers */
if((my_info_struct->mmode-0x30==1) &&
(strncmp(my_info_struct->dev,"wlan",4)==0)) {
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);
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);
- printf("ieee802.11 header:\n");
- package+=sizeof(struct linux_wlan_ng_prism_hdr);
- w_hdr=(struct ieee802_11_hdr *)package;
+ printf("ieee802.11 header: (%d bytes)\n",w_o);
+ w_hdr=(struct ieee802_11_hdr *)(package+p_o);
printf("version = %x ",ntohs(ip_hdr->ip_v));
printf("header_length = %x \n",ntohs(ip_hdr->ip_hl));
printf("service = %x ",ntohs(ip_hdr->ip_tos));
printf("version = %x ",ntohs(ip_hdr->ip_v));
printf("header_length = %x \n",ntohs(ip_hdr->ip_hl));
printf("service = %x ",ntohs(ip_hdr->ip_tos));