Commit graph

145 commits

Author SHA1 Message Date
anthonykasza
d80ad3a06e levenshtein distance 2013-08-11 00:11:41 -05:00
Yun Zheng Hu
9a88dc500a Added reverse() function to strings.bif.
Closes #969.
2013-03-23 08:39:04 -07:00
Robin Sommer
a4e40bb402 Merge remote-tracking branch 'origin/topic/bernhard/vector-assignment'
Closes #956.

* origin/topic/bernhard/vector-assignment:
  change vector assignment operator and remove unnecessary argument (expr)
2013-03-06 16:50:53 -08:00
Bernhard Amann
8f259f866d change vector assignment operator and remove unnecessary argument (expr) 2013-03-06 14:08:06 -08:00
Bernhard Amann
986b346e3f remove the byte_len and length bifs 2013-03-06 13:45:42 -08:00
Daniel Thayer
72f16f2642 Remove unused argument of helper function
Removed an unused argument of the "do_split" helper function.  The unused
argument was previously used by a now-removed BIF.
2012-09-26 15:20:54 -05:00
Daniel Thayer
f00a7c3ee4 Remove deprecated built-in functions 2012-09-26 14:20:30 -05:00
Robin Sommer
73cefcc11c Merge remote-tracking branch 'origin/topic/dnthayer/bif-tests'
* origin/topic/dnthayer/bif-tests:
  Improve "fmt" BIF documentation comment
  Improve tests of the type_name BIF
  Improve test cases for "order" BIF
  Fix documentation of sort BIF and add more tests
  Fix documentation for system_env BIF
  Deprecate the parse_dotted_addr BIF (use to_addr instead)
  Improve tests for to_port and type_name BIFs
  Improve tests for sort, order, and system_env BIFs
  Fix the join_string_vec BIF and add more tests
  Add more tests for previously-untested BIFs
  Add more tests for previously-untested BIFs
  Add more tests for previously-untested BIFs
  Add more tests for previously-untested BIFs
  Add tests for previously-untested strings BIFs
