No description
Find a file
Gregor Maier fdaeea0ea9 enum type: don't allow mixing of explicit value and auto-increment.
Updated enum type. New description:

Enum's are supported in .bif and .bro scripts.
An enum in a bif will become available in the event engine and
the policy layer.

It is possible to assign an explicit value to an enum enumerator
element, or the enum type can automatically assign values. However,
the styles cannot be mixed. If automatic assignement is used, the first
element will have a value of 0, the next will have a value of 1, etc.

Enum type variables and identifiers can be formated using the "%s"
format specifier, in which case the symbolic name will be printed.
If the "%d" format specifier is used, the numerical value is
printed.

Example automatic assignment:
    type foo: enum {
        BAR_A,      # value will be 0
        BAR_B,      # value will be 1
        BAR_C,      # value will be 2
    };

Example with explicit assignment:
    type foobar: enum {
        BAR_X = 10,      # value will be 10
        BAR_Y = 23,      # value will be 23
        BAR_Z = 42,      # value will be 42
    };

Enumerator values can only by positive integer literals.
The literals can be specified in (0x....), but not in octal (bro policy
layer limitation). So, do not use 0123 as value in bifs!

Each enumerator value can only be used once per enum (C allows
to use the same value multiple times).

All these restrictions are enforced by the policy script layer and not
the bif compiler!

Enums can be redef'ed, i.e., extended. If the enum is automatic
increment assignment, then the value will continue to increment.
If the enum uses explicit assignment, then the redef need to use
explicit assignments as well.

Example 1::
    redef enum foo += {
        BAR_D,    # value will be 3
        BAR_E,    # value will be 4
        BAR_F,    # value will be 5
    };

Example 2::
    redef enum foobar += {
        BAR_W = 100,
    };
2011-02-10 13:14:24 -08:00
aux Adding new aux/btest submodule. 2011-02-08 14:28:15 -08:00
cmake Merge remote branch 'origin/fastpath' 2011-01-28 08:14:34 -08:00
doc Cleanup of the Bro distribution. 2010-11-26 13:45:54 -08:00
policy Merge remote branch 'remotes/origin/topic/robin/work' 2011-02-08 20:25:13 -08:00
src enum type: don't allow mixing of explicit value and auto-increment. 2011-02-10 13:14:24 -08:00
testing Initial import of svn+ssh:://svn.icir.org/bro/trunk/bro as of r7088 2010-09-27 20:42:30 -07:00
.gitignore New Makefile wrapper in top-level directory. 2010-11-26 15:31:00 -08:00
.gitmodules Adding new aux/btest submodule. 2011-02-08 14:28:15 -08:00
bro-path-dev.in Setting executable bit for bro-dev-path.in. 2010-12-09 02:51:11 -08:00
CHANGES Merge remote branch 'origin/topic/seth/fix-compiler-warnings' 2011-02-09 08:10:41 -08:00
Checklist-for-Release Cleanup of the Bro distribution. 2010-11-26 13:45:54 -08:00
CMakeLists.txt Fix for the --with-binpac configure option 2011-01-24 11:02:16 -06:00
config.h.in Fix for OS X 10.5 compile error wrt llabs() 2011-01-06 17:06:51 -06:00
configure Adding more configure options for finding dependencies 2011-01-28 10:10:16 -06:00
COPYING Cleanup of the Bro distribution. 2010-11-26 13:45:54 -08:00
INSTALL Changes for packaging 2011-01-14 22:25:10 -06:00
make-mac-packages Changes for packaging 2011-01-14 22:25:10 -06:00
make-rpm-packages Changes for packaging 2011-01-14 22:25:10 -06:00
Makefile Changes for packaging 2011-01-14 22:25:10 -06:00
README Cleanup of the Bro distribution. 2010-11-26 13:45:54 -08:00
VERSION Merge remote branch 'origin/topic/seth/fix-compiler-warnings' 2011-02-09 08:10:41 -08:00

This is release 1.6 of Bro, a system for detecting network intruders in
real-time using passive network monitoring.

Please see the file INSTALL for installation instructions and
pointers for getting started. For more documentation, see the
documentation on Bro's home page:

    http://www.bro-ids.org/docs

The main parts of Bro's documentation are also available in the doc/
directory of the distribution. (Please note that the documentation
is still a work in progress; there will be more in future releases.)

Numerous other Bro-related publications, including a paper describing the
system, can be found at

    http://www.bro-ids.org/publications.html

Send comments, etc., to the Bro mailing list, bro@bro-ids.org.
However, please note that you must first subscribe to the list in
order to be able to post to it.

- Vern Paxson & Robin Sommer, on behalf of the Bro development team

Lawrence Berkeley National Laboratory
University of California, Berkeley  USA

ICSI Center for Internet Research (ICIR)
International Computer Science Institute
Berkeley, CA  USA
vern@icir.org / robin@icir.org