[Bro] Changing an internal variable from C code

Ruoming Pang rpang at cs.princeton.edu
Fri Dec 8 10:07:24 PST 2006


> > Please take a look at NetVar.{h,cc} as a starting point. That's where
> > "internal variables" are defined.
>
> 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.

> > 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.

Ruoming



More information about the Bro mailing list