From 867b9c6acee3445d8da5d7ded95cd1482192e54e Mon Sep 17 00:00:00 2001 From: snorty Date: Tue, 9 Aug 2016 20:01:32 -0400 Subject: [PATCH] ohi updates for cmake --- src/CMakeLists.txt | 1 - src/decompress/CMakeLists.txt | 15 +++++++--- src/detection/CMakeLists.txt | 4 +-- src/file_api/CMakeLists.txt | 20 ++++++++----- src/log/CMakeLists.txt | 4 +-- src/loggers/CMakeLists.txt | 3 +- src/managers/CMakeLists.txt | 12 ++++++-- src/mime/CMakeLists.txt | 28 +++++++++++-------- src/search_engines/CMakeLists.txt | 2 +- src/service_inspectors/CMakeLists.txt | 2 -- src/service_inspectors/Makefile.am | 1 - .../nhttp_inspect/CMakeLists.txt | 26 ++++------------- src/utils/CMakeLists.txt | 13 ++++----- 13 files changed, 68 insertions(+), 63 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5cba4fa09..ca11b2511 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -111,7 +111,6 @@ target_link_libraries( snort stream_file stream_paf mime - http_inspect imap pop smtp diff --git a/src/decompress/CMakeLists.txt b/src/decompress/CMakeLists.txt index 7ab7f5267..06fc68789 100644 --- a/src/decompress/CMakeLists.txt +++ b/src/decompress/CMakeLists.txt @@ -1,15 +1,22 @@ -add_library (decompress STATIC - file_decomp.cc +set( DECOMPRESS_INCLUDES file_decomp.h - file_decomp_pdf.cc file_decomp_pdf.h - file_decomp_swf.cc file_decomp_swf.h ) +add_library (decompress STATIC + ${DECOMPRESS_INCLUDES} + file_decomp.cc + file_decomp_pdf.cc + file_decomp_swf.cc +) target_link_libraries(decompress log utils ) + +install (FILES ${DECOMPRESS_INCLUDES} + DESTINATION "${INCLUDE_INSTALL_PATH}/decompress" +) diff --git a/src/detection/CMakeLists.txt b/src/detection/CMakeLists.txt index fd45b18e4..974b9d234 100644 --- a/src/detection/CMakeLists.txt +++ b/src/detection/CMakeLists.txt @@ -1,7 +1,9 @@ set (DETECTION_INCLUDES + detect.h detection_defines.h detection_options.h + detection_util.h pattern_match_data.h rule_option_types.h rules.h @@ -12,10 +14,8 @@ set (DETECTION_INCLUDES add_library (detection STATIC ${DETECTION_INCLUDES} detect.cc - detect.h detection_options.cc detection_util.cc - detection_util.h fp_config.cc fp_config.h fp_create.cc diff --git a/src/file_api/CMakeLists.txt b/src/file_api/CMakeLists.txt index 74c24d517..665ad8410 100644 --- a/src/file_api/CMakeLists.txt +++ b/src/file_api/CMakeLists.txt @@ -1,33 +1,39 @@ +set( FILE_API_INCLUDES + file_api.h + file_config.h + file_flows.h + file_identifier.h + file_lib.h + file_policy.h + file_service.h +) add_library ( file_api STATIC + ${FILE_API_INCLUDES} circular_buffer.cc circular_buffer.h - file_api.h file_capture.cc file_capture.h file_config.cc - file_config.h file_enforcer.cc file_enforcer.h file_flows.cc - file_flows.h - file_identifier.h file_identifier.cc file_lib.cc - file_lib.h file_log.cc file_mempool.cc file_mempool.h file_module.cc file_module.h file_policy.cc - file_policy.h file_service.cc - file_service.h file_stats.cc file_stats.h ) target_link_libraries(file_api mime) +install (FILES ${FILE_API_INCLUDES} + DESTINATION "${INCLUDE_INSTALL_PATH}/file_api" +) diff --git a/src/log/CMakeLists.txt b/src/log/CMakeLists.txt index 1506b0a09..7ceb5ec16 100644 --- a/src/log/CMakeLists.txt +++ b/src/log/CMakeLists.txt @@ -1,15 +1,15 @@ - set (LOG_INCLUDES + log.h messages.h obfuscator.h text_log.h + unified2.h ) add_library ( log STATIC ${LOG_INCLUDES} log.cc - log.h log_text.cc log_text.h messages.cc diff --git a/src/loggers/CMakeLists.txt b/src/loggers/CMakeLists.txt index c930e4c84..431e9dc62 100644 --- a/src/loggers/CMakeLists.txt +++ b/src/loggers/CMakeLists.txt @@ -14,7 +14,6 @@ set (PLUGIN_LIST log_hext.cc log_pcap.cc unified2.cc - unified2_common.h ) if (LINUX) @@ -44,7 +43,7 @@ else (STATIC_LOGGERS) add_shared_library(alert_syslog loggers alert_syslog.cc) add_shared_library(log_hext loggers log_hext.cc) add_shared_library(log_pcap loggers log_pcap.cc) - add_shared_library(unified2 loggers unified2.cc unified2_common.h) + add_shared_library(unified2 loggers unified2.cc) endif (STATIC_LOGGERS) diff --git a/src/managers/CMakeLists.txt b/src/managers/CMakeLists.txt index 76a30b3cb..31a475d8b 100644 --- a/src/managers/CMakeLists.txt +++ b/src/managers/CMakeLists.txt @@ -4,7 +4,12 @@ set (LUA_INCLUDES ${CMAKE_CURRENT_BINARY_DIR}/snort_plugin.lua ) -add_library( managers +set( MANAGERS_INCLUDES + inspector_manager.h +) + +add_library( managers STATIC + ${MANAGERS_INCLUDES} action_manager.h action_manager.cc codec_manager.h @@ -12,7 +17,6 @@ add_library( managers event_manager.cc event_manager.h inspector_manager.cc - inspector_manager.h ips_manager.cc ips_manager.h lua_plugin_defs.h @@ -43,6 +47,10 @@ target_link_libraries(managers ips_actions ) +install (FILES ${MANAGERS_INCLUDES} + DESTINATION "${INCLUDE_INSTALL_PATH}/managers" +) + add_custom_command ( OUTPUT snort_plugin.lua COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/ffi_wrap.sh ${CMAKE_CURRENT_SOURCE_DIR}/lua_plugin_defs.h > snort_plugin.lua diff --git a/src/mime/CMakeLists.txt b/src/mime/CMakeLists.txt index dc55ce109..c71405dd1 100644 --- a/src/mime/CMakeLists.txt +++ b/src/mime/CMakeLists.txt @@ -1,30 +1,36 @@ +set( MIME_INCLUDES + decode_b64.h + decode_base.h + decode_bit.h + decode_buffer.h + decode_qp.h + decode_uu.h + file_mime_config.h + file_mime_decode.h + file_mime_log.h + file_mime_paf.h + file_mime_process.h +) add_library ( mime STATIC + ${MIME_INCLUDES} file_mime_config.cc - file_mime_config.h - file_mime_decode.h file_mime_decode.cc - file_mime_log.h file_mime_log.cc - file_mime_paf.h file_mime_paf.cc - file_mime_process.h file_mime_process.cc decode_base.cc - decode_base.h decode_b64.cc - decode_b64.h decode_bit.cc - decode_bit.h decode_buffer.cc - decode_buffer.h decode_qp.cc - decode_qp.h decode_uu.cc - decode_uu.h ) target_link_libraries(mime file_api) +install (FILES ${MIME_INCLUDES} + DESTINATION "${INCLUDE_INSTALL_PATH}/mime" +) diff --git a/src/search_engines/CMakeLists.txt b/src/search_engines/CMakeLists.txt index 5e3947dda..3166be46f 100644 --- a/src/search_engines/CMakeLists.txt +++ b/src/search_engines/CMakeLists.txt @@ -2,6 +2,7 @@ set (SEARCH_ENGINE_INCLUDES pat_stats.h search_common.h + search_tool.h ) set (ACSMX_SOURCES @@ -45,7 +46,6 @@ set (SEARCH_ENGINE_SOURCES search_engines.cc search_engines.h search_tool.cc - search_tool.h ${BNFA_SOURCES} ${HYPER_SOURCES} ) diff --git a/src/service_inspectors/CMakeLists.txt b/src/service_inspectors/CMakeLists.txt index f7fc8f8a6..6fcee8f4d 100644 --- a/src/service_inspectors/CMakeLists.txt +++ b/src/service_inspectors/CMakeLists.txt @@ -5,7 +5,6 @@ add_subdirectory(dnp3) add_subdirectory(dns) add_subdirectory(ftp_telnet) add_subdirectory(gtp) -add_subdirectory(http_inspect) add_subdirectory(imap) add_subdirectory(modbus) add_subdirectory(nhttp_inspect) @@ -44,6 +43,5 @@ add_library( service_inspectors STATIC ) target_link_libraries( service_inspectors - http_inspect ${STATIC_INSECTOR_LIBS} ) diff --git a/src/service_inspectors/Makefile.am b/src/service_inspectors/Makefile.am index eb1fa2ecc..f69de989e 100644 --- a/src/service_inspectors/Makefile.am +++ b/src/service_inspectors/Makefile.am @@ -9,7 +9,6 @@ service_inspectors.h #libservice_inspectors_a_LIBADD = \ #back_orifice/libback_orifice.a \ #ftp_telnet/libftp_telnet.a \ -#http_inspect/libhttp_inspect.a \ #nhttp_inspect/libnhttp_inspect.a \ #rpc_decode/librpc_decode.a #wizard/libwizard.a diff --git a/src/service_inspectors/nhttp_inspect/CMakeLists.txt b/src/service_inspectors/nhttp_inspect/CMakeLists.txt index afc5da585..f499ff05c 100644 --- a/src/service_inspectors/nhttp_inspect/CMakeLists.txt +++ b/src/service_inspectors/nhttp_inspect/CMakeLists.txt @@ -1,18 +1,7 @@ -# Version of the add_shared_library macro that does not set BUILDING_SO -# FIXIT-L eliminate this macro when OHI retired -macro (add_shared_library2 libname install_path) - set (sources ${ARGN}) - - add_library ( ${libname} SHARED ${sources} ) - - install ( - TARGETS ${libname} - LIBRARY - DESTINATION "lib/${CMAKE_PROJECT_NAME}/${install_path}" - ) -endmacro (add_shared_library2) set (FILE_LIST + ips_nhttp.cc + ips_nhttp.h nhttp_inspect.cc nhttp_inspect.h nhttp_msg_section.cc @@ -71,18 +60,13 @@ set (FILE_LIST nhttp_event_gen.h ) -# FIXIT-L merge two file lists when OHI retired -set (IPS_FILE_LIST - ips_nhttp.cc - ips_nhttp.h -) - if (STATIC_INSPECTORS) add_library(nhttp_inspect STATIC ${FILE_LIST}) -# FIXIT-L eliminate this call when OHI retired - add_shared_library2(nhttp_inspect_opt inspectors ${IPS_FILE_LIST}) + else(STATIC_INSPECTORS) add_shared_library(nhttp_inspect inspectors ${FILE_LIST} ${IPS_FILE_LIST}) + endif(STATIC_INSPECTORS) add_subdirectory ( test ) + diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt index 28b50f57c..15f5ecb8b 100644 --- a/src/utils/CMakeLists.txt +++ b/src/utils/CMakeLists.txt @@ -11,17 +11,21 @@ if ( BUILD_SNPRINTF ) ) endif ( BUILD_SNPRINTF ) - set( UTIL_INCLUDES bitop.h dnet_header.h + kmap.h safec.h segment_mem.h sflsq.h sfmemcap.h + sfsnprintfappend.h snort_bounds.h stats.h util.h + util_jsnorm.h + util_unfold.h + util_utf.h ) ADD_LIBRARY( utils STATIC @@ -32,22 +36,17 @@ ADD_LIBRARY( utils STATIC dyn_array.cc dyn_array.h kmap.cc - kmap.h segment_mem.cc sflsq.cc sfmemcap.cc sfsnprintfappend.cc - sfsnprintfappend.h stats.cc util.cc util_jsnorm.cc - util_jsnorm.h util_net.cc util_net.h - util_utf.cc - util_utf.h util_unfold.cc - util_unfold.h + util_utf.cc ) target_link_libraries(utils -- 2.47.2