Commit graph

2220 commits

Author SHA1 Message Date
Jon Siwek
8515d3aa57 Support omission of string slice low/high indices, BIT-1097.
Omission of the low index defaults to 0:

    s = "12345"; s[:3] == "123"

Omission of the high index defaults to length of the string:

    s = "12345"; s[3:] == "45"
2013-12-04 15:11:48 -06:00
Robin Sommer
dda5e43aa9 Merge branch 'topic/robin/string-slicing-fix' 2013-12-04 12:42:22 -08:00
Robin Sommer
8331d0d09b Updating tests. 2013-12-04 12:40:51 -08:00
Robin Sommer
320f2d5ab6 Merge remote-tracking branch 'origin/topic/bernhard/ssl_ciphers_vector'
BIT-1011 #merged

* origin/topic/bernhard/ssl_ciphers_vector:
  Change ciphers in changes ciphers from a set to a vector.
2013-12-04 12:17:22 -08:00
Robin Sommer
dadfcde70e Merge branch 'topic/robin/event-dumper'
Changes:

   - Changing semantics of the new_event() meta event: it's raised
     only for events that have a handler defined. There are too many
     checks in Bro that prevent events wo/ handler from being even
     prepared to raise to do that differently.

   - Adding test case.

* topic/robin/event-dumper:
  New script misc/dump-events.bro, along with core support, that dumps events Bro is raising in an easily readable form.
  Prettyfing Describe() for record types.
2013-12-04 12:13:07 -08:00
Bernhard Amann
b7dc03bb82 Change ciphers in changes ciphers from a set to a vector.
This preserves the ordering of the cipher suites the client sent,
allowing e.g. better client fingerprinting.
2013-12-04 11:38:15 -08:00
Robin Sommer
18a23fbdb8 Merge remote-tracking branch 'origin/topic/jsiwek/string-slicing-fix'
* origin/topic/jsiwek/string-slicing-fix:
  Fix string slice notation, addresses BIT-1097.
2013-12-04 11:23:26 -08:00
Robin Sommer
3abf626908 Merge remote-tracking branch 'origin/topic/jsiwek/broxygen'
BIT-1098

* origin/topic/jsiwek/broxygen:
  Fix Broxygen-related compile errors.
  Add a Broxygen coverage test.
  Internal Broxygen organization/documentation/polish.
  Add unit tests for Broxygen config file targets.
  Change Broxygen config file format.
  Broxygen doc-related test updates.  Fix two regressions.
  A couple documentation fixes.
  Integrate new Broxygen functionality into Sphinx.
  Implement majority of Broxygen features delegated to Bro.
  Broxygen can now read a config file specifying particular targets.
  Remove unneeded Broxygen comments in scan.bro.
  Replace safe_basename/safe_dirname w/ SafeBasename/SafeDirname.
  Add BIF interface for retrieving comments/docs.
  Quick optimization to Broxygen doc gathering.
  Flesh out Broxygen doc-gathering skeleton.
  Refactor search_for_file() util function.
  Initial skeleton of new Broxygen infrastructure.
2013-12-04 11:14:19 -08:00
Jon Siwek
2ea6011186 Improve a unit test involving 'when' conditionals.
May fix a sporadic failure, in which case it was just not getting enough
time to run or lookup_hostname() taking longer than ~3 seconds.  Else,
the new output should give more hints on what's going wrong.  In any
case, termination conditions for the test are now explicit.
2013-12-03 16:51:36 -06:00
Jon Siwek
4014cdc277 Fix string slice notation, addresses BIT-1097.
Slice ranges were not correctly determined for negative indices and also
off by one in general (included one more element at the end of the
substring than what actually matched the index range).

It's now equivalent to Python slice notation.  Accessing a string at
a single index is also the same as Python except that an out-of-range
index returns an empty string instead of throwing an expection.
2013-12-03 14:39:21 -06:00
Jon Siwek
5aa04089af Unit test for broccoli vector support.
Broccoli clients can only recv events w/ vectors for now.

Also changed ordering of Bro type tag enum -- the addition of opaque
types changed the value of the vector type, making broccoli.h's
definition out of sync.  Probably could have just changed broccoli's
definition, but seems more correct to go back to using the same value
for vectors as they were before opaques.  It's also better in case
there's some other location I'm not aware of where the values are
replicated.
2013-12-03 11:28:06 -06:00
Robin Sommer
555df1e7ea Checkpointing the dynamic plugin code.
This is essentially the code from the dynamic-plugin branch except for
some pieces that I have split out into separate, earlier commits.

I'm going to updatre things in this branch going forward.
2013-11-26 14:04:29 -08:00
Jon Siwek
25e28c04f0 Add a Broxygen coverage test. 2013-11-25 15:49:53 -06:00
Jon Siwek
27138b893a Add unit tests for Broxygen config file targets. 2013-11-22 14:59:16 -06:00
Jon Siwek
e3f74dc319 Change Broxygen config file format.
"<type> <pattern> <output-file>" seems a more natural order for
specifying targets.
2013-11-22 14:37:07 -06:00
Jon Siwek
98dcfc64a8 Broxygen doc-related test updates. Fix two regressions.
- Fix automatic function parameter documentation formatting for
  record fields that are functions.

- Document redefs in a fixed order.
2013-11-22 14:18:24 -06:00
Jon Siwek
96ba5c82a3 Merge branch 'master' into topic/jsiwek/broxygen 2013-11-21 15:46:55 -06:00
Jon Siwek
9967aea52c Integrate new Broxygen functionality into Sphinx.
Add a "broxygen" domain Sphinx extension w/ directives to allow
on-the-fly documentation to be generated w/ Bro and included in files.

This means all autogenerated reST docs are now done by Bro.  The odd
CMake/Python glue scipts which used to generate some portions are now
gone.  Bro and the Sphinx extension handle checking for outdated docs
themselves.

Parallel builds of `make doc` target should now work (mostly because
I don't think there's any tasks that can be done in parallel anymore).

Overall, this seems to simplify things and make the Broxygen-generated
portions of the documentation visible/traceable from the main Sphinx
source tree.  The one odd thing still is that per-script documentation
is rsync'd in to a shadow copy of the Sphinx source tree within the
build dir.  This is less elegant than using the new broxygen extension
to make per-script docs, but rsync is faster and simpler.  Simpler as in
less code because it seems like, in the best case, I'd need to write a
custom Sphinx Builder to be able to get that to even work.
2013-11-21 14:34:32 -06:00
Robin Sommer
1e31538829 Merge remote-tracking branch 'origin/topic/bernhard/ticket1094'
* origin/topic/bernhard/ticket1094:
  Add minimal testcase for sqlite writer crash.
  Fixed Segmentation fault in SQLite Writer.

BIT-1094 #merged
BIT-1095 #comment Add to 2.2.1
2013-11-11 13:42:52 -08:00
Bernhard Amann
81d0def327 Add minimal testcase for sqlite writer crash.
The writer did not work with a non-empty set or vector
as the last element in the logged column.
2013-11-10 22:04:16 -08:00
Robin Sommer
1164fdfb46 Removing location information from ssh.log in external tests. 2013-11-07 02:19:23 -08:00
Daniel Thayer
410e4babd0 Fix typos in sumstats doc and update doc test 2013-11-06 18:56:39 -06:00
Daniel Thayer
85d8653bce Update docs and tests for a recent change to detect-MHR.bro 2013-11-06 15:58:24 -06:00
Daniel Thayer
9ed5f8bae8 Update tests and baselines for sumstats docs 2013-11-06 14:56:32 -06:00
Seth Hall
ef33696d2e Merge branch 'master' of ssh://git.bro-ids.org/bro 2013-11-06 13:52:38 -05:00
Seth Hall
fab47cc749 Added a document for the SumStats framework. 2013-11-06 13:52:29 -05:00
Jon Siwek
96ed7aed1a Merge branch 'master' into topic/jsiwek/broxygen 2013-11-04 10:17:24 -06:00
Robin Sommer
5f863df91f Canonfying an intel test to not depend on output order. 2013-11-01 05:03:54 -07:00
Jon Siwek
b38efa58d0 Merge branch 'master' into topic/jsiwek/broxygen
Conflicts:
	testing/btest/Baseline/coverage.bare-load-baseline/canonified_loaded_scripts.log
	testing/btest/Baseline/coverage.default-load-baseline/canonified_loaded_scripts.log
2013-10-30 16:20:48 -05:00
Jon Siwek
3a99aaaf0a Add BIF interface for retrieving comments/docs.
The new BIFs:
    - get_identifier_comments
    - get_script_comments
    - get_package_readme
    - get_record_field_comments
2013-10-30 16:07:57 -05:00
Daniel Thayer
32d7c96cd4 Update test and baseline for a recent doc test fix 2013-10-25 15:11:20 -05:00
Robin Sommer
8ce3865bd2 Updating baselines for packet filter changes. 2013-10-24 14:31:23 -07:00
Robin Sommer
26c01468f5 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  temporary osx mavericks libc++ issue workaround.
  Change test of identify_data BIF to ignore charset.
