[Bro] Changing an internal variable from C code

Yuppie yuppie4ever at gmail.com
Fri Dec 8 10:27:18 PST 2006

On Fri, 2006-12-08 at 13:07 -0500, Ruoming Pang wrote:
> > Net.cc doesn't seem to modify anything. I wanted to know how can I
> > modify variables that are defined in the .bro files.
> Well, first, it's not Net.cc, but NetVar.cc. Are you looking at the
> right file? Second, the way it works is that you define a variable in
> NetVar.{h,cc} and also in bro.init. Then you can access the variable
> from both C++ and bro scripts.

Sorry about the typo... I did mean NetVar.cc. Accessing is one thing.. I
know how to do it. Can you point me to an example where C++ code
modifies it? Or give a li'l sample code.

> > > By the way, which is the variable you want to manipulate in C++ code?
> >
> > It's my own variable - a variable defined by my .bro file which is
> > loaded on startup. I want to modify it later in the C++ code.
> What does the variable represent? I'm curious about why you need an
> additional internal variable because they are not needed for most
> cases---that's why there are only a limited number of them.

Well... it's a variable defined and required by my .bro module. I want
to be able to send a signal to Bro and change its value... in C++ code.
I want to use it to change Bro behavior.


More information about the Bro mailing list