Commit graph

13262 commits

Author SHA1 Message Date
Robin Sommer
4f39470c1b New option exit_only_after_terminate to prevent Bro from exiting.
If set, the main loop won't terminate before somebody calls
terminate().

This should make input framework testing more reliable I'd hope.
2013-01-18 17:34:33 -08:00
Robin Sommer
fdf79196c6 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Fixing variable size issues (was uint, should be long) with http response code.
  Revert "Trick for parallelizing input framework unit tests."
  add opaque type-ignoring for the accept_unsupported_types input framework option.
2013-01-18 17:19:40 -08:00
Gilbert Clark
a712488cd6 Merge branch 'fastpath' of ssh://git.bro-ids.org/bro into fastpath 2013-01-18 14:34:00 -05:00
Gilbert Clark
cce73a3aad Fixing variable size issues (was uint, should be long) with http response code. 2013-01-18 14:23:34 -05:00
Gilbert Clark
0a7e0cc7d5 Merge branch 'master' into fastpath 2013-01-18 14:16:37 -05:00
Jon Siwek
acafcfafd2 Revert "Trick for parallelizing input framework unit tests."
This reverts commit 43ed437daa.

The old way of doing the tests seems more reliable for now.
2013-01-18 13:15:34 -06:00
Jon Siwek
3b73862ffb Merge branch 'master' into fastpath 2013-01-18 13:08:20 -06:00
Jon Siwek
624980b98d Add a null value check in CompositeHash::ComputeHash.
Because I guess aborting is nicer than segfaulting.

Addresses #930.
2013-01-18 12:56:23 -06:00
Jon Siwek
fdd11428c1 Change reporter messages to more reliably print to stderr.
Moved this functionality to be internal instead of in the script-layer
event handlers.  The issue with the later is that bad things can happen
between the time a reporter event handler is dispatched and the time it
is executed, and if bro crashes in that time, the message may never be
seen/logged.

Addressed #930 (and revisits #836).
2013-01-18 12:46:00 -06:00
Robin Sommer
2823744ea5 Removing unused class member. 2013-01-17 17:40:34 -08:00
Jon Siwek
0a69b87f03 Fix uninitialized locals in event/hook handlers from having a value.
Since values for local variables are referenced by offset within a Frame
(not by identifier name), and event/hook handler bodies share a common
Frame, the value offsets for local variables in different handlers may
overlap.  This meant locals in a handler without an initialization may
actually end up referring to the value of a previous handler's local
that has the same Frame offset.  When executing the body, that can
possibly result in a type-conflict error or give give unexpected
results instead of a "use of uninitialized value" error.

This patch makes it so uninitialized locals do always refer to a null
value before executing the body of a event/hook handler, so that using
them without assigning a value within the body will connsistently give
a "use of uninitialized value" error.

Addresses #932.
2013-01-17 15:21:50 -06:00
Bernhard Amann
0fcc3db9a0 start adding a different text for empty records for the sqlite writer.
Sadly there also seems to be another deadlock issue which I am currently
not really able to figure out - on shutdown sometimes (too often) the main
thread + all sqlite threads wait for semaphores or mutexes.
2013-01-16 18:13:39 -08:00
Jon Siwek
4a6fdfbc9c Minor refactor of file analysis prototype interfaces. 2013-01-16 16:57:58 -06:00
Jon Siwek
be71a42f4c Add "fallthrough" keyword, require a flow statement to end case blocks.
Case blocks in switch statements now must end in a break, return, or
fallthrough statement to give best mix of safety, readability, and
flexibility.

The new fallthrough keyword explicitly allows control to be passed to the
next case block in a switch statement.

Addresses #754.
2013-01-16 16:37:50 -06:00
Jon Siwek
69bd46b3af Fix coverage unit tests due to added file analysis scripts. 2013-01-16 12:08:09 -06:00
Bernhard Amann
8f71186bf7 no, you will never guess from where I copied this file... 2013-01-15 16:23:48 -08:00
Bernhard Amann
3415b5fcbe make sqlite support more or less work for logging and input
* add support for &type_column for reading
* add basic tests for logging & input
* clean up a bit
* add support for tables for reading (untested)
2013-01-15 16:01:30 -08:00
Bernhard Amann
365c2b0917 Merge remote-tracking branch 'origin/fastpath' into topic/bernhard/sqlite 2013-01-15 15:04:47 -08:00
Bernhard Amann
f7679a3d50 add opaque type-ignoring for the accept_unsupported_types input framework option.
Allows reading of records that contain &optional opaque-entries when
accept_unsupported_types=T
2013-01-15 15:03:20 -08:00
Matthias Vallentin
a635f96518 Small cosmetic changes. 2013-01-15 14:56:02 -08:00
Bernhard Amann
d843297a97 make sqlite-writer more stable.
This actually looks quite good...
2013-01-15 11:48:47 -08:00
Bernhard Amann
96aa8776d3 make it compile with new version of AsciiInputOutput 2013-01-13 19:32:12 -08:00
Bernhard Amann
5704496f26 Merge branch 'topic/bernhard/input-logging-commmon-functions' into topic/bernhard/sqlite 2013-01-13 19:24:44 -08:00
Bernhard Amann
e2e22a707b add the last of Robins suggestions (separate info-struct for constructors).
This took a while.
2013-01-12 14:39:00 -08:00
Jon Siwek
390e4082c7 Add prototype file analysis interfaces.
Nothing connects to them yet and nothing would happen even if it did.
Work on analyzers/actions for files coming soon.
2013-01-11 13:12:49 -06:00
Bernhard Amann
253b8201e8 port memory leak fix from master 2013-01-11 10:01:47 -08:00
Bernhard Amann
1b0bb5063a Merge remote-tracking branch 'origin/master' into topic/bernhard/input-logging-commmon-functions
Conflicts:
	src/input/readers/Ascii.cc
