Use the same rules as cmake submodule to reformat Zeek

This commit is contained in:
Tim Wojtulewicz 2023-05-08 10:19:26 -07:00
parent fd72d81bad
commit 84e3f414a7
125 changed files with 1423 additions and 1670 deletions

80
.cmake-format.json Normal file
View file

@ -0,0 +1,80 @@
{
"parse": {
"additional_commands": {
"CheckIPProto": {
"kwargs": {
"_proto": "*"
}
},
"CheckType": {
"kwargs": {
"_type": "*",
"_alt_type": "*",
"_var": "*"
}
},
"SetPackageVersion": {
"kwargs": {
"_version": "*"
}
},
"SetPackageFileName": {
"kwargs": {
"_version": "*"
}
},
"SetPackageInstallScripts": {
"kwargs": {
"VERSION": "*"
}
},
"ConfigurePackaging": {
"kwargs": {
"_version": "*"
}
},
"SetPackageGenerators": {},
"SetPackageMetadata": {},
"FindRequiredPackage": {
"kwargs": {
"packageName": "*"
}
},
"InstallClobberImmune": {
"kwargs": {
"_srcfile": "*",
"_dstfile": "*"
}
},
"InstallPackageConfigFile": {
"kwargs": {
"_srcfile": "*",
"_dstdir": "*",
"_dstfilename": "*"
}
},
"InstallShellScript": {
"kwargs": {
"_srcfile": "*",
"_dstfile": "*"
}
},
"InstallSymLink": {
"kwargs": {
"_filepath": "*",
"_sympath": "*"
}
}
}
},
"format": {
"line_width": 100,
"tab_size": 4,
"separate_ctrl_name_with_space": true,
"max_subgroups_hwrap": 3,
"line_ending": "unix"
},
"markup": {
"enable_markup": false
}
}

View file

@ -17,3 +17,9 @@ repos:
rev: v0.31.0
hooks:
- id: yapf
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-format
exclude: '^auxil/.*$'

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
install(DIRECTORY . DESTINATION ${ZEEK_MAN_INSTALL_PATH}/man8 FILES_MATCHING
PATTERN "*.8"
)
install(
DIRECTORY .
DESTINATION ${ZEEK_MAN_INSTALL_PATH}/man8
FILES_MATCHING
PATTERN "*.8")

View file

@ -1,22 +1,22 @@
include(InstallPackageConfigFile)
install(DIRECTORY ./ DESTINATION ${ZEEK_SCRIPT_INSTALL_PATH} FILES_MATCHING
PATTERN "site/local*" EXCLUDE
PATTERN "*.zeek"
PATTERN "*.sig"
PATTERN "*.fp"
)
install(
DIRECTORY ./
DESTINATION ${ZEEK_SCRIPT_INSTALL_PATH}
FILES_MATCHING
PATTERN "site/local*" EXCLUDE
PATTERN "*.zeek"
PATTERN "*.sig"
PATTERN "*.fp")
# Install local script as a config file since it's meant to be modified directly.
InstallPackageConfigFile(
${CMAKE_CURRENT_SOURCE_DIR}/site/local.zeek
${ZEEK_SCRIPT_INSTALL_PATH}/site
local.zeek)
# Install local script as a config file since it's meant to be modified
# directly.
InstallPackageConfigFile(${CMAKE_CURRENT_SOURCE_DIR}/site/local.zeek
${ZEEK_SCRIPT_INSTALL_PATH}/site local.zeek)
# Substitute values in templated script files, and install them.
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/base/misc/installation.zeek.in
${CMAKE_CURRENT_BINARY_DIR}/base/misc/installation.zeek @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/base/misc/installation.zeek.in
${CMAKE_CURRENT_BINARY_DIR}/base/misc/installation.zeek @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/base/misc/installation.zeek
DESTINATION ${ZEEK_SCRIPT_INSTALL_PATH}/base/misc)
DESTINATION ${ZEEK_SCRIPT_INSTALL_PATH}/base/misc)

View file

@ -1,24 +1,16 @@
include_directories(BEFORE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/include
)
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/include)
# Force creation of includes symlink. This can't just be in the src directory
# because MSVC will end up with an include loop.
execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory
"${CMAKE_CURRENT_SOURCE_DIR}/include")
execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink
".."
"${CMAKE_CURRENT_SOURCE_DIR}/include/zeek")
execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_SOURCE_DIR}/include")
execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink ".."
"${CMAKE_CURRENT_SOURCE_DIR}/include/zeek")
# Allows header file inclusion via zeek/ within the build tree
execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory
"${CMAKE_CURRENT_BINARY_DIR}/include")
execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink
".."
"${CMAKE_CURRENT_BINARY_DIR}/include/zeek")
execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/include")
execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink ".."
"${CMAKE_CURRENT_BINARY_DIR}/include/zeek")
# Poor man's JSON escaping as this is rendered into a C string.
string(REPLACE "\"" "\\\"" ZEEK_BUILD_INFO_ESCAPED "${ZEEK_BUILD_INFO}")
@ -26,96 +18,85 @@ string(REPLACE "\n" "\\n" ZEEK_BUILD_INFO_ESCAPED "${ZEEK_BUILD_INFO_ESCAPED}")
configure_file(version.c.in ${CMAKE_CURRENT_BINARY_DIR}/version.c)
configure_file(util-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/util-config.h)
# This creates a custom command to transform a bison output file (inFile)
# into outFile in order to avoid symbol conflicts:
# - replaces instances of 'yylex' in inFile with yylexPrefix
# - replaces instances of 'yy' in inFile with yyPrefix
# - deletes instances of 'extern char.*getenv' in inFile
# - writes results to outFile and adds it to list TRANSFORMED_BISON_OUTPUTS
macro(REPLACE_YY_PREFIX_TARGET inFile outFile yylexPrefix yyPrefix)
# This creates a custom command to transform a bison output file (inFile) into
# outFile in order to avoid symbol conflicts: - replaces instances of 'yylex' in
# inFile with yylexPrefix - replaces instances of 'yy' in inFile with yyPrefix -
# deletes instances of 'extern char.*getenv' in inFile - writes results to
# outFile and adds it to list TRANSFORMED_BISON_OUTPUTS
macro (REPLACE_YY_PREFIX_TARGET inFile outFile yylexPrefix yyPrefix)
set(args "\"/extern char.*getenv/d")
set(args "${args}\;s/yylex/${yylexPrefix}lex/")
set(args "${args}\;s/yy/${yyPrefix}/g\"" < ${inFile} > ${outFile})
add_custom_command(OUTPUT ${outFile}
COMMAND ${SED_EXE}
ARGS ${args}
DEPENDS ${inFile}
COMMENT "[sed] replacing stuff in ${inFile}"
)
add_custom_command(
OUTPUT ${outFile}
COMMAND ${SED_EXE} ARGS ${args}
DEPENDS ${inFile}
COMMENT "[sed] replacing stuff in ${inFile}")
list(APPEND TRANSFORMED_BISON_OUTPUTS ${outFile})
endmacro(REPLACE_YY_PREFIX_TARGET)
endmacro (REPLACE_YY_PREFIX_TARGET)
########################################################################
## Create targets to generate parser and scanner code
# ##############################################################################
# Create targets to generate parser and scanner code
set(BISON_FLAGS "--debug")
if ( MSVC )
if (MSVC)
set(SIGN_COMPARE_FLAG "/wd4018")
else()
else ()
set(SIGN_COMPARE_FLAG "-Wno-sign-compare")
endif()
endif ()
# Rule parser/scanner
bison_target(RuleParser rule-parse.y
${CMAKE_CURRENT_BINARY_DIR}/rup.cc
HEADER ${CMAKE_CURRENT_BINARY_DIR}/rup.h
#VERBOSE ${CMAKE_CURRENT_BINARY_DIR}/rule_parse.output
COMPILE_FLAGS "${BISON_FLAGS}")
bison_target(
RuleParser rule-parse.y ${CMAKE_CURRENT_BINARY_DIR}/rup.cc HEADER
${CMAKE_CURRENT_BINARY_DIR}/rup.h
# VERBOSE ${CMAKE_CURRENT_BINARY_DIR}/rule_parse.output
COMPILE_FLAGS "${BISON_FLAGS}")
replace_yy_prefix_target(${CMAKE_CURRENT_BINARY_DIR}/rup.cc
${CMAKE_CURRENT_BINARY_DIR}/rule-parse.cc
rules_ rules_)
replace_yy_prefix_target(${CMAKE_CURRENT_BINARY_DIR}/rup.h
${CMAKE_CURRENT_BINARY_DIR}/rule-parse.h
${CMAKE_CURRENT_BINARY_DIR}/rule-parse.cc rules_ rules_)
replace_yy_prefix_target(${CMAKE_CURRENT_BINARY_DIR}/rup.h ${CMAKE_CURRENT_BINARY_DIR}/rule-parse.h
rules_ rules_)
flex_target(RuleScanner rule-scan.l ${CMAKE_CURRENT_BINARY_DIR}/rule-scan.cc
COMPILE_FLAGS "-Prules_")
set_property(SOURCE rule-scan.cc APPEND_STRING PROPERTY COMPILE_FLAGS "${SIGN_COMPARE_FLAG}")
# RE parser/scanner
bison_target(REParser re-parse.y
${CMAKE_CURRENT_BINARY_DIR}/rep.cc
HEADER ${CMAKE_CURRENT_BINARY_DIR}/re-parse.h
#VERBOSE ${CMAKE_CURRENT_BINARY_DIR}/re_parse.output
COMPILE_FLAGS "${BISON_FLAGS}")
replace_yy_prefix_target(${CMAKE_CURRENT_BINARY_DIR}/rep.cc
${CMAKE_CURRENT_BINARY_DIR}/re-parse.cc
bison_target(
REParser re-parse.y ${CMAKE_CURRENT_BINARY_DIR}/rep.cc HEADER
${CMAKE_CURRENT_BINARY_DIR}/re-parse.h
# VERBOSE ${CMAKE_CURRENT_BINARY_DIR}/re_parse.output
COMPILE_FLAGS "${BISON_FLAGS}")
replace_yy_prefix_target(${CMAKE_CURRENT_BINARY_DIR}/rep.cc ${CMAKE_CURRENT_BINARY_DIR}/re-parse.cc
re_ RE_)
flex_target(REScanner re-scan.l ${CMAKE_CURRENT_BINARY_DIR}/re-scan.cc
COMPILE_FLAGS "-Pre_")
flex_target(REScanner re-scan.l ${CMAKE_CURRENT_BINARY_DIR}/re-scan.cc COMPILE_FLAGS "-Pre_")
add_flex_bison_dependency(REScanner REParser)
set_property(SOURCE re-scan.cc APPEND_STRING PROPERTY COMPILE_FLAGS "${SIGN_COMPARE_FLAG}")
# Parser/Scanner
bison_target(Parser parse.y
${CMAKE_CURRENT_BINARY_DIR}/p.cc
HEADER ${CMAKE_CURRENT_BINARY_DIR}/zeekparse.h
#VERBOSE ${CMAKE_CURRENT_BINARY_DIR}/parse.output
COMPILE_FLAGS "${BISON_FLAGS}")
replace_yy_prefix_target(${CMAKE_CURRENT_BINARY_DIR}/p.cc
${CMAKE_CURRENT_BINARY_DIR}/parse.cc
zeek yy)
flex_target(Scanner scan.l ${CMAKE_CURRENT_BINARY_DIR}/scan.cc
COMPILE_FLAGS "-Pzeek")
bison_target(
Parser parse.y ${CMAKE_CURRENT_BINARY_DIR}/p.cc HEADER ${CMAKE_CURRENT_BINARY_DIR}/zeekparse.h
# VERBOSE ${CMAKE_CURRENT_BINARY_DIR}/parse.output
COMPILE_FLAGS "${BISON_FLAGS}")
replace_yy_prefix_target(${CMAKE_CURRENT_BINARY_DIR}/p.cc ${CMAKE_CURRENT_BINARY_DIR}/parse.cc zeek
yy)
flex_target(Scanner scan.l ${CMAKE_CURRENT_BINARY_DIR}/scan.cc COMPILE_FLAGS "-Pzeek")
set_property(SOURCE scan.cc APPEND_STRING PROPERTY COMPILE_FLAGS "${SIGN_COMPARE_FLAG}")
# Add a dependency for the generated files to zeek_autogen_files.
add_custom_target(
zeek_bison_outputs
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/parse.cc
${CMAKE_CURRENT_BINARY_DIR}/re-parse.cc
${CMAKE_CURRENT_BINARY_DIR}/re-parse.h
${CMAKE_CURRENT_BINARY_DIR}/re-scan.cc
${CMAKE_CURRENT_BINARY_DIR}/rule-parse.cc
${CMAKE_CURRENT_BINARY_DIR}/rule-parse.h
${CMAKE_CURRENT_BINARY_DIR}/rule-scan.cc
${CMAKE_CURRENT_BINARY_DIR}/scan.cc
)
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/parse.cc
${CMAKE_CURRENT_BINARY_DIR}/re-parse.cc
${CMAKE_CURRENT_BINARY_DIR}/re-parse.h
${CMAKE_CURRENT_BINARY_DIR}/re-scan.cc
${CMAKE_CURRENT_BINARY_DIR}/rule-parse.cc
${CMAKE_CURRENT_BINARY_DIR}/rule-parse.h
${CMAKE_CURRENT_BINARY_DIR}/rule-scan.cc
${CMAKE_CURRENT_BINARY_DIR}/scan.cc)
add_dependencies(zeek_autogen_files zeek_bison_outputs)
########################################################################
## bifcl-dependent targets
# ##############################################################################
# bifcl-dependent targets
include(BifCl)
@ -131,34 +112,30 @@ set(BIF_SRCS
strings.bif
reporter.bif
option.bif
# Note: the supervisor BIF file is treated like other top-level BIFs
# instead of contained in its own subdirectory CMake logic because
# subdirectory BIFs are treated differently and don't support being called
# *during* parsing (e.g. within an @if directive).
# Note: the supervisor BIF file is treated like other top-level BIFs instead
# of contained in its own subdirectory CMake logic because subdirectory BIFs
# are treated differently and don't support being called *during* parsing
# (e.g. within an @if directive).
supervisor/supervisor.bif
# The packet analysis BIF is treated like other top-level BIFs because
# it's needed before parsing the packet protocol scripts, which happen
# very near to the start of parsing.
# The packet analysis BIF is treated like other top-level BIFs because it's
# needed before parsing the packet protocol scripts, which happen very near
# to the start of parsing.
packet_analysis/packet_analysis.bif
# The C++ loading BIF is treated like other top-level BIFs to give
# us flexibility regarding when it's called.
script_opt/CPP/CPP-load.bif
)
# The C++ loading BIF is treated like other top-level BIFs to give us
# flexibility regarding when it's called.
script_opt/CPP/CPP-load.bif)
foreach (bift ${BIF_SRCS})
bif_target(${bift} "standard")
endforeach ()
########################################################################
## BinPAC-dependent targets
# ##############################################################################
# BinPAC-dependent targets
include(BinPAC)
set(BINPAC_AUXSRC
${CMAKE_CURRENT_SOURCE_DIR}/binpac.pac
${CMAKE_CURRENT_SOURCE_DIR}/zeek.pac
${CMAKE_CURRENT_SOURCE_DIR}/binpac_zeek.h
)
set(BINPAC_AUXSRC ${CMAKE_CURRENT_SOURCE_DIR}/binpac.pac ${CMAKE_CURRENT_SOURCE_DIR}/zeek.pac
${CMAKE_CURRENT_SOURCE_DIR}/binpac_zeek.h)
set(BINPAC_OUTPUTS "")
@ -168,8 +145,8 @@ list(APPEND BINPAC_OUTPUTS "${BINPAC_OUTPUT_CC}")
binpac_target(binpac_zeek-lib.pac)
list(APPEND BINPAC_OUTPUTS "${BINPAC_OUTPUT_CC}")
########################################################################
## Gen-ZAM setup
# ##############################################################################
# Gen-ZAM setup
include(Gen-ZAM)
@ -177,9 +154,9 @@ set(GEN_ZAM_SRC ${CMAKE_CURRENT_SOURCE_DIR}/script_opt/ZAM/Ops.in)
gen_zam_target(${GEN_ZAM_SRC})
########################################################################
## Including subdirectories.
########################################################################
# ##############################################################################
# Including subdirectories.
# ##############################################################################
option(USE_SQLITE "Should Zeek use SQLite?" ON)
@ -195,8 +172,8 @@ add_subdirectory(logging)
add_subdirectory(probabilistic)
add_subdirectory(session)
########################################################################
## Build in the discovered external plugins and create the autogenerated scripts.
# ##############################################################################
# Build in the discovered external plugins and create the autogenerated scripts.
set(PRELOAD_SCRIPT ${PROJECT_BINARY_DIR}/scripts/builtin-plugins/__preload__.zeek)
file(WRITE ${PRELOAD_SCRIPT} "# Warning, this is an autogenerated file!\n")
@ -204,14 +181,14 @@ set(LOAD_SCRIPT ${PROJECT_BINARY_DIR}/scripts/builtin-plugins/__load__.zeek)
file(WRITE ${LOAD_SCRIPT} "# Warning, this is an autogenerated file!\n")
# TODO: this really should be a function to make sure we have an isolated scope.
# However, for historic reasons, we're not doing that yet. Some plugin
# modify global state such as `zeekdeps`.
macro(add_extra_builtin_plugin plugin_dir)
# However, for historic reasons, we're not doing that yet. Some plugin modify
# global state such as `zeekdeps`.
macro (add_extra_builtin_plugin plugin_dir)
get_filename_component(plugin_name "${plugin_dir}" NAME)
if(IS_DIRECTORY "${plugin_dir}/cmake")
if (IS_DIRECTORY "${plugin_dir}/cmake")
list(APPEND CMAKE_MODULE_PATH "${plugin_dir}/cmake")
endif()
endif ()
# Set this flag so that ZeekPluginStatic.cmake knows that this plugin is not
# from our source tree but from an external source (or git submodule). This
@ -222,36 +199,36 @@ macro(add_extra_builtin_plugin plugin_dir)
# TODO: drop once we turn this into a function.
set(ZEEK_BUILDING_EXTRA_PLUGINS OFF)
endmacro()
endmacro ()
foreach (plugin_dir ${BUILTIN_PLUGIN_LIST})
add_extra_builtin_plugin("${plugin_dir}")
endforeach()
endforeach ()
install(FILES ${PRELOAD_SCRIPT} DESTINATION ${ZEEK_SCRIPT_INSTALL_PATH}/builtin-plugins/)
install(FILES ${LOAD_SCRIPT} DESTINATION ${ZEEK_SCRIPT_INSTALL_PATH}/builtin-plugins/)
########################################################################
## This has to happen after the parts for builtin plugins, or else
## symbols are missing when it goes to link the fuzzer binaries.
# ##############################################################################
# This has to happen after the parts for builtin plugins, or else symbols are
# missing when it goes to link the fuzzer binaries.
add_subdirectory(fuzzers)
########################################################################
## zeek target
# ##############################################################################
# zeek target
find_package (Threads)
find_package(Threads)
# Avoid CMake warning about "3rdparty" looking like a number.
cmake_policy(PUSH)
if (POLICY CMP0012)
cmake_policy(SET CMP0012 NEW)
cmake_policy(SET CMP0012 NEW)
endif ()
# This macro stores associated headers for any C/C++ source files given
# as arguments (past _var) as a list in the CMake variable named "_var".
macro(COLLECT_HEADERS _var)
# This macro stores associated headers for any C/C++ source files given as
# arguments (past _var) as a list in the CMake variable named "_var".
macro (COLLECT_HEADERS _var)
foreach (src ${ARGN})
get_filename_component(ext ${src} EXT)
if ("${ext}" STREQUAL ".cc" OR "${ext}" STREQUAL ".c")
@ -266,39 +243,34 @@ macro(COLLECT_HEADERS _var)
endif ()
endif ()
endforeach ()
endmacro(COLLECT_HEADERS _var)
endmacro (COLLECT_HEADERS _var)
cmake_policy(POP)
# define a command that's used to run the make_dbg_constants.py script
# building the zeek binary depends on the outputs of this script
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/DebugCmdConstants.h
${CMAKE_CURRENT_BINARY_DIR}/DebugCmdInfoConstants.cc
COMMAND ${PYTHON_EXECUTABLE}
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/make_dbg_constants.py
${CMAKE_CURRENT_SOURCE_DIR}/DebugCmdInfoConstants.in
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/make_dbg_constants.py
${CMAKE_CURRENT_SOURCE_DIR}/DebugCmdInfoConstants.in
COMMENT "[Python] Processing debug commands"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
# define a command that's used to run the make_dbg_constants.py script building
# the zeek binary depends on the outputs of this script
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/DebugCmdConstants.h
${CMAKE_CURRENT_BINARY_DIR}/DebugCmdInfoConstants.cc
COMMAND ${PYTHON_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/make_dbg_constants.py
${CMAKE_CURRENT_SOURCE_DIR}/DebugCmdInfoConstants.in
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/make_dbg_constants.py
${CMAKE_CURRENT_SOURCE_DIR}/DebugCmdInfoConstants.in
COMMENT "[Python] Processing debug commands"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
add_custom_target(
zeek_debugcmd_gen
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/DebugCmdConstants.h
${CMAKE_CURRENT_BINARY_DIR}/DebugCmdInfoConstants.cc
)
add_custom_target(zeek_debugcmd_gen DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/DebugCmdConstants.h
${CMAKE_CURRENT_BINARY_DIR}/DebugCmdInfoConstants.cc)
add_dependencies(zeek_autogen_files zeek_debugcmd_gen)
set(_gen_zeek_script_cpp ${CMAKE_CURRENT_BINARY_DIR}/../CPP-gen.cc)
add_custom_command(OUTPUT ${_gen_zeek_script_cpp}
COMMAND ${CMAKE_COMMAND} -E touch ${_gen_zeek_script_cpp})
add_custom_command(OUTPUT ${_gen_zeek_script_cpp} COMMAND ${CMAKE_COMMAND} -E touch
${_gen_zeek_script_cpp})
if (!MSVC)
set_source_files_properties(legacy-netvar-init.cc PROPERTIES COMPILE_FLAGS
-Wno-deprecated-declarations)
endif()
-Wno-deprecated-declarations)
endif ()
set(MAIN_SRCS
digest.cc
@ -386,9 +358,7 @@ set(MAIN_SRCS
ZeekArgs.cc
ZeekString.cc
ZVal.cc
${SUPERVISOR_SRCS}
threading/BasicThread.cc
threading/Formatter.cc
threading/Manager.cc
@ -396,12 +366,10 @@ set(MAIN_SRCS
threading/SerialTypes.cc
threading/formatters/Ascii.cc
threading/formatters/JSON.cc
plugin/Component.cc
plugin/ComponentManager.h
plugin/Manager.cc
plugin/Plugin.cc
script_opt/CPP/Attrs.cc
script_opt/CPP/Consts.cc
script_opt/CPP/DeclFunc.cc
@ -421,9 +389,7 @@ set(MAIN_SRCS
script_opt/CPP/Types.cc
script_opt/CPP/Util.cc
script_opt/CPP/Vars.cc
${_gen_zeek_script_cpp}
script_opt/Expr.cc
script_opt/GenIDDefs.cc
script_opt/IDOptInfo.cc
@ -435,7 +401,6 @@ set(MAIN_SRCS
script_opt/TempVar.cc
script_opt/UsageAnalyzer.cc
script_opt/UseDefs.cc
script_opt/ZAM/AM-Opt.cc
script_opt/ZAM/Branches.cc
script_opt/ZAM/BuiltIn.cc
@ -450,9 +415,7 @@ set(MAIN_SRCS
script_opt/ZAM/ZBody.cc
script_opt/ZAM/ZInst.cc
script_opt/ZAM/ZOp.cc
digest.h
)
digest.h)
set(THIRD_PARTY_SRCS
3rdparty/bro_inet_ntop.c # Remove in v6.1.
@ -464,69 +427,58 @@ set(THIRD_PARTY_SRCS
3rdparty/patricia.c
3rdparty/setsignal.c
$<$<BOOL:USE_SQLITE>:3rdparty/sqlite3.c>
3rdparty/strsep.c
)
3rdparty/strsep.c)
# Highwayhash. Highwayhash is a bit special since it has architecture dependent code...
# Highwayhash. Highwayhash is a bit special since it has architecture dependent
# code...
set(hhash_dir ${PROJECT_SOURCE_DIR}/auxil/highwayhash/highwayhash)
zeek_add_subdir_library(
hhash
SOURCES
${hhash_dir}/sip_hash.cc
${hhash_dir}/sip_tree_hash.cc
${hhash_dir}/scalar_sip_tree_hash.cc
${hhash_dir}/arch_specific.cc
${hhash_dir}/instruction_sets.cc
${hhash_dir}/nanobenchmark.cc
${hhash_dir}/os_specific.cc
${hhash_dir}/hh_portable.cc
)
${hhash_dir}/sip_hash.cc
${hhash_dir}/sip_tree_hash.cc
${hhash_dir}/scalar_sip_tree_hash.cc
${hhash_dir}/arch_specific.cc
${hhash_dir}/instruction_sets.cc
${hhash_dir}/nanobenchmark.cc
${hhash_dir}/os_specific.cc
${hhash_dir}/hh_portable.cc)
if (${COMPILER_ARCHITECTURE} STREQUAL "arm")
check_c_source_compiles("
check_c_source_compiles(
"
#if defined(__ARM_NEON__) || defined(__ARM_NEON)
int main() { return 0; }
#else
#error
#endif
" test_arm_neon)
"
test_arm_neon)
if (test_arm_neon)
target_sources(zeek_hhash_obj PRIVATE ${hhash_dir}/hh_neon.cc)
endif ()
if (test_arm_neon)
target_sources(zeek_hhash_obj PRIVATE ${hhash_dir}/hh_neon.cc)
endif ()
target_compile_options(
zeek_hhash_obj
PRIVATE
-mfloat-abi=hard
-march=armv7-a
-mfpu=neon
)
target_compile_options(zeek_hhash_obj PRIVATE -mfloat-abi=hard -march=armv7-a -mfpu=neon)
elseif (${COMPILER_ARCHITECTURE} STREQUAL "aarch64")
target_sources(zeek_hhash_obj PRIVATE ${hhash_dir}/hh_neon.cc)
target_sources(zeek_hhash_obj PRIVATE ${hhash_dir}/hh_neon.cc)
elseif (${COMPILER_ARCHITECTURE} STREQUAL "power")
target_sources(zeek_hhash_obj PRIVATE ${hhash_dir}/hh_vsx.cc)
set_source_files_properties(${hhash_dir}/hh_vsx.cc PROPERTIES COMPILE_FLAGS
-mvsx)
elseif(${COMPILER_ARCHITECTURE} STREQUAL "x86_64")
target_sources(
zeek_hhash_obj
PRIVATE
${hhash_dir}/hh_avx2.cc
${hhash_dir}/hh_sse41.cc)
if (MSVC)
set(_avx_flag /arch:AVX2)
# Using an undocumentd compiler flag: https://stackoverflow.com/questions/64053597/how-do-i-enable-sse4-1-and-sse3-but-not-avx-in-msvc/69328426#69328426
set(_sse_flag /d2archSSE42)
else()
set(_avx_flag -mavx2)
set(_sse_flag -msse4.1)
endif()
target_sources(zeek_hhash_obj PRIVATE ${hhash_dir}/hh_vsx.cc)
set_source_files_properties(${hhash_dir}/hh_vsx.cc PROPERTIES COMPILE_FLAGS -mvsx)
elseif (${COMPILER_ARCHITECTURE} STREQUAL "x86_64")
target_sources(zeek_hhash_obj PRIVATE ${hhash_dir}/hh_avx2.cc ${hhash_dir}/hh_sse41.cc)
if (MSVC)
set(_avx_flag /arch:AVX2)
# Using an undocumentd compiler flag:
# https://stackoverflow.com/questions/64053597/how-do-i-enable-sse4-1-and-sse3-but-not-avx-in-msvc/69328426#69328426
set(_sse_flag /d2archSSE42)
else ()
set(_avx_flag -mavx2)
set(_sse_flag -msse4.1)
endif ()
set_source_files_properties(${hhash_dir}/hh_avx2.cc PROPERTIES COMPILE_FLAGS
${_avx_flag})
set_source_files_properties(${hhash_dir}/hh_sse41.cc PROPERTIES COMPILE_FLAGS
${_sse_flag})
set_source_files_properties(${hhash_dir}/hh_avx2.cc PROPERTIES COMPILE_FLAGS ${_avx_flag})
set_source_files_properties(${hhash_dir}/hh_sse41.cc PROPERTIES COMPILE_FLAGS ${_sse_flag})
endif ()
set(zeek_SRCS
@ -550,8 +502,7 @@ set(zeek_SRCS
${CMAKE_CURRENT_BINARY_DIR}/ZAM-MethodDecls.h
${THIRD_PARTY_SRCS}
${HH_SRCS}
${MAIN_SRCS}
)
${MAIN_SRCS})
collect_headers(zeek_HEADERS ${zeek_SRCS})
@ -564,35 +515,31 @@ zeek_target_link_libraries(zeek_objs)
if (TARGET zeek_exe)
target_sources(zeek_exe PRIVATE main.cc ${zeek_HEADERS})
# npcap/winpcap need to be loaded in delayed mode so that we can set the load path
# correctly at runtime. See https://npcap.com/guide/npcap-devguide.html#npcap-feature-native
# for why this is necessary.
if ( MSVC AND HAVE_WPCAP )
# npcap/winpcap need to be loaded in delayed mode so that we can set the load
# path correctly at runtime. See
# https://npcap.com/guide/npcap-devguide.html#npcap-feature-native for why
# this is necessary.
if (MSVC AND HAVE_WPCAP)
set(zeekdeps ${zeekdeps} delayimp.lib)
set_target_properties(zeek_exe PROPERTIES LINK_FLAGS "/DELAYLOAD:wpcap.dll")
endif()
endif ()
target_link_libraries(zeek_exe PRIVATE ${zeekdeps} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
# Export symbols from zeek executable for use by plugins
set_target_properties(zeek_exe PROPERTIES ENABLE_EXPORTS TRUE)
if ( MSVC )
if (MSVC)
set(WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif ()
endif()
endif ()
if (TARGET zeek_lib)
target_sources(zeek_lib PRIVATE ${zeek_HEADERS})
target_link_libraries(
zeek_lib
PUBLIC
${zeekdeps}
${CMAKE_THREAD_LIBS_INIT}
${CMAKE_DL_LIBS})
endif()
target_link_libraries(zeek_lib PUBLIC ${zeekdeps} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
endif ()
zeek_include_directories(
${CMAKE_BINARY_DIR}
@ -601,21 +548,23 @@ zeek_include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/zeek/src
${CMAKE_SOURCE_DIR}/zeek/src/include
)
${CMAKE_SOURCE_DIR}/zeek/src/include)
# Install *.bif.zeek.
install(DIRECTORY ${PROJECT_BINARY_DIR}/scripts/base/bif DESTINATION ${ZEEK_SCRIPT_INSTALL_PATH}/base)
install(DIRECTORY ${PROJECT_BINARY_DIR}/scripts/base/bif
DESTINATION ${ZEEK_SCRIPT_INSTALL_PATH}/base)
# Create plugin directory at install time.
install(DIRECTORY DESTINATION ${ZEEK_PLUGIN_DIR})
# Make clean removes the bif directory.
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${PROJECT_BINARY_DIR}/scripts/base/bif)
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
${PROJECT_BINARY_DIR}/scripts/base/bif)
# Remove some stale files and scripts that previous Zeek versions put in
# place, yet make confuse us now. This makes upgrading easier.
install(CODE "
# Remove some stale files and scripts that previous Zeek versions put in place,
# yet make confuse us now. This makes upgrading easier.
install(
CODE "
file(REMOVE_RECURSE
${ZEEK_SCRIPT_INSTALL_PATH}/base/frameworks/logging/writers/dataseries.bro
${ZEEK_SCRIPT_INSTALL_PATH}/base/frameworks/logging/writers/elasticsearch.bro
@ -623,60 +572,59 @@ install(CODE "
)
")
# Make sure to escape a bunch of special characters in the path before trying to use it as a
# regular expression below.
string(REGEX REPLACE "([][+.*()^])" "\\\\\\1" escaped_include_path "${CMAKE_CURRENT_SOURCE_DIR}/include/*")
# Make sure to escape a bunch of special characters in the path before trying to
# use it as a regular expression below.
string(REGEX REPLACE "([][+.*()^])" "\\\\\\1" escaped_include_path
"${CMAKE_CURRENT_SOURCE_DIR}/include/*")
if (WIN32)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/windows/usr.include/
DESTINATION include/
FILES_MATCHING
PATTERN "*.h"
)
endif()
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
DESTINATION include/zeek
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/windows/usr.include/
DESTINATION include/
FILES_MATCHING
PATTERN "*.h"
PATTERN "*.pac"
PATTERN "3rdparty/*" EXCLUDE
# The "zeek -> ." symlink isn't needed in the install-tree
REGEX "${escaped_include_path}$" EXCLUDE
PATTERN "*.h")
endif ()
# FILES_MATCHING creates empty directories:
# https://gitlab.kitware.com/cmake/cmake/-/issues/17122
# Exclude the ones that this affects explicitly.
PATTERN "script_opt/CPP/maint" EXCLUDE
PATTERN "fuzzers/corpora" EXCLUDE
)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
DESTINATION include/zeek
FILES_MATCHING
PATTERN "*.h"
PATTERN "*.pac"
PATTERN "3rdparty/*" EXCLUDE
# The "zeek -> ." symlink isn't needed in the install-tree
REGEX "${escaped_include_path}$" EXCLUDE
# FILES_MATCHING creates empty directories:
# https://gitlab.kitware.com/cmake/cmake/-/issues/17122 Exclude the ones that
# this affects explicitly.
PATTERN "script_opt/CPP/maint" EXCLUDE
PATTERN "fuzzers/corpora" EXCLUDE)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/
DESTINATION include/zeek
FILES_MATCHING
PATTERN "*.bif.func_h"
PATTERN "*.bif.netvar_h"
PATTERN "*.bif.h"
PATTERN "CMakeFiles" EXCLUDE
# The "include/zeek -> .." symlink isn't needed in the install-tree
REGEX "${escaped_include_path}$" EXCLUDE
)
install(
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/
DESTINATION include/zeek
FILES_MATCHING
PATTERN "*.bif.func_h"
PATTERN "*.bif.netvar_h"
PATTERN "*.bif.h"
PATTERN "CMakeFiles" EXCLUDE
# The "include/zeek -> .." symlink isn't needed in the install-tree
REGEX "${escaped_include_path}$" EXCLUDE)
install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/ConvertUTF.h
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/bro_inet_ntop.h # Remove in v6.1
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/zeek_inet_ntop.h
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/bsd-getopt-long.h
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/modp_numtoa.h
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/patricia.h
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/setsignal.h
$<$<BOOL:USE_SQLITE>:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/sqlite3.h>
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/doctest.h
DESTINATION include/zeek/3rdparty
)
install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/ConvertUTF.h
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/bro_inet_ntop.h # Remove in v6.1
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/zeek_inet_ntop.h
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/bsd-getopt-long.h
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/modp_numtoa.h
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/patricia.h
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/setsignal.h
$<$<BOOL:USE_SQLITE>:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/sqlite3.h>
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/doctest.h
DESTINATION include/zeek/3rdparty)
########################################################################
## Clang-tidy target now that we have all of the sources
# ##############################################################################
# Clang-tidy target now that we have all of the sources
add_clang_tidy_files(${MAIN_SRCS})
@ -685,23 +633,22 @@ add_clang_tidy_files(${MAIN_SRCS})
# *.bif.register.cc)
create_clang_tidy_target()
########################################################################
## CTest setup.
# ##############################################################################
# CTest setup.
# Scan all .cc files for TEST_CASE macros and generate CTest targets.
if (ENABLE_ZEEK_UNIT_TESTS)
set(test_cases "")
foreach (cc_file ${TIDY_SRCS})
file (STRINGS ${cc_file} test_case_lines REGEX "TEST_CASE")
file(STRINGS ${cc_file} test_case_lines REGEX "TEST_CASE")
foreach (line ${test_case_lines})
string(REGEX REPLACE "TEST_CASE\\(\"(.+)\"\\)" "\\1" test_case "${line}")
list(APPEND test_cases "${test_case}")
endforeach ()
endforeach ()
list(LENGTH test_cases num_test_cases)
MESSAGE(STATUS "-- Found ${num_test_cases} test cases for CTest")
message(STATUS "-- Found ${num_test_cases} test cases for CTest")
foreach (test_case ${test_cases})
add_test(NAME "\"${test_case}\""
COMMAND zeek --test "--test-case=${test_case}")
add_test(NAME "\"${test_case}\"" COMMAND zeek --test "--test-case=${test_case}")
endforeach ()
endif ()