2013-10-24 13:07:49 -07:00
Seth Hall
ccc7b7669d Merge remote-tracking branch 'origin/topic/seth/fix-packetfilter-log'
* origin/topic/seth/fix-packetfilter-log:
  Hack to make sure that the starting BPF filter is logged on clusters.
2013-10-24 15:36:17 -04:00
Seth Hall
af6e44589f Hack to make sure that the starting BPF filter is logged on clusters. 2013-10-24 14:55:37 -04:00
Jon Siwek
eab886fb84 Change test of identify_data BIF to ignore charset.
It may vary with libmagic version.
2013-10-23 16:51:55 -05:00
Robin Sommer
08e6b6b4b4 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Fix record coercion tolerance of optional fields.
  Add NEWS about incompatible local.bro changes, addresses BIT-1047.
  Fix minor formatting problem in NEWS.
2013-10-23 09:50:47 -07:00
Jon Siwek
7e95755ce5 Fix record coercion tolerance of optional fields.
There were cases where coercing a record value with an uninitialized
field could cause a null pointer dereference even though the field
can validly be unset since it has &optional.
2013-10-23 11:37:23 -05:00
Daniel Thayer
9374a7d584 Fix typos and formatting in the policy/protocols docs
Also updated a test related to these changes, and adjusted line numbers.
2013-10-21 02:34:28 -05:00
Daniel Thayer
24da7ab839 Fix typos and formatting in the policy/frameworks docs
Also updated some tests related to these changes.
2013-10-21 01:23:08 -05:00
Robin Sommer
8bfb81ca6f Moving the SQLite examples into separate Bro files to turn them into
sphinx-btest tests.

It's hard to make sure these are actually working as expected, but the
tests now at least make sure things parse correctly.
2013-10-18 14:18:33 -07:00
Robin Sommer
1759e0d687 Updating test baseline. 2013-10-18 13:59:56 -07:00
Robin Sommer
615cca8baa Merge remote-tracking branch 'origin/topic/dnthayer/doc-changes-for-2.2'
Snapshotting the work in this branch. I'll merge it again later as we
get closer to the release.

* origin/topic/dnthayer/doc-changes-for-2.2: (29 commits)
  Add README files for base/protocols
  Fix incorrect uses of reST directives
  Fix typos and formatting in the BiFs docs
  Fix typos and formatting in the base/utils docs
  Fix typos and formatting in the other protocol docs
  Fix typos and formatting in the ssl protocol docs
  Fix typos and formatting in the http protocol docs
  Fix typos and formatting in the ftp protocol docs
  Fix typos and formatting in the dns protocol docs
  Fix typos and formatting in the dhcp protocol docs
  Adjust line numbers to match changes in conn/main.bro
  Fix typos and formatting in the conn protocol docs
  Update FreeBSD install instructions
  Improvements to file analysis docs
  Add README files for most Bro frameworks
  Fix typos and formatting in various other framework docs
  Fix typos and formatting in the software framework docs
  Fix typos and formatting in the sumstats docs
  Fix typos and formatting in the packet filter docs
  Fix typos and formatting in the logging framework docs
  ...
2013-10-18 13:49:49 -07:00
Bernhard Amann
363cfb8506 rename the dbname configuration option to tablename.
Sorry for this - I noticed that I named this option quite unfortunately
while writing the documentation.

The patch also removes the dbname configuration option from the sqlite
input reader - it was not used there at all anymore (and I did not notice
that).
2013-10-17 12:24:40 -07:00
Daniel Thayer
fe60404f0f Fix typos and formatting in the http protocol docs
Also adjusted line numbers in scripting doc due to changes in http/main.bro
2013-10-16 13:13:53 -05:00
Daniel Thayer
f0f1918954 Merge remote-tracking branch 'origin/master' into topic/dnthayer/doc-changes-for-2.2 2013-10-14 17:26:52 -05:00
Daniel Thayer
1d23f055ba Add check for sqlite3 command to tests that require it 2013-10-14 15:05:06 -05:00
Robin Sommer
2e05978210 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Add check for curl command to active-http.test

I've moved the check from TEST-EXEC to TEST-REQUIRES. I think it's
fine to just skip the test if curl is not available.
2013-10-14 09:27:14 -07:00
Daniel Thayer
fdb6d190b8 Add check for curl command to active-http.test
Added a check if the curl command is available when running the
active-http.test so that it fails more quickly and with a clear error
message if it's not available.
2013-10-13 20:31:48 -05:00
Daniel Thayer
93c1073673 Merge remote-tracking branch 'origin/master' into topic/dnthayer/doc-changes-for-2.2 2013-10-11 23:16:57 -05:00