#define FLOW_DEFAULT_FLOW_PRUNE 5
+FlowBucket *flow_hash;
SC_ATOMIC_EXTERN(unsigned int, flow_prune_idx);
SC_ATOMIC_EXTERN(unsigned int, flow_flags);
/* Run mode selected at suricata.c */
extern int run_mode;
+/** queue to pass flows to cleanup/log thread(s) */
+FlowQueue flow_recycle_q;
+
/* multi flow mananger support */
static uint32_t flowmgr_number = 1;
/* atomic counter for flow managers, to assign instance id */
SC_ATOMIC_EXTERN(unsigned int, flow_flags);
+SCCtrlCondT flow_manager_ctrl_cond;
+SCCtrlMutex flow_manager_ctrl_mutex;
+
+SCCtrlCondT flow_recycler_ctrl_cond;
+SCCtrlMutex flow_recycler_ctrl_mutex;
typedef FlowProtoTimeout *FlowProtoTimeoutPtr;
SC_ATOMIC_DECLARE(FlowProtoTimeoutPtr, flow_timeouts);
void FlowTimeoutsEmergency(void);
/** flow manager scheduling condition */
-SCCtrlCondT flow_manager_ctrl_cond;
-SCCtrlMutex flow_manager_ctrl_mutex;
+extern SCCtrlCondT flow_manager_ctrl_cond;
+extern SCCtrlMutex flow_manager_ctrl_mutex;
#define FlowWakeupFlowManagerThread() SCCtrlCondSignal(&flow_manager_ctrl_cond)
void FlowManagerThreadSpawn(void);
void FlowMgrRegisterTests (void);
/** flow recycler scheduling condition */
-SCCtrlCondT flow_recycler_ctrl_cond;
-SCCtrlMutex flow_recycler_ctrl_mutex;
+extern SCCtrlCondT flow_recycler_ctrl_cond;
+extern SCCtrlMutex flow_recycler_ctrl_mutex;
#define FlowWakeupFlowRecyclerThread() \
SCCtrlCondSignal(&flow_recycler_ctrl_cond)
/** FlowProto specific timeouts and free/state functions */
-FlowProtoTimeout flow_timeouts_normal[FLOW_PROTO_MAX];
-FlowProtoTimeout flow_timeouts_emerg[FLOW_PROTO_MAX];
-FlowProtoFreeFunc flow_freefuncs[FLOW_PROTO_MAX];
+extern FlowProtoTimeout flow_timeouts_normal[FLOW_PROTO_MAX];
+extern FlowProtoTimeout flow_timeouts_emerg[FLOW_PROTO_MAX];
+extern FlowProtoFreeFunc flow_freefuncs[FLOW_PROTO_MAX];
/** spare/unused/prealloced flows live here */
-FlowQueue flow_spare_q;
+extern FlowQueue flow_spare_q;
/** queue to pass flows to cleanup/log thread(s) */
-FlowQueue flow_recycle_q;
+extern FlowQueue flow_recycle_q;
-FlowBucket *flow_hash;
-FlowConfig flow_config;
+extern FlowBucket *flow_hash;
+extern FlowConfig flow_config;
/** flow memuse counter (atomic), for enforcing memcap limit */
-SC_ATOMIC_DECLARE(uint64_t, flow_memuse);
+SC_ATOMIC_EXTERN(uint64_t, flow_memuse);
#endif /* __FLOW_PRIVATE_H__ */
/** atomic flags */
SC_ATOMIC_DECLARE(unsigned int, flow_flags);
+/** FlowProto specific timeouts and free/state functions */
+
+FlowProtoTimeout flow_timeouts_normal[FLOW_PROTO_MAX];
+FlowProtoTimeout flow_timeouts_emerg[FLOW_PROTO_MAX];
+FlowProtoFreeFunc flow_freefuncs[FLOW_PROTO_MAX];
+
+/** spare/unused/prealloced flows live here */
+FlowQueue flow_spare_q;
+
+FlowConfig flow_config;
+
+/** flow memuse counter (atomic), for enforcing memcap limit */
+SC_ATOMIC_DECLARE(uint64_t, flow_memuse);
+
void FlowRegisterTests(void);
void FlowInitFlowProto(void);
int FlowSetProtoFreeFunc(uint8_t, void (*Free)(void *));