handle = pcap_open_live(dev, BUFSIZ, 0, 0, errbuf); pcap_compile(handle, &fp, filter_exp, 0, mask) == -1 pcap_setfilter(handle, &fp); struct pcap_pkthdr pcap_header; // The header that pcap gives us const u_char *pcap_packet; // The actual packet
while(1){ n=fork(); if(n==0) { // child process fd_set rdfds; int pcap_fd = pcap_get_selectable_fd(pcap_handler); for(;;){ FD_ZERO(&rdfds); FD_SET(pcap_fd, &rdfds); FD_SET(sd_proxy, &rdfds); // here is another fd select(pcap_fd>sd_proxy?pcap_fd+1:sd_proxy+1, &rdfds, NULL, NULL, NULL) _______________________________________________ tcpdump-workers mailing list tcpdump-workers@lists.tcpdump.org https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers