Commit graph

3495 commits

Author SHA1 Message Date
Bernhard Amann
14c6c40042 fix crash when all value fields of imported table are uninitialized. 2012-03-22 10:59:36 -07:00
Bernhard Amann
51ddc9f572 fix bug that crashed input framework when creating already existing stream (tried to free not yet alloccated data) + write twotables test 2012-03-21 15:51:21 -07:00
Jon Siwek
c765f43fe3 Refactor script-layer IPv6 ext. header chain (addresses #795)
This replaces the "ip6_hdr_chain" in the "ip6_hdr" record with a vector of
"ip6_ext_hdr" to make it easier to traverse the chain.
2012-03-21 10:34:38 -05:00
Bernhard Amann
d39a389201 make optional fields possible for input framework.
This do not have to be present in the input file and are marked as &optional in the record description.

Those can e.g. be used to create field values on the file in a predicate while reading a file - example:

	Input::add_table([$source="input.log", $name="input", $idx=Idx, $val=Val, $destination=servers,
				$pred(typ: Input::Event, left: Idx, right: Val) = { right$notb = !right$b; return T; }
2012-03-20 14:11:59 -07:00
Jon Siwek
1c1d657039 Changes to IPv6 ext. header parsing (addresses #795).
In response to feedback from Robin:

  - rename "ip_hdr" to "ip4_hdr"

  - pkt_hdr$ip6 is now of type "ip6_hdr" instead of "ip6_hdr_chain"

  - "ip6_hdr_chain" no longer contains an "ip6_hdr" field, instead
    it's the other way around, "ip6_hdr" contains an "ip6_hdr_chain"

  - other internal refactoring
2012-03-20 15:50:17 -05:00
Bernhard Amann
08e1771682 update to execute raw.
support reading from commands by adppending | to the filename.

support streaming reads from command.

Fix something to make rearead work better. (magically happened)
2012-03-20 12:07:37 -07:00
Jon Siwek
f11fca588e Merge branch 'master' into topic/jsiwek/ipv6-ext-headers 2012-03-19 14:26:59 -05:00
Jon Siwek
667487cec9 Adapt FreeBSD's inet_ntop implementation for internal use.
So we get consistent text representations of IPv6 addresses across
platforms.
2012-03-19 11:26:31 -05:00
Bernhard Amann
88e0cea598 add execute-mode support to the raw reader - allows to directly call commands and read their output.
Note that fdstream.h is from boost and has a separate license:
 * (C) Copyright Nicolai M. Josuttis 2001.
 * Permission to copy, use, modify, sell and distribute this software
 * is granted provided this copyright notice appears in all copies.
 * This software is provided "as is" without express or implied
 * warranty, and with no claim as to its suitability for any purpose.
2012-03-18 15:31:47 -07:00
Bernhard Amann
b34a0b6deb Merge remote-tracking branch 'origin/topic/robin/log-threads' into topic/bernhard/input-threads
Conflicts:
	src/threading/Manager.cc
2012-03-18 11:03:04 -07:00
Bernhard Amann
bf597012f8 fix some stupid, not that easy to find bugs.
Functionality seems to work completely again - including all tests passing.
2012-03-18 10:50:10 -07:00
Bernhard Amann
29f56b4986 continue finetuning of interface + adjust tests.
streaming + re-reading do not seem to work completely correctly + there are still some strange random crashes.
2012-03-16 23:43:13 -07:00
Bernhard Amann
e59aed6ce3 for seth - reverse order of event arguments 2012-03-16 08:31:19 -07:00
Bernhard Amann
842f635695 give EventDescripion field back to events 2012-03-16 08:10:28 -07:00
Bernhard Amann
367c4b4a7e make raw reading work.
apparently there was a crash in the reader plugin, but main bro did not notice but waited for eternity for it do to something.
2012-03-16 07:53:29 -07:00
Bernhard Amann
57ffe1be77 completely change interface again.
compiles, not really tested.

basic test works 70% of the time, coredumps in the other 30 - but was not easy to debug on a first glance (most interestingly the crash happens in the logging framework - I wonder how that works).
Other tests are not adjusted to the new interface yet.
2012-03-15 18:41:51 -07:00
Robin Sommer
d2b59b1cb8 Merge branch 'topic/jsiwek/ipv6-ext-headers' of ssh://git.bro-ids.org/bro into topic/jsiwek/ipv6-ext-headers
Conflicts:
	src/Sessions.cc
2012-03-14 13:50:39 -07:00
Bernhard Amann
c3d2f1d5fc Merge remote-tracking branch 'origin/master' into topic/bernhard/input-threads 2012-03-14 12:28:53 -07:00
Jon Siwek
5312a904ab Fix ipv6_ext_headers event and add routing0_data_to_addrs BIF.
Also add unit tests for ipv6_ext_headers and esp_packet events.
2012-03-14 10:31:08 -05:00
Robin Sommer
9dd63acaa3 Updating baseline.
Is that a platform-specific difference?
2012-03-13 16:10:42 -07:00
Robin Sommer
d8d7dd4d53 Merge remote-tracking branch 'origin/topic/jsiwek/ipv6-literals'
* origin/topic/jsiwek/ipv6-literals:
  Change IPv6 literal constant syntax to require encasing square brackets
2012-03-13 15:33:43 -07:00
Robin Sommer
e83714e178 Merge branch 'master' into topic/jsiwek/ipv6-ext-headers 2012-03-13 15:25:05 -07:00
Robin Sommer
c78a391635 Merge remote-tracking branch 'origin/topic/jsiwek/remove-match'
* origin/topic/jsiwek/remove-match:
  Remove the match expression (addressed #753).
2012-03-13 14:55:40 -07:00
Jon Siwek
bf3f184a01 Change IPv6 literal constant syntax to require encasing square brackets
This is to avoid ambiguity between compressed hex notation and
module namespacing, both which use "::". E.g.: "aaaa::bbbb" could
be an identifier or an IPv6 address, but "[aaaa::bbbb]" is now
clearly the address.

Also added IPv6 mixed notation to allow an IPv4 dotted-decimal
address to be specified in the lower 32-bits.
2012-03-13 13:47:07 -05:00
Jon Siwek
e74cbbf774 Add unit test for IPv6 fragment reassembly. 2012-03-12 15:26:51 -05:00
Robin Sommer
0208dd2844 Merge remote branch 'origin/master' into topic/robin/log-threads 2012-03-08 17:35:58 -08:00
Robin Sommer
83038d78e0 Adding new leak tests involving remote logging. 2012-03-08 17:35:58 -08:00
Jon Siwek
0b32c980bf Update PacketFilter/Discarder code for IP version independence.
The signatures of script-layer functions 'discarder_check_ip',
'discarder_check_tcp', 'discarder_check_udp', and 'discarder_check_icmp'
were changed to use the more general 'pkt_hdr' type as a parameter
instead of individual header types.
2012-03-08 13:12:04 -06:00
Bernhard Amann
cd78005d09 Merge remote-tracking branch 'origin/master' into topic/bernhard/input-threads 2012-03-07 13:43:48 -08:00
Bernhard Amann
7076c64a5e Merge remote-tracking branch 'origin/topic/robin/log-threads' into topic/bernhard/input-threads
(and move a little bit of functionality from ascii reader to backend)

Conflicts:
	src/threading/Manager.cc
2012-03-07 13:42:49 -08:00
Jon Siwek
fef671e4a6 Fix a BRO_PROFILER_FILE/mkstemp portability issue. (addresses #794) 2012-03-02 12:40:25 -06:00
Jon Siwek
ef5e9caaf4 Changes to how script coverage integrates with test suites.
- BRO_PROFILER_FILE now passes .X* templated filenames to mkstemp
  for generating unique coverage state files.  All test suites
  now use this so each Bro instance writes to a unique coverage file.
- Rearranging Makefile targets.  The general rule is that if the
  all/brief target fails out due to a test failure, then the dependent
  coverage target won't run, but can still be invoked directly later.
  (e.g. make brief || make coverage)
2012-03-01 13:00:44 -06:00
Robin Sommer
92ed583ee7 Adding btest group "leaks" to leak tests.
This will make it easier to run just the leak tests.
2012-02-29 17:19:38 -08:00
Robin Sommer
9b83591374 Merge remote-tracking branch 'origin/topic/robin/parallel-btest'
* origin/topic/robin/parallel-btest:
  Updating submodule(s).
  Adding group "comm" to communication tests for parallelizing execution with new btest version.

This is in preparation for the merge with the parallel btest branch.

Conflicts:
	cmake
	testing/btest/istate/pybroccoli.py
	testing/btest/scripts/base/frameworks/control/configuration_update.bro
	testing/btest/scripts/base/frameworks/control/id_value.bro
	testing/btest/scripts/base/frameworks/control/shutdown.bro
	testing/btest/scripts/base/frameworks/metrics/basic-cluster.bro
2012-02-29 17:17:25 -08:00
Robin Sommer
bfeca444db Sorting all output for the external tests.
Let's see how this goes. The script keeps comments at the beginning.
2012-02-29 17:09:38 -08:00
Bernhard Amann
417542f283 Merge branch 'topic/bernhard/log-threads' into topic/bernhard/input-threads
Seems to work -- all test pass.
But there are thread-safety issues at the moment, because the constructors of IPAddr and IPPrefix are not thread-safe, but needed by workers.

Conflicts:
	src/logging/Manager.cc
2012-02-27 22:59:08 -08:00
Robin Sommer
36d46efa68 Merge remote-tracking branch 'origin/topic/jsiwek/broccoli-ipv6'
* origin/topic/jsiwek/broccoli-ipv6:
  Update/add tests for broccoli IPv6 addr/subnet support (addresses #448)
2012-02-27 21:15:41 -08:00
Jon Siwek
e07470c7f1 Remove connection compressor (addresses #559). 2012-02-27 11:35:25 -06:00
Robin Sommer
d2b2157454 Fixing merge relict. 2012-02-24 15:52:15 -08:00
Robin Sommer
2eeac54857 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Add to_subnet bif (fixes #782).
  Refactor IPAddr v4 initialization from string. (fixes #775)

Closes #782.
Closes #775.
Closes #784.
2012-02-24 15:26:18 -08:00
Robin Sommer
3323692771 Merge remote-tracking branch 'origin/topic/jsiwek/ipaddr-refactoring'
* origin/topic/jsiwek/ipaddr-refactoring:
  Refactoring various usages of new IPAddr class.

Conflicts:
	src/bro.bif

Closes #784.
2012-02-24 15:21:57 -08:00
Robin Sommer
4ef8607e60 Merge remote-tracking branch 'origin/topic/dnthayer/ftp-ipv6'
* origin/topic/dnthayer/ftp-ipv6:
  Add test case for FTP over IPv4
  Fix IPv6 URLs
  Add a test for FTP over IPv6
  Update FTP EPSV response processing for IPv6
  Fix parsing of FTP EPRT command and EPSV response

Conflicts:
	src/bro.bif

Closes #778.
2012-02-24 15:00:41 -08:00
Jon Siwek
32aabe8432 Add to_subnet bif (fixes #782).
Also fix IPAddr::Mask/ReverseMask not allowing argument of 0.

And clarified return value of to_addr bif when the input string
does not parse into a valid IP address.
2012-02-24 12:34:29 -06:00
Bernhard Amann
d553a3c6f6 fix strange bug when using predicates and events at the same time on a tablefilter.
Testcase is now more involved.
2012-02-23 15:30:39 -08:00
Jon Siwek
14ccd6436f Update/add tests for broccoli IPv6 addr/subnet support (addresses #448) 2012-02-23 16:55:19 -06:00
Jon Siwek
d7dafe2fe2 Refactoring various usages of new IPAddr class.
Reducing number of places that internal representation was exposed
via GetBytes/CopyIPv6.

Also fixed a bug in remask_addr bif.
2012-02-22 14:45:44 -06:00
Bernhard Amann
93fac7a4be fix one of the bugs seth found in the input framework.
(bug in PutTable when the table contained only one element and that element should not be wrapped into a record)
2012-02-22 10:46:35 -08:00
Bernhard Amann
7e5f733826 raw input reader for seth, which can simply read a file into string-events given a line separator. 2012-02-22 09:44:45 -08:00
Daniel Thayer
96df1bac40 Add test case for FTP over IPv4 2012-02-21 11:18:43 -06:00
Bernhard Amann
edd30da082 better testcase & fix a few bugs (that took way too long to find). 2012-02-20 15:30:21 -08:00