From: Josh Date: Thu, 17 Apr 2014 21:45:47 +0000 (-0400) Subject: swipe added and compiles X-Git-Tag: 3.0.0-233~1559^2~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fbcb386523f37eabc5ffd711ce65e458b2e55377;p=thirdparty%2Fsnort3.git swipe added and compiles --- diff --git a/src/codecs/plugins/cd_swipe.cc b/src/codecs/plugins/cd_swipe.cc index 787b95cb3..39866f11e 100644 --- a/src/codecs/plugins/cd_swipe.cc +++ b/src/codecs/plugins/cd_swipe.cc @@ -27,12 +27,6 @@ #include "config.h" #endif -#ifdef HAVE_DUMBNET_H -#include -#else -#include -#endif - #include "codecs/decode_module.h" #include "codecs/codec_events.h" @@ -40,13 +34,13 @@ namespace{ const uint32_t ICMP_HEADER_LEN = 4; const uint32_t ICMP_NORMAL_LEN = 8; +const uint16_t SWIPE_PROT_ID = 53; - -class CodecSwipe : public Codec{ +class SwipeCodec : public Codec{ public: - CodecSwipe() : Codec("swipe"){}; - virtual ~CodecSwipe(); + SwipeCodec() : Codec("swipe"){}; + virtual ~SwipeCodec(); virtual bool decode(const uint8_t* raw_packet, const uint32_t raw_len, Packet *p, uint16_t &p_hdr_len, int &next_prot_id); @@ -56,7 +50,7 @@ public: } // namespace -bool CodecSwipe::decode(const uint8_t* raw_packet, const uint32_t raw_len, +bool SwipeCodec::decode(const uint8_t* raw_packet, const uint32_t raw_len, Packet *p, uint16_t &p_hdr_len, int &next_prot_id) { @@ -71,9 +65,9 @@ bool CodecSwipe::decode(const uint8_t* raw_packet, const uint32_t raw_len, return true; } -void CodecSwipe::get_protocol_ids(std::vector &proto_ids) +void SwipeCodec::get_protocol_ids(std::vector &proto_ids) { - proto_ids.push_back(IPPROTO_SWIPE); + proto_ids.push_back(SWIPE_PROT_ID); } @@ -81,7 +75,7 @@ static const char* name = "swipe"; static Codec *ctor() { - return new CodecSwipe(); + return new SwipeCodec(); } static void dtor(Codec *cd) @@ -98,6 +92,8 @@ static const CodecApi udp_api = NULL, // tterm ctor, // ctor dtor, // dtor + NULL, + NULL }; diff --git a/src/protocols/packet.h b/src/protocols/packet.h index 1bc261d90..d5ed85a2f 100644 --- a/src/protocols/packet.h +++ b/src/protocols/packet.h @@ -480,9 +480,6 @@ typedef struct _WifiHdr Source: http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml */ #define MIN_UNASSIGNED_IP_PROTO 143 -#ifndef IPPROTO_SWIPE -#define IPPROTO_SWIPE 53 -#endif #ifndef IPPROTO_IP_MOBILITY #define IPPROTO_IP_MOBILITY 55 #endif