diff --git a/CHANGES b/CHANGES index c2f8589886..3bfd8c24e8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,9 @@ +2.4-beta-32 | 2015-06-02 09:43:31 -0700 + + * A larger set of documentation updates, fixes, and extentions. + (Daniel Thayer) + 2.4-beta-14 | 2015-06-02 09:16:44 -0700 * Add memleak btest for attachments over SMTP. (Vlad Grigorescu) diff --git a/VERSION b/VERSION index 7714ab8526..f6913e8dba 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.4-beta-14 +2.4-beta-32 diff --git a/aux/plugins b/aux/plugins index 475beed1e9..64f85b5086 160000 --- a/aux/plugins +++ b/aux/plugins @@ -1 +1 @@ -Subproject commit 475beed1e9688f572ee60c196e07c0fa72e1ed9f +Subproject commit 64f85b5086fe9feb4cbcaaa8712db61e709836d3 diff --git a/doc/components/bro-plugins/README.rst b/doc/components/bro-plugins/README.rst new file mode 120000 index 0000000000..8f96f50909 --- /dev/null +++ b/doc/components/bro-plugins/README.rst @@ -0,0 +1 @@ +../../../aux/plugins/README \ No newline at end of file diff --git a/doc/components/bro-plugins/dataseries/README.rst b/doc/components/bro-plugins/dataseries/README.rst new file mode 120000 index 0000000000..3362e911fc --- /dev/null +++ b/doc/components/bro-plugins/dataseries/README.rst @@ -0,0 +1 @@ +../../../../aux/plugins/dataseries/README \ No newline at end of file diff --git a/doc/components/bro-plugins/elasticsearch/README.rst b/doc/components/bro-plugins/elasticsearch/README.rst new file mode 120000 index 0000000000..8a5b78d689 --- /dev/null +++ b/doc/components/bro-plugins/elasticsearch/README.rst @@ -0,0 +1 @@ +../../../../aux/plugins/elasticsearch/README \ No newline at end of file diff --git a/doc/components/bro-plugins/netmap/README.rst b/doc/components/bro-plugins/netmap/README.rst new file mode 120000 index 0000000000..819a2bb0e9 --- /dev/null +++ b/doc/components/bro-plugins/netmap/README.rst @@ -0,0 +1 @@ +../../../../aux/plugins/netmap/README \ No newline at end of file diff --git a/doc/components/index.rst b/doc/components/index.rst index c1feda4a61..85527e9f9c 100644 --- a/doc/components/index.rst +++ b/doc/components/index.rst @@ -21,6 +21,7 @@ current, independent component releases. Broker - User Manual BroControl - Interactive Bro management shell Bro-Aux - Small auxiliary tools for Bro + Bro-Plugins - A collection of plugins for Bro BTest - A unit testing framework Capstats - Command-line packet statistic tool PySubnetTree - Python module for CIDR lookups diff --git a/doc/devel/plugins.rst b/doc/devel/plugins.rst index 5c963a1552..091a0090d1 100644 --- a/doc/devel/plugins.rst +++ b/doc/devel/plugins.rst @@ -3,7 +3,7 @@ Writing Bro Plugins =================== -Bro internally provides plugin API that enables extending +Bro internally provides a plugin API that enables extending the system dynamically, without modifying the core code base. That way custom code remains self-contained and can be maintained, compiled, and installed independently. Currently, plugins can add the following @@ -32,7 +32,7 @@ Quick Start =========== Writing a basic plugin is quite straight-forward as long as one -follows a few conventions. In the following we walk a simple example +follows a few conventions. In the following we create a simple example plugin that adds a new built-in function (bif) to Bro: we'll add ``rot13(s: string) : string``, a function that rotates every character in a string by 13 places. @@ -81,7 +81,7 @@ 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 -configure script that ``init-plugin`` put in place where the Bro +configure script (that ``init-plugin`` created) where the Bro source tree is located (Bro needs to have been built there first):: # cd rot13-plugin @@ -99,7 +99,7 @@ option:: # export BRO_PLUGIN_PATH=/path/to/rot13-plugin/build # bro -N [...] - Plugin: Demo::Rot13 - (dynamic, version 1) + Demo::Rot13 - (dynamic, version 0.1) [...] That looks quite good, except for the dummy description that we should @@ -108,28 +108,30 @@ is about. We do this by editing the ``config.description`` line in ``src/Plugin.cc``, like this:: [...] - plugin::Configuration Configure() + plugin::Configuration Plugin::Configure() { plugin::Configuration config; config.name = "Demo::Rot13"; config.description = "Caesar cipher rotating a string's characters by 13 places."; - config.version.major = 1; - config.version.minor = 0; + config.version.major = 0; + config.version.minor = 1; return config; } [...] +Now rebuild and verify that the description is visible:: + # make [...] # bro -N | grep Rot13 - Plugin: Demo::Rot13 - Caesar cipher rotating a string's characters by 13 places. (dynamic, version 1) + Demo::Rot13 - Caesar cipher rotating a string's characters by 13 places. (dynamic, version 0.1) -Better. Bro can also show us what exactly the plugin provides with the +Bro can also show us what exactly the plugin provides with the more verbose option ``-NN``:: # bro -NN [...] - Plugin: Demo::Rot13 - Caesar cipher rotating a string's characters by 13 places. (dynamic, version 1) + Demo::Rot13 - Caesar cipher rotating a string's characters by 13 places. (dynamic, version 0.1) [Function] Demo::rot13 [...] @@ -157,10 +159,12 @@ The installed version went into ``/lib/bro/plugins/Demo_Rot13``. One can distribute the plugin independently of Bro for others to use. -To distribute in source form, just remove the ``build/`` (``make -distclean`` does that) and then tar up the whole ``rot13-plugin/`` +To distribute in source form, just remove the ``build/`` directory +(``make distclean`` does that) and then tar up the whole ``rot13-plugin/`` directory. Others then follow the same process as above after -unpacking. To distribute the plugin in binary form, the build process +unpacking. + +To distribute the plugin in binary form, the build process conveniently creates a corresponding tarball in ``build/dist/``. In this case, it's called ``Demo_Rot13-0.1.tar.gz``, with the version number coming out of the ``VERSION`` file that ``init-plugin`` put @@ -169,14 +173,14 @@ plugin, but no further source files. Optionally, one can include further files by specifying them in the plugin's ``CMakeLists.txt`` through the ``bro_plugin_dist_files`` macro; the skeleton does that for ``README``, ``VERSION``, ``CHANGES``, and ``COPYING``. To use the -plugin through the binary tarball, just unpack it and point -``BRO_PLUGIN_PATH`` there; or copy it into -``/lib/bro/plugins/`` directly. +plugin through the binary tarball, just unpack it into +``/lib/bro/plugins/``. Alternatively, if you unpack +it in another location, then you need to point ``BRO_PLUGIN_PATH`` there. Before distributing your plugin, you should edit some of the meta files that ``init-plugin`` puts in place. Edit ``README`` and ``VERSION``, and update ``CHANGES`` when you make changes. Also put a -license file in place as ``COPYING``; if BSD is fine, you find a +license file in place as ``COPYING``; if BSD is fine, you will find a template in ``COPYING.edit-me``. Plugin Directory Layout @@ -193,7 +197,7 @@ directory. With the skeleton, ```` corresponds to ``build/``. must exist, and its content must consist of a single line with the qualified name of the plugin (e.g., "Demo::Rot13"). -``/lib/--.so`` +``/lib/.-.so`` The shared library containing the plugin's compiled code. Bro will load this in dynamically at run-time if OS and architecture match the current platform. @@ -215,8 +219,8 @@ directory. With the skeleton, ```` corresponds to ``build/``. Any other files in ```` are ignored by Bro. By convention, a plugin should put its custom scripts into sub folders -of ``scripts/``, i.e., ``scripts//