Commit graph

308 commits

Author SHA1 Message Date
Johanna Amann
4792c94212 Merge remote-tracking branch 'origin/master' into topic/johanna/remove-serializer 2019-06-19 18:34:49 -07:00
Johanna Amann
ca28b98fd4 Fix cardinalitycounter deserialization.
This one took me way too long to admit. Values were pushed back on
deserialization - instead of assigned. Meaning they were added to the
end of the already 0-assigned vector.

The mean thing here is that estimation still worked - just merging
resulted in 0. And estimation still was correct because m, V, alpha_m
are enough for this - and those were correctly copied...

With this change, all tests pass.
2019-06-18 08:59:31 -07:00
Tim Wojtulewicz
502ad9abc3 Add ability to grow/shrink a vector using slicing, also adds Insert/Remove methods for VectorVal 2019-06-17 15:34:24 -07:00
Tim Wojtulewicz
23f9fb0ae9 Allow assignment for vectors using slices 2019-06-13 15:37:31 -07:00
Tim Wojtulewicz
964e2c91a3 Check for integral slice indexes, add extra test for [:] 2019-06-13 13:40:07 -07:00
Tim Wojtulewicz
0af79a7a16 GH-393: Add slice notation for vectors 2019-06-12 14:20:37 -07:00
Robin Sommer
c0c5dccd06 Add new test for when-statement watching global variables. 2019-06-07 23:17:29 +00:00
ZekeMedley
e100558658 Change C++11 detection in paraglob. 2019-06-05 12:33:20 -07:00
Jon Siwek
43104565a4 Merge remote-tracking branch 'origin/topic/timw/159-coerce-counts'
* origin/topic/timw/159-coerce-counts:
  GHI-155: set the type of a vector based on the variable's type, not the value's type
  GH-159: Allow coercion of numeric values into other types
  Allow passing a location to BroObj::Warning and BroObj::Error.
  Add CLion directories to gitignore
  Move #define outside of max_type for clarity
2019-06-04 17:57:15 -07:00
Tim Wojtulewicz
394aec5a72 GHI-155: set the type of a vector based on the variable's type, not the value's type 2019-06-04 14:59:17 -07:00
ZekeMedley
42b1f4fd2e Make paraglob serializable and copyable. 2019-06-04 14:56:48 -07:00
ZekeMedley
e1520a0d67 Initial paraglob integration. 2019-06-04 14:24:51 -07:00
Tim Wojtulewicz
76fe643c87 GH-159: Allow coercion of numeric values into other types 2019-06-04 10:08:41 -07:00
Robin Sommer
0767598771 GH-293: Protect copy() against reference cycles.
Reference cycles shouldn't occur but there's nothing really preventing
people from creating them, so may just as well be safe and deal with
them when cloning values. While the code is a bit more cumbersome this
way, it could actually be bit faster as well as it no longer caches
non-mutable values. (I measured it with the test suite: That's about
the same in execution time, maybe tiny little bit faster now;
definitly not slower).
2019-06-03 15:20:30 +00:00
Jon Siwek
f2b7764769 Merge branch 'table-error' of https://github.com/ZekeMedley/zeek
* 'table-error' of https://github.com/ZekeMedley/zeek:
  Check table yield type on assignment.

Also extended the type checking to include sets as well as the full
table type (yield type as well as index types).
2019-05-28 10:51:50 -07:00
Jon Siwek
580822a32c Merge remote-tracking branch 'origin/topic/dnthayer/gh-339'
* origin/topic/dnthayer/gh-339:
  Rename all BRO-prefixed environment variables
2019-05-23 20:23:14 -07:00
Johanna Amann
63e6921895 Add leak-checks for new copy operations 2019-05-22 14:57:55 -07:00
Johanna Amann
74bb7716f6 Finish implementation of copy method.
All types (besides EntropyVal) now support a native copy operation,
which uses primitives of the underlying datatypes to perform a quick
copy, without serialization.

