diff --git a/doc/devel/plugins.rst b/doc/devel/plugins.rst index 5095e6dd54..76f5c75a68 100644 --- a/doc/devel/plugins.rst +++ b/doc/devel/plugins.rst @@ -57,10 +57,10 @@ called ``Demo::Rot13``. The ``init-plugin`` script puts a number of files in place. The full layout is described later. For now, all we need is -``src/functions.bif``. It's initially empty, but we'll add our new bif +``src/rot13.bif``. It's initially empty, but we'll add our new bif there as follows:: - # cat scripts/functions.bif + # cat src/rot13.bif module CaesarCipher; function rot13%(s: string%) : string @@ -73,17 +73,19 @@ there as follows:: *p = (*p - b + 13) % 26 + b; } - return new StringVal(new BroString(1, rot13, strlen(rot13))); + BroString* bs = new BroString(1, reinterpret_cast(rot13), + strlen(rot13)); + return new StringVal(bs); %} The syntax of this file is just like any other ``*.bif`` file; we won't go into it here. Now we can already compile our plugin, we just need to tell the -Makefile put in place by ``init-plugin`` where the Bro source tree is -located (Bro needs to have been built there first):: +configure script put in place by ``init-plugin`` where the Bro source +tree is located (Bro needs to have been built there first):: - # make BRO=/path/to/bro/dist + # ./configure --bro-dist=/path/to/bro/dist && make [... cmake output ...] Now our ``rot13-plugin`` directory has everything that it needs