Commit graph

35 commits

Author SHA1 Message Date
Jon Siwek
80e154ba3c Various changes to documentation framework.
- Reorganize top-level 'doc' Makefile target so submodules can easily
  add their own doc-generating routines to it.  e.g. the Bro project
  makes a placeholder 'doc' target, then adds 'restdoc', 'sphinxdoc';
  later Broccoli can add it's own target as a dependency for generating
  API docs.

- Fixed generated docs for BIFs not being organized under a base/
  subdirectory like the original source files.

- Fixed documentation style for function parameters not applying to
  functions declared as record fields.

- Misc. script documentation tweaks to address warnings given by Sphinx.
2011-09-07 10:02:15 -05:00
Seth Hall
11c437faa3 Logging framework update and mass Log::ID renaming.
- Log path's are generated in the scripting land
  now.  The default Log stream ID to path string
  mapping works like this:
    - Notice::LOG -> "notice"
    - Notice::POLICY_LOG -> "notice_policy"
    - TestModule::LOG -> "test_module"

- Logging streams updated across all of the shipped
  scripts to be more user friendly.  Instead of
  the logging stream ID HTTP::HTTP, we now have
  HTTP::LOG, etc.

- The priorities on some bro_init handlers have
  been adjusted to make the process of applying
  filters or disabling streams easier for users.
2011-09-03 01:10:17 -04:00
Jon Siwek
33fce8a71d Misc. doc/script/test cleanup.
- fixing some Metrics::add_data() call signatures
- slight refactors to cluster framework @if and adding a NONE NodeType for
  so local_node_type() will return that instead of just emitting an error
  when cluster mode isn't enabled
- `make restdoc` target now uses bro's bare-mode
- bro scripts generated from bifs now really only live in the build/src/base/
  directory and changed the DocSourcesList.cmake to dynamically figure out
  what bifs exist by looking in src/ instead of build/src/
- add some missing @load dependencies
2011-08-15 17:29:41 -05:00
Jon Siwek
a3147033e2 Update doc sources and touch up a few script comments. 2011-08-13 09:45:42 -05:00
Jon Siwek
4ac6d0ae2e Fixes for script auto-documentation.
- Fixing the parts of the `make restdoc` and `make doc` process that were
  broken by the last Bro script re-organization

- Generated documentation for Bro scripts derived from BiFs now use the
  original BiF source file as the "original source file" link

- Renaming of the internal POLICYDEST definition and other misc places that
  refer to "policy" scripts; that terminology doesn't make total sense now

- Added a documentation blacklist reminder test that will fail if there's
  scripts that are blacklisted from being documentated because they're still
  in progress

- Some minor Bro script changes to fix small @load dependency errors

Addresses #543
2011-08-08 19:50:45 -05:00
Seth Hall
d223637460 Small tweaks for doc generation.
- There is still a bug in that scripts loaded by core scripts don't
  get their path correctly figured out by Bro's documentation
  generation.
2011-08-06 00:40:30 -04:00
Seth Hall
cdfaff7fab Attempt at cleaning up doc generation. 2011-08-05 23:30:35 -04:00
Seth Hall
d6a67f7c1f Merge branch 'master' of ssh://git.bro-ids.org/bro
Conflicts:
	scripts/base/frameworks/control/main.bro
2011-08-05 23:11:40 -04:00
Seth Hall
597a4d6704 Hopefully the last major script reorganization.
- policy/ renamed to scripts/

- By default BROPATH now contains:
	- scripts/
	- scripts/policy
	- scripts/site

- *Nearly* all tests pass.

- All of scripts/base/ is loaded by main.cc
	- Can be disabled by setting $BRO_NO_BASE_SCRIPTS
	- Scripts in scripts/base/ don't use relative path loading to ease use of BRO_NO_BASE_SCRIPTS (to copy and paste that script).

- The scripts in scripts/base/protocols/ only (or soon will only) do logging and state building.

- The scripts in scripts/base/frameworks/ add functionality without causing any additional overhead.

- All "detection" activity happens through scripts in scripts/policy/.

- Communications framework modified temporarily to need an environment variable to actually enable (ENABLE_COMMUNICATION=1)
	- This is so the communications framework can be loaded as part
	  of the base without causing trouble when it's not needed.
	- This will be removed once a resolution to ticket #540 is reached.
2011-08-05 23:09:53 -04:00
Jon Siwek
c2bfe0d78d Update script doc-generation README.
And remove an unused reference in sphinx source tree index's TOC.
2011-08-05 10:39:26 -05:00
Jon Siwek
ca2582d325 Omission of bro.init from doc generation fixed. 2011-08-05 10:11:29 -05:00
Jon Siwek
ef60a84b19 Fix genDocSourcesList script lack of explicit sorting
To make the doc.coverage test more portable/happy
2011-08-03 11:44:31 -05:00
Jon Siwek
78e2d768c7 Adding a documentation coverage test.
- The CMake targets for generating reST docs from policy scripts are now
  automatically generated via the genDocSourcesList.sh script

