[Bro-Dev] [JIRA] (BIT-1261) Bro plugin documentation incomplete
Jon Siwek (JIRA)
jira at bro-tracker.atlassian.net
Wed Sep 24 08:08:07 PDT 2014
[ https://bro-tracker.atlassian.net/browse/BIT-1261?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jon Siwek updated BIT-1261:
---------------------------
Fix Version/s: 2.4
> Bro plugin documentation incomplete
> -----------------------------------
>
> Key: BIT-1261
> URL: https://bro-tracker.atlassian.net/browse/BIT-1261
> Project: Bro Issue Tracker
> Issue Type: Problem
> Components: bro-aux
> Reporter: AK
> Assignee: Jon Siwek
> Labels: documentation
> Fix For: 2.4
>
>
> I found some issues with the steps found here: <https://www.bro.org/sphinx-git/devel/plugins.html>. The three important changes include running configure with the Bro directory option set, the name of the *.bif file matches the plugin name specified to init-plugin, and the call to byte_vec() in the return line of the example rot13 function. Other than that, everything worked rather nicely.
> The steps should be:
> cd aux/bro-aux/plugin-support
> mkdir rot13-plugin
> cd rot13-plugin
> ../init-plugin Demo Rot13
> # edit src/rot13.bif to include the following, note the difference in the return line
> module CaesarCipher;
> function rot13%(s: string%) : string
> %{
> char* rot13 = copy_string(s->CheckString());
> for ( char* p = rot13; *p; p++ )
> {
> char b = islower(*p) ? 'a' : 'A';
> *p = (*p - b + 13) % 26 + b;
> }
> return new StringVal(new BroString(1, byte_vec(rot13), strlen(rot13)));
> %}
> ./configure --bro-dist=%BRO_DIR%
> make
> export BRO_PLUGIN_PATH=$BRO_PLUGIN_PATH:%BRO_DIR%/bro/aux/bro-aux/plugin-support/MY_PLUGIN_NAME
> %BRO_DIR%/build/src/bro -N
> %BRO_DIR%/bro -e 'print CaesarCipher::rot13("Hello")'
--
This message was sent by Atlassian JIRA
(v6.4-OD-05-009#64003)
More information about the bro-dev
mailing list