2012-06-06 11:42:16 -07:00
Jon Siwek
7599ac8f31 Memory leak fixes for bad usages of VectorVal ctor.
Many usages of the VectorVal ctor didn't account for the fact that
it automatically Ref's the VectorType argument and end up leaking it.
2012-06-06 11:50:15 -05:00
Daniel Thayer
17155a103d Fix the join_string_vec BIF and add more tests 2012-05-30 16:50:43 -05:00
Daniel Thayer
be65ddca37 Correct various errors in the BIF documentation 2012-05-17 16:03:17 -05:00
Robin Sommer
3d2dc5f5fc Merge remote-tracking branch 'origin/topic/script-reference'
* origin/topic/script-reference: (50 commits)
  A few updates for the FAQ.
  Fixing some doc warnings.
  Forgot to add protocol identifier support for TLS 1.2
  Finished SSL & syslog autodocs.
  Adding the draft SSL extension type next_protocol_negotiation.
  Fix some documentation errors.
  Tweaks.
  A set of script-reference polishing.
  fixed a couple typos in comments
  Add summary documentation to bif files.
  Add ssl and syslog script documentation
  Add Conn and DNS protocol script documentation. (fixes #731)
  Small updates to the default local.bro.
  Documentation updates for HTTP & IRC scripts.
  SSH&FTP Documentation updates.
  Fixing a warning from the documentation generation.
  This completes framework documentation package 4.
  Minor notice documentation tweaks.
  Fix some malformed Broxygen xref roles.
  Minor doc tweaks to init-bare.bro.
  ...

Conflicts:
	aux/broccoli
	aux/broctl
	src/bro.bif
	src/strings.bif

Includes:

    - Updated baselines for autodoc tests.
    - Now excluding stats.bro from external texts, it's not stable.
2012-01-10 14:00:44 -08:00
Robin Sommer
a2e8146e4f Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Fix ref counting bug in BIFs that call internal_type. (fixes #740)
2012-01-10 10:32:59 -08:00
Jon Siwek
2348d794b6 Fix ref counting bug in BIFs that call internal_type. (fixes #740) 2012-01-10 12:25:33 -06:00
Jon Siwek
b8778026a6 Add summary documentation to bif files. 2012-01-09 16:11:41 -06:00
Jon Siwek
cc1459ef35 Fix some malformed Broxygen xref roles. 2011-12-16 14:30:36 -06:00
Matthias Vallentin
1fb58eaeb7 Start documenting bro.bif. 2011-11-30 22:40:50 -08:00
Jon Siwek
f1c2b338ce Fix documentation formatting that Sphinx complained about 2011-11-30 11:32:49 -06:00
Matthias Vallentin
98028dba89 Finish Broxygen documentation of string.bif. 2011-11-29 17:56:45 -08:00
Matthias Vallentin
76ca1f532f Begin with documenting strings.bif. 2011-11-29 12:20:09 -08:00
Robin Sommer
2252e9d90b Fixing two memory leaks. 2011-09-29 15:28:41 -07:00
Jon Siwek
928baf4b66 Fix lack of NUL-termination in to_upper/to_lower BIF's return val. 2011-09-22 13:56:16 -05:00
Jon Siwek
495e987938 Remove $Id$ tags 2011-08-04 15:21:18 -05:00
Robin Sommer
66e2c3b623 Renaming the Logger to Reporter.
Also changing output to not include timestamps when we haven't started
processing packets yet.
2011-07-01 09:22:33 -07:00
Robin Sommer
93894eed9b Overhauling the internal reporting of messages to the user.
The Logger class is now in charge of reporting all errors, warnings,
informational messages, weirds, and syslogs. All other components
route their messages through the global bro_logger singleton.

The Logger class comes with these reporting methods:

    void Message(const char* fmt, ...);
    void Warning(const char* fmt, ...);
    void Error(const char* fmt, ...);
    void FatalError(const char* fmt, ...); // Terminate Bro.
    void Weird(const char* name);
    [ .. some more Weird() variants ... ]
    void Syslog(const char* fmt, ...);
    void InternalWarning(const char* fmt, ...);
    void InternalError(const char* fmt, ...); // Terminates Bro.

See Logger.h for more information on these.

Generally, the reporting now works as follows:

    - All non-fatal message are reported in one of two ways:

        (1) At startup (i.e., before we start processing packets),
            they are logged to stderr.

        (2) During processing, they turn into events:

            event log_message%(msg: string, location: string%);
            event log_warning%(msg: string, location: string%);
            event log_error%(msg: string, location: string%);

            The script level can then handle them as desired.

            If we don't have an event handler, we fall back to
            reporting on stderr.

    - All fatal errors are logged to stderr and Bro terminates
      immediately.

    - Syslog(msg) directly syslogs, but doesn't do anything else.

The three main types of messages can also be generated on the
scripting layer via new Log::* bifs:

    Log::error(msg: string);
    Log::warning(msg: string);
    Log::message(msg: string);

These pass through the bro_logger as well and thus are handled in the
same way. Their output includes location information.

More changes:

    - Removed the alarm statement and the alarm_hook event.

    - Adapted lots of locations to use the bro_logger, including some
      of the messages that were previously either just written to
      stdout, or even funneled through the alarm mechanism.

    - No distinction anymore between Error() and RunTime(). There's
      now only one class of errors; the line was quite blurred already
      anyway.

    - util.h: all the error()/warn()/message()/run_time()/pinpoint()
      functions are gone. Use the bro_logger instead now.

    - Script errors are formatted a bit differently due to the
      changes. What I've seen so far looks ok to me, but let me know
      if there's something odd.

Notes:

    - The default handlers for the new log_* events are just dummy
      implementations for now since we need to integrate all this into
      the new scripts anyway.

    - I'm not too happy with the names of the Logger class and its
      instance bro_logger. We now have a LogMgr as well, which makes
      this all a bit confusing. But I didn't have a good idea for
      better names so I stuck with them for now.

      Perhaps we should merge Logger and LogMgr?
2011-06-25 16:40:54 -07:00
Robin Sommer
714289bd13 Changing the HTTP's analyzers internals to use 64-bit integers.
(Gregor Maier).

This is the patch from #326, plus some cleanup.
2011-04-27 21:25:51 -07:00
Seth Hall
c5a19f7cdc Fixed another do_split bug and included a test for the fix. 2011-04-22 08:00:28 -04:00
Robin Sommer
9fe52512eb Merge remote branch 'origin/topic/seth/fix-do_split'
* origin/topic/seth/fix-do_split:
  Fixed the do_split bug and added a test.
2011-04-21 19:42:50 -07:00
Robin Sommer
13a492091f Merge remote branch 'origin/topic/robin/logging-internals'
Includes some additional cleanup.
2011-04-20 21:30:41 -07:00
Seth Hall
cba5766bc8 Fixed the do_split bug and added a test.
* do_split was having a problem if there was another match
  after the end of the number of separators.  It would only
  return the match up to the point of the next match instead
  of the rest of the string.
2011-04-19 22:24:46 -04:00
Robin Sommer
c015605113 Merge remote branch 'origin/master' into topic/robin/logging-internals 2011-02-20 17:18:06 -08:00
Seth Hall
ffa494e428 Fixed an off-by-one error in join_string_vec 2011-02-09 15:18:12 -05:00
Robin Sommer
2f7fa3470b Merge remote branch 'origin/topic/seth/fix-compiler-warnings'
* origin/topic/seth/fix-compiler-warnings:
  Fixed problem with PRI macros.
  PRI macros are currently not working for some reason.
  Two more small compile time error fixes.
  Cleaned up the output from running binpac.
  Added line to expect shift/reduce errors in parse.in
  Cleaned up g++ warnings.

Addition: I fixed a few more warnings I was getting, and tweaked some
of the existing changes slightly.
2011-02-09 08:10:41 -08:00
Robin Sommer
bf76811776 Merge remote branch 'remotes/origin/topic/robin/work'
* remotes/origin/topic/robin/work:
  *Now* this passes the test suite.
  Fixes to SSL/TLS analyzer
  Added new TLS ciphers
  Removing some apparently unnecessary lines.
  A few smaller tweaks.
  Prepared the old analyzer for extracting SSL extensions.
  Fixed bug in do_split implementation.
  Removed an accidental debugging printf.
  Readded the other changes to remove CheckString calls from strings.bif.
  Fixed the problem with do_split function which caused it to bail 1 separator early.
  Modification from rmkml to support SSL extensions.
  Updated SSL analyzer and Bro script with lots of new ciphers.
2011-02-08 20:25:13 -08:00
Seth Hall
d7786a6576 Checkpoint 2011-02-08 15:49:06 -05:00
Seth Hall
65687d86d8 *Now* this passes the test suite.
I got the last fix wrong and I was still misunderstanding
one behavior of the existing do_split function.  When a
separator match goes to the last character of the string,
a blank string element should be appended to the
string_array to indicate that a successful split occurred.
2011-01-31 12:19:11 -05:00
Seth Hall
0fe30453cf Removing some apparently unnecessary lines. 2011-01-21 20:59:51 -05:00
Robin Sommer
668824d1b6 A few smaller tweaks. 2011-01-20 14:36:07 -08:00
Seth Hall
9cfef93522 Fixed bug in do_split implementation.
Test suite succeeds!
2011-01-18 14:40:37 -05:00
Seth Hall
266acde342 Removed an accidental debugging printf. 2010-12-09 16:01:19 -05:00
Seth Hall
61c99176ad Readded the other changes to remove CheckString calls from strings.bif. 2010-12-09 15:59:08 -05:00
Seth Hall
a598bdb555 Fixed the problem with do_split function which caused it to bail 1 separator early. 2010-12-09 15:23:54 -05:00
Robin Sommer
c6631d1483 Reversing the null-byte change to strings.bif once more.
I'm actually not sure how that got back in again, but it did ...
Must have been during the merges.
2010-12-08 04:46:10 -08:00
Seth Hall
5bf18fdb7f Modified all of the string functions that
used the CheckString function.  All now use
Bytes and Len to extract the bytes from string
arguments.  The result of this is that these
functions now don't fail when presented with
strings containing NULL bytes.

Signed-off-by: Seth Hall <seth@icir.org>
2010-10-13 14:32:27 -04:00
Robin Sommer
61757ac78b Initial import of svn+ssh:://svn.icir.org/bro/trunk/bro as of r7088 2010-09-27 20:42:30 -07:00