Commit graph

2499 commits

Author SHA1 Message Date
Daniel Thayer
fe5d865e64 Remove --enable-brov6 from configure usage text 2012-02-03 18:06:02 -06:00
Jon Siwek
b3f1f45082 Remove --enable-brov6 flag, IPv6 now supported by default.
Internally, all BROv6 preprocessor switches were removed and
addr/subnet representations wrapped in the new IPAddr/IPPrefix classes.

Some script-layer changes of note:

- dns_AAAA_reply event signature changed: the string representation
  of an IPv6 addr is easily derived from the addr value, it doesn't
  need to be another parameter.  This event also now generated directly
  by the DNS analyzer instead of being "faked" into a dns_A_reply event.

- removed addr_to_count BIF.  It used to return the host-order
  count representation of IPv4 addresses only.  To make it more
  generic, we might later add a BIF to return a vector of counts
  in order to support IPv6.

- changed the result of enclosing addr variables in vertical pipes
  (e.g. |my_addr|) to return the bit-width of the address type which
  is 128 for IPv6 and 32 for IPv4.  It used to function the same
  way as addr_to_count mentioned above.

- remove bro_has_ipv6 BIF
2012-02-03 16:46:58 -06:00
Bernhard Amann
a0487ecb30 move Value and Field from the logging namespace to the threading namespace, because other modules using threading will need them. 2012-02-03 14:12:29 -08:00
Seth Hall
600d015dab One more very minor change I forgot to commit. 2012-02-03 16:27:51 -05:00
Seth Hall
0fbe925dc5 Fixed a misspelling. 2012-02-03 16:25:30 -05:00
Seth Hall
44bb4d0320 Updates for CHANGES and VERSION files. 2012-02-03 16:17:45 -05:00
Seth Hall
2cd88ee4f6 Merge remote-tracking branch 'origin/topic/bernhard/software'
* origin/topic/bernhard/software:
  change software framework interface again. At the moment everything should worl.
  start reworking interface of software framework. working apart from detect-webapps.bro, which direcly manipulates a no longer available interface...
  after talking to seth - change host_a field in record back to host.
  forgotten policy files.
  Software framework stores ports for server software.