- Fixed a lot of parsing errors in policy scripts that I saw along the way
2011-07-23 20:55:06 -05:00
Seth Hall
0332a06012 Fixed most of the tests after the script reorganization. 2011-07-12 14:12:25 -04:00
Robin Sommer
1fded82c32 Fixing tests. 2011-07-01 22:26:45 -07:00
Jon Siwek
9242f17978 Add RPC/SSL scripts to doc generation target. 2011-06-30 17:12:35 -05:00
Jon Siwek
5a2cd265ab Update the generated script doc organization.
Added an additional master TOC index for Bro script packages that
automatically gets filled in at ``make doc`` time.  The master TOC
links to per-package indexes which contains links to all the scripts
contained within it along with their summary.  The per-package index
is also now automatically generated/derived from the path component
of the script passed into the rest_target() macro.
2011-06-30 16:58:20 -05:00
Jon Siwek
fe5f4b8e53 Changes to make generated script docs understand new policy/ hierarchy.
Added an arg to the search_for_files() util function that can return
the subpath of BROPATH's policy/ dir in which the loaded file is found.
This subpath is then used in both the the reST file's document title
(so that script's named e.g. "base.bro" actually have some context) and
in figuring out how to interlink with other generated docs of other
scripts that are found in @load directives.

I still need to overhaul things so the loading of "packages" is
documented in a meaningful way and that the CMake targets are able
to generate indexes for packages.
2011-06-30 11:37:15 -05:00
Jon Siwek
33f0c237ca Doc tweaks for new conn/contents.bro 2011-05-25 15:34:57 -05:00
Jon Siwek
d1cdc9f208 Generation of docs for http/detect-webapps.bro and depending scripts now works. 2011-05-18 11:51:06 -05:00
Jon Siwek
3a655c610c Add all new policy scripts to doc generation target.
Minor script tweaks along the way to get rid of reST format warnings
or @load dependency issues.
2011-05-17 11:15:09 -05:00
Jon Siwek
56a946568a More changes to how Bro generates docs for scripts in subdirs of BROPATH
The output reST filename now reflects the subdir information (by flattening
'/' path separators into the '^' character).  This is to prevent file name
conflicts when generated reST docs, but during the CMake 'doc' target to
build HTML docs, everything gets unflattened.
2011-05-16 20:17:58 -05:00
Jon Siwek
f70b5ece8c Add note to stub files used for grouping script docs. 2011-05-12 15:13:51 -05:00
Jon Siwek
650177cde0 DNS policy scripts documentation cleanup/tweaks. 2011-05-12 12:19:43 -05:00
Jon Siwek
68784634ff Fixing doc tests in the btest suite.
- reduce number of docs generated by `make doc`; will add as they're reviewed

- Conforming to new Notice::Type enum for notices
2011-05-12 11:21:20 -05:00
Jon Siwek
e2c194c990 Fix make doc CMake 2.8.3 incompatibility.
CMake 2.8.4 seems to be able to handle add_custom_target()
interdependencies with the DEPENDS arguments, but 2.8.3 does not.

Using add_dependencies() to create top-level target
dependencies works in both cases.
2011-05-10 11:03:56 -05:00
Jon Siwek
80abad01a9 Adding example documentation for a script's use of logging features. 2011-05-06 19:23:15 -05:00
Jon Siwek
2a21ebba2e Adding &log attribute to static attr_names array. 2011-05-06 18:52:23 -05:00
Jon Siwek
cf0a542f7c Bro doc mode now tracks record redefs that extend its field list. 2011-05-05 10:43:15 -05:00
Jon Siwek
ceaba8077b Fixes related to make doc handling of script summary text (##! comments)
- Summary comments (##!) can now be placed at the beginning of
BiF files (but still outside C segments).  An issue was fixed where
these comments would mistakenly be transferred into the generated
.func_def file and cause a compile error. I completely removed writing
any opt_ws value into the .func_def file because it was currently not
writing anything besides whitespace.

- The generation of reST for the collecting of "groups" of policy
script documentation now happens at build time of `make doc` through the
use of a helper script rather than doing this at configure time so that
changes to summary text will always be reflected in the documentation.
2011-05-02 15:34:34 -05:00
Jon Siwek
f10d2e10ea Overhaul of "doc" build target for generating policy script documentation.
It's now all implemented in CMake scripting.

The generation of reST docs is now a distinct target, "restdoc", while
the target to generate HTML docs, "doc", depends on "restdoc".  reST doc
generation supports incremental builds (documentation for a given policy
script is only regenerated when it is out of date), but HTML doc generation
via ``make doc`` is not incremental (Sphinx always starts with fresh input).

Building the "restdoc" target is now covered by a btest to ensure all
policy scripts are parse-able when Bro is in "doc mode".

Generated reST docs should now support "@load"ing from subdirectories.  e.g.
"@load foo/baz" and "@load bar/baz" will now generate the right xref links.
2011-04-26 22:13:04 -05:00
Jon Siwek
4634d92394 Move stuff related to policy script documentation from doc/ to doc/scripts/ 2011-04-20 21:11:32 -05:00
Jon Siwek
b8f6c5bc7d Improving documention for the Bro script document-generation process
Some minor organizational revisions to the python scripting.
2011-04-06 16:39:50 -05:00
Jon Siwek
f3b1a6bb9e Implementing capability to logically group generated policy script docs 2011-04-06 14:38:35 -05:00
Jon Siwek
5183ab409b Initial implementation of a make doc target to generate script docs. 2011-04-06 12:06:39 -05:00