]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
updating CMake. Fixing plugins.
authorJosh <jrosenba@cisco.com>
Mon, 18 Aug 2014 19:03:41 +0000 (15:03 -0400)
committerJosh <jrosenba@cisco.com>
Mon, 18 Aug 2014 21:13:32 +0000 (17:13 -0400)
30 files changed:
cmake/macros.cmake
cmake/platforms.cmake
src/CMakeLists.txt
src/Makefile.am
src/codecs/CMakeLists.txt
src/codecs/ip/cd_ipv4.cc
src/codecs/ip/cd_ipv6.cc
src/codecs/link/CMakeLists.txt
src/codecs/link/Makefile.am
src/codecs/root/CMakeLists.txt
src/codecs/root/Makefile.am
src/codecs/root/cd_linux_sll.cc
src/protocols/arp.h
src/protocols/eapol.h
src/protocols/eth.h
src/protocols/gre.h
src/protocols/icmp4.h
src/protocols/icmp6.h
src/protocols/ipv4.h
src/protocols/ipv6.h
src/protocols/layer.h
src/protocols/linux_sll.h
src/protocols/mpls.h
src/protocols/protocol_ids.h
src/protocols/tcp.h
src/protocols/teredo.h
src/protocols/token_ring.h
src/protocols/udp.h
src/protocols/vlan.h
src/protocols/wlan.h

index 7f158d99c74ffcf7d9d29cac4f9c8d127647b357..fde5509824836fca7be8b44ee82c83bd373468aa 100644 (file)
@@ -55,8 +55,8 @@ macro (add_shared_library libname install_path)
             COMPILE_FLAGS "-DBUILDING_SO"
             LINK_FLAGS "-export-dynamic -shared"
         )
-        #INSTALL INTO STATIC LIBRARY
-        
+
+        #install into given library
         install (TARGETS ${libname}
             LIBRARY DESTINATION "lib/${CMAKE_PROJECT_NAME}/${install_path}"
         )
index aab68a314093318b19b3a80d03541be0a8871efb..a5fdf9d1802248aeaf7e47c80573d411b31f1058 100644 (file)
@@ -58,6 +58,7 @@ endif ()
 # APPLE is defined by Cmake
 if (APPLE)
     set(MACOS 1)
+    set(CMAKE_MACOSX_RPATH OFF)
 endif()
 
 
@@ -66,6 +67,7 @@ endif()
 if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
     if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
