diff --git a/policy/bro.init b/policy/bro.init index 8be0ab754a..59acf746dd 100644 --- a/policy/bro.init +++ b/policy/bro.init @@ -86,7 +86,7 @@ export { type parent_t: record { cid: conn_id; tunnel_type: tunneltype_t; - }; + } &log; } # end export module GLOBAL; diff --git a/src/Sessions.cc b/src/Sessions.cc index 41a7f4c52d..9241b17005 100644 --- a/src/Sessions.cc +++ b/src/Sessions.cc @@ -135,7 +135,6 @@ NetSessions::NetSessions() tunnel_handler = new TunnelHandler(this); else tunnel_handler = 0; - printf("tunnel_handler: %p\n", tunnel_handler); } NetSessions::~NetSessions() diff --git a/src/TunnelHandler.cc b/src/TunnelHandler.cc index 3256894cd0..78428c700f 100644 --- a/src/TunnelHandler.cc +++ b/src/TunnelHandler.cc @@ -18,10 +18,22 @@ TunnelHandler::TunnelHandler(NetSessions *arg_s) { s = arg_s; + PortVal *pv = 0; + TableVal *udp_tunnel_ports = BifConst::Tunnel::udp_tunnel_ports->AsTableVal(); + // Find UDP ports we want to analyze. Store them in an array for faster + // lookup. for (int i=0; i< 65536; i++) - udp_ports[i] = 0; - udp_ports[3544] = 1; - udp_ports[5072] = 1; + { + Unref(pv); + pv = new PortVal(i, TRANSPORT_UDP); + if (udp_tunnel_ports->Lookup(pv, false)) + { + udp_ports[i] = 1; + } + else + udp_ports[i] = 0; + } + Unref(pv); } TunnelInfo* TunnelHandler::DecapsulateTunnel(const IP_Hdr *ip_hdr, int len, int caplen,