View file

@ -1,12 +1,14 @@
zeek_add_subdir_library(
analyzer
INTERNAL_DEPENDENCIES ${BIF_BUILD_TARGET}
INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
INTERNAL_DEPENDENCIES
${BIF_BUILD_TARGET}
INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
SOURCES
Analyzer.cc
Component.cc
Manager.cc
)
Analyzer.cc
Component.cc
Manager.cc)
# Treat BIFs as builtin (alternative mode).
bif_target(analyzer.bif)

View file

@ -2,13 +2,12 @@ zeek_add_plugin(
Zeek
BitTorrent
SOURCES
BitTorrent.cc
BitTorrentTracker.cc
Plugin.cc
BitTorrent.cc
BitTorrentTracker.cc
Plugin.cc
BIFS
events.bif
events.bif
PAC
bittorrent.pac
bittorrent-analyzer.pac
bittorrent-protocol.pac
)
bittorrent.pac
bittorrent-analyzer.pac
bittorrent-protocol.pac)

View file

@ -2,9 +2,8 @@ zeek_add_plugin(
Zeek
ConnSize
SOURCES
ConnSize.cc
Plugin.cc
ConnSize.cc
Plugin.cc
BIFS
events.bif
functions.bif
)
events.bif
functions.bif)

View file

