Support for (mixed) MPLS and VLAN traffic, and a new default BPF

filter. (Seth Hall and Robin Sommer)

- Merging in the patch from #264, which provides support for mixed
  VLAN and MPLS traffic.

- Changing Bro's default filter from being built dynamically to being
  a static "ip or not ip". To get the old behaviour back (i.e., the
  dynamically built filter), redef "all_packets" to false.

- print-filter.bro now always prints the filter that Bro is actually
  using, even if overriden from the command line.
This commit is contained in:
Robin Sommer 2011-04-28 21:14:52 -07:00
parent b01aa66fe6
commit 9ddc26328d
18 changed files with 170 additions and 35 deletions

View file

@ -349,6 +349,7 @@ int main(int argc, char** argv)
char* events_file = 0;
char* seed_load_file = getenv("BRO_SEED_FILE");
char* seed_save_file = 0;
char* user_pcap_filter = 0;
int seed = 0;
int dump_cfg = false;
int to_xml = 0;
@ -743,6 +744,16 @@ int main(int argc, char** argv)
init_general_global_var();
if ( user_pcap_filter )
{
ID* id = global_scope()->Lookup("cmd_line_bpf_filter");
if ( ! id )
internal_error("global cmd_line_bpf_filter not defined");
id->SetVal(new StringVal(user_pcap_filter));
}
// Parse rule files defined on the script level.
char* script_rule_files =
copy_string(internal_val("signature_files")->AsString()->CheckString());
@ -800,8 +811,7 @@ int main(int argc, char** argv)
if ( dns_type != DNS_PRIME )
net_init(interfaces, read_files, netflows, flow_files,
writefile,
user_pcap_filter ? user_pcap_filter : "tcp or udp",
writefile, "tcp or udp or icmp",
secondary_path->Filter(), do_watchdog);
if ( ! reading_traces )