[Bro] is that possible to use a global variable defined in other policy script?

Seth Hall seth at icir.org
Fri Jan 13 18:23:36 PST 2012


On Jan 13, 2012, at 5:42 PM, Hui Lin (Hugo) wrote:

> I am wondering whether it is possible to use a global variable that is defined in other policy script?

That's basically the definition of a global.  It's just a runtime modifiable variable that can exist outside of a particular scope.  You just need to make sure that the script that defines the variable is loaded prior to the script that uses it.  Bro's parser will tell you if the variable isn't available yet which would mean you probably loaded the scripts in the wrong order.

> I found that in some scripts, "export" are used. Does this achieve similar function?

The export keyword is only to making variables and types available outside of a module's namespace.  If variables are defined within a module but not in the export section then you will only have access to those from code within that module.

  .Seth

--
Seth Hall
International Computer Science Institute
(Bro) because everyone has a network
http://www.bro-ids.org/




More information about the Bro mailing list