@ -2,17 +2,16 @@ zeek_add_plugin(
Zeek
DCE_RPC
SOURCES
DCE_RPC.cc
Plugin.cc
DCE_RPC.cc
Plugin.cc
BIFS
consts.bif
types.bif
events.bif
consts.bif
types.bif
events.bif
PAC
dce_rpc.pac
dce_rpc-protocol.pac
dce_rpc-analyzer.pac
dce_rpc-auth.pac
endpoint-atsvc.pac
endpoint-epmapper.pac
)
dce_rpc.pac
dce_rpc-protocol.pac
dce_rpc-analyzer.pac
dce_rpc-auth.pac
endpoint-atsvc.pac
endpoint-epmapper.pac)

View file

@ -2,14 +2,13 @@ zeek_add_plugin(
Zeek
DHCP
SOURCES
DHCP.cc
Plugin.cc
DHCP.cc
Plugin.cc
BIFS
events.bif
types.bif
events.bif
types.bif
PAC
dhcp.pac
dhcp-protocol.pac
dhcp-analyzer.pac
dhcp-options.pac
)
dhcp.pac
dhcp-protocol.pac
dhcp-analyzer.pac
dhcp-options.pac)

View file

@ -2,13 +2,12 @@ zeek_add_plugin(
Zeek
DNP3
SOURCES
DNP3.cc
Plugin.cc
DNP3.cc
Plugin.cc
BIFS
events.bif
events.bif
PAC
dnp3.pac
dnp3-analyzer.pac
dnp3-protocol.pac
dnp3-objects.pac
)
dnp3.pac
dnp3-analyzer.pac
dnp3-protocol.pac
dnp3-objects.pac)

View file

@ -2,8 +2,7 @@ zeek_add_plugin(
Zeek
DNS
SOURCES
DNS.cc
Plugin.cc
DNS.cc
Plugin.cc
BIFS
events.bif
)
events.bif)

View file

@ -2,8 +2,7 @@ zeek_add_plugin(
Zeek
File
SOURCES
File.cc
Plugin.cc
File.cc
Plugin.cc
BIFS
events.bif
)
events.bif)

View file

@ -1,9 +1,8 @@
spicy_add_analyzer(
NAME
NAME
Finger
SOURCES
SOURCES
finger.spicy
finger.evt
LEGACY
legacy
)
LEGACY
legacy)

View file

@ -2,8 +2,7 @@ zeek_add_plugin(
Zeek
Finger
SOURCES
Finger.cc
Plugin.cc
Finger.cc
Plugin.cc
BIFS
events.bif
)
events.bif)

View file

@ -2,9 +2,8 @@ zeek_add_plugin(
Zeek
FTP
SOURCES
FTP.cc
Plugin.cc
FTP.cc
Plugin.cc
BIFS
events.bif
functions.bif
)
events.bif
functions.bif)

View file

@ -2,8 +2,7 @@ zeek_add_plugin(
Zeek
Gnutella
SOURCES
Gnutella.cc
Plugin.cc
Gnutella.cc
Plugin.cc
BIFS
events.bif
)
events.bif)

View file

@ -2,13 +2,12 @@ zeek_add_plugin(
Zeek
GSSAPI
SOURCES
GSSAPI.cc
Plugin.cc
GSSAPI.cc
Plugin.cc
BIFS
events.bif
events.bif
PAC
gssapi.pac
gssapi-protocol.pac
gssapi-analyzer.pac
${PROJECT_SOURCE_DIR}/src/analyzer/protocol/asn1/asn1.pac
)
gssapi.pac
gssapi-protocol.pac
gssapi-analyzer.pac
${PROJECT_SOURCE_DIR}/src/analyzer/protocol/asn1/asn1.pac)

