]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
correcting cd_swipe.c
authorJosh <jrosenba@cisco.com>
Mon, 28 Apr 2014 21:36:06 +0000 (17:36 -0400)
committerJosh <jrosenba@cisco.com>
Mon, 28 Apr 2014 21:36:06 +0000 (17:36 -0400)
src/codecs/plugins/cd_swipe.cc
src/codecs/plugins/cd_vlan.cc

index 4f8a54e9a2f576472deb900cdb8329715f7c1ee4..1fe241a9df9b6dfffb6e0808f10f0d1bf251c26e 100644 (file)
@@ -42,12 +42,20 @@ public:
     SwipeCodec() : Codec("swipe"){};
     virtual ~SwipeCodec(){};
     
+    virtual void get_protocol_ids(std::vector<uint16_t>& v);
     virtual bool decode(const uint8_t* raw_packet, const uint32_t raw_len, 
         Packet *p, uint16_t &lyr_len, int &next_prot_id);
 };
 
 } // namespace
 
+
+void SwipeCodec::get_protocol_ids(std::vector<uint16_t> &proto_ids)
+{
+    proto_ids.push_back(SWIPE_PROT_ID);
+}
+
+
 bool SwipeCodec::decode(const uint8_t* raw_packet, const uint32_t raw_len, 
         Packet *p, uint16_t &lyr_len, int &next_prot_id)
 {
@@ -66,12 +74,6 @@ bool SwipeCodec::decode(const uint8_t* raw_packet, const uint32_t raw_len,
 // api
 //-------------------------------------------------------------------------
 
-
-static void get_protocol_ids(std::vector<uint16_t> &proto_ids)
-{
-    proto_ids.push_back(SWIPE_PROT_ID);
-}
-
 static Codec *ctor()
 {
     return new SwipeCodec();
@@ -82,18 +84,23 @@ static void dtor(Codec *cd)
     delete cd;
 }
 
-static const char* name = "swipe_codec";
+static const char* name = "swipe";
 static const CodecApi swipe_api =
 {
-    { PT_CODEC, name, CDAPI_PLUGIN_V0, 0 },
+    {
+        PT_CODEC,
+        name,
+        CDAPI_PLUGIN_V0,
+        0,
+        nullptr,
+        nullptr,
+    },
     NULL, // pinit
     NULL, // pterm
     NULL, // tinit
     NULL, // tterm
     ctor, // ctor
     dtor, // dtor
-    NULL,
-    get_protocol_ids,
 };
 
 
index fb9c97d2b3b4c32ade42286eaf288479b3d81b05..33b8e74c7f199ccf7e773657a54a41e0204cc936 100644 (file)
@@ -39,7 +39,6 @@ public:
     VlanCodec() : Codec("vlan"){};
     ~VlanCodec(){};
 
-
     virtual void get_protocol_ids(std::vector<uint16_t>& v);
     virtual bool decode(const uint8_t *raw_pkt, const uint32_t len, 
         Packet *, uint16_t &lyr_len, int &next_prot_id);