** 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
#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;