View file

@ -2,9 +2,8 @@ zeek_add_plugin(
Zeek
HTTP
SOURCES
HTTP.cc
Plugin.cc
HTTP.cc
Plugin.cc
BIFS
events.bif
functions.bif
)
events.bif
functions.bif)

View file

@ -2,8 +2,7 @@ zeek_add_plugin(
Zeek
Ident
SOURCES
Ident.cc
Plugin.cc
Ident.cc
Plugin.cc
BIFS
events.bif
)
events.bif)

View file

@ -2,12 +2,11 @@ zeek_add_plugin(
Zeek
IMAP
SOURCES
Plugin.cc
IMAP.cc
Plugin.cc
IMAP.cc
BIFS
events.bif
events.bif
PAC
imap.pac
imap-analyzer.pac
imap-protocol.pac
)
imap.pac
imap-analyzer.pac
imap-protocol.pac)

View file

@ -2,8 +2,7 @@ zeek_add_plugin(
Zeek
IRC
SOURCES
IRC.cc
Plugin.cc
IRC.cc
Plugin.cc
BIFS
events.bif
)
events.bif)

View file

@ -2,28 +2,27 @@ zeek_add_plugin(
Zeek
KRB
SOURCES
Plugin.cc
KRB.cc
KRB_TCP.cc
Plugin.cc
KRB.cc
KRB_TCP.cc
BIFS
types.bif
events.bif
types.bif
events.bif
PAC
krb.pac
krb-protocol.pac
krb-analyzer.pac
krb-asn1.pac
krb-defs.pac
krb-types.pac
krb-padata.pac
${PROJECT_SOURCE_DIR}/src/analyzer/protocol/asn1/asn1.pac
krb.pac
krb-protocol.pac
krb-analyzer.pac
krb-asn1.pac
krb-defs.pac
krb-types.pac
krb-padata.pac
${PROJECT_SOURCE_DIR}/src/analyzer/protocol/asn1/asn1.pac
PAC
krb_TCP.pac
krb-protocol.pac
krb-analyzer.pac
krb-asn1.pac
krb-defs.pac
krb-types.pac
krb-padata.pac
${PROJECT_SOURCE_DIR}/src/analyzer/protocol/asn1/asn1.pac
)
krb_TCP.pac
krb-protocol.pac
krb-analyzer.pac
krb-asn1.pac
krb-defs.pac
krb-types.pac
krb-padata.pac
${PROJECT_SOURCE_DIR}/src/analyzer/protocol/asn1/asn1.pac)

View file

@ -2,13 +2,12 @@ zeek_add_plugin(
Zeek
Login
SOURCES
Login.cc
RSH.cc
Telnet.cc
Rlogin.cc
NVT.cc
Plugin.cc
Login.cc
RSH.cc
Telnet.cc
Rlogin.cc
NVT.cc
Plugin.cc
BIFS
events.bif
functions.bif
)
events.bif
functions.bif)

View file

@ -7,8 +7,7 @@ zeek_add_plugin(
Zeek
MIME
SOURCES
MIME.cc
Plugin.cc
MIME.cc
Plugin.cc
BIFS
events.bif
)
events.bif)

View file

@ -2,12 +2,11 @@ zeek_add_plugin(
Zeek
Modbus
SOURCES
Modbus.cc
Plugin.cc
Modbus.cc
Plugin.cc
BIFS
events.bif
events.bif
PAC
modbus.pac
modbus-analyzer.pac
modbus-protocol.pac
)
modbus.pac
modbus-analyzer.pac
modbus-protocol.pac)

View file

@ -2,26 +2,25 @@ zeek_add_plugin(
Zeek
MQTT
SOURCES
MQTT.cc
Plugin.cc
MQTT.cc
Plugin.cc
BIFS
types.bif
events.bif
types.bif
events.bif
PAC
mqtt.pac
mqtt-protocol.pac
commands/connect.pac
commands/connack.pac
commands/publish.pac
commands/puback.pac
commands/pubrec.pac
commands/pubrel.pac
commands/pubcomp.pac
commands/subscribe.pac
commands/suback.pac
commands/unsuback.pac
commands/unsubscribe.pac
commands/disconnect.pac
commands/pingreq.pac
commands/pingresp.pac
)
mqtt.pac
mqtt-protocol.pac
commands/connect.pac
commands/connack.pac
commands/publish.pac
commands/puback.pac
commands/pubrec.pac
commands/pubrel.pac
commands/pubcomp.pac
commands/subscribe.pac
commands/suback.pac
commands/unsuback.pac
commands/unsubscribe.pac
commands/disconnect.pac
commands/pingreq.pac
commands/pingresp.pac)

View file

@ -2,12 +2,11 @@ zeek_add_plugin(
Zeek
MySQL
SOURCES
MySQL.cc
Plugin.cc
MySQL.cc
Plugin.cc
BIFS
events.bif
events.bif
PAC
mysql.pac
mysql-analyzer.pac
mysql-protocol.pac
)
mysql.pac
mysql-analyzer.pac
mysql-protocol.pac)

View file

@ -2,11 +2,10 @@ zeek_add_plugin(
Zeek
NCP
SOURCES
NCP.cc
Plugin.cc
NCP.cc
Plugin.cc
BIFS
events.bif
consts.bif
events.bif
consts.bif
PAC
ncp.pac
)
ncp.pac)

View file

@ -2,9 +2,8 @@ zeek_add_plugin(
Zeek
NetBIOS
SOURCES
NetbiosSSN.cc
Plugin.cc
NetbiosSSN.cc
Plugin.cc
BIFS
events.bif
functions.bif
)
events.bif
functions.bif)

View file

@ -2,13 +2,12 @@ zeek_add_plugin(
Zeek
NTLM
SOURCES
NTLM.cc
Plugin.cc
NTLM.cc
Plugin.cc
BIFS
types.bif
events.bif
types.bif
events.bif
PAC
ntlm.pac
ntlm-protocol.pac
ntlm-analyzer.pac
)
ntlm.pac
ntlm-protocol.pac
ntlm-analyzer.pac)

View file

@ -2,14 +2,13 @@ zeek_add_plugin(
Zeek
NTP
SOURCES
NTP.cc
Plugin.cc
NTP.cc
Plugin.cc
BIFS
types.bif
events.bif
types.bif
events.bif
PAC
ntp.pac
ntp-analyzer.pac
ntp-mode7.pac
ntp-protocol.pac
)
ntp.pac
ntp-analyzer.pac
ntp-mode7.pac
ntp-protocol.pac)

View file

@ -1,7 +1 @@
zeek_add_plugin(
Zeek
PIA
SOURCES
PIA.cc
Plugin.cc
)
zeek_add_plugin(Zeek PIA SOURCES PIA.cc Plugin.cc)

View file

@ -2,8 +2,7 @@ zeek_add_plugin(
Zeek
POP3
SOURCES
POP3.cc
Plugin.cc
POP3.cc
Plugin.cc
BIFS
events.bif
)
events.bif)

View file

@ -2,12 +2,11 @@ zeek_add_plugin(
Zeek
RADIUS
SOURCES
RADIUS.cc
Plugin.cc
RADIUS.cc
Plugin.cc
BIFS
events.bif
events.bif
PAC
radius.pac
radius-analyzer.pac
radius-protocol.pac
)
radius.pac
radius-analyzer.pac
radius-protocol.pac)

View file

@ -2,19 +2,18 @@ zeek_add_plugin(
Zeek
RDP
SOURCES
RDPEUDP.cc
RDP.cc
Plugin.cc
RDPEUDP.cc
RDP.cc
Plugin.cc
BIFS
events.bif
types.bif
events.bif
types.bif
PAC
rdp.pac
rdp-analyzer.pac
rdp-protocol.pac
${PROJECT_SOURCE_DIR}/src/analyzer/protocol/asn1/asn1.pac
rdp.pac
rdp-analyzer.pac
rdp-protocol.pac
${PROJECT_SOURCE_DIR}/src/analyzer/protocol/asn1/asn1.pac
PAC
rdpeudp.pac
rdpeudp-analyzer.pac
rdpeudp-protocol.pac
)
rdpeudp.pac
rdpeudp-analyzer.pac
rdpeudp-protocol.pac)

View file

@ -2,12 +2,11 @@ zeek_add_plugin(
Zeek
RFB
SOURCES
RFB.cc
Plugin.cc
RFB.cc
Plugin.cc
BIFS
events.bif
events.bif
PAC
rfb.pac
rfb-analyzer.pac
rfb-protocol.pac
)
rfb.pac
rfb-analyzer.pac
rfb-protocol.pac)

View file

@ -2,12 +2,11 @@ zeek_add_plugin(
Zeek
RPC
SOURCES
RPC.cc
NFS.cc
MOUNT.cc
Portmap.cc
XDR.cc
Plugin.cc
RPC.cc
NFS.cc
MOUNT.cc
Portmap.cc
XDR.cc
Plugin.cc
BIFS
events.bif
)
events.bif)

View file

@ -2,17 +2,16 @@ zeek_add_plugin(
Zeek
SIP
SOURCES
Plugin.cc
SIP.cc
SIP_TCP.cc
Plugin.cc
SIP.cc
SIP_TCP.cc
BIFS
events.bif
events.bif
PAC
sip.pac
sip-analyzer.pac
sip-protocol.pac
sip.pac
sip-analyzer.pac
sip-protocol.pac
PAC
sip_TCP.pac
sip-protocol.pac
sip-analyzer.pac
)
sip_TCP.pac
sip-protocol.pac
sip-analyzer.pac)

View file

