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}"
)
# APPLE is defined by Cmake
if (APPLE)
set(MACOS 1)
+ set(CMAKE_MACOSX_RPATH OFF)
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++
if (STATIC_CODECS)
set (STATIC_CODEC_LIBRARIES
link_codecs
+ root_codecs
)
endif()
ips_actions
managers
codecs
- root_codecs
ip_codecs
misc_codecs
${STATIC_CODEC_LIBRARIES}
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 = \
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 \
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
** 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>
** 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>
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 \
cd_trans_bridge.cc \
cd_vlan.cc
-
-if STATIC_CODECS
-liblink_codecs_a_SOURCES = $(plugin_list)
-
else
ehlibdir = $(pkglibdir)/codecs
-include_directories(${PCAP_INCLUDE_DIR})
+include_directories (${PCAP_INCLUDE_DIR})
if (STATIC_CODECS)
- set( PLUGIN_LIST
+ set (PLUGIN_LIST
cd_eth.cc
cd_raw4.cc
cd_raw6.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)
+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)
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 \
#root_i4lciscoip.cc
-
else
ehlibdir = $(pkglibdir)/codecs
** 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>
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
/* 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 */
//-------------------------------------------------------------------------
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 =
** 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
** 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
** 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
** 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
** 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
** 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
** 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
** 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
** 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
** 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
** 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
** 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
** 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
** 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
** 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
** 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
** 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
** 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