Commit graph

576 commits

Author SHA1 Message Date
Jon Siwek
e5e3bf28ec Make @load statements recognize relative paths.
For example a script can do "@load ./foo" to load a script named
foo.bro that lives in the same directory or "@load ../bar" to load
a script named bar.bro in the parent directory, even if those
directories are not contained in BROPATH.
2011-07-14 11:35:23 -05:00
Seth Hall
0332a06012 Fixed most of the tests after the script reorganization. 2011-07-12 14:12:25 -04:00
Robin Sommer
084c2086a4 Fixing bug causing crash when running without arguments. 2011-07-07 19:56:48 -07:00
Robin Sommer
df1b2f922b Renaming reporter_message to report_info.
Same change internally.
2011-07-07 19:56:25 -07:00
Robin Sommer
eb0580c622 Fixing another memory leak.
This is the ConnVal leak that Gilbert also saw.
2011-07-07 19:46:40 -07:00
Robin Sommer
9709b1d522 Merge remote branch 'origin/topic/robin/reporting'
* origin/topic/robin/reporting:
  Syslog BiF now goes through the reporter as well.
  Avoiding infinite loops when an error message handlers triggers errors itself.
  Renaming the Logger to Reporter.
  Overhauling the internal reporting of messages to the user.

Updating a bunch of tests/baselines as well.

Conflicts:
	aux/broccoli
	policy.old/alarm.bro
	policy/all.bro
	policy/bro.init
	policy/frameworks/notice/weird.bro
	policy/notice.bro
	src/SSL-binpac.cc
	src/bro.bif
	src/main.cc
2011-07-01 13:59:21 -07:00
Robin Sommer
fb6a8cec19 Avoiding infinite loops when an error message handlers triggers errors
itself.

If an error is triggered inside one of the reporter_* handlers, the
message about that will now fall back to stderr.
2011-07-01 10:04:27 -07:00
Robin Sommer
66e2c3b623 Renaming the Logger to Reporter.
Also changing output to not include timestamps when we haven't started
processing packets yet.
2011-07-01 09:22:33 -07:00
Jon Siwek
3c055b16a5 Update core.conn-uid test/baseline.
All the UIDs in the baselines changed because they're now also
being generated for notices.
2011-06-29 12:49:07 -05:00
Jon Siwek
0d4be5d772 Fixing tests / updating baselines.
- core.load-unload: scripts that get loaded by default changed, so to
  make the test insensitive to that in the future, I changed the test
  to just check that the stdout is empty (the @unload'd script would have
  had output there)

- policy.frameworks.logging.rotate-custom: I saw that the ordering of
  the log postprocessor output caused a failure for me even though the
  overall content was the same, so it now sorts that part before diff'ing

- core.print-bpf-filters-ipv[4|6]: packet-filter log file name changed

- policy.protocols.conn.known-services: logging file names changes and
  local_nets is now in the Site module
2011-06-29 12:34:14 -05:00
Seth Hall
c070cb31da Merge remote branch 'origin/master' into topic/policy-scripts-new
Conflicts:
	policy/bro.init
	testing/btest/language/rare-events.bro
2011-06-25 23:49:20 -04:00
Jon Siwek
ea1f819b3e Update core.vlan-mpls test to use new policy scripts. 2011-06-20 16:06:44 -05:00
Jon Siwek
fc66d88a04 Updating the packet filter tests to use new policy scripts. 2011-06-20 15:56:16 -05:00
Jon Siwek
ef79ab3562 Update baseline for core.load-pkg test
I removed the diff'ing against which scripts Bro outputs as loaded
because that's going to be sensitive to changes in which scripts
get loaded by default.  What really matters is the output that shows
that Bro was able to load the script via a directory's __load__.bro
2011-06-20 14:10:02 -05:00
Jon Siwek
9de6e9170c Cleaning up the script loading implementation.
This change primarily improves the way Bro detects and prevents
the same script from being loaded twice.  It now compares inode
numbers instead of path names.
2011-06-20 12:10:09 -05:00
Jon Siwek
0f6a6ddc28 Fix baseline for core.conn-id (now core.conn-uid) test.
"conn-id.bro" was the name of a script in the policy/ directory that conn.bro
expected to @load, but when the unit test was also named "conn-id.bro",
it would be loaded twice during the test (once from conn.bro and once
as a command line argument to bro).  This means two event handlers were
registered in error and the baseline output contained duplicate lines
that can be removed.
2011-06-20 10:11:44 -05:00
Jon Siwek
b4d70a22db Fixed core.load-pkg test w/ diff canonifier instead 2011-06-10 15:07:32 -05:00
Jon Siwek
9e747a040d Revert "Fix core.load-pkg unit test."
This reverts commit 80558a994a.
2011-06-10 15:01:35 -05:00
Jon Siwek
13c90fc732 Fix core.conn-id test on some platforms.
The output of some versions of `wc` (e.g. MacOS) seems to indent
their output while others don't, causing the baseline diff to fail.
So pipe to sed to get rid of spaces before diffing.
2011-06-10 12:17:10 -05:00
Jon Siwek
80558a994a Fix core.load-pkg unit test.
Removed the test's diff against baseline output that contained absolute
paths so that it will work across systems.  Also don't redirect anything
to stderr so that failure information shows up in btest diagnostic output.
2011-06-10 11:53:51 -05:00
Robin Sommer
a236dd0d3d Fixing typo in test. 2011-06-02 22:07:36 -07:00
Robin Sommer
fac328685b @load now supports loading a directory.
With a directory "foo" somewhere in BROPATH, "@load foo" now checks if
there's a file "foo/__load__.bro". If so, it reads that file in. (If
not, Bro reports the same error as before, complaining that it can't
read a directory).
2011-06-02 21:57:24 -07:00
Robin Sommer
b16bb7fff4 Test updates.
Includes splitting up one test which's output now depends on wether
we've compiled with IPv6 support or not.
2011-05-10 19:33:37 -07:00
Robin Sommer
61c929bc16 Updating btests and a Makefile.
"make" now runs all the tests.
2011-05-10 17:56:45 -07:00
Robin Sommer
9ddc26328d Support for (mixed) MPLS and VLAN traffic, and a new default BPF
filter. (Seth Hall and Robin Sommer)

- Merging in the patch from #264, which provides support for mixed
  VLAN and MPLS traffic.

- Changing Bro's default filter from being built dynamically to being
  a static "ip or not ip". To get the old behaviour back (i.e., the
  dynamically built filter), redef "all_packets" to false.

- print-filter.bro now always prints the filter that Bro is actually
  using, even if overriden from the command line.
2011-04-29 09:10:43 -07:00
Robin Sommer
59d6202104 Merge remote branch 'origin/topic/robin/conn-ids'
* origin/topic/robin/conn-ids:
  Moving uid from conn_id to connection, and making output determistic if a hash seed is given.
  Extending conn_id with a globally unique identifiers.
2011-04-22 22:13:44 -07:00