@ -2,88 +2,87 @@ zeek_add_plugin(
Zeek
SMB
SOURCES
SMB.cc
Plugin.cc
SMB.cc
Plugin.cc
BIFS
# SMB 1.
smb1_com_check_directory.bif
smb1_com_close.bif
smb1_com_create_directory.bif
smb1_com_echo.bif
smb1_com_logoff_andx.bif
smb1_com_negotiate.bif
smb1_com_nt_create_andx.bif
smb1_com_nt_cancel.bif
smb1_com_query_information.bif
smb1_com_read_andx.bif
smb1_com_session_setup_andx.bif
smb1_com_transaction.bif
smb1_com_transaction_secondary.bif
smb1_com_transaction2.bif
smb1_com_transaction2_secondary.bif
smb1_com_tree_connect_andx.bif
smb1_com_tree_disconnect.bif
smb1_com_write_andx.bif
smb1_events.bif
# SMB 2.
smb2_com_close.bif
smb2_com_create.bif
smb2_com_negotiate.bif
smb2_com_read.bif
smb2_com_session_setup.bif
smb2_com_set_info.bif
smb2_com_tree_connect.bif
smb2_com_tree_disconnect.bif
smb2_com_write.bif
smb2_com_transform_header.bif
smb2_events.bif
# Common boilerplate.
events.bif
consts.bif
types.bif
# SMB 1.
smb1_com_check_directory.bif
smb1_com_close.bif
smb1_com_create_directory.bif
smb1_com_echo.bif
smb1_com_logoff_andx.bif
smb1_com_negotiate.bif
smb1_com_nt_create_andx.bif
smb1_com_nt_cancel.bif
smb1_com_query_information.bif
smb1_com_read_andx.bif
smb1_com_session_setup_andx.bif
smb1_com_transaction.bif
smb1_com_transaction_secondary.bif
smb1_com_transaction2.bif
smb1_com_transaction2_secondary.bif
smb1_com_tree_connect_andx.bif
smb1_com_tree_disconnect.bif
smb1_com_write_andx.bif
smb1_events.bif
# SMB 2.
smb2_com_close.bif
smb2_com_create.bif
smb2_com_negotiate.bif
smb2_com_read.bif
smb2_com_session_setup.bif
smb2_com_set_info.bif
smb2_com_tree_connect.bif
smb2_com_tree_disconnect.bif
smb2_com_write.bif
smb2_com_transform_header.bif
smb2_events.bif
# Common boilerplate.
events.bif
consts.bif
types.bif
PAC
# Common boilerplate.
smb.pac
smb-common.pac
smb-strings.pac
smb-time.pac
smb-pipe.pac
smb-gssapi.pac
smb-mailslot.pac
# SMB 1.
smb1-protocol.pac
smb1-com-check-directory.pac
smb1-com-close.pac
smb1-com-create-directory.pac
smb1-com-echo.pac
smb1-com-locking-andx.pac
smb1-com-logoff-andx.pac
smb1-com-negotiate.pac
smb1-com-nt-cancel.pac
smb1-com-nt-create-andx.pac
smb1-com-nt-transact.pac
smb1-com-query-information.pac
smb1-com-read-andx.pac
smb1-com-session-setup-andx.pac
smb1-com-transaction-secondary.pac
smb1-com-transaction.pac
smb1-com-transaction2.pac
smb1-com-transaction2-secondary.pac
smb1-com-tree-connect-andx.pac
smb1-com-tree-disconnect.pac
smb1-com-write-andx.pac
# SMB 2.
smb2-protocol.pac
smb2-com-close.pac
smb2-com-create.pac
smb2-com-ioctl.pac
smb2-com-lock.pac
smb2-com-negotiate.pac
smb2-com-read.pac
smb2-com-session-setup.pac
smb2-com-set-info.pac
smb2-com-tree-connect.pac
smb2-com-tree-disconnect.pac
smb2-com-write.pac
smb2-com-transform-header.pac
)
# Common boilerplate.
smb.pac
smb-common.pac
smb-strings.pac
smb-time.pac
smb-pipe.pac
smb-gssapi.pac
smb-mailslot.pac
# SMB 1.
smb1-protocol.pac
smb1-com-check-directory.pac
smb1-com-close.pac
smb1-com-create-directory.pac
smb1-com-echo.pac
smb1-com-locking-andx.pac
smb1-com-logoff-andx.pac
smb1-com-negotiate.pac
smb1-com-nt-cancel.pac
smb1-com-nt-create-andx.pac
smb1-com-nt-transact.pac
smb1-com-query-information.pac
smb1-com-read-andx.pac
smb1-com-session-setup-andx.pac
smb1-com-transaction-secondary.pac
smb1-com-transaction.pac
smb1-com-transaction2.pac
smb1-com-transaction2-secondary.pac
smb1-com-tree-connect-andx.pac
smb1-com-tree-disconnect.pac
smb1-com-write-andx.pac
# SMB 2.
smb2-protocol.pac
smb2-com-close.pac
smb2-com-create.pac
smb2-com-ioctl.pac
smb2-com-lock.pac
smb2-com-negotiate.pac
smb2-com-read.pac
smb2-com-session-setup.pac
smb2-com-set-info.pac
smb2-com-tree-connect.pac
smb2-com-tree-disconnect.pac
smb2-com-write.pac
smb2-com-transform-header.pac)

View file

@ -2,9 +2,8 @@ zeek_add_plugin(
Zeek
SMTP
SOURCES
SMTP.cc
Plugin.cc
SMTP.cc
Plugin.cc
BIFS
events.bif
functions.bif
)
events.bif
functions.bif)

View file

@ -2,14 +2,13 @@ zeek_add_plugin(
Zeek
SNMP
SOURCES
SNMP.cc
Plugin.cc
SNMP.cc
Plugin.cc
BIFS
types.bif
events.bif
types.bif
events.bif
PAC
snmp.pac
snmp-protocol.pac
snmp-analyzer.pac
${PROJECT_SOURCE_DIR}/src/analyzer/protocol/asn1/asn1.pac
)
snmp.pac
snmp-protocol.pac
snmp-analyzer.pac
${PROJECT_SOURCE_DIR}/src/analyzer/protocol/asn1/asn1.pac)

View file

@ -2,12 +2,11 @@ zeek_add_plugin(
Zeek
SOCKS
SOURCES
SOCKS.cc
Plugin.cc
SOCKS.cc
Plugin.cc
BIFS
events.bif
events.bif
PAC
socks.pac
socks-protocol.pac
socks-analyzer.pac
)
socks.pac
socks-protocol.pac
socks-analyzer.pac)

View file

@ -2,14 +2,13 @@ zeek_add_plugin(
Zeek
SSH
SOURCES
SSH.cc
Plugin.cc
SSH.cc
Plugin.cc
BIFS
types.bif
events.bif
types.bif
events.bif
PAC
ssh.pac
ssh-analyzer.pac
ssh-protocol.pac
consts.pac
)
ssh.pac
ssh-analyzer.pac
ssh-protocol.pac
consts.pac)

View file

@ -2,34 +2,33 @@ zeek_add_plugin(
Zeek
SSL
SOURCES
SSL.cc
DTLS.cc
Plugin.cc
SSL.cc
DTLS.cc
Plugin.cc
BIFS
types.bif
events.bif
functions.bif
consts.bif
types.bif
events.bif
functions.bif
consts.bif
PAC
tls-handshake.pac
tls-handshake-protocol.pac
tls-handshake-analyzer.pac
ssl-defs.pac
proc-certificate.pac
tls-handshake-signed_certificate_timestamp.pac
tls-handshake.pac
tls-handshake-protocol.pac
tls-handshake-analyzer.pac
ssl-defs.pac
proc-certificate.pac
tls-handshake-signed_certificate_timestamp.pac
PAC
ssl.pac
ssl-dtls-analyzer.pac
ssl-analyzer.pac
ssl-dtls-protocol.pac
ssl-protocol.pac
ssl-defs.pac
proc-certificate.pac
ssl.pac
ssl-dtls-analyzer.pac
ssl-analyzer.pac
ssl-dtls-protocol.pac
ssl-protocol.pac
ssl-defs.pac
proc-certificate.pac
PAC
dtls.pac
ssl-dtls-analyzer.pac
dtls-analyzer.pac
ssl-dtls-protocol.pac
dtls-protocol.pac
ssl-defs.pac
)
dtls.pac
ssl-dtls-analyzer.pac
dtls-analyzer.pac
ssl-dtls-protocol.pac
dtls-protocol.pac
ssl-defs.pac)

View file

@ -1,9 +1,8 @@
spicy_add_analyzer(
NAME
NAME
Syslog
SOURCES
SOURCES
syslog.spicy
syslog.evt
LEGACY
legacy
)
LEGACY
legacy)

View file

@ -2,12 +2,11 @@ zeek_add_plugin(
Zeek
Syslog
SOURCES
Syslog.cc
Plugin.cc
Syslog.cc
Plugin.cc
BIFS
events.bif
events.bif
PAC
syslog.pac
syslog-analyzer.pac
syslog-protocol.pac
)
syslog.pac
syslog-analyzer.pac
syslog-protocol.pac)

View file

@ -2,13 +2,12 @@ zeek_add_plugin(
Zeek
TCP
SOURCES
TCP.cc
TCP_Endpoint.cc
TCP_Reassembler.cc
ContentLine.cc
Plugin.cc
TCP.cc
TCP_Endpoint.cc
TCP_Reassembler.cc
ContentLine.cc
Plugin.cc
BIFS
events.bif
types.bif
functions.bif
)
events.bif
types.bif
functions.bif)

View file

@ -2,12 +2,11 @@ zeek_add_plugin(
Zeek
XMPP
SOURCES
Plugin.cc
XMPP.cc
Plugin.cc
XMPP.cc
BIFS
events.bif
events.bif
PAC
xmpp.pac
xmpp-analyzer.pac
xmpp-protocol.pac
)
xmpp.pac
xmpp-analyzer.pac
xmpp-protocol.pac)

View file

@ -1,7 +1 @@
zeek_add_plugin(
Zeek
ZIP
SOURCES
ZIP.cc
Plugin.cc
)
zeek_add_plugin(Zeek ZIP SOURCES ZIP.cc Plugin.cc)

View file

@ -1,13 +1,14 @@
zeek_add_subdir_library(
comm
INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
SOURCES
Data.cc
Manager.cc
Store.cc
Data.cc
Manager.cc
Store.cc
BIFS
comm.bif
data.bif
messaging.bif
store.bif
)
comm.bif
data.bif
messaging.bif
store.bif)

View file

@ -1,16 +1,17 @@
zeek_add_subdir_library(
file_analysis
INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
SOURCES
Manager.cc
File.cc
FileTimer.cc
FileReassembler.cc
Analyzer.cc
AnalyzerSet.cc
Component.cc
Manager.cc
File.cc
FileTimer.cc
FileReassembler.cc
Analyzer.cc
AnalyzerSet.cc
Component.cc
BIFS
file_analysis.bif
)
file_analysis.bif)
add_subdirectory(analyzer)

View file

@ -2,8 +2,7 @@ zeek_add_plugin(
Zeek
FileDataEvent
SOURCES
DataEvent.cc
Plugin.cc
DataEvent.cc
Plugin.cc
INCLUDE_DIRS
"${CMAKE_CURRENT_SOURCE_DIR}"
)
"${CMAKE_CURRENT_SOURCE_DIR}")

View file

@ -2,8 +2,7 @@ zeek_add_plugin(
Zeek
FileEntropy
SOURCES
Entropy.cc
Plugin.cc
Entropy.cc
Plugin.cc
BIFS
events.bif
)
events.bif)