2013-01-11 09:48:53 -08:00
Jon Siwek
8695053e27 Disable automatic case fallthrough in switch stmts. Addresses #754.
Case bodies now don't require a "break" statement to prevent fallthrough
to case bodies below.  Empty case bodies generate an error message at
parse-time to help indicate the absence of automatic fallthrough; to
associate multiple values with a case, use "case 1, 2:" instead of
"case 1: case 2:".
2013-01-11 11:43:15 -06:00
Scott Runnels
f9359ad40d Moving to new rootedliteralinclude directive. 2013-01-09 14:23:09 -05:00
Scott Runnels
546be58ded Merge remote-tracking branch 'origin/master' into topic/documentation 2013-01-09 13:32:00 -05:00
Jon Siwek
01090cf09f Teach sphinx a new ".. rootedliteralinclude::" directive.
It's like ".. literalinclude::" except the argument is an absolute path
which may contain environment variables to be be expanded when
generating documents.
2013-01-09 11:16:43 -06:00
Scott Runnels
c453c228cb Iteration over vectors. 2013-01-08 15:31:56 -05:00
Scott Runnels
7d583b6b78 Vector declarations and explanations, including btests 2013-01-08 14:47:39 -05:00
Robin Sommer
564e27abb6 Merge remote-tracking branch 'origin/topic/jsiwek/string-indexing'
* origin/topic/jsiwek/string-indexing:
  Change substring index notation to use a colon (addresses #422).

Tweaked slightly to make it more generic, we may index other types
with slices eventually too.

Closes #422.
2013-01-08 10:20:12 -08:00
Jon Siwek
8b46bbb1c0 Change substring index notation to use a colon (addresses #422).
String slice notation is written as `s[1:2]` instead of `s[1, 2]`
because the later is ambiguous with composite index types.
2013-01-07 13:29:05 -06:00
Robin Sommer
e638f04301 Updating submodule(s).
[nomail]
2013-01-07 09:47:09 -08:00
Robin Sommer
4488dce493 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Fix memory leak in OpaqueType::DoUnserialize.
2013-01-07 09:43:56 -08:00
Jon Siwek
8000c40fee Fix memory leak in OpaqueType::DoUnserialize. 2013-01-07 11:41:36 -06:00
Seth Hall
720089c03f Add a feature to better select the value threshold will apply to in the metrics framework.
- The feature was primarily added to allow the value to be
   modified for cluster based intermediate threshold checks
   without requiring the user to write the metrics filter
   differently for cluster consideration.  It's also a nice
   way to calculate some related information to the metric
   without accidently applying thresholds to that value.

 - Fixed a few small bugs in ftp detect-bruteforcing script
   and adapted it to the new threshold value selection feature.
2013-01-05 22:37:19 -05:00
Seth Hall
bcd7fe114d Fixed an issue causing reporter messages from the metrics framework. 2013-01-05 22:27:17 -05:00
Scott Runnels
5260e10290 A short discussion of variables versus values in the section on Local Variables. 2013-01-05 17:59:47 -05:00
Seth Hall
9366411cf4 Fix the FTP bruteforce threshold to what it's really supposed to be. 2013-01-04 23:49:09 -05:00
Seth Hall
283f7840b3 Removing some debugging print statements I accidently left behind. 2013-01-04 23:38:10 -05:00
Seth Hall
9e1d5d87de New script to detect FTP bruteforcing.
- Created a new time utils library.
2013-01-04 23:34:57 -05:00
Seth Hall
ab7087f953 Hooks work now, enabling the hooks in the scan.bro script. 2013-01-04 21:01:49 -05:00
Seth Hall
89bc65f23c Merge remote-tracking branch 'origin/master' into topic/seth/metrics-merge 2013-01-04 20:49:37 -05:00
Seth Hall
c3a6916572 More cluster tuning for the metrics framework.
- Fixed several state maintenance issues for intermediate updates.

 - Added a new tuning variable Metrics::max_outstanding_global_views
   which limits the number of in-flight intermediate updates per
   metric filter.

 - Changed the default global view threshold percent to 20% (up from 10%)
2013-01-04 16:54:13 -05:00
Scott Runnels
b8c31458ff Local variables. Baselines and data_type_local.bro btest-able script. 2013-01-03 17:03:45 -05:00
Matthias Vallentin
32a0ead698 Give log buffer the correct name. 2012-12-24 23:06:56 -08:00
Matthias Vallentin
7ff15f4599 Simplify delayed logging of SSL records. 2012-12-24 22:57:49 -08:00