From 87528709678e450f6c9d5596af035711d627f871 Mon Sep 17 00:00:00 2001 From: Robin Sommer Date: Wed, 15 May 2013 20:22:51 -0700 Subject: [PATCH] Fixing cmake dependencies and "make {install,clean}" Also includes a bunch of cleanup. --- cmake | 2 +- src/CMakeLists.txt | 34 ++++++++++++------- src/FlowSrc.cc | 2 +- src/analyzer/CMakeLists.txt | 10 ++---- src/analyzer/Manager.cc | 18 +++++----- src/analyzer/protocol/arp/CMakeLists.txt | 2 +- src/analyzer/protocol/arp/Plugin.cc | 2 +- src/analyzer/protocol/ayiya/CMakeLists.txt | 2 +- src/analyzer/protocol/ayiya/Plugin.cc | 2 +- src/analyzer/protocol/backdoor/CMakeLists.txt | 2 +- src/analyzer/protocol/backdoor/Plugin.cc | 2 +- .../protocol/bittorrent/CMakeLists.txt | 2 +- src/analyzer/protocol/bittorrent/Plugin.cc | 2 +- .../protocol/conn-size/CMakeLists.txt | 2 +- src/analyzer/protocol/conn-size/Plugin.cc | 2 +- src/analyzer/protocol/dce-rpc/CMakeLists.txt | 3 +- src/analyzer/protocol/dce-rpc/Plugin.cc | 2 +- src/analyzer/protocol/dhcp/CMakeLists.txt | 2 +- src/analyzer/protocol/dhcp/Plugin.cc | 2 +- src/analyzer/protocol/dns/CMakeLists.txt | 2 +- src/analyzer/protocol/dns/Plugin.cc | 2 +- src/analyzer/protocol/file/CMakeLists.txt | 2 +- src/analyzer/protocol/file/Plugin.cc | 2 +- src/analyzer/protocol/finger/CMakeLists.txt | 2 +- src/analyzer/protocol/finger/Plugin.cc | 2 +- src/analyzer/protocol/ftp/CMakeLists.txt | 2 +- src/analyzer/protocol/ftp/Plugin.cc | 2 +- src/analyzer/protocol/gnutella/CMakeLists.txt | 2 +- src/analyzer/protocol/gnutella/Plugin.cc | 2 +- src/analyzer/protocol/gtpv1/CMakeLists.txt | 2 +- src/analyzer/protocol/gtpv1/Plugin.cc | 2 +- src/analyzer/protocol/http/CMakeLists.txt | 2 +- src/analyzer/protocol/http/Plugin.cc | 2 +- src/analyzer/protocol/icmp/CMakeLists.txt | 2 +- src/analyzer/protocol/icmp/Plugin.cc | 2 +- src/analyzer/protocol/ident/CMakeLists.txt | 2 +- src/analyzer/protocol/ident/Plugin.cc | 2 +- .../protocol/interconn/CMakeLists.txt | 2 +- src/analyzer/protocol/interconn/Plugin.cc | 2 +- src/analyzer/protocol/irc/CMakeLists.txt | 2 +- src/analyzer/protocol/irc/Plugin.cc | 2 +- src/analyzer/protocol/login/CMakeLists.txt | 2 +- src/analyzer/protocol/login/Plugin.cc | 2 +- src/analyzer/protocol/mime/CMakeLists.txt | 2 +- src/analyzer/protocol/mime/Plugin.cc | 2 +- src/analyzer/protocol/modbus/CMakeLists.txt | 2 +- src/analyzer/protocol/modbus/Plugin.cc | 2 +- src/analyzer/protocol/ncp/CMakeLists.txt | 2 +- src/analyzer/protocol/ncp/Plugin.cc | 2 +- src/analyzer/protocol/netbios/CMakeLists.txt | 5 ++- src/analyzer/protocol/netbios/Plugin.cc | 2 +- src/analyzer/protocol/netflow/CMakeLists.txt | 2 +- src/analyzer/protocol/netflow/Plugin.cc | 2 +- src/analyzer/protocol/ntp/CMakeLists.txt | 2 +- src/analyzer/protocol/ntp/Plugin.cc | 2 +- src/analyzer/protocol/pia/CMakeLists.txt | 2 +- src/analyzer/protocol/pia/Plugin.cc | 2 +- src/analyzer/protocol/pop3/CMakeLists.txt | 2 +- src/analyzer/protocol/pop3/Plugin.cc | 2 +- src/analyzer/protocol/rpc/CMakeLists.txt | 2 +- src/analyzer/protocol/rpc/Plugin.cc | 2 +- src/analyzer/protocol/smb/CMakeLists.txt | 3 +- src/analyzer/protocol/smb/Plugin.cc | 2 +- src/analyzer/protocol/smtp/CMakeLists.txt | 2 +- src/analyzer/protocol/smtp/Plugin.cc | 2 +- src/analyzer/protocol/socks/CMakeLists.txt | 2 +- src/analyzer/protocol/socks/Plugin.cc | 2 +- src/analyzer/protocol/ssh/CMakeLists.txt | 2 +- src/analyzer/protocol/ssh/Plugin.cc | 2 +- src/analyzer/protocol/ssl/CMakeLists.txt | 2 +- src/analyzer/protocol/ssl/Plugin.cc | 2 +- .../protocol/stepping-stone/CMakeLists.txt | 2 +- .../protocol/stepping-stone/Plugin.cc | 2 +- src/analyzer/protocol/syslog/CMakeLists.txt | 2 +- src/analyzer/protocol/syslog/Plugin.cc | 2 +- src/analyzer/protocol/tcp/CMakeLists.txt | 2 +- src/analyzer/protocol/tcp/Plugin.cc | 2 +- src/analyzer/protocol/teredo/CMakeLists.txt | 2 +- src/analyzer/protocol/teredo/Plugin.cc | 2 +- src/analyzer/protocol/udp/CMakeLists.txt | 2 +- src/analyzer/protocol/udp/Plugin.cc | 2 +- src/analyzer/protocol/zip/CMakeLists.txt | 2 +- src/analyzer/protocol/zip/Plugin.cc | 2 +- src/bro.bif | 2 -- src/builtin-func.l | 9 +++-- src/plugin/Macros.h | 8 ++--- 86 files changed, 130 insertions(+), 116 deletions(-) diff --git a/cmake b/cmake index c50757259f..0034421286 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit c50757259f509f13227cf28bbd4fd281828a39d2 +Subproject commit 0034421286f23a3d7ab2044d658c3ac72797569b diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b374c64d2c..0ab11fc85e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,6 +3,9 @@ include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR} ) +# This collects generated bif and pac files from subdirectories. +set(bro_ALL_GENERATED_OUTPUTS CACHE INTERNAL "automatically generated files" FORCE) + configure_file(version.c.in ${CMAKE_CURRENT_BINARY_DIR}/version.c) configure_file(util-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/util-config.h) @@ -114,11 +117,9 @@ set(BIF_SRCS ) foreach (bift ${BIF_SRCS}) - bif_target(${bift}) + bif_target(${bift} "standard") endforeach () -add_custom_target(generate_bifs DEPENDS ${ALL_BIF_OUTPUTS}) - ######################################################################## ## BinPAC-dependent targets @@ -131,7 +132,10 @@ set(BINPAC_AUXSRC ) binpac_target(binpac-lib.pac) +list(APPEND BINPAC_OUTPUTS "${BINPAC_OUTPUT_CC}") + binpac_target(binpac_bro-lib.pac) +list(APPEND BINPAC_OUTPUTS "${BINPAC_OUTPUT_CC}") ######################################################################## ## Including subdirectories. @@ -156,7 +160,7 @@ find_package (Threads) macro(COLLECT_HEADERS _var) foreach (src ${ARGN}) get_filename_component(ext ${src} EXT) - if (${ext} STREQUAL ".cc" OR ${ext} STREQUAL ".c") + if ("${ext}" STREQUAL ".cc" OR "${ext}" STREQUAL ".c") get_filename_component(base ${src} NAME_WE) get_filename_component(dir ${src} PATH) if (NOT "${dir}") @@ -189,10 +193,8 @@ set_source_files_properties(nb_dns.c PROPERTIES COMPILE_FLAGS set(bro_SRCS ${CMAKE_CURRENT_BINARY_DIR}/version.c ${BIF_SRCS} - ${ALL_BIF_OUTPUTS} ${BINPAC_AUXSRC} - ${ALL_BINPAC_INPUTS} - ${ALL_BINPAC_OUTPUTS} + ${BINPAC_OUTPUTS} ${TRANSFORMED_BISON_OUTPUTS} ${FLEX_RuleScanner_OUTPUTS} ${FLEX_RuleScanner_INPUT} @@ -333,12 +335,20 @@ add_executable(bro ${bro_SRCS} ${bro_HEADERS} ${bro_SUBDIRS}) target_link_libraries(bro ${brodeps} ${CMAKE_THREAD_LIBS_INIT}) install(TARGETS bro DESTINATION bin) -install(FILES ${INSTALL_BIF_OUTPUTS} DESTINATION ${BRO_SCRIPT_INSTALL_PATH}/base) set(BRO_EXE bro CACHE STRING "Bro executable binary" FORCE) -include(BroPlugin) -bro_plugin_bif_create_loader(bif_loader ${CMAKE_BINARY_DIR}/scripts/base/bif/plugins) -add_dependencies(bif_loader ${bro_SUBDIRS}) -add_dependencies(bro bif_loader) +add_custom_target(generate_outputs DEPENDS ${bro_ALL_GENERATED_OUTPUTS}) + +# Build __load__.bro files for plugins/*.bif.bro. +bro_bif_create_loader(bif_loader_plugins ${CMAKE_BINARY_DIR}/scripts/base/bif/plugins) +add_dependencies(bif_loader_plugins ${bro_SUBDIRS}) +add_dependencies(bro bif_loader_plugins) + +# Install *.bif.bro. +install(DIRECTORY ${CMAKE_BINARY_DIR}/scripts/base/bif DESTINATION ${BRO_SCRIPT_INSTALL_PATH}/base) + +# Make clean removes the bif directory. +set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_BINARY_DIR}/scripts/base/bif) + diff --git a/src/FlowSrc.cc b/src/FlowSrc.cc index 59ce3fd6a4..f5fb0bd1e6 100644 --- a/src/FlowSrc.cc +++ b/src/FlowSrc.cc @@ -9,7 +9,7 @@ #include "FlowSrc.h" #include "Net.h" -#include "netflow_pac.h" +#include "analyzer/protocol/netflow/netflow_pac.h" #include FlowSrc::FlowSrc() diff --git a/src/analyzer/CMakeLists.txt b/src/analyzer/CMakeLists.txt index 026bbac80a..1e91141114 100644 --- a/src/analyzer/CMakeLists.txt +++ b/src/analyzer/CMakeLists.txt @@ -13,10 +13,6 @@ set(analyzer_SRCS Tag.cc ) -bif_target_for_subdir(analyzer.bif) - -bro_plugin_dependencies(DCE_RPC generate_analyzer.bif) - -add_library(bro_analyzer OBJECT ${analyzer_SRCS} ${BIF_OUTPUT_CC} ${BIF_OUTPUT_H}) - -add_dependencies(bro_analyzer generate_events.bif) +bif_target(analyzer.bif) +add_library(bro_analyzer OBJECT ${analyzer_SRCS} ${BIF_OUTPUT_CC}) +add_dependencies(bro_analyzer generate_outputs) diff --git a/src/analyzer/Manager.cc b/src/analyzer/Manager.cc index 4f33ccef93..22912ad19d 100644 --- a/src/analyzer/Manager.cc +++ b/src/analyzer/Manager.cc @@ -4,18 +4,18 @@ #include "Hash.h" #include "Val.h" -#include "analyzer/protocol/backdoor/BackDoor.h" -#include "analyzer/protocol/conn-size/ConnSize.h" -#include "analyzer/protocol/icmp/ICMP.h" -#include "analyzer/protocol/interconn/InterConn.h" -#include "analyzer/protocol/pia/PIA.h" -#include "analyzer/protocol/stepping-stone/SteppingStone.h" -#include "analyzer/protocol/tcp/TCP.h" -#include "analyzer/protocol/udp/UDP.h" +#include "protocol/backdoor/BackDoor.h" +#include "protocol/conn-size/ConnSize.h" +#include "protocol/icmp/ICMP.h" +#include "protocol/interconn/InterConn.h" +#include "protocol/pia/PIA.h" +#include "protocol/stepping-stone/SteppingStone.h" +#include "protocol/tcp/TCP.h" +#include "protocol/udp/UDP.h" #include "plugin/Manager.h" -#include "protocols/tcp/events.bif.h" +#include "protocol/tcp/events.bif.h" using namespace analyzer; diff --git a/src/analyzer/protocol/arp/CMakeLists.txt b/src/analyzer/protocol/arp/CMakeLists.txt index 5654802b07..eec6755a18 100644 --- a/src/analyzer/protocol/arp/CMakeLists.txt +++ b/src/analyzer/protocol/arp/CMakeLists.txt @@ -8,7 +8,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(ARP) +bro_plugin_begin(Bro ARP) bro_plugin_cc(ARP.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_end() diff --git a/src/analyzer/protocol/arp/Plugin.cc b/src/analyzer/protocol/arp/Plugin.cc index 06b4940719..9045ef412f 100644 --- a/src/analyzer/protocol/arp/Plugin.cc +++ b/src/analyzer/protocol/arp/Plugin.cc @@ -1,7 +1,7 @@ #include "plugin/Plugin.h" -BRO_PLUGIN_BEGIN(ARP) +BRO_PLUGIN_BEGIN(Bro, ARP) BRO_PLUGIN_DESCRIPTION("ARP Parsing Code"); BRO_PLUGIN_BIF_FILE(events); BRO_PLUGIN_END diff --git a/src/analyzer/protocol/ayiya/CMakeLists.txt b/src/analyzer/protocol/ayiya/CMakeLists.txt index 8f578a763b..ae23c25e2d 100644 --- a/src/analyzer/protocol/ayiya/CMakeLists.txt +++ b/src/analyzer/protocol/ayiya/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(AYIYA) +bro_plugin_begin(Bro AYIYA) bro_plugin_cc(AYIYA.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_pac(ayiya.pac ayiya-protocol.pac ayiya-analyzer.pac) diff --git a/src/analyzer/protocol/ayiya/Plugin.cc b/src/analyzer/protocol/ayiya/Plugin.cc index 069aedde0a..0fc96eff3c 100644 --- a/src/analyzer/protocol/ayiya/Plugin.cc +++ b/src/analyzer/protocol/ayiya/Plugin.cc @@ -3,7 +3,7 @@ #include "AYIYA.h" -BRO_PLUGIN_BEGIN(AYIYA) +BRO_PLUGIN_BEGIN(Bro, AYIYA) BRO_PLUGIN_DESCRIPTION("AYIYA Analyzer"); BRO_PLUGIN_ANALYZER("AYIYA", ayiya::AYIYA_Analyzer); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/analyzer/protocol/backdoor/CMakeLists.txt b/src/analyzer/protocol/backdoor/CMakeLists.txt index b065cc2c95..5df04769f6 100644 --- a/src/analyzer/protocol/backdoor/CMakeLists.txt +++ b/src/analyzer/protocol/backdoor/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(BackDoor) +bro_plugin_begin(Bro BackDoor) bro_plugin_cc(BackDoor.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_end() diff --git a/src/analyzer/protocol/backdoor/Plugin.cc b/src/analyzer/protocol/backdoor/Plugin.cc index b350e835a1..0983aaf5d3 100644 --- a/src/analyzer/protocol/backdoor/Plugin.cc +++ b/src/analyzer/protocol/backdoor/Plugin.cc @@ -3,7 +3,7 @@ #include "BackDoor.h" -BRO_PLUGIN_BEGIN(BackDoor) +BRO_PLUGIN_BEGIN(Bro, BackDoor) BRO_PLUGIN_DESCRIPTION("Backdoor Analyzer (deprecated)"); BRO_PLUGIN_ANALYZER("BackDoor", backdoor::BackDoor_Analyzer); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/analyzer/protocol/bittorrent/CMakeLists.txt b/src/analyzer/protocol/bittorrent/CMakeLists.txt index 5a3f9372bb..630ea03498 100644 --- a/src/analyzer/protocol/bittorrent/CMakeLists.txt +++ b/src/analyzer/protocol/bittorrent/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(BitTorrent) +bro_plugin_begin(Bro BitTorrent) bro_plugin_cc(BitTorrent.cc BitTorrentTracker.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_pac(bittorrent.pac bittorrent-analyzer.pac bittorrent-protocol.pac) diff --git a/src/analyzer/protocol/bittorrent/Plugin.cc b/src/analyzer/protocol/bittorrent/Plugin.cc index 59e81749ce..2da9972d0d 100644 --- a/src/analyzer/protocol/bittorrent/Plugin.cc +++ b/src/analyzer/protocol/bittorrent/Plugin.cc @@ -4,7 +4,7 @@ #include "BitTorrent.h" #include "BitTorrentTracker.h" -BRO_PLUGIN_BEGIN(BitTorrent) +BRO_PLUGIN_BEGIN(Bro, BitTorrent) BRO_PLUGIN_DESCRIPTION("BitTorrent Analyzer"); BRO_PLUGIN_ANALYZER("BitTorrent", bittorrent::BitTorrent_Analyzer); BRO_PLUGIN_ANALYZER("BitTorrentTracker", bittorrent::BitTorrent_Analyzer); diff --git a/src/analyzer/protocol/conn-size/CMakeLists.txt b/src/analyzer/protocol/conn-size/CMakeLists.txt index e5edd9c947..efaadef401 100644 --- a/src/analyzer/protocol/conn-size/CMakeLists.txt +++ b/src/analyzer/protocol/conn-size/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(ConnSize) +bro_plugin_begin(Bro ConnSize) bro_plugin_cc(ConnSize.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_end() diff --git a/src/analyzer/protocol/conn-size/Plugin.cc b/src/analyzer/protocol/conn-size/Plugin.cc index d72b97dac6..6993e15ff8 100644 --- a/src/analyzer/protocol/conn-size/Plugin.cc +++ b/src/analyzer/protocol/conn-size/Plugin.cc @@ -3,7 +3,7 @@ #include "ConnSize.h" -BRO_PLUGIN_BEGIN(ConnSize) +BRO_PLUGIN_BEGIN(Bro, ConnSize) BRO_PLUGIN_DESCRIPTION("Connection size analyzer"); BRO_PLUGIN_ANALYZER("ConnSize", conn_size::ConnSize_Analyzer); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/analyzer/protocol/dce-rpc/CMakeLists.txt b/src/analyzer/protocol/dce-rpc/CMakeLists.txt index 61e6170640..d9baa08acf 100644 --- a/src/analyzer/protocol/dce-rpc/CMakeLists.txt +++ b/src/analyzer/protocol/dce-rpc/CMakeLists.txt @@ -3,9 +3,10 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(DCE_RPC) +bro_plugin_begin(Bro DCE_RPC) bro_plugin_cc(DCE_RPC.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_pac(dce_rpc.pac dce_rpc-protocol.pac dce_rpc-analyzer.pac) bro_plugin_pac(dce_rpc_simple.pac dce_rpc-protocol.pac epmapper.pac) bro_plugin_end() + diff --git a/src/analyzer/protocol/dce-rpc/Plugin.cc b/src/analyzer/protocol/dce-rpc/Plugin.cc index 368cffdc7f..d9f3ce16c8 100644 --- a/src/analyzer/protocol/dce-rpc/Plugin.cc +++ b/src/analyzer/protocol/dce-rpc/Plugin.cc @@ -3,7 +3,7 @@ #include "DCE_RPC.h" -BRO_PLUGIN_BEGIN(DCE_RPC) +BRO_PLUGIN_BEGIN(Bro, DCE_RPC) BRO_PLUGIN_DESCRIPTION("DCE-RPC analyzer"); BRO_PLUGIN_ANALYZER("DCE_RPC", dce_rpc::DCE_RPC_Analyzer); BRO_PLUGIN_SUPPORT_ANALYZER("Contents_DCE_RPC"); diff --git a/src/analyzer/protocol/dhcp/CMakeLists.txt b/src/analyzer/protocol/dhcp/CMakeLists.txt index f4552b666a..646a11f9ab 100644 --- a/src/analyzer/protocol/dhcp/CMakeLists.txt +++ b/src/analyzer/protocol/dhcp/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(DHCP) +bro_plugin_begin(Bro DHCP) bro_plugin_cc(DHCP.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_pac(dhcp.pac dhcp-protocol.pac dhcp-analyzer.pac) diff --git a/src/analyzer/protocol/dhcp/Plugin.cc b/src/analyzer/protocol/dhcp/Plugin.cc index 8bc1c68a6b..73603f8cb1 100644 --- a/src/analyzer/protocol/dhcp/Plugin.cc +++ b/src/analyzer/protocol/dhcp/Plugin.cc @@ -3,7 +3,7 @@ #include "DHCP.h" -BRO_PLUGIN_BEGIN(DHCP) +BRO_PLUGIN_BEGIN(Bro, DHCP) BRO_PLUGIN_DESCRIPTION("DHCP analyzer"); BRO_PLUGIN_ANALYZER("DHCP", dhcp::DHCP_Analyzer); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/analyzer/protocol/dns/CMakeLists.txt b/src/analyzer/protocol/dns/CMakeLists.txt index 38a4cedd03..c63b2dc690 100644 --- a/src/analyzer/protocol/dns/CMakeLists.txt +++ b/src/analyzer/protocol/dns/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(DNS) +bro_plugin_begin(Bro DNS) bro_plugin_cc(DNS.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_end() diff --git a/src/analyzer/protocol/dns/Plugin.cc b/src/analyzer/protocol/dns/Plugin.cc index f4275b4181..bb96692cd0 100644 --- a/src/analyzer/protocol/dns/Plugin.cc +++ b/src/analyzer/protocol/dns/Plugin.cc @@ -3,7 +3,7 @@ #include "DNS.h" -BRO_PLUGIN_BEGIN(DNS) +BRO_PLUGIN_BEGIN(Bro, DNS) BRO_PLUGIN_DESCRIPTION("DNS analyzer"); BRO_PLUGIN_ANALYZER("DNS", dns::DNS_Analyzer); BRO_PLUGIN_SUPPORT_ANALYZER("Contents_DNS"); diff --git a/src/analyzer/protocol/file/CMakeLists.txt b/src/analyzer/protocol/file/CMakeLists.txt index 924aadd406..978c28c9c4 100644 --- a/src/analyzer/protocol/file/CMakeLists.txt +++ b/src/analyzer/protocol/file/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(File) +bro_plugin_begin(Bro File) bro_plugin_cc(File.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_end() diff --git a/src/analyzer/protocol/file/Plugin.cc b/src/analyzer/protocol/file/Plugin.cc index 06d3ba9373..5a674c47c0 100644 --- a/src/analyzer/protocol/file/Plugin.cc +++ b/src/analyzer/protocol/file/Plugin.cc @@ -3,7 +3,7 @@ #include "./File.h" -BRO_PLUGIN_BEGIN(File) +BRO_PLUGIN_BEGIN(Bro, File) BRO_PLUGIN_DESCRIPTION("Generic file analyzer"); BRO_PLUGIN_ANALYZER("File", file::File_Analyzer); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/analyzer/protocol/finger/CMakeLists.txt b/src/analyzer/protocol/finger/CMakeLists.txt index f51f892390..52dd3816f9 100644 --- a/src/analyzer/protocol/finger/CMakeLists.txt +++ b/src/analyzer/protocol/finger/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(Finger) +bro_plugin_begin(Bro Finger) bro_plugin_cc(Finger.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_end() diff --git a/src/analyzer/protocol/finger/Plugin.cc b/src/analyzer/protocol/finger/Plugin.cc index a20c0765c1..6cf909ca54 100644 --- a/src/analyzer/protocol/finger/Plugin.cc +++ b/src/analyzer/protocol/finger/Plugin.cc @@ -3,7 +3,7 @@ #include "Finger.h" -BRO_PLUGIN_BEGIN(Finger) +BRO_PLUGIN_BEGIN(Bro, Finger) BRO_PLUGIN_DESCRIPTION("Finger analyzer"); BRO_PLUGIN_ANALYZER("Finger", finger::Finger_Analyzer); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/analyzer/protocol/ftp/CMakeLists.txt b/src/analyzer/protocol/ftp/CMakeLists.txt index 9a92d95116..ab657f9260 100644 --- a/src/analyzer/protocol/ftp/CMakeLists.txt +++ b/src/analyzer/protocol/ftp/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(FTP) +bro_plugin_begin(Bro FTP) bro_plugin_cc(FTP.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_bif(functions.bif) diff --git a/src/analyzer/protocol/ftp/Plugin.cc b/src/analyzer/protocol/ftp/Plugin.cc index e35185d5c5..db8e20e7ed 100644 --- a/src/analyzer/protocol/ftp/Plugin.cc +++ b/src/analyzer/protocol/ftp/Plugin.cc @@ -3,7 +3,7 @@ #include "FTP.h" -BRO_PLUGIN_BEGIN(FTP) +BRO_PLUGIN_BEGIN(Bro, FTP) BRO_PLUGIN_DESCRIPTION("FTP analyzer"); BRO_PLUGIN_ANALYZER("FTP", ftp::FTP_Analyzer); BRO_PLUGIN_SUPPORT_ANALYZER("FTP_ADAT"); diff --git a/src/analyzer/protocol/gnutella/CMakeLists.txt b/src/analyzer/protocol/gnutella/CMakeLists.txt index 7418ab46ba..ee5415b924 100644 --- a/src/analyzer/protocol/gnutella/CMakeLists.txt +++ b/src/analyzer/protocol/gnutella/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(Gnutella) +bro_plugin_begin(Bro Gnutella) bro_plugin_cc(Gnutella.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_end() diff --git a/src/analyzer/protocol/gnutella/Plugin.cc b/src/analyzer/protocol/gnutella/Plugin.cc index b52d545bc3..73b91af002 100644 --- a/src/analyzer/protocol/gnutella/Plugin.cc +++ b/src/analyzer/protocol/gnutella/Plugin.cc @@ -3,7 +3,7 @@ #include "Gnutella.h" -BRO_PLUGIN_BEGIN(Gnutella) +BRO_PLUGIN_BEGIN(Bro, Gnutella) BRO_PLUGIN_DESCRIPTION("Gnutella analyzer"); BRO_PLUGIN_ANALYZER("Gnutella", gnutella::Gnutella_Analyzer); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/analyzer/protocol/gtpv1/CMakeLists.txt b/src/analyzer/protocol/gtpv1/CMakeLists.txt index b739330b37..b45f32e883 100644 --- a/src/analyzer/protocol/gtpv1/CMakeLists.txt +++ b/src/analyzer/protocol/gtpv1/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(GTPv1) +bro_plugin_begin(Bro GTPv1) bro_plugin_cc(GTPv1.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_pac(gtpv1.pac gtpv1-protocol.pac gtpv1-analyzer.pac) diff --git a/src/analyzer/protocol/gtpv1/Plugin.cc b/src/analyzer/protocol/gtpv1/Plugin.cc index 5a39dd3980..83d1557e4d 100644 --- a/src/analyzer/protocol/gtpv1/Plugin.cc +++ b/src/analyzer/protocol/gtpv1/Plugin.cc @@ -3,7 +3,7 @@ #include "GTPv1.h" -BRO_PLUGIN_BEGIN(GTPv1) +BRO_PLUGIN_BEGIN(Bro, GTPv1) BRO_PLUGIN_DESCRIPTION("GTPv1 analyzer"); BRO_PLUGIN_ANALYZER("GTPv1", gtpv1::GTPv1_Analyzer); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/analyzer/protocol/http/CMakeLists.txt b/src/analyzer/protocol/http/CMakeLists.txt index 68bdb632a4..d1fbed07f0 100644 --- a/src/analyzer/protocol/http/CMakeLists.txt +++ b/src/analyzer/protocol/http/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(HTTP) +bro_plugin_begin(Bro HTTP) bro_plugin_cc(HTTP.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_bif(functions.bif) diff --git a/src/analyzer/protocol/http/Plugin.cc b/src/analyzer/protocol/http/Plugin.cc index 2908a37511..1a2a05cbed 100644 --- a/src/analyzer/protocol/http/Plugin.cc +++ b/src/analyzer/protocol/http/Plugin.cc @@ -3,7 +3,7 @@ #include "HTTP.h" -BRO_PLUGIN_BEGIN(HTTP) +BRO_PLUGIN_BEGIN(Bro, HTTP) BRO_PLUGIN_DESCRIPTION("HTTP analyzer"); BRO_PLUGIN_ANALYZER("HTTP", http::HTTP_Analyzer); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/analyzer/protocol/icmp/CMakeLists.txt b/src/analyzer/protocol/icmp/CMakeLists.txt index e867bac238..7b8bd9c7fe 100644 --- a/src/analyzer/protocol/icmp/CMakeLists.txt +++ b/src/analyzer/protocol/icmp/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(ICMP) +bro_plugin_begin(Bro ICMP) bro_plugin_cc(ICMP.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_end() diff --git a/src/analyzer/protocol/icmp/Plugin.cc b/src/analyzer/protocol/icmp/Plugin.cc index fa0c885a3e..f313842c2a 100644 --- a/src/analyzer/protocol/icmp/Plugin.cc +++ b/src/analyzer/protocol/icmp/Plugin.cc @@ -3,7 +3,7 @@ #include "ICMP.h" -BRO_PLUGIN_BEGIN(ICMP) +BRO_PLUGIN_BEGIN(Bro, ICMP) BRO_PLUGIN_DESCRIPTION("ICMP analyzer"); BRO_PLUGIN_ANALYZER("ICMP", icmp::ICMP_Analyzer); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/analyzer/protocol/ident/CMakeLists.txt b/src/analyzer/protocol/ident/CMakeLists.txt index a8d4102a58..658dff141e 100644 --- a/src/analyzer/protocol/ident/CMakeLists.txt +++ b/src/analyzer/protocol/ident/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(Ident) +bro_plugin_begin(Bro Ident) bro_plugin_cc(Ident.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_end() diff --git a/src/analyzer/protocol/ident/Plugin.cc b/src/analyzer/protocol/ident/Plugin.cc index d520374552..c053689b8f 100644 --- a/src/analyzer/protocol/ident/Plugin.cc +++ b/src/analyzer/protocol/ident/Plugin.cc @@ -3,7 +3,7 @@ #include "Ident.h" -BRO_PLUGIN_BEGIN(Ident) +BRO_PLUGIN_BEGIN(Bro, Ident) BRO_PLUGIN_DESCRIPTION("Ident analyzer"); BRO_PLUGIN_ANALYZER("Ident", ident::Ident_Analyzer); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/analyzer/protocol/interconn/CMakeLists.txt b/src/analyzer/protocol/interconn/CMakeLists.txt index 6a5ae1f3fe..ef5ca13a9a 100644 --- a/src/analyzer/protocol/interconn/CMakeLists.txt +++ b/src/analyzer/protocol/interconn/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(InterConn) +bro_plugin_begin(Bro InterConn) bro_plugin_cc(InterConn.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_end() diff --git a/src/analyzer/protocol/interconn/Plugin.cc b/src/analyzer/protocol/interconn/Plugin.cc index e1792dc3ef..c135d0fb07 100644 --- a/src/analyzer/protocol/interconn/Plugin.cc +++ b/src/analyzer/protocol/interconn/Plugin.cc @@ -3,7 +3,7 @@ #include "InterConn.h" -BRO_PLUGIN_BEGIN(InterConn) +BRO_PLUGIN_BEGIN(Bro, InterConn) BRO_PLUGIN_DESCRIPTION("InterConn analyzer (deprecated)"); BRO_PLUGIN_ANALYZER("InterConn", interconn::InterConn_Analyzer); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/analyzer/protocol/irc/CMakeLists.txt b/src/analyzer/protocol/irc/CMakeLists.txt index 2e7ed7616b..5f97482365 100644 --- a/src/analyzer/protocol/irc/CMakeLists.txt +++ b/src/analyzer/protocol/irc/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(IRC) +bro_plugin_begin(Bro IRC) bro_plugin_cc(IRC.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_end() diff --git a/src/analyzer/protocol/irc/Plugin.cc b/src/analyzer/protocol/irc/Plugin.cc index 046d1b5a02..fc7de1bd6d 100644 --- a/src/analyzer/protocol/irc/Plugin.cc +++ b/src/analyzer/protocol/irc/Plugin.cc @@ -3,7 +3,7 @@ #include "IRC.h" -BRO_PLUGIN_BEGIN(IRC) +BRO_PLUGIN_BEGIN(Bro, IRC) BRO_PLUGIN_DESCRIPTION("IRC analyzer"); BRO_PLUGIN_ANALYZER("IRC", irc::IRC_Analyzer); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/analyzer/protocol/login/CMakeLists.txt b/src/analyzer/protocol/login/CMakeLists.txt index 60a5b57ec5..66f8eb1568 100644 --- a/src/analyzer/protocol/login/CMakeLists.txt +++ b/src/analyzer/protocol/login/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(Login) +bro_plugin_begin(Bro Login) bro_plugin_cc(Login.cc RSH.cc Telnet.cc Rlogin.cc NVT.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_bif(functions.bif) diff --git a/src/analyzer/protocol/login/Plugin.cc b/src/analyzer/protocol/login/Plugin.cc index 8c7287afae..6b8d1a8fed 100644 --- a/src/analyzer/protocol/login/Plugin.cc +++ b/src/analyzer/protocol/login/Plugin.cc @@ -6,7 +6,7 @@ #include "RSH.h" #include "Rlogin.h" -BRO_PLUGIN_BEGIN(Login) +BRO_PLUGIN_BEGIN(Bro, Login) BRO_PLUGIN_DESCRIPTION("Telnet/Rsh/Rlogin analyzers"); BRO_PLUGIN_ANALYZER("Telnet", login::Telnet_Analyzer); BRO_PLUGIN_ANALYZER("Rsh", login::Rsh_Analyzer); diff --git a/src/analyzer/protocol/mime/CMakeLists.txt b/src/analyzer/protocol/mime/CMakeLists.txt index 1df45cd395..0a038625f8 100644 --- a/src/analyzer/protocol/mime/CMakeLists.txt +++ b/src/analyzer/protocol/mime/CMakeLists.txt @@ -8,7 +8,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(MIME) +bro_plugin_begin(Bro MIME) bro_plugin_cc(MIME.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_end() diff --git a/src/analyzer/protocol/mime/Plugin.cc b/src/analyzer/protocol/mime/Plugin.cc index ff90d9d671..d519a8f84e 100644 --- a/src/analyzer/protocol/mime/Plugin.cc +++ b/src/analyzer/protocol/mime/Plugin.cc @@ -1,7 +1,7 @@ #include "plugin/Plugin.h" -BRO_PLUGIN_BEGIN(MIME) +BRO_PLUGIN_BEGIN(Bro, MIME) BRO_PLUGIN_DESCRIPTION("MIME parsing code"); BRO_PLUGIN_BIF_FILE(events); BRO_PLUGIN_END diff --git a/src/analyzer/protocol/modbus/CMakeLists.txt b/src/analyzer/protocol/modbus/CMakeLists.txt index 120e352f36..e6705cdd22 100644 --- a/src/analyzer/protocol/modbus/CMakeLists.txt +++ b/src/analyzer/protocol/modbus/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(Modbus) +bro_plugin_begin(Bro Modbus) bro_plugin_cc(Modbus.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_pac(modbus.pac modbus-analyzer.pac modbus-protocol.pac) diff --git a/src/analyzer/protocol/modbus/Plugin.cc b/src/analyzer/protocol/modbus/Plugin.cc index e03f8dbb9b..c84992cbae 100644 --- a/src/analyzer/protocol/modbus/Plugin.cc +++ b/src/analyzer/protocol/modbus/Plugin.cc @@ -3,7 +3,7 @@ #include "Modbus.h" -BRO_PLUGIN_BEGIN(Modbus) +BRO_PLUGIN_BEGIN(Bro, Modbus) BRO_PLUGIN_DESCRIPTION("Modbus analyzer"); BRO_PLUGIN_ANALYZER("MODBUS", modbus::ModbusTCP_Analyzer); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/analyzer/protocol/ncp/CMakeLists.txt b/src/analyzer/protocol/ncp/CMakeLists.txt index 021561f0aa..bd06d4e426 100644 --- a/src/analyzer/protocol/ncp/CMakeLists.txt +++ b/src/analyzer/protocol/ncp/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(NCP) +bro_plugin_begin(Bro NCP) bro_plugin_cc(NCP.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_pac(ncp.pac) diff --git a/src/analyzer/protocol/ncp/Plugin.cc b/src/analyzer/protocol/ncp/Plugin.cc index 5e1a955606..85cd318fe0 100644 --- a/src/analyzer/protocol/ncp/Plugin.cc +++ b/src/analyzer/protocol/ncp/Plugin.cc @@ -3,7 +3,7 @@ #include "NCP.h" -BRO_PLUGIN_BEGIN(NCP) +BRO_PLUGIN_BEGIN(Bro, NCP) BRO_PLUGIN_DESCRIPTION("NCP analyzer"); BRO_PLUGIN_ANALYZER("NCP", ncp::NCP_Analyzer); BRO_PLUGIN_SUPPORT_ANALYZER("Contents_NCP"); diff --git a/src/analyzer/protocol/netbios/CMakeLists.txt b/src/analyzer/protocol/netbios/CMakeLists.txt index ab31cd6e0a..ad6009d171 100644 --- a/src/analyzer/protocol/netbios/CMakeLists.txt +++ b/src/analyzer/protocol/netbios/CMakeLists.txt @@ -2,9 +2,12 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(AFTER ${CMAKE_CURRENT_BINARY_DIR}/../dce-rpc) +include_directories(AFTER ${CMAKE_CURRENT_BINARY_DIR}/../smb) -bro_plugin_begin(NetBIOS) +bro_plugin_begin(Bro NetBIOS) bro_plugin_cc(NetbiosSSN.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_bif(functions.bif) bro_plugin_end() + diff --git a/src/analyzer/protocol/netbios/Plugin.cc b/src/analyzer/protocol/netbios/Plugin.cc index 36ec458138..15daeb1ab5 100644 --- a/src/analyzer/protocol/netbios/Plugin.cc +++ b/src/analyzer/protocol/netbios/Plugin.cc @@ -3,7 +3,7 @@ #include "NetbiosSSN.h" -BRO_PLUGIN_BEGIN(NetBIOS) +BRO_PLUGIN_BEGIN(Bro, NetBIOS) BRO_PLUGIN_DESCRIPTION("NetBIOS analyzer (support only SSN currently)"); BRO_PLUGIN_ANALYZER("NetbiosSSN", netbios_ssn::NetbiosSSN_Analyzer); BRO_PLUGIN_SUPPORT_ANALYZER("Contents_NetbiosSSN"); diff --git a/src/analyzer/protocol/netflow/CMakeLists.txt b/src/analyzer/protocol/netflow/CMakeLists.txt index c45f410b26..3afc9fd66a 100644 --- a/src/analyzer/protocol/netflow/CMakeLists.txt +++ b/src/analyzer/protocol/netflow/CMakeLists.txt @@ -8,7 +8,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(NetFlow) +bro_plugin_begin(Bro NetFlow) bro_plugin_cc(Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_pac(netflow.pac netflow-protocol.pac netflow-analyzer.pac) diff --git a/src/analyzer/protocol/netflow/Plugin.cc b/src/analyzer/protocol/netflow/Plugin.cc index cd7a937171..b994caa5d8 100644 --- a/src/analyzer/protocol/netflow/Plugin.cc +++ b/src/analyzer/protocol/netflow/Plugin.cc @@ -1,7 +1,7 @@ #include "plugin/Plugin.h" -BRO_PLUGIN_BEGIN(NetFlow) +BRO_PLUGIN_BEGIN(Bro, NetFlow) BRO_PLUGIN_DESCRIPTION("NetFlow parsing code"); BRO_PLUGIN_BIF_FILE(events); BRO_PLUGIN_END diff --git a/src/analyzer/protocol/ntp/CMakeLists.txt b/src/analyzer/protocol/ntp/CMakeLists.txt index b16c1edee9..a8b8bb1872 100644 --- a/src/analyzer/protocol/ntp/CMakeLists.txt +++ b/src/analyzer/protocol/ntp/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(NTP) +bro_plugin_begin(Bro NTP) bro_plugin_cc(NTP.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_end() diff --git a/src/analyzer/protocol/ntp/Plugin.cc b/src/analyzer/protocol/ntp/Plugin.cc index bf2bd5df15..ce4ce5680f 100644 --- a/src/analyzer/protocol/ntp/Plugin.cc +++ b/src/analyzer/protocol/ntp/Plugin.cc @@ -3,7 +3,7 @@ #include "NTP.h" -BRO_PLUGIN_BEGIN(NTP) +BRO_PLUGIN_BEGIN(Bro, NTP) BRO_PLUGIN_DESCRIPTION("NTP analyzer"); BRO_PLUGIN_ANALYZER("NTP", ntp::NTP_Analyzer); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/analyzer/protocol/pia/CMakeLists.txt b/src/analyzer/protocol/pia/CMakeLists.txt index 8c55deca09..ff55bcf0aa 100644 --- a/src/analyzer/protocol/pia/CMakeLists.txt +++ b/src/analyzer/protocol/pia/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(PIA) +bro_plugin_begin(Bro PIA) bro_plugin_cc(PIA.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_end() diff --git a/src/analyzer/protocol/pia/Plugin.cc b/src/analyzer/protocol/pia/Plugin.cc index 6c4bf1a6b2..7d52801475 100644 --- a/src/analyzer/protocol/pia/Plugin.cc +++ b/src/analyzer/protocol/pia/Plugin.cc @@ -3,7 +3,7 @@ #include "PIA.h" -BRO_PLUGIN_BEGIN(PIA) +BRO_PLUGIN_BEGIN(Bro, PIA) BRO_PLUGIN_DESCRIPTION("Analyzers implementing Dynamic Protocol Detection"); BRO_PLUGIN_ANALYZER("PIA_TCP", pia::PIA_TCP); BRO_PLUGIN_ANALYZER("PIA_UDP", pia::PIA_UDP); diff --git a/src/analyzer/protocol/pop3/CMakeLists.txt b/src/analyzer/protocol/pop3/CMakeLists.txt index 5af5a7f624..8071d6a74d 100644 --- a/src/analyzer/protocol/pop3/CMakeLists.txt +++ b/src/analyzer/protocol/pop3/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(POP3) +bro_plugin_begin(Bro POP3) bro_plugin_cc(POP3.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_end() diff --git a/src/analyzer/protocol/pop3/Plugin.cc b/src/analyzer/protocol/pop3/Plugin.cc index b686e2fbee..edd99e2617 100644 --- a/src/analyzer/protocol/pop3/Plugin.cc +++ b/src/analyzer/protocol/pop3/Plugin.cc @@ -3,7 +3,7 @@ #include "POP3.h" -BRO_PLUGIN_BEGIN(POP3) +BRO_PLUGIN_BEGIN(Bro, POP3) BRO_PLUGIN_DESCRIPTION("POP3 analyzer"); BRO_PLUGIN_ANALYZER("POP3", pop3::POP3_Analyzer); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/analyzer/protocol/rpc/CMakeLists.txt b/src/analyzer/protocol/rpc/CMakeLists.txt index edf6371dd1..5696a74cd6 100644 --- a/src/analyzer/protocol/rpc/CMakeLists.txt +++ b/src/analyzer/protocol/rpc/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(RPC) +bro_plugin_begin(Bro RPC) bro_plugin_cc(RPC.cc NFS.cc Portmap.cc XDR.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_end() diff --git a/src/analyzer/protocol/rpc/Plugin.cc b/src/analyzer/protocol/rpc/Plugin.cc index 815cf14362..9760df0623 100644 --- a/src/analyzer/protocol/rpc/Plugin.cc +++ b/src/analyzer/protocol/rpc/Plugin.cc @@ -5,7 +5,7 @@ #include "NFS.h" #include "Portmap.h" -BRO_PLUGIN_BEGIN(RPC) +BRO_PLUGIN_BEGIN(Bro, RPC) BRO_PLUGIN_DESCRIPTION("Analyzers for RPC-based protocols"); BRO_PLUGIN_ANALYZER("NFS", rpc::NFS_Analyzer); BRO_PLUGIN_ANALYZER("Portmapper", rpc::Portmapper_Analyzer); diff --git a/src/analyzer/protocol/smb/CMakeLists.txt b/src/analyzer/protocol/smb/CMakeLists.txt index 30338d91f5..feec283197 100644 --- a/src/analyzer/protocol/smb/CMakeLists.txt +++ b/src/analyzer/protocol/smb/CMakeLists.txt @@ -2,8 +2,9 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(AFTER ${CMAKE_CURRENT_BINARY_DIR}/../dce-rpc) -bro_plugin_begin(SMB) +bro_plugin_begin(Bro SMB) bro_plugin_cc(SMB.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_pac(smb.pac smb-protocol.pac smb-pipe.pac smb-mailslot.pac) diff --git a/src/analyzer/protocol/smb/Plugin.cc b/src/analyzer/protocol/smb/Plugin.cc index 97ea10f5d8..af564c067c 100644 --- a/src/analyzer/protocol/smb/Plugin.cc +++ b/src/analyzer/protocol/smb/Plugin.cc @@ -3,7 +3,7 @@ #include "SMB.h" -BRO_PLUGIN_BEGIN(SMB) +BRO_PLUGIN_BEGIN(Bro, SMB) BRO_PLUGIN_DESCRIPTION("SMB analyzer"); BRO_PLUGIN_ANALYZER("SMB", smb::SMB_Analyzer); BRO_PLUGIN_SUPPORT_ANALYZER("Contents_SMB"); diff --git a/src/analyzer/protocol/smtp/CMakeLists.txt b/src/analyzer/protocol/smtp/CMakeLists.txt index 1f4779c0f8..82918656a0 100644 --- a/src/analyzer/protocol/smtp/CMakeLists.txt +++ b/src/analyzer/protocol/smtp/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(SMTP) +bro_plugin_begin(Bro SMTP) bro_plugin_cc(SMTP.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_bif(functions.bif) diff --git a/src/analyzer/protocol/smtp/Plugin.cc b/src/analyzer/protocol/smtp/Plugin.cc index f1567098d2..e089d7ffb1 100644 --- a/src/analyzer/protocol/smtp/Plugin.cc +++ b/src/analyzer/protocol/smtp/Plugin.cc @@ -3,7 +3,7 @@ #include "SMTP.h" -BRO_PLUGIN_BEGIN(SMTP) +BRO_PLUGIN_BEGIN(Bro, SMTP) BRO_PLUGIN_DESCRIPTION("SMTP analyzer"); BRO_PLUGIN_ANALYZER("SMTP", smtp::SMTP_Analyzer); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/analyzer/protocol/socks/CMakeLists.txt b/src/analyzer/protocol/socks/CMakeLists.txt index 451dfd53f4..5157c8d368 100644 --- a/src/analyzer/protocol/socks/CMakeLists.txt +++ b/src/analyzer/protocol/socks/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(SOCKS) +bro_plugin_begin(Bro SOCKS) bro_plugin_cc(SOCKS.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_pac(socks.pac socks-protocol.pac socks-analyzer.pac) diff --git a/src/analyzer/protocol/socks/Plugin.cc b/src/analyzer/protocol/socks/Plugin.cc index 3c659de628..d01f4520b7 100644 --- a/src/analyzer/protocol/socks/Plugin.cc +++ b/src/analyzer/protocol/socks/Plugin.cc @@ -3,7 +3,7 @@ #include "SOCKS.h" -BRO_PLUGIN_BEGIN(SOCKS) +BRO_PLUGIN_BEGIN(Bro, SOCKS) BRO_PLUGIN_DESCRIPTION("SOCKS analyzer"); BRO_PLUGIN_ANALYZER("SOCKS", socks::SOCKS_Analyzer); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/analyzer/protocol/ssh/CMakeLists.txt b/src/analyzer/protocol/ssh/CMakeLists.txt index 659e3207ab..505c89332e 100644 --- a/src/analyzer/protocol/ssh/CMakeLists.txt +++ b/src/analyzer/protocol/ssh/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(SSH) +bro_plugin_begin(Bro SSH) bro_plugin_cc(SSH.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_end() diff --git a/src/analyzer/protocol/ssh/Plugin.cc b/src/analyzer/protocol/ssh/Plugin.cc index 4bb2a0ffdb..53a0294a88 100644 --- a/src/analyzer/protocol/ssh/Plugin.cc +++ b/src/analyzer/protocol/ssh/Plugin.cc @@ -3,7 +3,7 @@ #include "SSH.h" -BRO_PLUGIN_BEGIN(SSH) +BRO_PLUGIN_BEGIN(Bro, SSH) BRO_PLUGIN_DESCRIPTION("SSH analyzer"); BRO_PLUGIN_ANALYZER("SSH", ssh::SSH_Analyzer); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/analyzer/protocol/ssl/CMakeLists.txt b/src/analyzer/protocol/ssl/CMakeLists.txt index 57f9b47e4d..f1838e5f3b 100644 --- a/src/analyzer/protocol/ssl/CMakeLists.txt +++ b/src/analyzer/protocol/ssl/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(SSL) +bro_plugin_begin(Bro SSL) bro_plugin_cc(SSL.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_bif(functions.bif) diff --git a/src/analyzer/protocol/ssl/Plugin.cc b/src/analyzer/protocol/ssl/Plugin.cc index 5edbecd480..c63be864f8 100644 --- a/src/analyzer/protocol/ssl/Plugin.cc +++ b/src/analyzer/protocol/ssl/Plugin.cc @@ -3,7 +3,7 @@ #include "SSL.h" -BRO_PLUGIN_BEGIN(SSL) +BRO_PLUGIN_BEGIN(Bro, SSL) BRO_PLUGIN_DESCRIPTION("SSL analyzer"); BRO_PLUGIN_ANALYZER("SSL", ssl::SSL_Analyzer); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/analyzer/protocol/stepping-stone/CMakeLists.txt b/src/analyzer/protocol/stepping-stone/CMakeLists.txt index 4de6210027..042f5bc858 100644 --- a/src/analyzer/protocol/stepping-stone/CMakeLists.txt +++ b/src/analyzer/protocol/stepping-stone/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(SteppingStone) +bro_plugin_begin(Bro SteppingStone) bro_plugin_cc(SteppingStone.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_end() diff --git a/src/analyzer/protocol/stepping-stone/Plugin.cc b/src/analyzer/protocol/stepping-stone/Plugin.cc index bde87384fa..129b95fb25 100644 --- a/src/analyzer/protocol/stepping-stone/Plugin.cc +++ b/src/analyzer/protocol/stepping-stone/Plugin.cc @@ -3,7 +3,7 @@ #include "SteppingStone.h" -BRO_PLUGIN_BEGIN(SteppingStone) +BRO_PLUGIN_BEGIN(Bro, SteppingStone) BRO_PLUGIN_DESCRIPTION("Stepping stone analyzer (deprecated)"); BRO_PLUGIN_ANALYZER("SteppingStone", stepping_stone::SteppingStone_Analyzer); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/analyzer/protocol/syslog/CMakeLists.txt b/src/analyzer/protocol/syslog/CMakeLists.txt index 3fc6b9ea69..5366f94642 100644 --- a/src/analyzer/protocol/syslog/CMakeLists.txt +++ b/src/analyzer/protocol/syslog/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(Syslog) +bro_plugin_begin(Bro Syslog) bro_plugin_cc(Syslog.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_pac(syslog.pac syslog-analyzer.pac syslog-protocol.pac) diff --git a/src/analyzer/protocol/syslog/Plugin.cc b/src/analyzer/protocol/syslog/Plugin.cc index 0616cace14..67abaaf970 100644 --- a/src/analyzer/protocol/syslog/Plugin.cc +++ b/src/analyzer/protocol/syslog/Plugin.cc @@ -3,7 +3,7 @@ #include "Syslog.h" -BRO_PLUGIN_BEGIN(Syslog) +BRO_PLUGIN_BEGIN(Bro, Syslog) BRO_PLUGIN_DESCRIPTION("Syslog analyzer (UDP-only currently)"); BRO_PLUGIN_ANALYZER("Syslog", syslog::Syslog_Analyzer); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/analyzer/protocol/tcp/CMakeLists.txt b/src/analyzer/protocol/tcp/CMakeLists.txt index f61f27495b..d4b2dc3eab 100644 --- a/src/analyzer/protocol/tcp/CMakeLists.txt +++ b/src/analyzer/protocol/tcp/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(TCP) +bro_plugin_begin(Bro TCP) bro_plugin_cc(TCP.cc TCP_Endpoint.cc TCP_Reassembler.cc ContentLine.cc Stats.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_bif(functions.bif) diff --git a/src/analyzer/protocol/tcp/Plugin.cc b/src/analyzer/protocol/tcp/Plugin.cc index 8342f2ed3e..6132b6f386 100644 --- a/src/analyzer/protocol/tcp/Plugin.cc +++ b/src/analyzer/protocol/tcp/Plugin.cc @@ -3,7 +3,7 @@ #include "TCP.h" -BRO_PLUGIN_BEGIN(TCP) +BRO_PLUGIN_BEGIN(Bro, TCP) BRO_PLUGIN_DESCRIPTION("TCP analyzer"); BRO_PLUGIN_ANALYZER("TCP", tcp::TCP_Analyzer); BRO_PLUGIN_ANALYZER("TCPStats", tcp::TCPStats_Analyzer); diff --git a/src/analyzer/protocol/teredo/CMakeLists.txt b/src/analyzer/protocol/teredo/CMakeLists.txt index cf4d2a9bcf..c9c4a84db6 100644 --- a/src/analyzer/protocol/teredo/CMakeLists.txt +++ b/src/analyzer/protocol/teredo/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(Teredo) +bro_plugin_begin(Bro Teredo) bro_plugin_cc(Teredo.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_end() diff --git a/src/analyzer/protocol/teredo/Plugin.cc b/src/analyzer/protocol/teredo/Plugin.cc index 38f3a8edd9..91de23b318 100644 --- a/src/analyzer/protocol/teredo/Plugin.cc +++ b/src/analyzer/protocol/teredo/Plugin.cc @@ -3,7 +3,7 @@ #include "Teredo.h" -BRO_PLUGIN_BEGIN(Teredo) +BRO_PLUGIN_BEGIN(Bro, Teredo) BRO_PLUGIN_DESCRIPTION("Teredo analyzer"); BRO_PLUGIN_ANALYZER("Teredo", teredo::Teredo_Analyzer); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/analyzer/protocol/udp/CMakeLists.txt b/src/analyzer/protocol/udp/CMakeLists.txt index 077c4136b5..0c92be60a3 100644 --- a/src/analyzer/protocol/udp/CMakeLists.txt +++ b/src/analyzer/protocol/udp/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(UDP) +bro_plugin_begin(Bro UDP) bro_plugin_cc(UDP.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_end() diff --git a/src/analyzer/protocol/udp/Plugin.cc b/src/analyzer/protocol/udp/Plugin.cc index c18a846e00..0dbf0f80ca 100644 --- a/src/analyzer/protocol/udp/Plugin.cc +++ b/src/analyzer/protocol/udp/Plugin.cc @@ -3,7 +3,7 @@ #include "analyzer/protocol/udp/UDP.h" -BRO_PLUGIN_BEGIN(UDP) +BRO_PLUGIN_BEGIN(Bro, UDP) BRO_PLUGIN_DESCRIPTION("UDP Analyzer"); BRO_PLUGIN_ANALYZER("UDP", udp::UDP_Analyzer); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/analyzer/protocol/zip/CMakeLists.txt b/src/analyzer/protocol/zip/CMakeLists.txt index 5b2864c618..814119f9f7 100644 --- a/src/analyzer/protocol/zip/CMakeLists.txt +++ b/src/analyzer/protocol/zip/CMakeLists.txt @@ -3,7 +3,7 @@ include(BroPlugin) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -bro_plugin_begin(ZIP) +bro_plugin_begin(Bro ZIP) bro_plugin_cc(ZIP.cc Plugin.cc) bro_plugin_bif(events.bif) bro_plugin_end() diff --git a/src/analyzer/protocol/zip/Plugin.cc b/src/analyzer/protocol/zip/Plugin.cc index 5ab2b60baf..b55accccb3 100644 --- a/src/analyzer/protocol/zip/Plugin.cc +++ b/src/analyzer/protocol/zip/Plugin.cc @@ -3,7 +3,7 @@ #include "ZIP.h" -BRO_PLUGIN_BEGIN(ZIP) +BRO_PLUGIN_BEGIN(Bro, ZIP) BRO_PLUGIN_DESCRIPTION("Generic ZIP support analyzer"); BRO_PLUGIN_ANALYZER_BARE("ZIP"); BRO_PLUGIN_BIF_FILE(events); diff --git a/src/bro.bif b/src/bro.bif index 6ad7dccc3a..4120bbdc9d 100644 --- a/src/bro.bif +++ b/src/bro.bif @@ -2626,8 +2626,6 @@ function decode_base64_custom%(s: string, a: string%): string %} %%{ -#include "analyzer/protocol/dce-rpc/DCE_RPC.h" - typedef struct { uint32 time_low; uint16 time_mid; diff --git a/src/builtin-func.l b/src/builtin-func.l index b2da7cb7c3..9555103857 100644 --- a/src/builtin-func.l +++ b/src/builtin-func.l @@ -193,7 +193,7 @@ void init_alternative_mode() snprintf(auto_gen_comment, n, "This file was automatically generated by bifcl from %s (%s mode).", - input_filename_with_path, plugin ? "plugin" : "subdir"); + input_filename_with_path, plugin ? "plugin" : "alternative"); fprintf(fp_bro_init, "# %s\n\n", auto_gen_comment); fprintf(fp_func_def, "// %s\n\n", auto_gen_comment); @@ -211,10 +211,15 @@ void init_alternative_mode() *p = '_'; } + fprintf(fp_func_h, "#if defined(BRO_IN_NETVAR) || ! defined(%s)\n", guard); + + fprintf(fp_func_h, "#ifndef BRO_IN_NETVAR\n"); fprintf(fp_func_h, "#ifndef %s\n", guard); fprintf(fp_func_h, "#define %s\n", guard); - fprintf(fp_func_h, "\n"); fprintf(fp_func_h, "#include \"bro-bif.h\"\n"); + fprintf(fp_func_h, "#endif\n"); + fprintf(fp_func_h, "#endif\n"); + fprintf(fp_func_h, "\n"); fprintf(fp_func_def, "\n"); fprintf(fp_func_def, "#include \"%s.h\"\n", input_filename); diff --git a/src/plugin/Macros.h b/src/plugin/Macros.h index 6912023cc4..4f84b037f9 100644 --- a/src/plugin/Macros.h +++ b/src/plugin/Macros.h @@ -9,14 +9,14 @@ #define _BRO_PLUGIN_VERSION_DEFAULT -1 -#define BRO_PLUGIN_BEGIN(_name) \ - namespace plugin { namespace _name { \ +#define BRO_PLUGIN_BEGIN(_ns, _name) \ + namespace plugin { namespace _ns ## _ ## _name {\ class Plugin : public plugin::Plugin { \ protected: \ void Init() \ { \ - SetName(#_name); \ - SetVersion(_BRO_PLUGIN_VERSION_DEFAULT); \ + SetName(#_ns "::" #_name); \ + SetVersion(_BRO_PLUGIN_VERSION_DEFAULT);\ SetAPIVersion(BRO_PLUGIN_API_VERSION); #define BRO_PLUGIN_END \