src/Makefile \
src/codecs/Makefile \
src/codecs/cd_eapol/Makefile \
-src/codecs/cd_i4l_rawip/Makefile \
src/codecs/cd_linux_sll/Makefile \
src/codecs/cd_null/Makefile \
src/codecs/cd_pflog/Makefile \
add_subdirectory ( cd_eapol )
-add_subdirectory ( cd_i4l_rawip )
add_subdirectory ( cd_linux_sll )
add_subdirectory ( cd_null )
add_subdirectory ( cd_pflog )
SUBDIRS = \
cd_eapol \
-cd_i4l_rawip \
cd_linux_sll \
cd_null \
cd_pflog \
+++ /dev/null
-cmake_minimum_required ( VERSION 2.8.11 )
-project ( cd_i4l_rawip CXX )
-
-if ( APPLE )
- set ( CMAKE_MACOSX_RPATH OFF )
- set (
- CMAKE_SHARED_LINKER_FLAGS
- "${CMAKE_SHARED_LINKER_FLAGS} -undefined dynamic_lookup"
- )
-endif ( APPLE )
-
-include ( FindPkgConfig )
-pkg_search_module ( SNORT3 REQUIRED snort>=3 )
-
-add_library (
- cd_i4l_rawip SHARED
- cd_i4l_rawip.cc
-)
-
-set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
-
-target_include_directories (
- cd_i4l_rawip PUBLIC
- ${SNORT3_INCLUDE_DIRS}
-)
-
-install (
- TARGETS cd_i4l_rawip
- LIBRARY DESTINATION "lib/${CMAKE_PROJECT_NAME}/codecs"
-)
+++ /dev/null
-cd_i4l_rawiplibdir = $(pkglibdir)/codecs
-
-AM_CXXFLAGS = @SNORT3_CFLAGS@ -std=c++11
-
-cd_i4l_rawiplib_LTLIBRARIES = libcd_i4l_rawip.la
-libcd_i4l_rawip_la_CXXFLAGS = $(AM_CXXFLAGS)
-libcd_i4l_rawip_la_LDFLAGS = -export-dynamic -shared -avoid-version
-libcd_i4l_rawip_la_SOURCES = cd_i4l_rawip.cc
+++ /dev/null
-//--------------------------------------------------------------------------
-// Copyright (C) 2014-2016 Cisco and/or its affiliates. All rights reserved.
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the terms of the GNU General Public License Version 2 as published
-// by the Free Software Foundation. You may not use, modify or distribute
-// this program under any other version of the GNU General Public License.
-//
-// This program is distributed in the hope that it will be useful, but
-// WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program; if not, write to the Free Software Foundation, Inc.,
-// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-//--------------------------------------------------------------------------
-// cd_i4l_rawip.cc author Josh Rosenbaum <jrosenba@cisco.com>
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <pcap.h>
-#include "framework/codec.h"
-
-#define I4L_RAWIP_NAME "i4l_rawip"
-#define I4L_RAWIP_HELP_STR "support for I4L IP"
-
-#ifdef DLT_I4L_RAWIP
-#define I4L_RAWIP_HELP ADD_DLT(I4L_RAWIP_HELP_STR, DLT_I4L_RAWIP)
-#else
-#define I4L_RAWIP_HELP I4L_RAWIP_HELP_STR
-#endif
-
-namespace
-{
-class I4LRawIpCodec : public Codec
-{
-public:
- I4LRawIpCodec() : Codec(I4L_RAWIP_NAME) { }
- ~I4LRawIpCodec() { }
-
- void get_data_link_type(std::vector<int>&) override;
- bool decode(const RawData&, CodecData&, DecodeData&) override;
-};
-} // namespace
-
-void I4LRawIpCodec::get_data_link_type(std::vector<int>& v)
-{
-#ifdef DLT_I4L_RAWIP
- v.push_back(DLT_I4L_RAWIP);
-#else
- UNUSED(v);
-#endif
-}
-
-bool I4LRawIpCodec::decode(const RawData& raw, CodecData& codec, DecodeData&)
-{
- if (raw.len < 2)
- return false;
-
- codec.lyr_len = 2;
- codec.next_prot_id = ProtocolId::ETHERTYPE_IPV4;
- return true;
-}
-
-//-------------------------------------------------------------------------
-// api
-//-------------------------------------------------------------------------
-
-static Codec* ctor(Module*)
-{ return new I4LRawIpCodec(); }
-
-static void dtor(Codec* cd)
-{ delete cd; }
-
-static const CodecApi i4l_rawip_api =
-{
- {
- PT_CODEC,
- sizeof(CodecApi),
- CDAPI_VERSION,
- 0,
- API_RESERVED,
- API_OPTIONS,
- I4L_RAWIP_NAME,
- I4L_RAWIP_HELP,
- nullptr, // mod_ctor
- nullptr // mod_dtor
- },
- nullptr, // ginit
- nullptr, // gterm
- nullptr, // tinit
- nullptr, // tterm
- ctor,
- dtor,
-};
-
-SO_PUBLIC const BaseApi* snort_plugins[] =
-{
- &i4l_rawip_api.base,
- nullptr
-};
#include "config.h"
#endif
-#include <pcap.h>
+extern "C" {
+#include <sfbpf_dlt.h>
+}
+
#include "framework/codec.h"
#include "protocols/linux_sll.h"
void LinuxSllCodec::get_data_link_type(std::vector<int>& v)
{
-#ifdef DLT_LINUX_SLL
v.push_back(DLT_LINUX_SLL);
-#endif
}
bool LinuxSllCodec::decode(const RawData& raw, CodecData& data, DecodeData&)
#include "config.h"
#endif
-#include <pcap.h>
+extern "C" {
+#include <sfbpf_dlt.h>
+}
#include "framework/codec.h"
#include "protocols/protocol_ids.h"
#include "config.h"
#endif
-#include <pcap.h>
-#include "framework/codec.h"
+extern "C" {
+#include <sfbpf_dlt.h>
+}
-#ifndef DLT_PFLOG
-#define DLT_PFLOG 117
-#endif
+#include "framework/codec.h"
#define PFLOG_NAME "pflog"
#define PFLOG_HELP_STR "support for OpenBSD PF log"
#include "config.h"
#endif
-#include <cstdint>
+#include <stdint.h>
+
+extern "C" {
+#include <sfbpf_dlt.h>
+}
+
#include "framework/codec.h"
#define PPP_NAME "ppp"
};
} // namespace
-#ifndef DLT_PPP
-static constexpr int DLT_PPP = 9;
-#endif
-
static constexpr uint8_t CHDLC_ADDR_BROADCAST = 0xff;
static constexpr uint8_t CHDLC_CTRL_UNNUMBERED = 0x03;
#include "config.h"
#endif
-#include <pcap.h>
+extern "C" {
+#include <sfbpf_dlt.h>
+}
#include "framework/codec.h"
#include "protocols/protocol_ids.h"
#include "config.h"
#endif
-#include <pcap.h>
+extern "C" {
+#include <sfbpf_dlt.h>
+}
#include "framework/codec.h"
#include "protocols/protocol_ids.h"
//--------------------------------------------------------------------------
// cd_sip.cc author Josh Rosenbaum <jrosenba@cisco.com>
-#include <pcap.h>
-#include <cstdint>
+#include <stdint.h>
+
+extern "C" {
+#include <sfbpf_dlt.h>
+}
+
#include "framework/codec.h"
#include "protocols/protocol_ids.h"
void SlipCodec::get_data_link_type(std::vector<int>& v)
{
-#if DLT_SLIP
v.push_back(DLT_SLIP);
-#endif
}
bool SlipCodec::decode(const RawData& raw, CodecData& codec, DecodeData&)
#include "config.h"
#endif
-#include <pcap.h>
+extern "C" {
+#include <sfbpf_dlt.h>
+}
+
#include "protocols/token_ring.h"
#include "framework/codec.h"
#include "codecs/codec_module.h"
-#ifdef DLT_IEEE802
-
namespace
{
#define TR_NAME "token_ring"
nullptr
};
-#endif
-
#include "config.h"
#endif
-#include <pcap.h>
+extern "C" {
+#include <sfbpf_dlt.h>
+}
+
#include "protocols/wlan.h"
#include "framework/codec.h"
#include "codecs/codec_module.h"
#include "protocols/protocol_ids.h"
#include "log/text_log.h"
-#ifndef DLT_IEEE802_11
-#define DLT_IEEE802_11 105
-#endif
-
#define CD_WLAN_NAME "wlan"
#define CD_WLAN_HELP_STR "support for wireless local area network protocol"
#define CD_WLAN_HELP ADD_DLT(CD_WLAN_HELP_STR, DLT_IEEE802_11)
#include "config.h"
#endif
-#include <pcap.h>
+extern "C" {
+#include <sfbpf_dlt.h>
+}
+
#include "codecs/codec_module.h"
#include "framework/codec.h"
#include "protocols/packet.h"
};
} // namespace
-#ifndef DLT_PPP_ETHER
-// For PPP over Eth, the first layer is ethernet.
-constexpr int DLT_PPP_ETHER = 51;
-#endif
-
void EthCodec::get_data_link_type(std::vector<int>& v)
{
v.push_back(DLT_PPP_ETHER);
return 0;
}
- u_int32_t serviceAppId = lua_tointeger(L, index++);
- u_int32_t clienAppId = lua_tointeger(L, index++);
- u_int32_t payloadAppId = lua_tointeger(L, index++);
+ uint32_t serviceAppId = lua_tointeger(L, index++);
+ uint32_t clienAppId = lua_tointeger(L, index++);
+ uint32_t payloadAppId = lua_tointeger(L, index++);
if (ud->validateParams.pkt)
{
#include "config.h"
#endif
+#include <fcntl.h>
#include <grp.h>
#include <luajit.h>
#include <netdb.h>