From: Russ Combs Date: Tue, 10 Jun 2014 19:49:44 +0000 (-0400) Subject: pulled in joshs codecs updates X-Git-Tag: 3.0.0-233~1496 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89b08cff26fd5b86f3e2bd79f389776b6cee1fa8;p=thirdparty%2Fsnort3.git pulled in joshs codecs updates --- 89b08cff26fd5b86f3e2bd79f389776b6cee1fa8 diff --cc src/codecs/Makefile.am index 22b9252b0,ff49b8de9..53f521548 --- a/src/codecs/Makefile.am +++ b/src/codecs/Makefile.am @@@ -5,15 -3,11 +5,15 @@@ x_includedir = $(pkgincludedir)/codec noinst_LIBRARIES = libcodecs.a noinst_LIBRARIES += libcodec_utils.a +x_include_HEADERS = \ - layer.h \ +sf_protocols.h + libcodecs_a_SOURCES = \ codec_api.cc \ codec_api.h \ +decode.h \ + decode_module.h \ -sf_protocols.h +decode_module.h libcodec_utils_a_SOURCES = \ codec_events.cc \ diff --cc src/codecs/root/cd_tr_module.h index 2520647bb,fcf5dfe71..8e3d08e55 --- a/src/codecs/root/cd_tr_module.h +++ b/src/codecs/root/cd_tr_module.h @@@ -18,17 -17,22 +17,21 @@@ ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - #ifndef LAYER_H - #define LAYER_H + // cd_trk_module.h author Josh Rosenbaum - #include "codecs/sf_protocols.h" + #ifndef CD_TRK_MODULE_H + #define CD_TRK_MODULE_H - struct Layer + #include "codecs/decode_module.h" + - + #define CD_TR_NAME "cd_tr" + + class TrCodecModule : public DecodeModule { - uint16_t prot_id; - PROTO_ID proto; - uint16_t length; - uint8_t* start; + public: + TrCodecModule(); + + bool set(const char*, Value&, SnortConfig*); }; #endif diff --cc src/framework/codec.h index aa852348e,8eb8371d5..1244664a1 --- a/src/framework/codec.h +++ b/src/framework/codec.h @@@ -21,39 -21,41 +21,41 @@@ #define CODEC_H #include + #include -#include "snort_types.h" +#include "main/snort_types.h" #include "framework/base_api.h" - #include "protocols/packet.h" - - - // REMOVE WHEN POSSIBLE!!! - + #include "codecs/sf_protocols.h" + #include "protocols/icmp4.h" + #include "packet.h" + struct Packet; struct Layer; - typedef enum { - ENC_TCP_FIN, ENC_TCP_RST, - ENC_UNR_NET, ENC_UNR_HOST, - ENC_UNR_PORT, ENC_UNR_FW, + enum EncodeType{ + ENC_TCP_FIN, + ENC_TCP_RST, + ENC_UNR_NET, + ENC_UNR_HOST, + ENC_UNR_PORT, + ENC_UNR_FW, ENC_TCP_PUSH, ENC_MAX - } EncodeType; - - #define ENC_FLAG_FWD 0x80000000 // send in forward direction - #define ENC_FLAG_SEQ 0x40000000 // VAL bits contain seq adj - #define ENC_FLAG_ID 0x20000000 // use randomized IP ID - #define ENC_FLAG_NET 0x10000000 // stop after innermost network (ip4/6) layer - #define ENC_FLAG_DEF 0x08000000 // stop before innermost ip4 opts or ip6 frag header - #define ENC_FLAG_RAW 0x04000000 // don't encode outer eth header (this is raw ip) - #define ENC_FLAG_RES 0x03000000 // bits reserved for future use - #define ENC_FLAG_VAL 0x00FFFFFF // bits for adjusting seq and/or ack - const uint8_t MIN_TTL = 64; - const uint8_t MAX_TTL = 255; + }; + typedef uint32_t EncodeFlags; + const uint32_t ENC_FLAG_FWD = 0x80000000; // send in forward direction + const uint32_t ENC_FLAG_SEQ = 0x40000000; // VAL bits contain seq adj + const uint32_t ENC_FLAG_ID = 0x20000000; // use randomized IP ID + const uint32_t ENC_FLAG_NET = 0x10000000; // stop after innermost network (ip4/6) layer + const uint32_t ENC_FLAG_DEF = 0x08000000; // stop before innermost ip4 opts or ip6 frag header + const uint32_t ENC_FLAG_RAW = 0x04000000; // don't encode outer eth header (this is raw ip) + const uint32_t ENC_FLAG_RES = 0x03000000; // bits reserved for future use + const uint32_t ENC_FLAG_VAL = 0x00FFFFFF; // bits for adjusting seq and/or ack + - typedef struct { + struct EncState{ EncodeType type; EncodeFlags flags; diff --cc src/protocols/Makefile.am index fafca5d7e,0e9f1d889..28f48f679 --- a/src/protocols/Makefile.am +++ b/src/protocols/Makefile.am @@@ -11,8 -12,10 +12,10 @@@ icmp4.h icmp6.h \ ipv4.h \ ipv6.h \ + gre.h \ + layer.h \ -layer.cc \ mpls.h \ +packet.h \ protocol_ids.h \ tcp.h \ teredo.h \