[Bro-Dev] [JIRA] (BIT-1261) Bro plugin documentation incomplete

AK (JIRA) jira at bro-tracker.atlassian.net
Tue Sep 23 19:37:07 PDT 2014

AK created BIT-1261:

             Summary: 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

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

More information about the bro-dev mailing list