[Bro-Dev] globals, consts, and &redef

Seth Hall seth at icir.org
Fri Dec 3 12:18:34 PST 2010


There was some discussion during the meeting at NCSA about the current applicability of the &redef attribute.  Does it make sense to deprecate the attribute?  It appears that the primary reason for it's existence is to create a public API to analysis scripts because you can withhold the &redef attribute from consts that you would like to remain private and apply it to consts you want to be public but that public/private distinction can now be implicitly defined with the export section in scripts.

There is at least one problem that has come to light due to the &redef attribute being applied to globals[1] and it started making me wonder if it conceptually even makes sense to apply &redef to a global?  It seems that the situations where &redef is applied to a global, the variable should actually either be a const or just be a global without the &redef attribute.

Many of these questions are of course for Vern because I don't know if I'm misinterpreting the purpose and lineage of the &redef attribute.  It does come across to me that during the script clean up, we could deprecate the &redef attribute and move "redef-able" variables into the export section of all of the scripts.  I think that consts outside of modules will be inherently redef-able, we'd essentially be using modules as the way to "hide" variables.

  .Seth

1. http://tracker.icir.org/bro/ticket/200



More information about the bro-dev mailing list