[Bro-Dev] #633: Globals cleanup (was: Redefable globals)
Bro Tracker
bro at tracker.bro-ids.org
Sun Oct 2 08:57:58 PDT 2011
#633: Globals cleanup
----------------------+------------------------
Reporter: robin | Owner:
Type: Problem | Status: new
Priority: Normal | Milestone: Bro1.6
Component: Bro | Version: git/master
Resolution: | Keywords: beta
----------------------+------------------------
Description changed by robin:
Old description:
> We still have a number of globals that are redefable and therefore
> should be constants instead:
>
> > grep -R ^global scripts | grep redef
New description:
There're a few little things regarding script globals that we should
cleanup:
- We still have a number of globals that are redefable and therefore
should be constants instead:
{{{> grep -R ^global scripts | grep redef}}}
- There are some globals that look like they should be {{{const ...
&redef}}} instead. Example:
{{{ global local_nets_table: table[subnet] of subnet = {}; }}} in
{{{./base/utils/site.bro}}}
- Not everything that should be {{{&synchronized}}} yet is already,
Roughly speaking, once the two tasks above are done, all remaining
``globals`` that store state not limited to a specific host pair, should
be {{{&synchronized}}}. Example {{{global did_notice_orig}}} in
{{{./base/frameworks/notice/weird.bro}}}. Exception: there are some global
tables that are static after initialization (like ``filters`` in
{{{./base/frameworks/logging/main.bro}}}; these are fine (ideally, we
would have a way to mark this usage pattern and catch it if somebody
changes stuff later)).
--
--
Ticket URL: <http://tracker.bro-ids.org/bro/ticket/633#comment:1>
Bro Tracker <http://tracker.bro-ids.org/bro>
Bro Issue Tracker
More information about the bro-dev
mailing list