[Bro] Interprocess Communication from BroScript

Seth Hall seth at icir.org
Wed Oct 2 11:59:57 PDT 2013


On Oct 2, 2013, at 1:08 PM, James Hook <jamesfhook at gmail.com> wrote:

> Has anybody else done anything similar?
> Are there anyways to load modules, call c functions (or functions in scripting languages) from the bro language?

Bro 2.2 beta has an exec module.

----script------
redef exit_only_after_terminate = T;

@load base/utils/exec
event bro_init()
	{
	when ( local result = Exec::run([$cmd="date"]) )
		{
		print result;
		}
	timeout 5secs
		{
		print "Hm, it didn't return.";
		}
	}
-----end script-----

$ bro -b ./test-exec.bro 
[exit_code=0, signal_exit=F, stdout=[Wed Oct  2 14:59:02 EDT 2013], stderr=<uninitialized>, files=<uninitialized>]


 .Seth

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : http://mailman.ICSI.Berkeley.EDU/pipermail/bro/attachments/20131002/3309b62e/attachment.bin 


More information about the Bro mailing list