View file

@ -2,9 +2,8 @@ zeek_add_plugin(
Zeek
FileExtract
SOURCES
Extract.cc
Plugin.cc
Extract.cc
Plugin.cc
BIFS
events.bif
functions.bif
)
events.bif
functions.bif)

View file

@ -2,8 +2,7 @@ zeek_add_plugin(
Zeek
FileHash
SOURCES
Hash.cc
Plugin.cc
Hash.cc
Plugin.cc
BIFS
events.bif
)
events.bif)

View file

@ -2,15 +2,14 @@ zeek_add_plugin(
Zeek
PE
SOURCES
PE.cc
Plugin.cc
PE.cc
Plugin.cc
BIFS
events.bif
events.bif
PAC
pe.pac
pe-analyzer.pac
pe-file-headers.pac
pe-file-idata.pac
pe-file.pac
pe-file-types.pac
)
pe.pac
pe-analyzer.pac
pe-file-headers.pac
pe-file-idata.pac
pe-file.pac
pe-file-types.pac)

View file

@ -2,16 +2,15 @@ zeek_add_plugin(
Zeek
X509
SOURCES
X509Common.cc
X509.cc
OCSP.cc
Plugin.cc
X509Common.cc
X509.cc
OCSP.cc
Plugin.cc
BIFS
events.bif
types.bif
functions.bif
ocsp_events.bif
events.bif
types.bif
functions.bif
ocsp_events.bif
PAC
x509-extension.pac
x509-signed_certificate_timestamp.pac
)
x509-extension.pac
x509-signed_certificate_timestamp.pac)

View file

@ -1,18 +1,18 @@
########################################################################
## Fuzzing targets
# ##############################################################################
# Fuzzing targets
if ( NOT ZEEK_ENABLE_FUZZERS )
if (NOT ZEEK_ENABLE_FUZZERS)
return()
endif ()
if ( NOT DEFINED ZEEK_FUZZING_ENGINE AND DEFINED ENV{LIB_FUZZING_ENGINE} )
if ( "$ENV{LIB_FUZZING_ENGINE}" STREQUAL "" )
if (NOT DEFINED ZEEK_FUZZING_ENGINE AND DEFINED ENV{LIB_FUZZING_ENGINE})
if ("$ENV{LIB_FUZZING_ENGINE}" STREQUAL "")
# Empty LIB_FUZZING_ENGINE, assume libFuzzer
set(ZEEK_FUZZING_ENGINE "-fsanitize=fuzzer" CACHE INTERNAL "" FORCE)
else ()
STRING(SUBSTRING "$ENV{LIB_FUZZING_ENGINE}" 0 1 _first_char)
string(SUBSTRING "$ENV{LIB_FUZZING_ENGINE}" 0 1 _first_char)
if ( "${_first_char}" STREQUAL "-" OR EXISTS "$ENV{LIB_FUZZING_ENGINE}" )
if ("${_first_char}" STREQUAL "-" OR EXISTS "$ENV{LIB_FUZZING_ENGINE}")
# Looks like a linker flag or valid file, use it
set(ZEEK_FUZZING_ENGINE "$ENV{LIB_FUZZING_ENGINE}" CACHE INTERNAL "" FORCE)
else ()
@ -23,37 +23,36 @@ if ( NOT DEFINED ZEEK_FUZZING_ENGINE AND DEFINED ENV{LIB_FUZZING_ENGINE} )
endif ()
# The bind library is handled a bit hack-ishly since it defaults to linking it
# as static library by default on Linux, but at least on one common distro,
# that static library wasn't compiled with -fPIC and so not usable in the
# shared library we're trying to build. So instead, the fuzzer executable, not
# the shared lib, links it.
# as static library by default on Linux, but at least on one common distro, that
# static library wasn't compiled with -fPIC and so not usable in the shared
# library we're trying to build. So instead, the fuzzer executable, not the
# shared lib, links it.
string(REGEX MATCH ".*\\.a$" _have_static_bind_lib "${BIND_LIBRARY}")
macro(SETUP_FUZZ_TARGET _fuzz_target _fuzz_source)
macro (SETUP_FUZZ_TARGET _fuzz_target _fuzz_source)
add_executable(${_fuzz_target} ${_fuzz_source} ${ARGN})
target_link_libraries(${_fuzz_target} zeek_fuzzer_shared)
if ( _have_static_bind_lib )
if (_have_static_bind_lib)
target_link_libraries(${_fuzz_target} ${BIND_LIBRARY})
endif ()
target_link_libraries(${_fuzz_target} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
if ( DEFINED ZEEK_FUZZING_ENGINE )
if (DEFINED ZEEK_FUZZING_ENGINE)
target_link_libraries(${_fuzz_target} ${ZEEK_FUZZING_ENGINE})
else ()
target_link_libraries(${_fuzz_target}
$<TARGET_OBJECTS:zeek_fuzzer_standalone>)
target_link_libraries(${_fuzz_target} $<TARGET_OBJECTS:zeek_fuzzer_standalone>)
endif ()
endmacro()
endmacro ()
macro(ADD_FUZZ_TARGET _name)
macro (ADD_FUZZ_TARGET _name)
set(_fuzz_target zeek-${_name}-fuzzer)
set(_fuzz_source ${_name}-fuzzer.cc)
setup_fuzz_target(${_fuzz_target} ${_fuzz_source})
endmacro ()
macro(ADD_GENERIC_ANALYZER_FUZZ_TARGET _name)
macro (ADD_GENERIC_ANALYZER_FUZZ_TARGET _name)
set(_fuzz_target zeek-${_name}-fuzzer)
set(_fuzz_source generic-analyzer-fuzzer.cc)
setup_fuzz_target(${_fuzz_target} ${_fuzz_source})
@ -68,9 +67,9 @@ target_sources(zeek_fuzzer_shared PRIVATE FuzzBuffer.cc)
set(zeek_fuzzer_shared_deps)
foreach(_dep ${zeekdeps} )
if ( "${_dep}" STREQUAL "${BIND_LIBRARY}" )
if ( NOT _have_static_bind_lib )
foreach (_dep ${zeekdeps})
if ("${_dep}" STREQUAL "${BIND_LIBRARY}")
if (NOT _have_static_bind_lib)
set(zeek_fuzzer_shared_deps ${zeek_fuzzer_shared_deps} ${_dep})
endif ()
else ()
@ -78,9 +77,8 @@ foreach(_dep ${zeekdeps} )
endif ()
endforeach ()
target_link_libraries(zeek_fuzzer_shared PUBLIC
${zeek_fuzzer_shared_deps}
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
target_link_libraries(zeek_fuzzer_shared PUBLIC ${zeek_fuzzer_shared_deps}
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
add_fuzz_target(packet)
add_fuzz_target(dns)
@ -104,26 +102,27 @@ add_generic_analyzer_fuzz_target(radius)
add_generic_analyzer_fuzz_target(rdp)
add_generic_analyzer_fuzz_target(rdpeudp)
add_generic_analyzer_fuzz_target(rfb)
add_generic_analyzer_fuzz_target(mount) #rpc
add_generic_analyzer_fuzz_target(nfs) #rpc
add_generic_analyzer_fuzz_target(portmapper) #rpc
add_generic_analyzer_fuzz_target(mount) # rpc
add_generic_analyzer_fuzz_target(nfs) # rpc
add_generic_analyzer_fuzz_target(portmapper) # rpc
add_generic_analyzer_fuzz_target(sip)
add_generic_analyzer_fuzz_target(smb)
add_generic_analyzer_fuzz_target(snmp)
add_generic_analyzer_fuzz_target(ssh)
add_generic_analyzer_fuzz_target(syslog)
#add_generic_analyzer_fuzz_target(finger) # no pcap files
#add_generic_analyzer_fuzz_target(gssapi) # only samples are embedded in smb
#add_generic_analyzer_fuzz_target(ident) # no pcap files
#add_generic_analyzer_fuzz_target(krb) # should these just be handled by smb?
#add_generic_analyzer_fuzz_target(krb_tcp) # should these just be handled by smb?
#add_generic_analyzer_fuzz_target(rsh) # login - no pcap files
#add_generic_analyzer_fuzz_target(rlogin) # login - no pcap files
#add_generic_analyzer_fuzz_target(telnet) # login - no pcap files
#add_generic_analyzer_fuzz_target(netbios) # no pcap files
#add_generic_analyzer_fuzz_target(ntlm) # only samples are embedded in dce-rpc or smb
#add_generic_analyzer_fuzz_target(xdr) # rpc - no pcap files
#add_generic_analyzer_fuzz_target(sip_tcp) # unnecessary?
#add_generic_analyzer_fuzz_target(socks) # can this one be tested by adding SOCKS pkts to the HTTP corpus?
#add_generic_analyzer_fuzz_target(xmpp) # no pcap files
# add_generic_analyzer_fuzz_target(finger) # no pcap files
# add_generic_analyzer_fuzz_target(gssapi) # only samples are embedded in smb
# add_generic_analyzer_fuzz_target(ident) # no pcap files
# add_generic_analyzer_fuzz_target(krb) # should these just be handled by
# smb? add_generic_analyzer_fuzz_target(krb_tcp) # should these just be handled
# by smb? add_generic_analyzer_fuzz_target(rsh) # login - no pcap files
# add_generic_analyzer_fuzz_target(rlogin) # login - no pcap files
# add_generic_analyzer_fuzz_target(telnet) # login - no pcap files
# add_generic_analyzer_fuzz_target(netbios) # no pcap files
# add_generic_analyzer_fuzz_target(ntlm) # only samples are embedded in
# dce-rpc or smb add_generic_analyzer_fuzz_target(xdr) # rpc - no pcap files
# add_generic_analyzer_fuzz_target(sip_tcp) # unnecessary?
# add_generic_analyzer_fuzz_target(socks) # can this one be tested by adding
# SOCKS pkts to the HTTP corpus? add_generic_analyzer_fuzz_target(xmpp) # no
# pcap files

View file

@ -1,12 +1,11 @@
zeek_add_subdir_library(
input
SOURCES
Component.cc
Manager.cc
ReaderBackend.cc
ReaderFrontend.cc
Component.cc
Manager.cc
ReaderBackend.cc
ReaderFrontend.cc
BIFS
input.bif
)
input.bif)
add_subdirectory(readers)

View file

@ -1,4 +1,3 @@
add_subdirectory(ascii)
add_subdirectory(benchmark)
add_subdirectory(binary)
@ -6,4 +5,4 @@ add_subdirectory(config)
add_subdirectory(raw)
if (USE_SQLITE)
add_subdirectory(sqlite)
endif()
endif ()

View file

@ -2,8 +2,7 @@ zeek_add_plugin(
Zeek
AsciiReader
SOURCES
Ascii.cc
Plugin.cc
Ascii.cc
Plugin.cc
BIFS
ascii.bif
)
ascii.bif)

View file

@ -2,8 +2,7 @@ zeek_add_plugin(
Zeek
BenchmarkReader
SOURCES
Benchmark.cc
Plugin.cc
Benchmark.cc
Plugin.cc
BIFS
benchmark.bif
)
benchmark.bif)

