mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
![]() We need this to sender through Broker, and we also leverage it for cloning opaques. The serialization methods now produce Broker data instances directly, and no longer go through the binary formatter. Summary of the new API for types derived from OpaqueVal: - Add DECLARE_OPAQUE_VALUE(<class>) to the class declaration - Add IMPLEMENT_OPAQUE_VALUE(<class>) to the class' implementation file - Implement these two methods (which are declated by the 1st macro): - broker::data DoSerialize() const - bool DoUnserialize(const broker::data& data) This machinery should work correctly from dynamic plugins as well. OpaqueVal provides a default implementation of DoClone() as well that goes through serialization. Derived classes can provide a more efficient version if they want. The declaration of the "OpaqueVal" class has moved into the header file "OpaqueVal.h", along with the new serialization infrastructure. This is breaking existing code that relies on the location, but because the API is changing anyways that seems fine. This adds an internal BiF "Broker::__opaque_clone_through_serialization" that does what the name says: deep-copying an opaque by serializing, then-deserializing. That can be used to tests the new functionality from btests. Not quite done yet. TODO: - Not all tests pass yet: [ 0%] language.named-set-ctors ... failed [ 16%] language.copy-all-opaques ... failed [ 33%] language.set-type-checking ... failed [ 50%] language.table-init-container-ctors ... failed [ 66%] coverage.sphinx-zeekygen-docs ... failed [ 83%] scripts.base.frameworks.sumstats.basic-cluster ... failed (Some of the serialization may still be buggy.) - Clean up the code a bit more. |
||
---|---|---|
.. | ||
btest | ||
coverage | ||
external | ||
scripts | ||
.gitignore | ||
Makefile | ||
README |
This directory contains suites for testing for Zeek's correct operation: btest/ An ever-growing set of small unit tests testing Zeek's functionality. external/ A framework for downloading additional test sets that run more complex Zeek configuration on larger traces files. Due to their size, these are not included directly. See the README for more information. scripts/ Helpers scripts used by some tests.