]> granicus.if.org Git - pdns/commitdiff
add support for raw IP tcpdump format, which makes is compatible with DNS OARC dnscap...
authorbert hubert <bert.hubert@netherlabs.nl>
Tue, 17 Feb 2015 12:42:27 +0000 (13:42 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Tue, 17 Feb 2015 12:42:27 +0000 (13:42 +0100)
pdns/dnspcap.cc

index 00e380223cf01b44380bc0c49dcf9ed69e21d83f..e81e9b5968f3d831358ce73048e3e8ddf4e7ebae 100644 (file)
@@ -20,7 +20,11 @@ PcapPacketReader::PcapPacketReader(const string& fname) : d_fname(fname)
   
   if( d_pfh.linktype==1) {
     d_skipMediaHeader=sizeof(struct ether_header);
-  } else if(d_pfh.linktype==113) {
+  }
+  else if(d_pfh.linktype==101) {
+    d_skipMediaHeader=0;
+  }
+  else if(d_pfh.linktype==113) {
     d_skipMediaHeader=16;
   }
   else throw runtime_error((format("Unsupported link type %d") % d_pfh.linktype).str());
@@ -77,6 +81,12 @@ try
     uint16_t contentCode=0;
     if(d_pfh.linktype==1) 
       contentCode=ntohs(d_ether->ether_type);
+    else if(d_pfh.linktype==101) {
+      if(d_ip->ip_v==4)
+       contentCode = 0x0800;
+      else
+       contentCode = 0x0806; // untested
+    }
     else if(d_pfh.linktype==113)
       contentCode=ntohs(d_lcc->lcc_protocol);