]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
pulled in joshs codecs updates
authorRuss Combs <rucombs@cisco.com>
Tue, 10 Jun 2014 19:49:44 +0000 (15:49 -0400)
committerRuss Combs <rucombs@cisco.com>
Tue, 10 Jun 2014 19:49:44 +0000 (15:49 -0400)
1  2 
src/codecs/Makefile.am
src/codecs/root/cd_tr_module.h
src/framework/codec.h
src/protocols/Makefile.am
src/protocols/packet.h
src/service_inspectors/back_orifice/back_orifice.cc

index 22b9252b0c9b0c22ca673126b96a3ebc822c0a86,ff49b8de93a7cec052f4d65acc8c501c520c9125..53f521548f98301c55cc447a8a8cca853f89adef
@@@ -5,15 -3,11 +5,15 @@@ x_includedir = $(pkgincludedir)/codec
  noinst_LIBRARIES = libcodecs.a
  noinst_LIBRARIES += libcodec_utils.a
  
- layer.h \
 +x_include_HEADERS = \
 +sf_protocols.h
 +
  libcodecs_a_SOURCES = \
  codec_api.cc \
  codec_api.h \
 -sf_protocols.h
 +decode.h \
+ decode_module.h \
 +decode_module.h
  
  libcodec_utils_a_SOURCES = \
  codec_events.cc \
index 2520647bb2942ff563a28740b4a2e36a011e40fa,fcf5dfe7136f88a27de9978bbfd2799d91c3eeaf..8e3d08e55e335208109f56f2bf62525817f85c75
  ** 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 <jrosenba@cisco.com>
  
- #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
index aa852348e2485d55ea592aee886d731108cb20db,8eb8371d59ea80a2e9fc9fc50d868a746541de58..1244664a19a6d7a07c0abcd79f115b828afeea35
  #define CODEC_H
  
  #include <vector>
+ #include <cstdint>
  
 -#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;
  
index fafca5d7eff4ae09e161c2219fc9783981dbbb25,0e9f1d8898ac8b7bf0701487a17d76e4afe6d241..28f48f6792ee92521e2bb1e5084d8200ed35e506
@@@ -11,8 -12,10 +12,10 @@@ icmp4.h 
  icmp6.h \
  ipv4.h \
  ipv6.h \
 -layer.cc \
+ gre.h \
+ layer.h \
  mpls.h \
 +packet.h \
  protocol_ids.h \
  tcp.h \
  teredo.h \
Simple merge