+        set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -undefined dynamic_lookup")
 
         find_library(CLANG_CXX_LIBRARY 
             NAMES c++
index 96f465d411ac69ab4ea7fd99625b4fd859658ec3..afbcaf2548ee6b3d951a19f76a6bdc4514e10c6a 100644 (file)
@@ -60,6 +60,7 @@ endif()
 if (STATIC_CODECS)
     set (STATIC_CODEC_LIBRARIES
         link_codecs
+        root_codecs
     )
 endif()
 
@@ -115,7 +116,6 @@ target_link_libraries( snort
     ips_actions
     managers
     codecs
-    root_codecs
     ip_codecs
     misc_codecs
     ${STATIC_CODEC_LIBRARIES}
index 3c06e181ba2026dd97321f9f85fc67df36490b49..8bd6c0fe2adc88efb4412e0b16842945e6d2eb19 100644 (file)
@@ -17,6 +17,12 @@ service_inspectors/rpc_decode/librpc_decode.a \
 service_inspectors/wizard/libwizard.a
 endif
 
+if STATIC_CODECS
+codec_list = \
+codecs/root/libroot_codecs.a \
+codecs/link/liblink_codecs.a
+endif
+
 # order libs to avoid undefined symbols
 # from gnu linker
 snort_LDADD = \
@@ -26,9 +32,8 @@ main/libmain.a \
 loggers/libloggers.a \
 codecs/libcodecs.a \
 codecs/ip/libip_codecs.a \
-codecs/link/liblink_codecs.a \
 codecs/misc/libmisc_codecs.a \
-codecs/root/libroot_codecs.a \
+${codec_list} \
 codecs/libcodec_utils.a \
 network_inspectors/libnetwork_inspectors.a \
 network_inspectors/binder/libbinder.a \
index c5690651a87dcf022d388433e358fa83dfb56932..4742a83d4f2ebdb968d01033b76043e25affec9f 100644 (file)
@@ -23,12 +23,12 @@ add_library( codecs STATIC
 if (STATIC_CODECS)
     set (CODEC_PLUGIN_LIBRARIES
         link_codecs
+        root_codecs
     )
 endif(STATIC_CODECS)
 
 target_link_libraries( codecs
     ${CODEC_PLUGIN_LIBRARIES}
-    root_codecs
     ip_codecs
     misc_codecs
     protocols
index a1f19b59d37ac1b78e8b50548fd7c740676eaac4..4608764f2759ec60ee5ccde348e6405ac49197c0 100644 (file)
@@ -17,6 +17,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
+// cd_ipv4.cc author Josh Rosenbaum <jrosenba@cisco.com>
 
 
 
index cb41c671817b60774fad38f318a655fcfd2a6e65..d73d0c5edadf20ee30d0cf7cb86368f598bd5b09 100644 (file)
@@ -17,6 +17,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
+// cd_ipv6.cc author Josh Rosenbaum <jrosenba@cisco.com>
 
 
 
index 38e44dcd7ee93a0c03c93f70f78c4d7833a0a848..56ce83e72e80803fa83d3d15582eebe6d2a08bdf 100644 (file)
@@ -46,4 +46,3 @@ if(STATIC_CODECS)
     )
 
 endif(STATIC_CODECS)
-
index f746cf83afebaf4babbd45da7221cca4fc5ee752..3025395c2c385e66ec34ab12d345cc3aac9728b6 100644 (file)
@@ -1,9 +1,10 @@
 AUTOMAKE_OPTIONS=foreign no-dependencies
 
-noinst_LIBRARIES = liblink_codecs.a
 
+if STATIC_CODECS
+noinst_LIBRARIES = liblink_codecs.a
 
-plugin_list = \
+liblink_codecs_a_SOURCES = \
 cd_arp.cc \
 cd_eapol.cc \
 cd_erspan2.cc \
@@ -14,10 +15,6 @@ cd_pppoe.cc \
 cd_trans_bridge.cc \
 cd_vlan.cc
 
-
-if STATIC_CODECS
-liblink_codecs_a_SOURCES = $(plugin_list)
-
 else
 
 ehlibdir = $(pkglibdir)/codecs
index 546763500cfd504188a1699ee675fc8c6e177182..104ab8b452b3424dd170334c15613703e6fa5d1f 100644 (file)
@@ -1,10 +1,10 @@
 
 
-include_directories(${PCAP_INCLUDE_DIR})
+include_directories (${PCAP_INCLUDE_DIR})
 
 
 if (STATIC_CODECS)
-    setPLUGIN_LIST
+    set (PLUGIN_LIST
         cd_eth.cc
         cd_raw4.cc
         cd_raw6.cc
@@ -26,25 +26,22 @@ if (STATIC_CODECS)
     )
 
 
-else(STATIC_CODECS)
-    add_shared_library(cd_eth codecs cd_eth.cc)
-    add_shared_library(cd_linux_sll codecs cd_linux_sll.cc)
-    add_shared_library(cd_ppp codecs cd_ppp.cc)
-    add_shared_library(cd_raw4 codecs cd_raw4.cc)
-    add_shared_library(cd_raw6 codecs cd_raw6.cc)
-    add_shared_library(cd_null codecs cd_null.cc)
-    add_shared_library(cd_wlan codecs cd_wlan.cc)
+else (STATIC_CODECS)
+    add_shared_library (cd_eth codecs cd_eth.cc)
+    add_shared_library (cd_linux_sll codecs cd_linux_sll.cc)
+    add_shared_library (cd_ppp codecs cd_ppp.cc)
+    add_shared_library (cd_raw4 codecs cd_raw4.cc)
+    add_shared_library (cd_raw6 codecs cd_raw6.cc)
+    add_shared_library (cd_null codecs cd_null.cc)
+    add_shared_library (cd_wlan codecs cd_wlan.cc)
 
-endif(STATIC_CODECS)
+endif (STATIC_CODECS)
 
 
-add_library(root_codecs STATIC
-    ${PLUGIN_LIST}
-    ${PCAP_INCLUDE_DIR}/pcap.h  # rebuild if a new libpcap is installed
-)
+if (STATIC_CODECS)
+    add_library(root_codecs STATIC
+        ${PLUGIN_LIST}
+        ${PCAP_INCLUDE_DIR}/pcap.h  # rebuild if a new libpcap is installed
+    )
 
-target_link_libraries(root_codecs
-    protocols
-    managers
-    ${PCAP_LIBRARIES}
-)
+endif (STATIC_CODECS)
index 04477adfbed90dc79ae0c133bc73e2173ed1cc4e..5ffcf14ba31e0a007e1c881362d591a891f43740 100644 (file)
@@ -1,10 +1,7 @@
 AUTOMAKE_OPTIONS=foreign no-dependencies
 
-noinst_LIBRARIES = libroot_codecs.a
-
-
-
 if STATIC_CODECS
+noinst_LIBRARIES = libroot_codecs.a
 
 libroot_codecs_a_SOURCES = \
 cd_eth.cc \
@@ -26,7 +23,6 @@ cd_wlan.cc
 #root_i4lciscoip.cc
 
 
-
 else
 ehlibdir = $(pkglibdir)/codecs
 
index 45af0b7559b5007d7d94398cf1190661a15b2cf4..3f670123e15a66bab5b5736e13ef03f6b7c351f7 100644 (file)
@@ -17,6 +17,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
+// cd_linux_sll.cc author Josh Rosenbaum <jrosenba@cisco.com>
 
 
 
@@ -47,15 +48,6 @@ public:
         Packet *, uint16_t &lyr_len, uint16_t &next_prot_id);
 };
 
-// Create your own Hdr Struct for this layer!
-struct NameHdr
-{
-    uint8_t ver;
-    uint8_t next_protocol;
-    uint16_t len;
-    // additional or different data
-};
-
 } // namespace
 
 
