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
This commit is contained in:
Jon Siwek 2011-08-15 17:29:41 -05:00
parent 41dd0b98e9
commit 33fce8a71d
18 changed files with 42 additions and 39 deletions

View file

@ -10,6 +10,7 @@ export {
} &log;
type NodeType: enum {
NONE,
CONTROL,
MANAGER,
PROXY,
@ -54,8 +55,8 @@ export {
## This function can be called at any time to determine what type of
## cluster node the current Bro instance is going to be acting as.
## :bro:id:`is_enabled` should be called first to find out if this is
## actually going to be a cluster node.
## If :bro:id:`Cluster::is_enabled` returns false, then
## :bro:enum:`Cluster::NONE` is returned.
global local_node_type: function(): NodeType;
## This gives the value for the number of workers currently connected to,
@ -81,7 +82,7 @@ function is_enabled(): bool
function local_node_type(): NodeType
{
return nodes[node]$node_type;
return is_enabled() ? nodes[node]$node_type : NONE;
}