]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
swipe added and compiles
authorJosh <jrosenba@cisco.com>
Thu, 17 Apr 2014 21:45:47 +0000 (17:45 -0400)
committerJosh <jrosenba@cisco.com>
Thu, 17 Apr 2014 21:45:47 +0000 (17:45 -0400)
src/codecs/plugins/cd_swipe.cc
src/protocols/packet.h

index 787b95cb3a92ba6cbebc6d9612e1e2e1378bceeb..39866f11ea0520c9d79f98bfa6e152a7dcd2e8b2 100644 (file)
 #include "config.h"
 #endif
 
-#ifdef HAVE_DUMBNET_H
-#include <dumbnet.h>
-#else
-#include <dnet.h>
-#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<uint16_t> &proto_ids)
+void SwipeCodec::get_protocol_ids(std::vector<uint16_t> &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
 };
 
 
index 1bc261d903ec6a3701fe5de567b1cfc7e26519a0..d5ed85a2fc685283eb533e2c8beab4e7751ba811 100644 (file)
@@ -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