@@ -72,11 +64,14 @@ bool LinuxSllCodec::decode(const uint8_t *raw_pkt, const uint32_t &raw_len,
     /* do a little validation */
     if(raw_len < linux_sll::SLL_HDR_LEN)
     {
+        #if 0
+        //  How do we log from a plugin??
         if (ScLogVerbose())
         {
             ErrorMessage("Captured data length < SLL header length (your "
                          "libpcap is broken?)! (%d bytes)\n", raw_len);
         }
+        #endif
         return false;
     }
     /* lay the ethernet structure over the packet data */
@@ -95,14 +90,10 @@ bool LinuxSllCodec::decode(const uint8_t *raw_pkt, const uint32_t &raw_len,
 //-------------------------------------------------------------------------
 
 static Codec* ctor(Module*)
-{
-    return new LinuxSllCodec();
-}
+{ return new LinuxSllCodec(); }
 
 static void dtor(Codec *cd)
-{
-    delete cd;
-}
+{ delete cd; }
 
 
 static const CodecApi linux_ssl_api =
index fb4615b790141856a06d34bf9d1c7a54e66c71ce..6775ee4103c61f6e9191c51e18ae647a7188c9c3 100644 (file)
@@ -17,6 +17,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
+// arp.h author Josh Rosenbaum <jrosenba@cisco.com>
 
 
 #ifndef PROTOCOLS_ARP_H
index 2bccde0b003612be76ee13025a4e3c140db6c905..b47e62db04a693983a66777c05064d599994b954 100644 (file)
@@ -17,6 +17,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
+// eapol.h author Josh Rosenbaum <jrosenba@cisco.com>
 
 
 #ifndef PROTOCOLS_EAPOL_H
index 6e051f90a2cbf0e75256df64db8e64a19f4a98a1..3ad53c1839f2de967746dfbcf4d4d67285f6efb5 100644 (file)
@@ -17,6 +17,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
+// eth.h author Josh Rosenbaum <jrosenba@cisco.com>
 
 
 #ifndef PROTOCOLS_ETH_H
index 6911482ee6bebe2effc7cd9e8b708220f89f293c..ed7e201a210c88974ff850bfd186f65ec72d03f3 100644 (file)
@@ -17,6 +17,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
+// gre.h author Josh Rosenbaum <jrosenba@cisco.com>
 
 
 #ifndef PROTOCOLS_GRE_H
index 71216889c36796f888f540b2fcafbe5ca8dfce9c..5d414826775f8b50a2a5885c4a86c4e1ab6d1c53 100644 (file)
@@ -17,6 +17,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
+// icmp4.h author Josh Rosenbaum <jrosenba@cisco.com>
 
 
 #ifndef PROTOCOLS_ICMP4_H
index c2428f473e606ed52eaba65bff8dee309b30b526..96c2f6e0fd01e205d44008ddd329865344452e90 100644 (file)
@@ -17,6 +17,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
+// icmp6.h author Josh Rosenbaum <jrosenba@cisco.com>
 
 
 #ifndef PROTOCOLS_ICMP6_H
index f58bc1e33d2e377c7feba478c88a8ed54e5a0caa..3fa7a08f7befa1ef24bf2085f53f74e686be70a8 100644 (file)
@@ -17,6 +17,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
+// ipv4.h author Josh Rosenbaum <jrosenba@cisco.com>
 
 #ifndef PROTOCOLS_IPV4_H
 #define PROTOCOLS_IPV4_H
index 97d30d78de6668889b1ae85d5d7bc0ecaf2ac305..091a6d163d525ce0789f96fe46431c328cb1f112 100644 (file)
@@ -17,6 +17,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
+// ipv6.h author Josh Rosenbaum <jrosenba@cisco.com>
 
 
 #ifndef PROTOCOLS_IPV6_H
index 8c0c854e121975e1f6e8999893ac31430b45f500..b917ee25b2674df0cdb0fb8f32d541aa4bf200e4 100644 (file)
@@ -17,6 +17,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
+// layer.h author Josh Rosenbaum <jrosenba@cisco.com>
 
 #ifndef PROTOCOLS_LAYER_H
 #define PROTOCOLS_LAYER_H
index b1692bce0f033c54d13b7013004012580eb1d8f6..42732a230934f7013ef27898a608a976d7306f82 100644 (file)
@@ -17,6 +17,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
+// linux_sll.h author Josh Rosenbaum <jrosenba@cisco.com>
 
 
 #ifndef PROTOCOLS_LINUX_SLL_H
index 110ddc739da15b9a248fc5c572d40f78ff43ae41..a1394cadf61cf8a7b264ee941c7559442af1c6ac 100644 (file)
@@ -17,6 +17,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
+// mpls.h author Josh Rosenbaum <jrosenba@cisco.com>
 
 
 #ifndef PROTOCOLS_MPLS_H
index 482f028159b15896579f40d393d165de91e1dcbb..5ffa025b9dcba65c2b5662fc801564de153962e9 100644 (file)
@@ -17,6 +17,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
+// protocol_ids.h author Josh Rosenbaum <jrosenba@cisco.com>
 
 
 #ifndef PROTOCOLS_PROTOCOL_IDS_H
index dd20580f794e80ba57b03c3f0a6f8ea485ecb82d..c8d314d6ff0890d4ebf1e38be6dce0df72d9277b 100644 (file)
@@ -16,6 +16,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
+// tcp.h author Josh Rosenbaum <jrosenba@cisco.com>
 
 
 #ifndef PROTOCOLS_TCP_H
index 106bd79e62060790ac03ac917e33eaa95269e111..9a33a80dc1eb18a1be89dd70dc9356b003cccb3e 100644 (file)
@@ -17,6 +17,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
+// teredo.h author Josh Rosenbaum <jrosenba@cisco.com>
 
 
 #ifndef PROTOCOLS_TEREDO_H
index 59779b55e82401f450f6b441ea8a558a11a57036..e94161823d846d24e30a47e485c2502681852053 100644 (file)
@@ -17,6 +17,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
+// token_ring.h author Josh Rosenbaum <jrosenba@cisco.com>
 
 
 #ifndef PROTOCOLS_TOKEN_RING_H
index e991536a50dc4c283aa4936f478315e2872e21e6..c6e45b57b917c9bffc972901b848476d2b0452d3 100644 (file)
@@ -17,6 +17,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
+// udp.h author Josh Rosenbaum <jrosenba@cisco.com>
 
 
 #ifndef PROTOCOLS_UDP_H
index b2c371a0c03eb5d0d51f57f52f63bc64840f992f..7cfb9ff4a9f8a992e09f6e9843b32abf222bd067 100644 (file)
@@ -17,6 +17,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
+// vlan.h author Josh Rosenbaum <jrosenba@cisco.com>
 
 
 #ifndef PROTOCOLS_VLAN_H
index d22795172589ea126c7a2191acaf41bb223d787e..afe50c34bb4f22c6ebbd69cfab04a5f235054968 100644 (file)
@@ -17,6 +17,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
+// wlan.h author Josh Rosenbaum <jrosenba@cisco.com>
 
 
 #ifndef PROTOCOLS_WLAN_H