New upstream version 1.5.0
Hilko Bengen
2 years ago
0 | ||
1 | 1.5.0 | 2020-12-04 11:14:48 -0800 | |
2 | ||
3 | * Release 1.5.0. | |
4 | ||
5 | 1.4.0-19 | 2020-12-02 11:04:01 -0800 | |
6 | ||
7 | * Update minimum required CMake to 3.5 (Jon Siwek, Corelight) | |
8 | ||
9 | * Postpone initialization of constants for subdir BIFs (Jon Siwek, Corelight) | |
10 | ||
11 | 1.4.0-11 | 2020-08-26 11:20:13 -0700 | |
12 | ||
13 | * Rename bro-bif.h to zeek-bif.h (Tim Wojtulewicz, Corelight) | |
14 | ||
15 | 1.4.0-9 | 2020-08-21 08:30:47 -0700 | |
16 | ||
17 | * Move __RegisterBif from zeek::detail::plugin to zeek::plugin::detail (Tim Wojtulewicz, Corelight) | |
18 | ||
19 | * SOURCE_LOCAL is part of the zeek::util::detail namespace now (Tim Wojtulewicz, Corelight) | |
20 | ||
21 | 1.4.0-6 | 2020-08-01 09:14:45 -0700 | |
22 | ||
23 | * Move Connection to zeek namespace (Tim Wojtulewicz, Corelight) | |
24 | ||
25 | * Move BifReturnVal to zeek::detail namespace (Tim Wojtulewicz, Corelight) | |
26 | ||
27 | * Move event code to zeek namespace, rename mgr to event_mgr (Tim Wojtulewicz, Corelight) | |
28 | ||
29 | * Move BroFile to zeek namespace, rename to File (Tim Wojtulewicz, Corelight) | |
30 | ||
31 | * Move base analyzer classes to zeek namespace (Tim Wojtulewicz, Corelight) | |
0 | 32 | |
1 | 33 | 1.4.0 | 2020-07-23 10:10:53 -0700 |
2 | 34 |
0 | 0 | |
1 | cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) | |
1 | cmake_minimum_required(VERSION 3.5 FATAL_ERROR) | |
2 | 2 | project(BifCl C CXX) |
3 | 3 | |
4 | 4 | include(cmake/CommonCMakeConfig.cmake) |
234 | 234 | fprintf(fp_func_h, "#ifndef BRO_IN_NETVAR\n"); |
235 | 235 | fprintf(fp_func_h, "#ifndef %s\n", guard); |
236 | 236 | fprintf(fp_func_h, "#define %s\n", guard); |
237 | fprintf(fp_func_h, "#include \"bro-bif.h\"\n"); | |
237 | fprintf(fp_func_h, "#include \"zeek-bif.h\"\n"); | |
238 | 238 | fprintf(fp_func_h, "#endif\n"); |
239 | 239 | fprintf(fp_func_h, "#endif\n"); |
240 | 240 | fprintf(fp_func_h, "\n"); |
279 | 279 | fprintf(fp_func_register, "\n"); |
280 | 280 | fprintf(fp_func_register, "namespace plugin { namespace %s {\n", plugin_canon); |
281 | 281 | fprintf(fp_func_register, "void __bif_%s_init(zeek::plugin::Plugin* plugin);\n", name); |
282 | fprintf(fp_func_register, "zeek::detail::plugin::__RegisterBif __register_bifs_%s_%s(\"%s\", __bif_%s_init);\n", plugin_canon, name, plugin, name); | |
282 | fprintf(fp_func_register, "zeek::plugin::detail::__RegisterBif __register_bifs_%s_%s(\"%s\", __bif_%s_init);\n", plugin_canon, name, plugin, name); | |
283 | 283 | fprintf(fp_func_register, "} }\n"); |
284 | 284 | } |
285 | 285 | } |
15 | 15 | extern int line_number; |
16 | 16 | extern char* input_filename; |
17 | 17 | extern char* plugin; |
18 | extern int alternative_mode; | |
18 | 19 | |
19 | 20 | #define print_line_directive(fp) fprintf(fp, "\n#line %d \"%s\"\n", line_number, input_filename) |
20 | 21 | |
219 | 220 | static void print_event_c_prototype_header(FILE* fp, bool smart) |
220 | 221 | { |
221 | 222 | if ( smart ) |
222 | fprintf(fp, "namespace zeek { %s void %s(analyzer::Analyzer* analyzer%s", | |
223 | fprintf(fp, "namespace zeek { %s void %s(zeek::analyzer::Analyzer* analyzer%s", | |
223 | 224 | decl.generate_c_namespace_start.c_str(), |
224 | 225 | decl.enqueue_c_barename.c_str(), |
225 | 226 | args.size() ? ", " : "" ); |
226 | 227 | else |
227 | fprintf(fp, "%s [[deprecated(\"Remove in 4.1. Use %s.\")]] void %s(analyzer::Analyzer* analyzer%s", | |
228 | fprintf(fp, "%s [[deprecated(\"Remove in 4.1. Use %s.\")]] void %s(zeek::analyzer::Analyzer* analyzer%s", | |
228 | 229 | decl.generate_c_namespace_start.c_str(), |
229 | 230 | decl.enqueue_c_fullname.c_str(), |
230 | 231 | decl.generate_bare_name.c_str(), |
239 | 240 | static void print_event_c_prototype_impl(FILE* fp, bool smart) |
240 | 241 | { |
241 | 242 | if ( smart ) |
242 | fprintf(fp, "void %s(analyzer::Analyzer* analyzer%s", | |
243 | fprintf(fp, "void %s(zeek::analyzer::Analyzer* analyzer%s", | |
243 | 244 | decl.enqueue_c_fullname.c_str(), |
244 | 245 | args.size() ? ", " : "" ); |
245 | 246 | else |
246 | fprintf(fp, "void %s(analyzer::Analyzer* analyzer%s", | |
247 | fprintf(fp, "void %s(zeek::analyzer::Analyzer* analyzer%s", | |
247 | 248 | decl.generate_c_fullname.c_str(), |
248 | 249 | args.size() ? ", " : "" ); |
249 | 250 | |
265 | 266 | |
266 | 267 | BuiltinFuncArg* connection_arg = 0; |
267 | 268 | |
268 | fprintf(fp, "\tmgr.Enqueue(%s, zeek::Args{\n", decl.c_fullname.c_str()); | |
269 | fprintf(fp, "\tzeek::event_mgr.Enqueue(%s, zeek::Args{\n", decl.c_fullname.c_str()); | |
269 | 270 | |
270 | 271 | for ( int i = 0; i < (int) args.size(); ++i ) |
271 | 272 | { |
287 | 288 | } |
288 | 289 | } |
289 | 290 | |
290 | fprintf(fp, "\t },\n\t SOURCE_LOCAL, analyzer->GetID()"); | |
291 | fprintf(fp, "\t },\n\t zeek::util::detail::SOURCE_LOCAL, analyzer->GetID()"); | |
291 | 292 | |
292 | 293 | if ( connection_arg ) |
293 | 294 | // Pass the connection to the EventMgr as the "cookie" |
534 | 535 | builtin_types[typeidx].c_type, decl.bare_name.c_str(), |
535 | 536 | decl.c_namespace_end.c_str()); |
536 | 537 | |
538 | if ( alternative_mode && ! plugin ) | |
539 | fprintf(fp_netvar_init, "\tzeek::detail::bif_initializers.emplace_back([]()\n"); | |
540 | ||
537 | 541 | fprintf(fp_netvar_init, "\t{\n"); |
538 | 542 | fprintf(fp_netvar_init, "\tconst auto& v = zeek::id::find_const%s(\"%s\");\n", |
539 | 543 | builtin_types[typeidx].cast_smart, decl.bro_fullname.c_str()); |
542 | 546 | fprintf(fp_netvar_init, "\t%s = v.get()%s;\n", |
543 | 547 | decl.c_fullname.c_str(), accessor); |
544 | 548 | fprintf(fp_netvar_init, "\t}\n"); |
549 | ||
550 | if ( alternative_mode && ! plugin ) | |
551 | fprintf(fp_netvar_init, "\t);\n"); | |
545 | 552 | |
546 | 553 | record_bif_item(decl.bro_fullname.c_str(), "CONSTANT"); |
547 | 554 | } |
630 | 637 | // (e.g. ones at global scope that may be used to implement |
631 | 638 | // the BIF itself). |
632 | 639 | fprintf(fp_func_h, |
633 | "namespace zeek { %sextern BifReturnVal %s_bif(zeek::detail::Frame* frame, const zeek::Args*);%s }\n", | |
640 | "namespace zeek { %sextern zeek::detail::BifReturnVal %s_bif(zeek::detail::Frame* frame, const zeek::Args*);%s }\n", | |
634 | 641 | decl.c_namespace_start.c_str(), decl.bare_name.c_str(), decl.c_namespace_end.c_str()); |
635 | 642 | |
636 | 643 | // This is the deprecated, legacy, version of the BIF that |
637 | 644 | // forwards to the "canonical" version. It also does have |
638 | 645 | // a "bro_" prefix in the name itself, but no "_bif" suffix. |
639 | 646 | fprintf(fp_func_h, |
640 | "%s [[deprecated(\"Remove in v4.1. Use zeek::%s_bif.\")]] inline BifReturnVal bro_%s(zeek::detail::Frame* frame, const zeek::Args* args)", | |
647 | "%s [[deprecated(\"Remove in v4.1. Use zeek::%s_bif.\")]] inline zeek::detail::BifReturnVal bro_%s(zeek::detail::Frame* frame, const zeek::Args* args)", | |
641 | 648 | decl.c_namespace_start.c_str(), decl.c_fullname.c_str(), decl.bare_name.c_str()); |
642 | 649 | fprintf(fp_func_h, " { return zeek::%s_bif(frame, args); } %s\n", |
643 | 650 | decl.c_fullname.c_str(), decl.c_namespace_end.c_str()); |
644 | 651 | |
645 | 652 | fprintf(fp_func_def, |
646 | "BifReturnVal zeek::%s_bif(zeek::detail::Frame* frame, const zeek::Args* %s)", | |
653 | "zeek::detail::BifReturnVal zeek::%s_bif(zeek::detail::Frame* frame, const zeek::Args* %s)", | |
647 | 654 | decl.c_fullname.c_str(), arg_list_name); |
648 | 655 | |
649 | 656 | record_bif_item(decl.bro_fullname.c_str(), "FUNCTION"); |
654 | 661 | { |
655 | 662 | // TODO: add namespace for events here |
656 | 663 | fprintf(fp_netvar_h, |
657 | "%sextern EventHandlerPtr %s; %s\n", | |
664 | "%sextern zeek::EventHandlerPtr %s; %s\n", | |
658 | 665 | decl.c_namespace_start.c_str(), decl.bare_name.c_str(), decl.c_namespace_end.c_str()); |
659 | 666 | |
660 | 667 | fprintf(fp_netvar_def, |
661 | "%sEventHandlerPtr %s; %s\n", | |
662 | decl.c_namespace_start.c_str(), decl.bare_name.c_str(), decl.c_namespace_end.c_str()); | |
668 | "%szeek::EventHandlerPtr %s; %s\n", | |
669 | decl.c_namespace_start.c_str(), decl.bare_name.c_str(), decl.c_namespace_end.c_str()); | |
663 | 670 | |
664 | 671 | fprintf(fp_netvar_init, |
665 | 672 | "\t%s = event_registry->Register(\"%s\");\n", |
133 | 133 | |
134 | 134 | set(HAVE_KQUEUE true) |
135 | 135 | set(LIBKQUEUE_LIBRARIES libkqueue_a CACHE STRING "libkqueue libs" FORCE) |
136 | set(LIBKQUEUE_INCLUDE_DIRS "${kqueue_src}/include" CACHE STRING "libkqueue includes" FORCE) | |
136 | set(LIBKQUEUE_INCLUDE_DIRS "${kqueue_src}/include;${kqueue_build}/include" CACHE INTERNAL "libkqueue includes" FORCE) | |
137 | 137 | |
138 | 138 | include_directories(BEFORE ${LIBKQUEUE_INCLUDE_DIRS}) |
139 | 139 | set(zeekdeps ${zeekdeps} ${LIBKQUEUE_LIBRARIES}) |
40 | 40 | # symlink). |
41 | 41 | get_filename_component(PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE}" REALPATH) |
42 | 42 | get_filename_component(PYTHON_EXECUTABLE_DIR "${PYTHON_EXECUTABLE}" DIRECTORY) |
43 | get_filename_component(PYTHON_EXECUTABLE_NAME "${PYTHON_EXECUTABLE}" NAME) | |
43 | 44 | |
44 | 45 | if ( EXISTS ${PYTHON_EXECUTABLE}-config ) |
45 | 46 | set(PYTHON_CONFIG ${PYTHON_EXECUTABLE}-config CACHE PATH "" FORCE) |
46 | elseif ( EXISTS ${PYTHON_EXECUTABLE_DIR}/python-config ) | |
47 | # Avoid assumption that python-config is associated with python3 if | |
48 | # python3 co-exists in a directory that also contains python2 stuff | |
49 | elseif ( EXISTS ${PYTHON_EXECUTABLE_DIR}/python-config AND | |
50 | NOT EXISTS ${PYTHON_EXECUTABLE_DIR}/python2 AND | |
51 | NOT EXISTS ${PYTHON_EXECUTABLE_DIR}/python2.7 AND | |
52 | NOT EXISTS ${PYTHON_EXECUTABLE_DIR}/python2-config AND | |
53 | NOT EXISTS ${PYTHON_EXECUTABLE_DIR}/python2.7-config ) | |
47 | 54 | set(PYTHON_CONFIG ${PYTHON_EXECUTABLE_DIR}/python-config CACHE PATH "" FORCE) |
48 | 55 | endif () |
49 | 56 | else () |
50 | find_program(PYTHON_CONFIG | |
51 | NAMES python-config python3.7-config python3.6-config python3.5-config | |
52 | python3.4-config python-config2.7 python-config2.6 python-config2.6 | |
53 | python-config2.4 python-config2.3) | |
57 | find_program(PYTHON_CONFIG NAMES | |
58 | python3-config | |
59 | python3.9-config | |
60 | python3.8-config | |
61 | python3.7-config | |
62 | python3.6-config | |
63 | python3.5-config | |
64 | python-config | |
65 | ) | |
54 | 66 | endif () |
55 | 67 | |
56 | 68 | # The OpenBSD python packages have python-config's that don't reliably |
57 | 69 | # report linking flags that will work. |
58 | 70 | if (PYTHON_CONFIG AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") |
59 | execute_process(COMMAND "${PYTHON_CONFIG}" --ldflags | |
71 | # Try `--ldflags --embed` first and fallback to `--ldflags` if it fails. | |
72 | # Python 3.8+ introduced the `--embed` flag in relation to this: | |
73 | # https://docs.python.org/3.8/whatsnew/3.8.html#debug-build-uses-the-same-abi-as-release-build | |
74 | # Note that even if this FindPythonDev script could technically apply to | |
75 | # either embedded or extension use cases, the `--embed` flag only adds | |
76 | # a `-lpython` and it's generally safe to link libpython in both cases. | |
77 | # The only downside to doing that against an extension when it's not | |
78 | # strictly necessary is losing the ability to mix-and-match debug/release | |
79 | # modes between Python and extensions and that's not a feature to typically | |
80 | # care about. | |
81 | execute_process(COMMAND "${PYTHON_CONFIG}" --ldflags --embed | |
82 | RESULT_VARIABLE _python_config_result | |
60 | 83 | OUTPUT_VARIABLE PYTHON_LIBRARIES |
61 | 84 | OUTPUT_STRIP_TRAILING_WHITESPACE |
62 | 85 | ERROR_QUIET) |
86 | ||
87 | if ( NOT ${_python_config_result} EQUAL 0 ) | |
88 | execute_process(COMMAND "${PYTHON_CONFIG}" --ldflags | |
89 | RESULT_VARIABLE _python_config_result | |
90 | OUTPUT_VARIABLE PYTHON_LIBRARIES | |
91 | OUTPUT_STRIP_TRAILING_WHITESPACE | |
92 | ERROR_QUIET) | |
93 | endif () | |
94 | ||
63 | 95 | string(STRIP "${PYTHON_LIBRARIES}" PYTHON_LIBRARIES) |
64 | 96 | |
65 | 97 | execute_process(COMMAND "${PYTHON_CONFIG}" --includes |
77 | 109 | PYTHON_LIBRARIES |
78 | 110 | ) |
79 | 111 | else () |
80 | find_package(PythonLibs) | |
81 | if (PYTHON_INCLUDE_PATH AND NOT PYTHON_INCLUDE_DIR) | |
82 | set(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_PATH}") | |
112 | if ( ${CMAKE_VERSION} VERSION_LESS "3.12.0" ) | |
113 | find_package(PythonLibs) | |
114 | ||
115 | if ( PYTHON_INCLUDE_PATH AND NOT PYTHON_INCLUDE_DIR ) | |
116 | set(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_PATH}") | |
117 | endif () | |
118 | else () | |
119 | # Expect this branch to be used mostly in macOS where the system | |
120 | # default Python 3 installation is not easily/consistently detected | |
121 | # by CMake. CMake 3.12+ is required, but it's expected that macOS | |
122 | # users are getting a recent version from homebrew/etc anyway. | |
123 | find_package(Python3 COMPONENTS Development) | |
124 | ||
125 | if ( Python3_INCLUDE_DIRS AND NOT PYTHON_INCLUDE_DIR ) | |
126 | set(PYTHON_INCLUDE_DIR "${Python3_INCLUDE_DIRS}") | |
127 | endif () | |
128 | ||
129 | if ( Python3_LIBRARIES AND NOT PYTHON_LIBRARIES ) | |
130 | set(PYTHON_LIBRARIES "${Python3_LIBRARIES}") | |
131 | endif () | |
83 | 132 | endif () |
133 | ||
84 | 134 | find_package_handle_standard_args(PythonDev DEFAULT_MSG |
85 | 135 | PYTHON_INCLUDE_DIR |
86 | 136 | PYTHON_LIBRARIES |
34 | 34 | string(REGEX MATCH ${_regex} _match ${_srclines}) |
35 | 35 | if (_match) |
36 | 36 | set(_shell ${CMAKE_MATCH_1}) |
37 | if (${_shell} STREQUAL "python" AND PYTHON_EXECUTABLE) | |
37 | if ( (${_shell} STREQUAL "python" OR ${_shell} STREQUAL "python3") AND PYTHON_EXECUTABLE ) | |
38 | 38 | set(${_shell}_interp ${PYTHON_EXECUTABLE}) |
39 | 39 | else () |
40 | 40 | find_program(${_shell}_interp ${_shell}) |
0 | 0 | if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") |
1 | set(bro_LINKER_FLAGS "${bro_LINKER_FLAGS} -rdynamic") | |
2 | 1 | |
3 | 2 | elseif (${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") |
4 | set(bro_LINKER_FLAGS "${bro_LINKER_FLAGS} -rdynamic") | |
5 | 3 | |
6 | 4 | elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") |
7 | 5 | set(HAVE_DARWIN true) |
1 | 1 | # can find internal/private libraries or libraries external to the build |
2 | 2 | # directory that were explicitly linked against |
3 | 3 | if (NOT BINARY_PACKAGING_MODE) |
4 | SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) | |
5 | SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") | |
6 | ||
7 | 4 | include(GNUInstallDirs) |
8 | 5 | |
9 | if ( NOT CMAKE_INSTALL_LIBDIR STREQUAL "lib" ) | |
10 | # Ideally, we'd consistently use just one lib dir (e.g. lib/ or lib64/), | |
11 | # which requires every sub-project and external/embedded dependency | |
12 | # agrees and/or offers ability to install at that canonical location. | |
13 | set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") | |
14 | endif () | |
6 | SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) | |
7 | set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}") | |
15 | 8 | endif () |
27 | 27 | ZEEK_EXE_PATH |
28 | 28 | CMAKE_CXX_FLAGS |
29 | 29 | CMAKE_C_FLAGS |
30 | PCAP_INCLUDE_DIR | |
31 | ZLIB_INCLUDE_DIR | |
32 | OPENSSL_INCLUDE_DIR | |
33 | LibKrb5_INCLUDE_DIR | |
34 | GooglePerftools_INCLUDE_DIR | |
30 | 35 | CAF_INCLUDE_DIRS) |
31 | 36 | |
32 | 37 | if ( NOT BRO_PLUGIN_BRO_PLUGIN_INSTALL_PATH ) |
50 | 55 | set(CMAKE_MODULE_PATH ${BRO_PLUGIN_BRO_CMAKE} ${CMAKE_MODULE_PATH}) |
51 | 56 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${bro_cache_CMAKE_C_FLAGS}") |
52 | 57 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${bro_cache_CMAKE_CXX_FLAGS}") |
58 | ||
59 | if ( bro_cache_PCAP_INCLUDE_DIR ) | |
60 | include_directories(BEFORE ${bro_cache_PCAP_INCLUDE_DIR}) | |
61 | endif () | |
62 | if ( bro_cache_ZLIB_INCLUDE_DIR ) | |
63 | include_directories(BEFORE ${bro_cache_ZLIB_INCLUDE_DIR}) | |
64 | endif () | |
65 | if ( bro_cache_OPENSSL_INCLUDE_DIR ) | |
66 | include_directories(BEFORE ${bro_cache_OPENSSL_INCLUDE_DIR}) | |
67 | endif () | |
68 | if ( bro_cache_LibKrb5_INCLUDE_DIR ) | |
69 | include_directories(BEFORE ${bro_cache_LibKrb5_INCLUDE_DIR}) | |
70 | endif () | |
71 | if ( bro_cache_GooglePerftools_INCLUDE_DIR ) | |
72 | include_directories(BEFORE ${bro_cache_GooglePerftools_INCLUDE_DIR}) | |
73 | endif () | |
53 | 74 | |
54 | 75 | # Zeek 3.2+ has auxil/ instead of aux/ |
55 | 76 | include_directories(BEFORE |
106 | 127 | " to the installation path of Zeek headers") |
107 | 128 | endif () |
108 | 129 | |
130 | # Add potential custom library paths to our search path. This | |
131 | # works transparently across future find_library() calls. | |
132 | # | |
133 | # The zeek-config call is currently an outlier ... we need it | |
134 | # because existing plugin configure scripts need to keep | |
135 | # working with possible alternative libdirs, but do not | |
136 | # determine the libdir themselves. zeek-config is the only way | |
137 | # to determine it post-installation in those cases. | |
138 | # | |
139 | # XXX In the future the FindZeek module should make | |
140 | # zeek-config calls to establish the various settings | |
141 | # consistently within cmake. This would simplify configure | |
142 | # scripts and make cmake use with Zeek more standard. | |
143 | if ( NOT BRO_CONFIG_LIB_DIR ) | |
144 | execute_process( | |
145 | COMMAND ${BRO_CONFIG_PREFIX}/bin/zeek-config --lib_dir | |
146 | OUTPUT_VARIABLE BRO_CONFIG_LIB_DIR | |
147 | OUTPUT_STRIP_TRAILING_WHITESPACE) | |
148 | endif () | |
149 | ||
150 | if ( BRO_CONFIG_LIB_DIR ) | |
151 | set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${BRO_CONFIG_LIB_DIR}) | |
152 | endif () | |
153 | ||
109 | 154 | set(BRO_PLUGIN_BRO_CONFIG_INCLUDE_DIR "${BRO_CONFIG_INCLUDE_DIR}" |
110 | 155 | CACHE INTERNAL "" FORCE) |
111 | 156 | set(BRO_PLUGIN_BRO_INSTALL_PREFIX "${BRO_CONFIG_PREFIX}" |
254 | 299 | |
255 | 300 | add_dependencies(${_plugin_lib} bro-plugin-${_plugin_name_canon}) |
256 | 301 | |
257 | set(_dist_tarball_name ${_plugin_name_canon}.tar.gz) | |
302 | set(_dist_tarball_name ${_plugin_name_canon}.tgz) | |
258 | 303 | set(_dist_output ${CMAKE_CURRENT_BINARY_DIR}/${_dist_tarball_name}) |
259 | 304 | |
260 | 305 | # Create binary install package. |
2 | 2 | DEFINE_BIF_TYPE(TYPE_ANY, "any", "any", "zeek::Val*", "zeek::IntrusivePtr<zeek::Val>", "%s", "%s", "", "zeek::IntrusivePtr{zeek::AdoptRef{}, %s}", "std::move(%s)") |
3 | 3 | DEFINE_BIF_TYPE(TYPE_BOOL, "bool", "bool", "int", "int", "%s->AsBool()", "%s->AsBool()", "", "zeek::val_mgr->Bool(%s)", "zeek::val_mgr->Bool(%s)") |
4 | 4 | DEFINE_BIF_TYPE(TYPE_CONN_ID, "conn_id", "conn_id", "zeek::Val*", "zeek::IntrusivePtr<zeek::Val>", "%s", "%s", "", "zeek::IntrusivePtr{zeek::AdoptRef{}, %s}", "std::move(%s)") |
5 | DEFINE_BIF_TYPE(TYPE_CONNECTION, "connection", "connection", "Connection*", "Connection*", "%s->AsRecordVal()->GetOrigin()", "%s->AsRecordVal()->GetOrigin()", "", "%s->ConnVal()", "%s->ConnVal()") | |
5 | DEFINE_BIF_TYPE(TYPE_CONNECTION, "connection", "connection", "zeek::Connection*", "zeek::Connection*", "%s->AsRecordVal()->GetOrigin()", "%s->AsRecordVal()->GetOrigin()", "", "%s->ConnVal()", "%s->ConnVal()") | |
6 | 6 | DEFINE_BIF_TYPE(TYPE_COUNT, "count", "count", "bro_uint_t", "bro_uint_t", "%s->AsCount()", "%s->AsCount()", "", "zeek::val_mgr->Count(%s)", "zeek::val_mgr->Count(%s)") |
7 | 7 | DEFINE_BIF_TYPE(TYPE_DOUBLE, "double", "double", "double", "double", "%s->AsDouble()", "%s->AsDouble()", "", "zeek::make_intrusive<zeek::DoubleVal>(%s)", "zeek::make_intrusive<zeek::DoubleVal>(%s)") |
8 | DEFINE_BIF_TYPE(TYPE_FILE, "file", "file", "BroFile*", "zeek::IntrusivePtr<zeek::Val>", "%s->AsFile()", "%s", "", "zeek::make_intrusive<zeek::Val>(zeek::IntrusivePtr{zeek::AdoptRef{}, %s})", "std::move(%s)") | |
8 | DEFINE_BIF_TYPE(TYPE_FILE, "file", "file", "zeek::File*", "zeek::IntrusivePtr<zeek::Val>", "%s->AsFile()", "%s", "", "zeek::make_intrusive<zeek::Val>(zeek::IntrusivePtr{zeek::AdoptRef{}, %s})", "std::move(%s)") | |
9 | 9 | DEFINE_BIF_TYPE(TYPE_INT, "int", "int", "bro_int_t", "bro_int_t", "%s->AsInt()", "%s->AsInt()", "", "zeek::val_mgr->Int(%s)", "zeek::val_mgr->Int(%s)") |
10 | 10 | DEFINE_BIF_TYPE(TYPE_INTERVAL, "interval", "interval", "double", "double", "%s->AsInterval()", "%s->AsInterval()", "", "zeek::make_intrusive<zeek::IntervalVal>(%s, Seconds)", "zeek::make_intrusive<zeek::IntervalVal>(%s, Seconds)") |
11 | 11 | DEFINE_BIF_TYPE(TYPE_PATTERN, "pattern", "pattern", "RE_Matcher*", "zeek::IntrusivePtr<zeek::PatternVal>", "%s->AsPattern()", "%s", "<zeek::PatternVal>", "zeek::make_intrusive<zeek::PatternVal>(%s)", "std::move(%s)") |