[Bro] Returning NULL?

Bernhard Amann bernhard at ICSI.Berkeley.EDU
Fri May 9 05:39:14 PDT 2014

On Fri, May 09, 2014 at 08:51:28AM +0000, Knick, Scott E CTR USARMY RCERT-EUR (US) wrote:
> Is there some way to return something like a NULL or undefined from a
> Bro script function? I'm looking to set a field in a logged record via a
> function call but would ideally like to be able to return an unset value
> from that function if needed.

There is no way to direcly return null. The two "workarounds" that come to
mind at the moment are to either return a record with one optional field -
which you can leave unset to represent null. Or return a vector where you
either can add the element when present, or let it be zero-size when 0.


More information about the Bro mailing list