From 2a4fd85d1d2ab27234e1e4fecdd33afc00af0b87 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 1 Dec 2023 09:47:13 +0100 Subject: [PATCH] flow/timeout: use const TcpSession; cleanup prototypes --- src/flow-timeout.c | 13 +++---------- src/flow-timeout.h | 3 +++ src/flow-worker.c | 4 ++-- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/flow-timeout.c b/src/flow-timeout.c index 6a9b707c21..90a97fa666 100644 --- a/src/flow-timeout.c +++ b/src/flow-timeout.c @@ -76,10 +76,8 @@ * packets need to force reassembly, in which case we just * set dummy ack/seq values. */ -static inline Packet *FlowForceReassemblyPseudoPacketSetup(Packet *p, - int direction, - Flow *f, - TcpSession *ssn) +static inline Packet *FlowForceReassemblyPseudoPacketSetup( + Packet *p, int direction, Flow *f, const TcpSession *ssn) { const int orig_dir = direction; p->tenant_id = f->tenant_id; @@ -265,12 +263,7 @@ error: return NULL; } -Packet *FlowForceReassemblyPseudoPacketGet(int direction, - Flow *f, - TcpSession *ssn); -Packet *FlowForceReassemblyPseudoPacketGet(int direction, - Flow *f, - TcpSession *ssn) +Packet *FlowForceReassemblyPseudoPacketGet(int direction, Flow *f, const TcpSession *ssn) { PacketPoolWait(); Packet *p = PacketPoolGetPacket(); diff --git a/src/flow-timeout.h b/src/flow-timeout.h index 7426d59d60..882f4e63b2 100644 --- a/src/flow-timeout.h +++ b/src/flow-timeout.h @@ -24,8 +24,11 @@ #ifndef __FLOW_TIMEOUT_H__ #define __FLOW_TIMEOUT_H__ +#include "stream-tcp-private.h" + void FlowForceReassemblyForFlow(Flow *f); int FlowForceReassemblyNeedReassembly(Flow *f); void FlowForceReassembly(void); +Packet *FlowForceReassemblyPseudoPacketGet(int direction, Flow *f, const TcpSession *ssn); #endif /* __FLOW_TIMEOUT_H__ */ diff --git a/src/flow-worker.c b/src/flow-worker.c index a20e053c59..3baa8ad7cb 100644 --- a/src/flow-worker.c +++ b/src/flow-worker.c @@ -96,8 +96,8 @@ typedef struct FlowWorkerThreadData_ { } FlowWorkerThreadData; -static void FlowWorkerFlowTimeout(ThreadVars *tv, Packet *p, FlowWorkerThreadData *fw, void *detect_thread); -Packet *FlowForceReassemblyPseudoPacketGet(int direction, Flow *f, TcpSession *ssn); +static void FlowWorkerFlowTimeout( + ThreadVars *tv, Packet *p, FlowWorkerThreadData *fw, void *detect_thread); /** * \internal -- 2.47.2