Commit graph

13262 commits

Author SHA1 Message Date
Bernhard Amann
3163e84629 and like nearly always - forgot the baseline. 2012-07-23 12:46:09 -07:00
Bernhard Amann
8e453663dd Input framework now accepts escaped ascii values as input.
I managed to completely forget to add unescaping to the input framework -
this should fix it. It now works with the exact same escaping that is
used by the writers (\x##).

Includes one testcase that seems to work - everything else still passes.
2012-07-23 12:43:42 -07:00
Bernhard Amann
336990e234 make reading ascii logfiles work when the input separator is different from \t.
(Wrong escape character was used for reading header fields).
2012-07-23 11:27:08 -07:00
Robin Sommer
f2e60a76a8 Script fix for Linux. 2012-07-22 21:04:59 -07:00
Robin Sommer
775961ee15 Updating test base line.
(Due to removing the debugging helper in canonification script.)
2012-07-22 15:57:26 -07:00
Robin Sommer
71fc2a1728 Another small change to MsgThread API.
Threads will now reliably get a call to DoFinish() no matter how the
thread terminates. This will always be called from within the thread,
whereas the destructor is called from the main thread after the child
thread has already terminated.

Also removing debugging code.

However, two problems remain with the ASCII writer (seeing them only
on MacOS):

    - the #start/#end timestamps contain only dummy values right now.
      The odd thing is that once I enable strftime() to print actual
      timestamps, I get crashes (even though strftime() is supposed to
      be thread-safe).

    - occassionally, there's still output missing in tests. In those
      cases, the file descriptor apparently goes bad: a write() will
      suddently return EBADF for reasons I don't understand yet.
2012-07-22 15:50:12 -07:00
Robin Sommer
053b307e24 Bug fix for BasicThread. 2012-07-22 13:42:31 -07:00
Bernhard Amann
642273bc58 Merge remote-tracking branch 'origin/fastpath' into fastpath 2012-07-20 14:37:53 -07:00
Bernhard Amann
58e2b70fc8 make version_ok return true for TLSv12
I think it is a bug that this was missing...
2012-07-20 14:37:14 -07:00
Bernhard Amann
d205eb8882 Merge remote-tracking branch 'origin/master' into fastpath 2012-07-20 14:26:23 -07:00
Robin Sommer
5ef83900d8 Sed usage in canonifier script didn't work on non-Linux systems. 2012-07-20 12:28:34 -07:00
Robin Sommer
ce4b8dd4ac Changing HTTP DPD port 3138 to 3128.
Addresses #857.
2012-07-20 09:57:38 -07:00
Robin Sommer
c5d1aebbfe Temporarily removing tuning/logs-to-elasticsearch.bro from the
test-all-policy.

Loading it in there can lead to some tests not terminating. We need to
fix that, it let's the coverage test fail.
2012-07-20 09:04:54 -07:00
Robin Sommer
6dc7a8b075 Merge remote-tracking branch 'origin/topic/seth/elasticsearch' into topic/robin/master-test
* origin/topic/seth/elasticsearch:
  More documentation updates.
2012-07-20 08:29:27 -07:00
Seth Hall
7bd8367076 More documentation updates. 2012-07-20 11:02:09 -04:00
Robin Sommer
eef8b7d1c4 Merge remote-tracking branch 'remotes/origin/topic/seth/elasticsearch' into topic/robin/master-test
I've only tested that it compiles, not whether it still works. The
fact that we don't have any tests for this makes me uneasy ...

* remotes/origin/topic/seth/elasticsearch: (35 commits)
  Some documentation updates for elasticsearch plugin.
  Temporarily removing the ES timeout because it works with signals and is incompatible with Bro threads.
  Changed ES index names to localtime and added a meta index.
  New script for easily duplicating logs to ElasticSearch.
  Some better elasticsearch reliability.
  Fixed small elasticsearch problem in configure output.
  Re-adding the needed call to FinishedRotation in the ES writer plugin.
  Tiny updates.
  Bringing elasticsearch branch up to date with master.
  Adding a define to make the stdint C macros available.
  Adding an extra header.
  Fixed a bug with messed up time value passing to elasticsearch.
  Small updates and a little standardization for config.h.in naming.
  Bug fixes.
  Bug fix and feature.
  Forgot to call the parent method for DoHeartBeat.
  Changed the escaping method.
  Flush logs to ES daemon as Bro is shutting down.
  Reduce the batch size to 1000 and add a maximum time interval for batches.
  Reworked bulk operation string construction to use ODesc and added json escaping.
  ...
2012-07-20 07:43:05 -07:00
Robin Sommer
147ddc779a Merge branch 'master' into topic/robin/master-test 2012-07-20 07:05:10 -07:00
Robin Sommer
2efebcd8be Updating submodule(s).
[nomail]
2012-07-20 07:04:37 -07:00
Robin Sommer
bdbc0a0d60 Merge remote-tracking branch 'origin/fastpath' into topic/robin/master-test
* origin/fastpath:
  Revert "Fixing calc_next_rotate to use UTC based time functions."
  Fixing calc_next_rotate to use UTC based time functions.
2012-07-20 06:59:39 -07:00
Robin Sommer
0a681367b7 Revert "Fixing calc_next_rotate to use UTC based time functions."
This reverts commit 6335dbb5e1.
2012-07-20 06:58:39 -07:00
Robin Sommer
450b49d14d Merge branch 'fastpath' of ssh://git.bro-ids.org/bro into fastpath 2012-07-20 06:58:33 -07:00
Seth Hall
db3d89d290 Some documentation updates for elasticsearch plugin. 2012-07-20 08:51:39 -04:00
Robin Sommer
7fde1165e9 Give configure a --disable-perftools option.
This disables Perftools support even if found. Linking in tcmalloc can
make debugging memory problems quite a bit hard (including confusing
valgrind).
2012-07-19 22:28:55 -07:00
Robin Sommer
5cfb8d65c3 Updating tests for the #start/#end change. 2012-07-19 22:28:55 -07:00
Robin Sommer
87e10b5f97 Further threading and API restructuring for logging and input
frameworks.

There were a number of cases that weren't thread-safe. In particular,
we don't use std::string anymore for anything that's passed between
threads (but instead plain old const char*, with manual memmory
managmenet).

This is still a check-point commit, I'll do more testing.
2012-07-19 22:28:30 -07:00
Robin Sommer
490859cfef Reworking forceful thread termination.
Ctrl-C now kills a thread even if it hangs at termination. And readded
a (rather long) timeout to kill threads automatically that don't
shutdown.
2012-07-19 21:22:28 -07:00
Robin Sommer
e90918aa50 Moving the ASCII writer over to use UNIX I/O rather than stdio. 2012-07-19 21:22:28 -07:00
Robin Sommer
f6b883bafc Further reworking the thread API. 2012-07-19 21:22:28 -07:00
Robin Sommer
f7a6407ab1 Reworking thread termination logic.
Turns out the finish methods weren't called correctly, caused by a
mess up with method names which all sounded too similar and the wrong
one ended up being called. I've reworked this by changing the
thread/writer/reader interfaces, which actually also simplifies them
by getting rid of the requirement for writer backends to call their
parent methods (i.e., less opportunity for errors).

This commit also includes the following (because I noticed the problem
above when working on some of these):

     - The ASCII log writer now includes "#start <timestamp>" and
      "#end <timestamp> lines in the each file. The latter supersedes
      Bernhard's "EOF" patch.

      This required a number of tests updates. The standard canonifier
      removes the timestamps, but some tests compare files directly,
      which doesn't work if they aren't printing out the same
      timestamps (like the comm tests).

     - The above required yet another change to the writer API to
       network_time to methods.

     - Renamed ASCII logger "header" options to "meta".

     - Fixes #763 "Escape # when first character in log file line".

All btests pass for me on Linux FC15. Will try MacOS next.
2012-07-19 21:22:22 -07:00
Robin Sommer
c8789cff94 If a thread doesn't terminate, we log that but not longer proceed
(because it could hang later still).

Also logging to stderr as well to make sure one sees it.

Also adding code to the ASCII writer to catch termination
inconsistencies.
2012-07-19 21:21:53 -07:00
Robin Sommer
1ca0d970fc Removing the thread kill functionality.
Wasn't really used and has potential for trouble.
2012-07-19 21:21:53 -07:00
Robin Sommer
f73eb3b086 Reworking thread termination logic.
Turns out the finish methods weren't called correctly, caused by a
mess up with method names which all sounded too similar and the wrong
one ended up being called. I've reworked this by changing the
thread/writer/reader interfaces, which actually also simplifies them
by getting rid of the requirement for writer backends to call their
parent methods (i.e., less opportunity for errors).

This commit also includes the following (because I noticed the problem
above when working on some of these):

     - The ASCII log writer now includes "#start <timestamp>" and
      "#end <timestamp> lines in the each file. The latter supersedes
      Bernhard's "EOF" patch.

      This required a number of tests updates. The standard canonifier
      removes the timestamps, but some tests compare files directly,
      which doesn't work if they aren't printing out the same
      timestamps (like the comm tests).

     - The above required yet another change to the writer API to
       network_time to methods.

     - Renamed ASCII logger "header" options to "meta".

     - Fixes #763 "Escape # when first character in log file line".

All btests pass for me on Linux FC15. Will try MacOS next.
2012-07-19 21:21:53 -07:00
Seth Hall
0c4c5ff335 Temporarily removing the ES timeout because it works with signals and is incompatible with Bro threads. 2012-07-19 12:14:13 -04:00
Seth Hall
1826827359 Changed ES index names to localtime and added a meta index. 2012-07-18 15:42:23 -04:00
Seth Hall
6335dbb5e1 Fixing calc_next_rotate to use UTC based time functions. 2012-07-18 11:32:14 -04:00
Seth Hall
43507b1bb9 New script for easily duplicating logs to ElasticSearch. 2012-07-18 11:28:41 -04:00
Robin Sommer
50f5f8131d Revert "Fixed a couple of init-time mem leaks."
This reverts commit 750e1ddf69.
2012-07-18 07:29:01 -07:00
Seth Hall
1fa182c169 Some better elasticsearch reliability.
- Added a configurable option for timing out ES HTTP requests.

 - Stop sending reporter messages after one message for one failure.
2012-07-18 00:00:31 -04:00
Bernhard Amann
81edec8b2e Fix bug, where in dns.log rcode always was set to 0/NOERROR when
no reply package was seen.

In the fixed version rcode is only set when a reply packet was seen.

Updates for the baseline have been commited separately in the
topic/bernhard/dns-fix branch.
2012-07-17 14:16:15 -07:00
Seth Hall
485e473561 Merge remote-tracking branch 'origin/master' into topic/seth/elasticsearch 2012-07-17 13:57:59 -04:00
Seth Hall
5d04d58385 Fixed small elasticsearch problem in configure output. 2012-07-17 13:57:23 -04:00
Seth Hall
750e1ddf69 Fixed a couple of init-time mem leaks. 2012-07-16 15:51:47 -04:00
Seth Hall
ce05600a71 Mozilla's current certificate bundle. 2012-07-13 22:24:34 -04:00
Robin Sommer
86f6f36f70 Merge remote-tracking branch 'vlad/info_record_fixes'
* vlad/info_record_fixes:
  Fix some Info:Record field documentation.

Closes #851. Many thanks!
2012-07-13 16:20:49 -07:00
Robin Sommer
731292a7a9 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Fix overrides of TCP_ApplicationAnalyzer::EndpointEOF.
  Fix segfault when incrementing whole vector values.
  Remove baselines for some leak-detecting unit tests.
  Unblock SIGFPE, SIGILL, SIGSEGV and SIGBUS for threads.
2012-07-13 16:00:26 -07:00
Jon Siwek
0ef91538db Fix overrides of TCP_ApplicationAnalyzer::EndpointEOF.
In many cases, classes derived from TCP_ApplicationAnalyzer were
*overloading* instead of overriding EndpointEOF causing the parent
class version to become hidden in the child and also for the child's
version to never to called polymorphically from
TCP_Analyzer::EndpointEOF.  Clang gave a warning in each case.
2012-07-13 16:25:58 -05:00
Jon Siwek
353393f9bd Fix segfault when incrementing whole vector values.
Also removed RefExpr::Eval(Val*) method since it was never called
(Clang emitted warning about this hiding overloaded virtual function
UnaryExpr::Eval(Frame*)) and doesn't appear to be necessary even if it
was called to avoid the default vector handling of UnaryExpr::Eval
(as the comment suggests as the intention).
2012-07-13 14:32:50 -05:00
Jon Siwek
8279de25c9 Remove baselines for some leak-detecting unit tests.
They were drifting from the non-leak-detecting unit tests and the point
of these was just leak detecting anyway, don't need the redundancy.
2012-07-13 14:25:31 -05:00
Jon Siwek
491c78e788 Merge branch 'master' into fastpath 2012-07-13 14:23:40 -05:00
Vlad Grigorescu
f43576cff3 Fix some Info:Record field documentation. 2012-07-13 14:04:24 -04:00