2012-02-03 16:17:04 -05:00
Robin Sommer
819cb57952 Updating submodule(s).
[nomail]
2012-02-03 04:05:34 -08:00
Robin Sommer
70fe7876a1 Updating thread naming.
Also includes experimental code to adapt the thread name as shown by
top, but it's untested.
2012-02-03 04:04:38 -08:00
Robin Sommer
cf6a346b86 Fixing prof.log output.
The queue Size() method was not yet atomic.
2012-02-03 04:04:38 -08:00
Robin Sommer
4879cb7b0d Improved signal handling.
Sending SIGTERM triggers a normal shutdown of all threads that waits
until they have processed their remaining data. However, sending a 2nd
SIGTERM while waiting for them to finish will immediately kill them
all.
2012-02-03 04:04:38 -08:00
Robin Sommer
ffb4094d36 Bugfixes 2012-02-03 04:04:38 -08:00
Robin Sommer
29fc56105d Documenting logging API. 2012-02-03 04:04:37 -08:00
Robin Sommer
1058e11ffb Adding thread statistics to prof.log 2012-02-03 04:04:37 -08:00
Robin Sommer
4f0fc571ef Doing bulkd writes instead of individual writes now.
Also slight change to Writer API, going back to how the rotate methods
were before.
2012-02-03 04:04:37 -08:00
Robin Sommer
a428645b2a Documenting the threading/* classes.
Also switching from semaphores to mutexes as the former don't seem to
be fully supported on MacOS.
2012-02-03 04:04:37 -08:00
Robin Sommer
396e8c901c Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Fix minor typos in documentation
2012-02-03 01:56:30 -08:00
Daniel Thayer
1d417a3e23 Fix minor typos in documentation 2012-02-02 18:48:23 -06:00
Robin Sommer
9c9b72a1b8 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Fix sorting of lines in Brofiler coverage.log
2012-01-31 11:51:25 -08:00
Daniel Thayer
4a6a9fe9f2 Fix sorting of lines in Brofiler coverage.log
Lines with a range were being output with text "lines", and so were
being listed after all other lines belonging to the same Bro script
(e.g., "lines 123-125" was listed after "line 492").  Fixed by using
the text "line" instead of "lines".

Line numbers with fewer digits were being listed after line numbers
with more digits (e.g., "line 85" was listed after "line 237").
Fixed by sorting on a reformatted string (this string does not appear
in the output) where line numbers are right justified (padded on left
with spaces) so that sorting produces the expected results.
2012-01-30 17:35:19 -06:00
Robin Sommer
2df3738d1a Merge remote-tracking branch 'origin/topic/bernhard/log-threads' into topic/robin/log-threads 2012-01-30 13:22:17 -08:00
Robin Sommer
b6912f16aa Merge branch 'master' of ssh://git.bro-ids.org/bro into topic/robin/log-threads 2012-01-30 13:22:02 -08:00
Bernhard Amann
6cc29a7832 make logging with threads compile on mac os and fix a couple of string literal warnings. 2012-01-30 12:12:14 -08:00
Seth Hall
c03efbb570 Small updates for the bittorrent analyzer to support 64bit types in binpac.
- This branch removes the attempt at bittorrent resynchronization.
  I don't think that the bittorrent resynchronization would really
  work very well anyway.

- This need to be merged after the topic/seth/64bit-type branch in binpac.
2012-01-27 22:55:42 -05:00
Robin Sommer
e4e770d475 Threaded logging framework.
This is based on Gilbert's code but I ended up refactoring it quite a
bit. That's why I didn't do a direct merge but started with a new
branch and copied things over to adapt. It looks quite a bit different
now as I tried to generalize things a bit more to also support the
Input Framework.

The larger changes code are:

    - Moved all logging code into subdirectory src/logging/. Code
      here is in namespace "logging".

    - Moved all threading code into subdirectory src/threading/. Code
      here is in namespace "threading".

    - Introduced a central thread manager that tracks threads and is
      in charge of termination and (eventually) statistics.

    - Refactored logging independent threading code into base classes
      BasicThread and MsgThread. The former encapsulates all the
      pthread code with simple start/stop methods and provides a
      single Run() method to override.

      The latter is derived from BasicThread and adds bi-directional
      message passing between main and child threads. The hope is that
      the Input Framework can reuse this part quite directly.

    - A log writer is now split into a general WriterFrontend
      (LogEmissary in Gilbert's code) and a type-specific
      WriterBackend. Specific writers are implemented by deriving from
      the latter. (The plugin interface is almost unchanged compared
      to the 2.0 version.).

      Frontend and backend communicate via MsgThread's message
      passing.

    - MsgThread (and thus WriterBackend) has a Heartbeat() method that
      a thread can override to execute code on a regular basis. It's
      triggered roughly once a second by the main thread.

    - Integration into "the rest of Bro". Threads can send messages to
      the reporter and do debugging output; they are hooked into the
      I/O loop for sending messages back; and there's a new debugging
      stream "threading" that logs, well, threading activity.

This all seems to work for the most part, but it's not done yet.

TODO list:

    - Not all tests pass yet. In particular, diffs for the external
      tests seem to indicate some memory problem (no crashes, just an
      occasional weird character).

    - Only tested in --enable-debug mode.

    - Only tested on Linux.

    - Needs leak check.

    - Each log write is currently a single inter-thread message. Bring
      Gilbert's bulk writes back.

    - Code needs further cleanup.

    - Document the class API.

    - Document the internal structure of the logging framework.

    - Check for robustness: live traffic, aborting, signals, etc.

    - Add thread statistics to profile.log (most of the code is there).

    - Customize the OS-visible thread names on platforms that support it.
2012-01-27 17:16:14 -08:00
Robin Sommer
c607785cec Merge remote-tracking branch 'origin/topic/jsiwek/brofiler'
* origin/topic/jsiwek/brofiler:
  Fix mktemp portability issue affecting test coverage. (addresses #752)

Closes #752.
2012-01-27 10:43:43 -08:00
Jon Siwek
0065cf6148 Fix mktemp portability issue affecting test coverage. (addresses #752)
Also update Makefiles to behave better for brief targets and in absence
of external test repos.
2012-01-27 11:01:50 -06:00
Robin Sommer
f6f9dd952f Fixed for Brofiler merge. 2012-01-26 20:55:24 -08:00
Robin Sommer
60ae6f01d1 Updating submodule(s).
[nomail]
2012-01-25 18:03:40 -08:00
Robin Sommer
6a3b41b84d Bugfix caught by test-suite. 2012-01-25 17:45:26 -08:00
Robin Sommer
d6767e1d83 Disalbing brofiling because of problem.
See #756.
2012-01-25 17:36:13 -08:00
Robin Sommer
6a6092daf8 Adding coverage to brief make target as well. 2012-01-25 17:35:25 -08:00
Robin Sommer
1aefccd96d Updating submodule(s).
[nomail]
2012-01-25 17:15:06 -08:00
Robin Sommer
848ae2355e Merge remote-tracking branch 'origin/topic/jsiwek/brofiler'
* origin/topic/jsiwek/brofiler:
  Fix superfluous/duplicate data getting in to testing coverage log.
  Add "# @no-test" tag to blacklist statements from test coverage analysis.
  Test coverage integration for external tests and complete suite.
  Integrate Bro script coverage profiling with the btest suite.
  Add simple profiling class to accumulate Stmt usage stats across runs.

Renaming environment variable BROFILER_FILE to BRO_PROFILER_FILE for
consistency. Yeah, I know, such a nice name! :)
2012-01-25 17:12:37 -08:00
Robin Sommer
b649ade9ba Merge remote-tracking branch 'origin/topic/bif_cleanup'
* origin/topic/bif_cleanup:
  Give mode2string a more generic name.
  Change some BiF return values from bool to any.
  Perform type checking on count-to-port conversion.
  Remove redundant connection_record() BiF.
  Remove redundant active_connection() BiF.
  Make exit() parameterizable.
  to_port() now parses a string instead of a count.

Closes #684.
2012-01-25 16:48:00 -08:00
Robin Sommer
7a8c9b1c69 Merge remote-tracking branch 'origin/topic/jsiwek/local-table-init'
* origin/topic/jsiwek/local-table-init:
  Allow local table variables to be initialized with {} list expressions.

Closes #739.
2012-01-25 13:47:42 -08:00
Robin Sommer
27ce62077f Merge remote-tracking branch 'origin/topic/jsiwek/complex-record-indices'
* origin/topic/jsiwek/complex-record-indices:
  Teach CompHash to allow indexing by records with vector/table/set fields.

Closes #464
2012-01-25 13:38:36 -08:00
Robin Sommer
2a06617e71 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Fixed a bug resulting in over-logging of detected webapps.
2012-01-25 13:25:48 -08:00
Robin Sommer
2c439fd0a2 Fixing typo 2012-01-23 22:00:56 -08:00
Robin Sommer
08683175c1 Interface draft for new IP address wrapper class. 2012-01-22 21:41:42 -08:00
Jon Siwek
1e4c3d8ea2 Teach CompHash to allow indexing by records with vector/table/set fields.
Addresses #464.
2012-01-20 16:54:48 -06:00
Bernhard Amann
eacdffff90 Merge remote-tracking branch 'origin/master' into topic/bernhard/software
Conflicts:
	scripts/base/frameworks/software/main.bro
	scripts/policy/protocols/ftp/software.bro
2012-01-20 12:51:58 -08:00
Bernhard Amann
f24c50b49a remove unnecessary stuff from function. 2012-01-20 12:42:23 -08:00
Bernhard Amann
ac1708f843 fix handling of predicates - now the second argument that is sent to the predicate really is a recordVal and not a ListVal. 2012-01-20 12:33:48 -08:00
Bernhard Amann
92050af947 Merge remote-tracking branch 'origin/master' into topic/bernhard/input 2012-01-20 12:03:54 -08:00
Seth Hall
5b04789ab8 Fixed a bug resulting in over-logging of detected webapps. 2012-01-20 11:22:15 -05:00
Robin Sommer
8eeb37129a Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Make communication log baseline test more reliable.
  fixed some broken links
2012-01-18 20:09:54 -08:00
Matthias Vallentin
6c255d13ff Merge remote-tracking branch 'origin/master' into topic/bif_cleanup
Conflicts:
	src/bro.bif
2012-01-18 14:56:53 -08:00
Jon Siwek
0287f7adc2 Fix superfluous/duplicate data getting in to testing coverage log. 2012-01-18 11:45:53 -06:00
Jon Siwek
ec6560a6ed Make communication log baseline test more reliable. 2012-01-13 16:06:44 -06:00