EntropyVal is the one exception - since that type is rather complex
(many members) and will probably not be copied a lot, if at all, it
makes sense to just use the serialization function.

This will have to be slightly re-written in the near-term-future to use
the new serialization function for that opaque type.

This change also introduces a new x509_from_der bif, which allows to
parse a der into an opaque of x509.

This change removes the d2i_X509_ wrapper function; this was a remnant
when d2i_X509 took non-const arguments. We directly use d2i_X509 at
several places assuming const-ness, so there does not seem to ba a
reason to keep the wrapper.

This change also exposed a problem in the File cache - cases in which an
object was brought back into the cache, and writing occurred in the
file_open event were never correctly handeled as far as I can tell.
2019-05-22 14:29:37 -07:00
Daniel Thayer
1a74516db1 Rename all BRO-prefixed environment variables
For backward compatibility when reading values, we first check
the ZEEK-prefixed value, and if not set, then check the corresponding
BRO-prefixed value.
2019-05-22 00:12:31 -05:00
Johanna Amann
2efbe76920 Checkpoint - all non-opaque-types can be cloned. 2019-05-21 15:06:39 -07:00
Johanna Amann
d13c939233 Merge remote-tracking branch 'origin/master' into topic/johanna/clone 2019-05-20 15:18:10 -07:00
Daniel Thayer
3f9e7138bd More bro-to-zeek renaming in the unit tests 2019-05-16 02:27:54 -05:00
Robin Sommer
789cb376fd GH-239: Rename bro to zeek, bro-config to zeek-config, and bro-path-dev to zeek-path-dev.
This also installs symlinks from "zeek" and "bro-config" to a wrapper
script that prints a deprecation warning.

The btests pass, but this is still WIP. broctl renaming is still
missing.

#239
2019-05-01 21:43:45 +00:00
Robin Sommer
b9dad02615 Reimplement copy().
The old implementation used the serialization framework, which is
going away. This is a new standalone implementation that should also
be quite a bit faster.

WIP: Not fully implemented and tested yet.
2019-04-29 16:52:01 -07:00
Jon Siwek
49908ac865 Fix parsing of hybrid IPv6-IPv4 addr literals with no zero compression 2019-04-26 19:29:40 -07:00
Jon Siwek
3ea34d6ea3 GH-236: Add zeek_script_loaded event, deprecate bro_script_loaded 2019-04-19 12:02:22 -07:00
Jon Siwek
a994be9eeb Merge remote-tracking branch 'origin/topic/seth/zeek_init'
* origin/topic/seth/zeek_init:
  Some more testing fixes.
  Update docs and tests for bro_(init|done) -> zeek_(init|done)
  Implement the zeek_init handler.
2019-04-19 11:24:29 -07:00
Jon Siwek
1e57e3f026 Use .zeek file suffix in unit tests 2019-04-16 16:08:57 -07:00
Seth Hall
9d676d368b Some more testing fixes. 2019-04-14 09:58:30 -04:00
Seth Hall
5db766bd88 Update docs and tests for bro_(init|done) -> zeek_(init|done) 2019-04-14 08:49:12 -04:00
Seth Hall
8cefb9be42 Implement the zeek_init handler.
Implements the change and a test.
2019-04-14 08:37:35 -04:00
Jon Siwek
41c7b229d3 Merge branch 'master' of https://github.com/ZekeMedley/zeek
* 'master' of https://github.com/ZekeMedley/zeek:
  Add key-value for loop

Fixes GH-154
2019-03-15 19:45:07 -07:00
ZekeMedley
1f7924754e Add key-value for loop 2019-03-14 09:46:16 -07:00
Robin Sommer
e2172018ee Merge remote-tracking branch 'origin/topic/jsiwek/gh-286'
Added note about different behaviour to NEWS.

Closes #286.

* origin/topic/jsiwek/gh-286:
  GH-286: Check for record type mismatch in ternary operator
