From e6af837b25871bee143841337363ab4ed89ab58e Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 2 Dec 2011 08:19:12 +0100 Subject: [PATCH] Convert StreamTcpSetEvent function into macro. Eases debug. --- src/stream-tcp-private.h | 5 +++++ src/stream-tcp.c | 5 ----- src/stream-tcp.h | 2 -- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/stream-tcp-private.h b/src/stream-tcp-private.h index 2dcb6fa9f2..a937500d0a 100644 --- a/src/stream-tcp-private.h +++ b/src/stream-tcp-private.h @@ -164,6 +164,11 @@ enum } while(0); \ } +#define StreamTcpSetEvent(p, e) { \ + SCLogDebug("setting event %"PRIu8" on pkt %p (%"PRIu64")", (e), p, (p)->pcap_cnt); \ + ENGINE_SET_EVENT((p), (e)); \ +} + typedef struct TcpSession_ { uint8_t state; uint16_t flags; diff --git a/src/stream-tcp.c b/src/stream-tcp.c index 7d6b8812b3..0eae56c7f7 100644 --- a/src/stream-tcp.c +++ b/src/stream-tcp.c @@ -585,11 +585,6 @@ void StreamTcpSetOSPolicy(TcpStream *stream, Packet *p) } -void StreamTcpSetEvent(Packet *p, uint8_t e) { - SCLogDebug("setting event %"PRIu8" on pkt %p (%"PRIu64")", e, p, p->pcap_cnt); - ENGINE_SET_EVENT(p, e); -} - /** * \brief macro to update last_ack only if the new value is higher * diff --git a/src/stream-tcp.h b/src/stream-tcp.h index acda90acc5..7460d298ff 100644 --- a/src/stream-tcp.h +++ b/src/stream-tcp.h @@ -106,8 +106,6 @@ int StreamTcpCheckMemcap(uint64_t); void StreamTcpPseudoPacketSetupHeader(Packet *, Packet *); Packet *StreamTcpPseudoSetup(Packet *, uint8_t *, uint32_t); -void StreamTcpSetEvent(Packet *p, uint8_t e); - int StreamTcpSegmentForEach(Packet *p, uint8_t flag, StreamSegmentCallback CallbackFunc, void *data);