From: Josh Date: Mon, 28 Apr 2014 21:36:06 +0000 (-0400) Subject: correcting cd_swipe.c X-Git-Tag: 3.0.0-233~1542^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf8ba1c3049ac398d02389c177e43003b2e97041;p=thirdparty%2Fsnort3.git correcting cd_swipe.c --- diff --git a/src/codecs/plugins/cd_swipe.cc b/src/codecs/plugins/cd_swipe.cc index 4f8a54e9a..1fe241a9d 100644 --- a/src/codecs/plugins/cd_swipe.cc +++ b/src/codecs/plugins/cd_swipe.cc @@ -42,12 +42,20 @@ public: SwipeCodec() : Codec("swipe"){}; virtual ~SwipeCodec(){}; + virtual void get_protocol_ids(std::vector& 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 &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 &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, }; diff --git a/src/codecs/plugins/cd_vlan.cc b/src/codecs/plugins/cd_vlan.cc index fb9c97d2b..33b8e74c7 100644 --- a/src/codecs/plugins/cd_vlan.cc +++ b/src/codecs/plugins/cd_vlan.cc @@ -39,7 +39,6 @@ public: VlanCodec() : Codec("vlan"){}; ~VlanCodec(){}; - virtual void get_protocol_ids(std::vector& v); virtual bool decode(const uint8_t *raw_pkt, const uint32_t len, Packet *, uint16_t &lyr_len, int &next_prot_id);