diff --git a/CHANGES b/CHANGES index a662995f2d..e4588559c8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,22 @@ +2.3-96 | 2014-08-01 14:35:01 -0700 + + * Small change to DHCP documentation. In server->client messages the + host name may differ from the one requested by the client. + (Johanna Amann) + + * Split DHCP log writing from record creation. This allows users to + customize dhcp.log by changing the record in their own dhcp_ack + event. (Johanna Amann) + + * Update PATH so that documentation btests can find bro-cut. (Daniel + Thayer) + + * Remove gawk from list of optional packages in documentation. + (Daniel Thayer) + + * Fix for redefining built-in constants. (Robin Sommer) + 2.3-86 | 2014-07-31 14:19:58 -0700 * Fix for redefining built-in constants. (Robin Sommer) diff --git a/NEWS b/NEWS index e7171fae0d..f06115d4ea 100644 --- a/NEWS +++ b/NEWS @@ -28,6 +28,7 @@ New Functionality Changed Functionality --------------------- +- bro-cut has been rewritten in C, and is hence much faster. Bro 2.3 ======= diff --git a/VERSION b/VERSION index 7551c78f13..e247bc816b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.3-86 +2.3-96 diff --git a/aux/binpac b/aux/binpac index 231a593eb8..30c156d879 160000 --- a/aux/binpac +++ b/aux/binpac @@ -1 +1 @@ -Subproject commit 231a593eb851713cc8da1ece3ce90d9317fb46b7 +Subproject commit 30c156d879f6303f15ebf8e59989d8a42d882bdf diff --git a/aux/broccoli b/aux/broccoli index 1f1f235163..07cfcc76fb 160000 --- a/aux/broccoli +++ b/aux/broccoli @@ -1 +1 @@ -Subproject commit 1f1f2351635bf3f437f35ceb6ba898ccff28dfea +Subproject commit 07cfcc76fb08365b545bd3f412c3f6e6c92824e9 diff --git a/aux/broctl b/aux/broctl index 2ebe2e3c92..2606a95c9d 160000 --- a/aux/broctl +++ b/aux/broctl @@ -1 +1 @@ -Subproject commit 2ebe2e3c9298fd21b06ff93dab8c6980edef144b +Subproject commit 2606a95c9dcbc83bd863c2981ce7189e5d58697b diff --git a/doc/conf.py.in b/doc/conf.py.in index 9720d12ade..4faebed3b8 100644 --- a/doc/conf.py.in +++ b/doc/conf.py.in @@ -21,7 +21,7 @@ sys.path.insert(0, os.path.abspath('sphinx_input/ext')) # ----- Begin of BTest configuration. ----- btest = os.path.abspath("@CMAKE_SOURCE_DIR@/aux/btest") -brocut = os.path.abspath("@CMAKE_SOURCE_DIR@/aux/bro-aux/bro-cut") +brocut = os.path.abspath("@CMAKE_SOURCE_DIR@/build/aux/bro-aux/bro-cut") bro = os.path.abspath("@CMAKE_SOURCE_DIR@/build/src") os.environ["PATH"] += (":%s:%s/sphinx:%s:%s" % (btest, btest, bro, brocut)) diff --git a/doc/install/install.rst b/doc/install/install.rst index 4450e842e3..9a258773ce 100644 --- a/doc/install/install.rst +++ b/doc/install/install.rst @@ -91,7 +91,6 @@ build time: * LibGeoIP (for geolocating IP addresses) * sendmail (enables Bro and BroControl to send mail) - * gawk (enables all features of bro-cut) * curl (used by a Bro script that implements active HTTP) * gperftools (tcmalloc is used to improve memory and CPU usage) * ipsumdump (for trace-summary; http://www.cs.ucla.edu/~kohler/ipsumdump) diff --git a/scripts/base/protocols/dhcp/main.bro b/scripts/base/protocols/dhcp/main.bro index c94bae0476..d6bb0defd2 100644 --- a/scripts/base/protocols/dhcp/main.bro +++ b/scripts/base/protocols/dhcp/main.bro @@ -47,13 +47,13 @@ redef record connection += { const ports = { 67/udp, 68/udp }; redef likely_server_ports += { 67/udp }; -event bro_init() +event bro_init() &priority=5 { Log::create_stream(DHCP::LOG, [$columns=Info, $ev=log_dhcp]); Analyzer::register_for_ports(Analyzer::ANALYZER_DHCP, ports); } -event dhcp_ack(c: connection, msg: dhcp_msg, mask: addr, router: dhcp_router_list, lease: interval, serv_addr: addr, host_name: string) +event dhcp_ack(c: connection, msg: dhcp_msg, mask: addr, router: dhcp_router_list, lease: interval, serv_addr: addr, host_name: string) &priority=5 { local info: Info; info$ts = network_time(); @@ -71,6 +71,9 @@ event dhcp_ack(c: connection, msg: dhcp_msg, mask: addr, router: dhcp_router_lis info$assigned_ip = c$id$orig_h; c$dhcp = info; + } +event dhcp_ack(c: connection, msg: dhcp_msg, mask: addr, router: dhcp_router_list, lease: interval, serv_addr: addr, host_name: string) &priority=-5 + { Log::write(DHCP::LOG, c$dhcp); } diff --git a/src/analyzer/protocol/dhcp/events.bif b/src/analyzer/protocol/dhcp/events.bif index 1f1e84ef0c..49a77d969e 100644 --- a/src/analyzer/protocol/dhcp/events.bif +++ b/src/analyzer/protocol/dhcp/events.bif @@ -33,7 +33,8 @@ event dhcp_discover%(c: connection, msg: dhcp_msg, req_addr: addr, host_name: st ## ## serv_addr: The server address specified by the message. ## -## host_name: The value of the host name option, if specified by the client. +## host_name: Optional host name value. May differ from the host name requested +## from the client. ## ## .. bro:see:: dhcp_discover dhcp_request dhcp_decline dhcp_ack dhcp_nak ## dhcp_release dhcp_inform @@ -75,7 +76,7 @@ event dhcp_request%(c: connection, msg: dhcp_msg, req_addr: addr, serv_addr: add ## ## msg: The parsed type-independent part of the DHCP message. ## -## host_name: The value of the host name option, if specified by the client. +## host_name: Optional host name value. ## ## .. bro:see:: dhcp_discover dhcp_offer dhcp_request dhcp_ack dhcp_nak ## dhcp_release dhcp_inform @@ -101,7 +102,8 @@ event dhcp_decline%(c: connection, msg: dhcp_msg, host_name: string%); ## ## serv_addr: The server address specified by the message. ## -## host_name: The value of the host name option, if specified by the client. +## host_name: Optional host name value. May differ from the host name requested +## from the client. ## ## .. bro:see:: dhcp_discover dhcp_offer dhcp_request dhcp_decline dhcp_nak ## dhcp_release dhcp_inform @@ -116,7 +118,7 @@ event dhcp_ack%(c: connection, msg: dhcp_msg, mask: addr, router: dhcp_router_li ## ## msg: The parsed type-independent part of the DHCP message. ## -## host_name: The value of the host name option, if specified by the client. +## host_name: Optional host name value. ## ## .. bro:see:: dhcp_discover dhcp_offer dhcp_request dhcp_decline dhcp_ack dhcp_release ## dhcp_inform diff --git a/src/plugin/Manager.cc b/src/plugin/Manager.cc index 4d81506817..ab0b85676b 100644 --- a/src/plugin/Manager.cc +++ b/src/plugin/Manager.cc @@ -542,15 +542,16 @@ int Manager::HookLoadFile(const string& file) int rc = -1; - for ( hook_list::iterator i = l->begin(); l && i != l->end(); i++ ) - { - Plugin* p = (*i).second; + if ( l ) + for ( hook_list::iterator i = l->begin(); i != l->end(); ++i ) + { + Plugin* p = (*i).second; - rc = p->HookLoadFile(normalized_file, ext); + rc = p->HookLoadFile(normalized_file, ext); - if ( rc >= 0 ) - break; - } + if ( rc >= 0 ) + break; + } if ( HavePluginForHook(META_HOOK_POST) ) MetaHookPost(HOOK_LOAD_FILE, args, HookArgument(rc)); @@ -573,15 +574,16 @@ Val* Manager::HookCallFunction(const Func* func, val_list* vargs) const Val* v = 0; - for ( hook_list::iterator i = l->begin(); l && i != l->end(); i++ ) - { - Plugin* p = (*i).second; + if ( l ) + for ( hook_list::iterator i = l->begin(); i != l->end(); ++i ) + { + Plugin* p = (*i).second; - v = p->HookCallFunction(func, vargs); + v = p->HookCallFunction(func, vargs); - if ( v ) - break; - } + if ( v ) + break; + } if ( HavePluginForHook(META_HOOK_POST) ) MetaHookPost(HOOK_CALL_FUNCTION, args, HookArgument(v)); @@ -603,16 +605,17 @@ bool Manager::HookQueueEvent(Event* event) const bool result = false; - for ( hook_list::iterator i = l->begin(); l && i != l->end(); i++ ) - { - Plugin* p = (*i).second; - - if ( p->HookQueueEvent(event) ) + if ( l ) + for ( hook_list::iterator i = l->begin(); i != l->end(); ++i ) { - result = true; - break; + Plugin* p = (*i).second; + + if ( p->HookQueueEvent(event) ) + { + result = true; + break; + } } - } if ( HavePluginForHook(META_HOOK_POST) ) MetaHookPost(HOOK_QUEUE_EVENT, args, HookArgument(result)); @@ -629,11 +632,12 @@ void Manager::HookDrainEvents() const hook_list* l = hooks[HOOK_DRAIN_EVENTS]; - for ( hook_list::iterator i = l->begin(); l && i != l->end(); i++ ) - { - Plugin* p = (*i).second; - p->HookDrainEvents(); - } + if ( l ) + for ( hook_list::iterator i = l->begin(); i != l->end(); ++i ) + { + Plugin* p = (*i).second; + p->HookDrainEvents(); + } if ( HavePluginForHook(META_HOOK_POST) ) MetaHookPost(HOOK_DRAIN_EVENTS, args, HookArgument()); @@ -652,11 +656,12 @@ void Manager::HookUpdateNetworkTime(double network_time) const hook_list* l = hooks[HOOK_UPDATE_NETWORK_TIME]; - for ( hook_list::iterator i = l->begin(); l && i != l->end(); i++ ) - { - Plugin* p = (*i).second; - p->HookUpdateNetworkTime(network_time); - } + if ( l ) + for ( hook_list::iterator i = l->begin(); i != l->end(); ++i ) + { + Plugin* p = (*i).second; + p->HookUpdateNetworkTime(network_time); + } if ( HavePluginForHook(META_HOOK_POST) ) MetaHookPost(HOOK_UPDATE_NETWORK_TIME, args, HookArgument()); @@ -674,35 +679,37 @@ void Manager::HookBroObjDtor(void* obj) const hook_list* l = hooks[HOOK_BRO_OBJ_DTOR]; - for ( hook_list::iterator i = l->begin(); l && i != l->end(); i++ ) - { - Plugin* p = (*i).second; - p->HookBroObjDtor(obj); - } + if ( l ) + for ( hook_list::iterator i = l->begin(); i != l->end(); ++i ) + { + Plugin* p = (*i).second; + p->HookBroObjDtor(obj); + } if ( HavePluginForHook(META_HOOK_POST) ) MetaHookPost(HOOK_BRO_OBJ_DTOR, args, HookArgument()); - } void Manager::MetaHookPre(HookType hook, const HookArgumentList& args) const { hook_list* l = hooks[HOOK_CALL_FUNCTION]; - for ( hook_list::iterator i = l->begin(); l && i != l->end(); i++ ) - { - Plugin* p = (*i).second; - p->MetaHookPre(hook, args); - } + if ( l ) + for ( hook_list::iterator i = l->begin(); i != l->end(); ++i ) + { + Plugin* p = (*i).second; + p->MetaHookPre(hook, args); + } } void Manager::MetaHookPost(HookType hook, const HookArgumentList& args, HookArgument result) const { hook_list* l = hooks[HOOK_CALL_FUNCTION]; - for ( hook_list::iterator i = l->begin(); l && i != l->end(); i++ ) - { - Plugin* p = (*i).second; - p->MetaHookPost(hook, args, result); - } + if ( l ) + for ( hook_list::iterator i = l->begin(); i != l->end(); ++i ) + { + Plugin* p = (*i).second; + p->MetaHookPost(hook, args, result); + } } diff --git a/testing/btest/btest.cfg b/testing/btest/btest.cfg index deb33b7767..430f4ba47c 100644 --- a/testing/btest/btest.cfg +++ b/testing/btest/btest.cfg @@ -13,7 +13,7 @@ BRO_PLUGIN_PATH= TZ=UTC LC_ALL=C BTEST_PATH=%(testbase)s/../../aux/btest -PATH=%(testbase)s/../../build/src:%(testbase)s/../scripts:%(testbase)s/../../aux/btest:%(testbase)s/../../aux/bro-aux/bro-cut:%(default_path)s:%(testbase)s/../../aux/btest/sphinx:%(default_path)s +PATH=%(testbase)s/../../build/src:%(testbase)s/../scripts:%(testbase)s/../../aux/btest:%(testbase)s/../../build/aux/bro-aux/bro-cut:%(default_path)s:%(testbase)s/../../aux/btest/sphinx:%(default_path)s TRACES=%(testbase)s/Traces FILES=%(testbase)s/Files SCRIPTS=%(testbase)s/../scripts