Changeset 840
- Timestamp:
- 05/23/06 12:02:28 (7 years ago)
- Location:
- trunk/pdns/pdns
- Files:
-
- 4 modified
-
dnspcap.cc (modified) (2 diffs)
-
dnspcap.hh (modified) (3 diffs)
-
dnsscope.cc (modified) (1 diff)
-
docs/pdns.sgml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/dnspcap.cc
r431 r840 19 19 throw runtime_error((format("PCAP file %s has bad magic %x, should be %x") % fname % d_pfh.magic % 2712847316UL).str()); 20 20 21 if( d_pfh.linktype!=1) 22 throw runtime_error((format("Unsupported link type %d") % d_pfh.linktype).str()); 21 if( d_pfh.linktype==1) { 22 d_skipMediaHeader=sizeof(struct ether_header); 23 } else if(d_pfh.linktype==113) { 24 d_skipMediaHeader=16; 25 } 26 else throw runtime_error((format("Unsupported link type %d") % d_pfh.linktype).str()); 23 27 24 28 d_runts = d_oversized = d_correctpackets = d_nonetheripudp = 0; … … 65 69 66 70 d_ether=reinterpret_cast<struct ether_header*>(d_buffer); 67 d_ ip=reinterpret_cast<struct ip*>(d_buffer + sizeof(struct ether_header));71 d_lcc=reinterpret_cast<struct pdns_lcc_header*>(d_buffer); 68 72 69 if(ntohs(d_ether->ether_type)==0x0800 && d_ip->ip_p==17) { // udp 70 d_udp=reinterpret_cast<const struct udphdr*>(d_buffer + sizeof(struct ether_header) + 4 * d_ip->ip_hl); 73 d_ip=reinterpret_cast<struct ip*>(d_buffer + d_skipMediaHeader); 74 75 uint16_t contentCode; 76 if(d_pfh.linktype==1) 77 contentCode=ntohs(d_ether->ether_type); 78 else if(d_pfh.linktype==113) 79 contentCode=ntohs(d_lcc->lcc_protocol); 80 81 if(contentCode==0x0800 && d_ip->ip_p==17) { // udp 82 d_udp=reinterpret_cast<const struct udphdr*>(d_buffer + d_skipMediaHeader + 4 * d_ip->ip_hl); 71 83 d_payload = (unsigned char*)d_udp + sizeof(struct udphdr); 72 84 d_len = ntohs(d_udp->uh_ulen) - sizeof(struct udphdr); -
trunk/pdns/pdns/dnspcap.hh
r527 r840 33 33 }; 34 34 35 struct pdns_lcc_header { 36 uint16_t lcc_pkttype;/* packet type */ 37 uint16_t lcc_hatype;/* link-layer address type */ 38 uint16_t lcc_halen;/* link-layer address length */ 39 uint8_t lcc_addr[8];/* link-layer address */ 40 uint16_t lcc_protocol;/* protocol */ 41 }; 42 35 43 class PcapPacketReader 36 44 { … … 58 66 bool getUDPPacket(); 59 67 68 struct pdns_lcc_header* d_lcc; 60 69 struct ether_header* d_ether; 61 70 struct ip *d_ip; … … 72 81 FILE* d_fp; 73 82 string d_fname; 83 int d_skipMediaHeader; 74 84 }; 75 85 -
trunk/pdns/pdns/dnsscope.cc
r564 r840 56 56 if((ntohs(pr.d_udp->uh_dport)==5300 || ntohs(pr.d_udp->uh_sport)==5300 || 57 57 ntohs(pr.d_udp->uh_dport)==53 || ntohs(pr.d_udp->uh_sport)==53) && 58 pr.d_len > sizeof(HEADER)) {58 pr.d_len > 12) { 59 59 try { 60 60 MOADNSParser mdp((const char*)pr.d_payload, pr.d_len); -
trunk/pdns/pdns/docs/pdns.sgml
r838 r840 248 248 <para> 249 249 Some operators may want to follow RFC 2181 paragraph 5.2 and 5.4. This harms performance and does not solve any real problem, 250 but does make PowerDNS more compliant. If you want this, enable <command>auth-can-lower-ttl</command>. Implemented in c83 9, which is250 but does make PowerDNS more compliant. If you want this, enable <command>auth-can-lower-ttl</command>. Implemented in c838, which is 251 251 post 3.1-pre2. 252 252 </para>