some minor changes

remotes/origin/master-1.0.x
Gurvinder Singh 16 years ago committed by Victor Julien
parent 94674c58f3
commit 71da019734

@ -22,3 +22,19 @@ void DecodeTunnel(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, uint8_t *pkt
} }
} }
/** \brief Set the No payload inspection Flag for the packet.
*
* \param p Packet to set the flag in
*/
void DecodeSetNoPayloadInspectionFlag(Packet *p) {
p->flags |= PKT_NOPAYLOAD_INSPECTION;
}
/** \brief Set the No packet inspection Flag for the packet.
*
* \param p Packet to set the flag in
*/
void DecodeSetNoPacketInspectionFlag(Packet *p) {
p->flags |= PKT_NOPACKET_INSPECTION;
}

@ -425,6 +425,9 @@ void DecodeGRE(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t,
Packet *SetupPkt (void); Packet *SetupPkt (void);
Packet *TunnelPktSetup(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, uint8_t); Packet *TunnelPktSetup(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, uint8_t);
void DecodeSetNoPayloadInspectionFlag(Packet *);
void DecodeSetNoPacketInspectionFlag(Packet *);
#define DECODER_SET_EVENT(p, e) ((p)->events[(e/8)] |= (1<<(e%8))) #define DECODER_SET_EVENT(p, e) ((p)->events[(e/8)] |= (1<<(e%8)))
#define DECODER_ISSET_EVENT(p, e) ((p)->events[(e/8)] & (1<<(e%8))) #define DECODER_ISSET_EVENT(p, e) ((p)->events[(e/8)] & (1<<(e%8)))
@ -459,5 +462,9 @@ Packet *TunnelPktSetup(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, ui
#define PPP_OVER_GRE 11 #define PPP_OVER_GRE 11
/*Packet Flags*/
#define PKT_NOPACKET_INSPECTION 0x01 /**< Flag to indicate that packet header or contents should not be inspected*/
#define PKT_NOPAYLOAD_INSPECTION 0x02 /**< Flag to indicate that packet contents should not be inspected*/
#endif /* __DECODE_H__ */ #endif /* __DECODE_H__ */

@ -17,8 +17,8 @@
#define FLOW_TOSERVER_IPONLY_SET 0x0020 #define FLOW_TOSERVER_IPONLY_SET 0x0020
#define FLOW_TOCLIENT_IPONLY_SET 0x0040 #define FLOW_TOCLIENT_IPONLY_SET 0x0040
#define FLOW_NOPACKET_INSPECTION 0x0080 #define FLOW_NOPACKET_INSPECTION 0x0080 /**< Flag to indicate the packet belongs to this flow should not be inspected*/
#define FLOW_NOPAYLOAD_INSPECTION 0x0100 #define FLOW_NOPAYLOAD_INSPECTION 0x0100 /**< Flag to indicate the contents or the packet which belongs to this flow should not be inspected*/
/* global flow flags */ /* global flow flags */
#define FLOW_EMERGENCY 0x01 #define FLOW_EMERGENCY 0x01

@ -345,9 +345,9 @@ void FlowHandlePacket (ThreadVars *tv, Packet *p)
/*set the detection bypass flags*/ /*set the detection bypass flags*/
if (f->flags & FLOW_NOPACKET_INSPECTION) if (f->flags & FLOW_NOPACKET_INSPECTION)
FlowSetPktNoPacketInspectionFlag(p); DecodeSetNoPacketInspectionFlag(p);
if (f->flags & FLOW_NOPAYLOAD_INSPECTION) if (f->flags & FLOW_NOPAYLOAD_INSPECTION)
FlowSetPktNoPayloadInspectionFlag(p); DecodeSetNoPayloadInspectionFlag(p);
/* set the flow in the packet */ /* set the flow in the packet */
p->flow = f; p->flow = f;
@ -750,8 +750,8 @@ int FlowSetProtoEmergencyTimeout(uint8_t proto, uint32_t emerg_new_timeout, uint
/** \brief Set the No Packet Inspection Flag after locking the flow. /** \brief Set the No Packet Inspection Flag after locking the flow.
* *
* \param f Flow to set the flag in * \param f Flow to set the flag in
*/ */
void FlowLockSetNoPacketInspectionFlag(Flow *f) { void FlowLockSetNoPacketInspectionFlag(Flow *f) {
mutex_lock(&f->m); mutex_lock(&f->m);
f->flags |= FLOW_NOPACKET_INSPECTION; f->flags |= FLOW_NOPACKET_INSPECTION;
@ -760,16 +760,16 @@ void FlowLockSetNoPacketInspectionFlag(Flow *f) {
/** \brief Set the No Packet Inspection Flag without locking the flow. /** \brief Set the No Packet Inspection Flag without locking the flow.
* *
* \param f Flow to set the flag in * \param f Flow to set the flag in
*/ */
void FlowSetNoPacketInspectionFlag(Flow *f) { void FlowSetNoPacketInspectionFlag(Flow *f) {
f->flags |= FLOW_NOPACKET_INSPECTION; f->flags |= FLOW_NOPACKET_INSPECTION;
} }
/** \brief Set the No payload inspection Flag after locking the flow. /** \brief Set the No payload inspection Flag after locking the flow.
* *
* \param f Flow to set the flag in * \param f Flow to set the flag in
*/ */
void FlowLockSetNoPayloadInspectionFlag(Flow *f) { void FlowLockSetNoPayloadInspectionFlag(Flow *f) {
mutex_lock(&f->m); mutex_lock(&f->m);
f->flags |= FLOW_NOPAYLOAD_INSPECTION; f->flags |= FLOW_NOPAYLOAD_INSPECTION;
@ -778,28 +778,12 @@ void FlowLockSetNoPayloadInspectionFlag(Flow *f) {
/** \brief Set the No payload inspection Flag without locking the flow. /** \brief Set the No payload inspection Flag without locking the flow.
* *
* \param f Flow to set the flag in * \param f Flow to set the flag in
*/ */
void FlowSetNoPayloadInspectionFlag(Flow *f) { void FlowSetNoPayloadInspectionFlag(Flow *f) {
f->flags |= FLOW_NOPAYLOAD_INSPECTION; f->flags |= FLOW_NOPAYLOAD_INSPECTION;
} }
/** \brief Set the No payload inspection Flag for the packet.
*
* \param p Packet to set the flag in
*/
void FlowSetPktNoPayloadInspectionFlag(Packet *p) {
p->flags |= PKT_NOPAYLOAD_INSPECTION;
}
/** \brief Set the No packet inspection Flag for the packet.
*
* \param p Packet to set the flag in
*/
void FlowSetPktNoPacketInspectionFlag(Packet *p) {
p->flags |= PKT_NOPACKET_INSPECTION;
}
#ifdef UNITTESTS #ifdef UNITTESTS
#include "stream-tcp-private.h" #include "stream-tcp-private.h"

@ -19,10 +19,6 @@
#define FLOW_PKT_NOSTREAM 0x40 #define FLOW_PKT_NOSTREAM 0x40
#define FLOW_PKT_STREAMONLY 0x80 #define FLOW_PKT_STREAMONLY 0x80
/*Packet Flags*/
#define PKT_NOPACKET_INSPECTION 0x01
#define PKT_NOPAYLOAD_INSPECTION 0x02
/* global flow config */ /* global flow config */
typedef struct FlowCnf_ typedef struct FlowCnf_
{ {
@ -127,6 +123,10 @@ int FlowSetProtoEmergencyTimeout(uint8_t ,uint32_t ,uint32_t ,uint32_t);
int FlowSetProtoFreeFunc (uint8_t , void (*Free)(void *)); int FlowSetProtoFreeFunc (uint8_t , void (*Free)(void *));
int FlowSetFlowStateFunc (uint8_t , int (*GetProtoState)(void *)); int FlowSetFlowStateFunc (uint8_t , int (*GetProtoState)(void *));
void FlowUpdateQueue(Flow *); void FlowUpdateQueue(Flow *);
void FlowLockSetNoPacketInspectionFlag(Flow *);
void FlowSetNoPacketInspectionFlag(Flow *);
void FlowLockSetNoPayloadInspectionFlag(Flow *);
void FlowSetNoPayloadInspectionFlag(Flow *);
#endif /* __FLOW_H__ */ #endif /* __FLOW_H__ */

@ -57,7 +57,7 @@ enum
#define STREAMTCP_FLAG_NOSERVER_REASSEMBLY 0x40 /**< Flag to avoid stream reassembly / application layer #define STREAMTCP_FLAG_NOSERVER_REASSEMBLY 0x40 /**< Flag to avoid stream reassembly / application layer
inspection for the server stream.*/ inspection for the server stream.*/
#define PAWS_24DAYS 2073600 /* 24 days in seconds */ #define PAWS_24DAYS 2073600 /**< 24 days in seconds */
/* Macro's for comparing Sequence numbers /* Macro's for comparing Sequence numbers
* Page 810 from TCP/IP Illustrated, Volume 2. */ * Page 810 from TCP/IP Illustrated, Volume 2. */

Loading…
Cancel
Save