2019-03-13 18:01:36 +00:00
Jon Siwek
628a46d8fd GH-219: revert previous change to |x| operator for interval/time
The result of the |x| operator for interval and time types historically
returned a value of type double.  This was changed as part of
3256ac7c49 to return interval/time, but
this now reverts to returning a double again to avoid introducing a
change that may break user code.

Fixes GH-219
2019-03-06 15:36:31 -08:00
Jon Siwek
74c225c7cb GH-286: Check for record type mismatch in ternary operator
Fixes GH-286
2019-02-25 12:55:03 -06:00
Jon Siwek
01a8418d79 GH-208: change invalid subnet expressions to a runtime error
Rather than abort.
2019-01-30 12:01:46 -06:00
Jon Siwek
67484a90fa GH-211: improve consistency of how scripting errors are handled
Scripting errors/mistakes now consistently generate a runtime error
which have the behavior of unwinding the call stack all the way out of
the current event handler.

Before, such errors were not treated consistently and either aborted
the process entirely or emitted a message while continuing to execute
subsequent statements without well-defined behavior (possibly causing
a cascade of errors).

The previous behavior also would only unwind out of the current
function (if within a function body), not out the current event
handler, which is especially problematic for functions that return
a value: the caller is essentially left a mess with no way to deal
with it.

This also changes the behavior of the startup/initialization process
to abort if there's errors during bro_init() rather than continue one
to the main run loop.  The `allow_init_errors` option may change this
new, default behavior.
2019-01-30 11:20:09 -06:00
Jon Siwek
3e2c2a6140 GH-210: improve call stack tracking
Adds tracking of arguments
2019-01-28 14:17:04 -06:00
Jon Siwek
9b43f1d5f4 GH-167: improve error message for unclosed function at EOF 2019-01-24 14:54:39 -06:00
Jon Siwek
3256ac7c49 GH-219: fix |x| operator int overflow / floating point type inconsistency
When 'x' is an integral arithmetic expression, it's now coerced to
yield a signed integer before taking the absolute value of it to
prevent the common issue of unsigned integer overflow/wraparound for
values below zero.

Using a time or interval value/expression for 'x' now also yields a
time or interval, respective, from the |x| operation instead of
a double.
2019-01-22 16:42:40 -06:00
Jon Siwek
d86fb9f87a GH-151: fix hash calculation for nested sets
Hash key construction of nested sets depended on the order in
which their elements are iterated, which varied even between sets
containing equivalent elements.  The iteration order is now sorted
by each element's hash value (or, on collision, by full key) such
that equivalent sets no longer hash differently.
2019-01-18 20:54:22 -06:00
Jon Siwek
ed1a50ec5b GH-213: change type of vector for-loop index to a count 2019-01-14 18:04:30 -06:00
Jon Siwek
cada0d5e6e GH-161: fix segfault in &default type checking for sets
Fixes GH-161
2019-01-14 14:03:15 -06:00
Jon Siwek
fd63168171 Merge remote-tracking branch 'origin/topic/jsiwek/parallelize-comm-tests'
* origin/topic/jsiwek/parallelize-comm-tests:
  Parallelize communication tests using btest TEST-PORT
2018-11-29 17:06:30 -06:00
Jon Siwek
ca014d6e35 Support appending to vector of any
For consistency, since it already works to assign to an index within
vector of any.
2018-11-07 11:48:43 -06:00
Jon Siwek
907297ba59 Parallelize communication tests using btest TEST-PORT 2018-11-04 15:29:59 -06:00
Jon Siwek
de640d651f Fix a unit test relying on a bash-ism 2018-11-02 18:31:45 -05:00
Jon Siwek
b2560384c4 Add script-layer call stack to internal errors messages that abort 2018-11-02 17:43:34 -05:00
Jon Siwek
a7ba44089b Improve error message of index assignment expression failures 2018-11-02 16:40:28 -05:00