Changeset 429
- Timestamp:
- 07/05/05 09:00:10 (8 years ago)
- Location:
- trunk/pdns/pdns
- Files:
-
- 3 modified
-
Makefile.am (modified) (1 diff)
-
dnspcap.cc (modified) (3 diffs)
-
dnspcap.hh (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/Makefile.am
r422 r429 52 52 53 53 dnswasher_SOURCES=dnswasher.cc misc.cc unix_utility.cc qtype.cc \ 54 logger.cc statbag.cc dnspcap.cc dnspcap.hh dnsparser. cc dnsrecords.cc dnsparser.hh54 logger.cc statbag.cc dnspcap.cc dnspcap.hh dnsparser.hh 55 55 56 56 dnswasher_LDFLAGS= @THREADFLAGS@ @DYNLINKFLAGS@ -
trunk/pdns/pdns/dnspcap.cc
r428 r429 1 #define __FAVOR_BSD 1 2 #include "dnspcap.hh" 2 3 #include <boost/format.hpp> 4 #include <fcntl.h> 3 5 4 6 using namespace boost; … … 9 11 unixDie("Unable to open file"); 10 12 13 int flags=fcntl(fileno(d_fp),F_GETFL,0); 14 fcntl(fileno(d_fp), F_SETFL,flags&(~O_NONBLOCK)); // bsd needs this in stdin (??) 11 15 12 16 checkedFread(&d_pfh); … … 66 70 d_udp=reinterpret_cast<const struct udphdr*>(d_buffer + sizeof(struct ether_header) + 4 * d_ip->ip_hl); 67 71 d_payload = (unsigned char*)d_udp + sizeof(struct udphdr); 68 d_len = ntohs(d_udp-> len) - sizeof(struct udphdr);72 d_len = ntohs(d_udp->uh_ulen) - sizeof(struct udphdr); 69 73 d_correctpackets++; 70 74 return true; -
trunk/pdns/pdns/dnspcap.hh
r428 r429 1 1 #ifndef PDNS_DNSPCAP_HH 2 2 #define PDNS_DNSPCAP_HH 3 #define __FAVOR_BSD 3 4 4 #include <cstdio> 5 5 #include <stdexcept> … … 7 7 #include "misc.hh" 8 8 #include <iostream> 9 #define __FAVOR_BSD 9 10 #include <netinet/in_systm.h> 10 11 #include <netinet/ip.h> 11 12 #include <netinet/udp.h> 12 #include <net inet/ether.h>13 #include <net/ethernet.h> 13 14 #include <vector> 14 15 #include <pcap.h>