View file

@ -2,8 +2,7 @@ zeek_add_plugin(
Zeek
BinaryReader
SOURCES
Binary.cc
Plugin.cc
Binary.cc
Plugin.cc
BIFS
binary.bif
)
binary.bif)

View file

@ -2,8 +2,7 @@ zeek_add_plugin(
Zeek
ConfigReader
SOURCES
Config.cc
Plugin.cc
Config.cc
Plugin.cc
BIFS
config.bif
)
config.bif)

View file

@ -2,8 +2,7 @@ zeek_add_plugin(
Zeek
RawReader
SOURCES
Raw.cc
Plugin.cc
Raw.cc
Plugin.cc
BIFS
raw.bif
)
raw.bif)

View file

@ -2,8 +2,7 @@ zeek_add_plugin(
Zeek
SQLiteReader
SOURCES
SQLite.cc
Plugin.cc
SQLite.cc
Plugin.cc
BIFS
sqlite.bif
)
sqlite.bif)

View file

@ -1,12 +1,11 @@
zeek_add_subdir_library(
iosource
SOURCES
BPF_Program.cc
Component.cc
Manager.cc
Packet.cc
PktDumper.cc
PktSrc.cc
)
BPF_Program.cc
Component.cc
Manager.cc
Packet.cc
PktDumper.cc
PktSrc.cc)
add_subdirectory(pcap)

View file

@ -1,11 +1,4 @@
zeek_add_plugin(
Zeek
Pcap
SOURCES
Source.cc
Dumper.cc
Plugin.cc
)
zeek_add_plugin(Zeek Pcap SOURCES Source.cc Dumper.cc Plugin.cc)
# Treat BIFs as builtin (alternative mode).
bif_target(pcap.bif)

View file

@ -1,12 +1,11 @@
zeek_add_subdir_library(
logging
SOURCES
Component.cc
Manager.cc
WriterBackend.cc
WriterFrontend.cc
Component.cc
Manager.cc
WriterBackend.cc
WriterFrontend.cc
BIFS
logging.bif
)
logging.bif)
add_subdirectory(writers)

View file

@ -1,6 +1,5 @@
add_subdirectory(ascii)
add_subdirectory(none)
if (USE_SQLITE)
add_subdirectory(sqlite)
endif()
endif ()

View file

@ -1,9 +1,8 @@
zeek_add_plugin(
Zeek
AsciiWriter
AsciiWriter
SOURCES
Ascii.cc
Plugin.cc
Ascii.cc
Plugin.cc
BIFS
ascii.bif
)
ascii.bif)

View file

@ -2,8 +2,7 @@ zeek_add_plugin(
Zeek
NoneWriter
SOURCES
None.cc
Plugin.cc
None.cc
Plugin.cc
BIFS
none.bif
)
none.bif)

View file

@ -2,8 +2,7 @@ zeek_add_plugin(
Zeek
SQLiteWriter
SOURCES
SQLite.cc
Plugin.cc
SQLite.cc
Plugin.cc
BIFS
sqlite.bif
)
sqlite.bif)

View file

@ -1,11 +1,12 @@
zeek_add_subdir_library(
packet_analysis
INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
SOURCES
Analyzer.cc
Dispatcher.cc
Manager.cc
Component.cc
)
Analyzer.cc
Dispatcher.cc
Manager.cc
Component.cc)
add_subdirectory(protocol)

View file

@ -2,8 +2,7 @@ zeek_add_plugin(
Zeek
ARP
SOURCES
ARP.cc
Plugin.cc
ARP.cc
Plugin.cc
BIFS
events.bif
)
events.bif)

View file

@ -1,7 +1 @@
zeek_add_plugin(
Zeek
AYIYA
SOURCES
AYIYA.cc
Plugin.cc
)
zeek_add_plugin(Zeek AYIYA SOURCES AYIYA.cc Plugin.cc)

View file

@ -1,7 +1 @@
zeek_add_plugin(
PacketAnalyzer
Ethernet
SOURCES
Ethernet.cc
Plugin.cc
)
zeek_add_plugin(PacketAnalyzer Ethernet SOURCES Ethernet.cc Plugin.cc)

View file

@ -1,7 +1 @@
zeek_add_plugin(
PacketAnalyzer
FDDI
SOURCES
FDDI.cc
Plugin.cc
)
zeek_add_plugin(PacketAnalyzer FDDI SOURCES FDDI.cc Plugin.cc)

View file

@ -2,8 +2,7 @@ zeek_add_plugin(
Zeek
Geneve
SOURCES
Geneve.cc
Plugin.cc
Geneve.cc
Plugin.cc
BIFS
events.bif
)
events.bif)

View file

@ -1,7 +1 @@
zeek_add_plugin(
PacketAnalyzer
GRE
SOURCES
GRE.cc
Plugin.cc
)
zeek_add_plugin(PacketAnalyzer GRE SOURCES GRE.cc Plugin.cc)

View file

@ -2,13 +2,12 @@ zeek_add_plugin(
Zeek
GTPv1
SOURCES
GTPv1.cc
Plugin.cc
GTPv1.cc
Plugin.cc
BIFS
events.bif
functions.bif
events.bif
functions.bif
PAC
gtpv1.pac
gtpv1-protocol.pac
gtpv1-analyzer.pac
)
gtpv1.pac
gtpv1-protocol.pac
gtpv1-analyzer.pac)

View file

@ -2,9 +2,8 @@ zeek_add_plugin(
Zeek
ICMP
SOURCES
ICMP.cc
ICMPSessionAdapter.cc
Plugin.cc
ICMP.cc
ICMPSessionAdapter.cc
Plugin.cc
BIFS
events.bif
)
events.bif)

View file

@ -1,7 +1 @@
zeek_add_plugin(
PacketAnalyzer
IEEE802_11
SOURCES
IEEE802_11.cc
Plugin.cc
)
zeek_add_plugin(PacketAnalyzer IEEE802_11 SOURCES IEEE802_11.cc Plugin.cc)

View file

@ -1,7 +1 @@
zeek_add_plugin(
PacketAnalyzer
IEEE802_11_Radio
SOURCES
IEEE802_11_Radio.cc
Plugin.cc
)
zeek_add_plugin(PacketAnalyzer IEEE802_11_Radio SOURCES IEEE802_11_Radio.cc Plugin.cc)

View file

@ -2,8 +2,7 @@ zeek_add_plugin(
PacketAnalyzer
IP
SOURCES
IP.cc
IPBasedAnalyzer.cc
SessionAdapter.cc
Plugin.cc
)
IP.cc
IPBasedAnalyzer.cc
SessionAdapter.cc
Plugin.cc)

View file

@ -1,7 +1 @@
zeek_add_plugin(
PacketAnalyzer
IPTunnel
SOURCES
IPTunnel.cc
Plugin.cc
)
zeek_add_plugin(PacketAnalyzer IPTunnel SOURCES IPTunnel.cc Plugin.cc)

View file

@ -1,7 +1 @@
zeek_add_plugin(
PacketAnalyzer
LinuxSLL
SOURCES
LinuxSLL.cc
Plugin.cc
)
zeek_add_plugin(PacketAnalyzer LinuxSLL SOURCES LinuxSLL.cc Plugin.cc)

View file

@ -1,7 +1 @@
zeek_add_plugin(
PacketAnalyzer
LinuxSLL2
SOURCES
LinuxSLL2.cc
Plugin.cc
)
zeek_add_plugin(PacketAnalyzer LinuxSLL2 SOURCES LinuxSLL2.cc Plugin.cc)

View file

@ -1,7 +1 @@
zeek_add_plugin(
PacketAnalyzer
LLC
SOURCES
LLC.cc
Plugin.cc
)
zeek_add_plugin(PacketAnalyzer LLC SOURCES LLC.cc Plugin.cc)

View file

@ -1,7 +1 @@
zeek_add_plugin(
PacketAnalyzer
MPLS
SOURCES
MPLS.cc
Plugin.cc
)
zeek_add_plugin(PacketAnalyzer MPLS SOURCES MPLS.cc Plugin.cc)

View file

@ -1,7 +1 @@
zeek_add_plugin(
PacketAnalyzer
NFLog
SOURCES
NFLog.cc
Plugin.cc
)
zeek_add_plugin(PacketAnalyzer NFLog SOURCES NFLog.cc Plugin.cc)

View file

@ -1,7 +1 @@
zeek_add_plugin(
PacketAnalyzer
Novell_802_3
SOURCES
Novell_802_3.cc
Plugin.cc
)
zeek_add_plugin(PacketAnalyzer Novell_802_3 SOURCES Novell_802_3.cc Plugin.cc)

View file

@ -1,7 +1 @@
zeek_add_plugin(
PacketAnalyzer
Null
SOURCES
Null.cc
Plugin.cc
)
zeek_add_plugin(PacketAnalyzer Null SOURCES Null.cc Plugin.cc)

View file

@ -1,4 +1,3 @@
include(ZeekPlugin)
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})

View file

@ -1,7 +1 @@
zeek_add_plugin(
PacketAnalyzer
PPPSerial
SOURCES
PPPSerial.cc
Plugin.cc
)
zeek_add_plugin(PacketAnalyzer PPPSerial SOURCES PPPSerial.cc Plugin.cc)

View file

@ -1,7 +1 @@
zeek_add_plugin(
PacketAnalyzer
PPPoE
SOURCES
PPPoE.cc
Plugin.cc
)
zeek_add_plugin(PacketAnalyzer PPPoE SOURCES PPPoE.cc Plugin.cc)

View file

@ -1,7 +1 @@
zeek_add_plugin(
PacketAnalyzer
Root
SOURCES
Root.cc
Plugin.cc
)
zeek_add_plugin(PacketAnalyzer Root SOURCES Root.cc Plugin.cc)

View file

@ -1,7 +1 @@
zeek_add_plugin(
PacketAnalyzer
Skip
SOURCES
Skip.cc
Plugin.cc
)
zeek_add_plugin(PacketAnalyzer Skip SOURCES Skip.cc Plugin.cc)

Some files were not shown because too many files have changed in this diff Show more