+
+ /* do loopp */
+ while (1) {
+
+ /* set pcap_fd */
+ FD_ZERO(&pcap_fd_set);
+ FD_SET(pcap_fd,&pcap_fd_set);
+ fd_set_tv.tv_sec=0;
+ fd_set_tv.tv_usec=200000;
+
+ 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) {
+ printf("channelhopping failed, aborting\n");
+ return -1;
+ }
+ }
+ return 0;
+}
+
+
+/* pcap_process callback function */
+void pcap_process(u_char *info,const struct pcap_pkthdr *pcap_header,
+ const u_char *package) {
+
+ /* local variables */
+ struct linux_wlan_ng_prism_hdr *prism_hdr;
+ struct ieee802_11_hdr *w_hdr;
+ struct ethhdr *e_hdr;
+ struct ip *ip_hdr;
+ struct info_struct *my_info_struct;
+ int i,p_o,w_o,e_o,i_o;