suricata
tmqh-flow.c File Reference
#include "suricata.h"
#include "packet-queue.h"
#include "decode.h"
#include "threads.h"
#include "threadvars.h"
#include "tmqh-flow.h"
#include "flow-hash.h"
#include "tm-queuehandlers.h"
#include "conf.h"
#include "util-unittest.h"
Include dependency graph for tmqh-flow.c:

Go to the source code of this file.

Macros

#define PRINT_IF_FUNC(f, msg)
 

Functions

PacketTmqhInputFlow (ThreadVars *t)
 
void TmqhOutputFlowHash (ThreadVars *t, Packet *p)
 
void TmqhOutputFlowIPPair (ThreadVars *tv, Packet *p)
 select the queue to output based on IP address pair. More...
 
void * TmqhOutputFlowSetupCtx (const char *queue_str)
 setup the queue handlers ctx More...
 
void TmqhOutputFlowFreeCtx (void *ctx)
 
void TmqhFlowRegisterTests (void)
 
void TmqhFlowRegister (void)
 
void TmqhFlowPrintAutofpHandler (void)
 

Detailed Description

Author
Victor Julien victo.nosp@m.r@in.nosp@m.linia.nosp@m.c.ne.nosp@m.t
Anoop Saldanha anoop.nosp@m.sald.nosp@m.anha@.nosp@m.gmai.nosp@m.l.com

Simple output queue handler that makes sure all packets of the same flow are sent to the same queue. We support different kind of q handlers. Have a look at "autofp-scheduler" conf to further understand the various q handlers we provide.

Definition in file tmqh-flow.c.

Macro Definition Documentation

◆ PRINT_IF_FUNC

#define PRINT_IF_FUNC (   f,
  msg 
)
Value:
if (tmqh_table[TMQH_FLOW].OutHandler == (f)) \
SCLogConfig("AutoFP mode using \"%s\" flow load balancer", (msg))

Function Documentation

◆ TmqhFlowPrintAutofpHandler()

void TmqhFlowPrintAutofpHandler ( void  )

Definition at line 84 of file tmqh-flow.c.

References PRINT_IF_FUNC, TmqhOutputFlowHash(), and TmqhOutputFlowIPPair().

Here is the call graph for this function:

◆ TmqhFlowRegister()

void TmqhFlowRegister ( void  )

◆ TmqhFlowRegisterTests()

void TmqhFlowRegisterTests ( void  )

Definition at line 396 of file tmqh-flow.c.

References UtRegisterTest().

Referenced by TmqhFlowRegister().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TmqhInputFlow()

Packet * TmqhInputFlow ( ThreadVars t)

Definition at line 98 of file tmqh-flow.c.

References PacketQueue_::cond_q, ThreadVars_::inq, PacketQueue_::len, PacketQueue_::mutex_q, PacketDequeue(), Tmq_::pq, SCCondWait, SCMutexLock, SCMutexUnlock, StatsSyncCountersIfSignalled(), and tv.

Referenced by TmqhFlowRegister().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TmqhOutputFlowFreeCtx()

void TmqhOutputFlowFreeCtx ( void *  ctx)

Definition at line 210 of file tmqh-flow.c.

References ctx, TmqhFlowCtx_::queues, SCFree, SCLogPerf, and TmqhFlowCtx_::size.

Referenced by TmqhFlowRegister().

Here is the caller graph for this function:

◆ TmqhOutputFlowHash()

void TmqhOutputFlowHash ( ThreadVars t,
Packet p 
)

Definition at line 220 of file tmqh-flow.c.

References PacketQueue_::cond_q, ctx, Packet_::flags, Packet_::flow_hash, PacketQueue_::mutex_q, ThreadVars_::outctx, PacketEnqueue(), PKT_WANTS_FLOW, SCCondSignal, SCMutexLock, SCMutexUnlock, and tv.

Referenced by TmqhFlowPrintAutofpHandler(), and TmqhFlowRegister().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TmqhOutputFlowIPPair()

void TmqhOutputFlowIPPair ( ThreadVars tv,
Packet p 
)

select the queue to output based on IP address pair.

Parameters
tvthread vars.
ppacket.

Definition at line 248 of file tmqh-flow.c.

References PacketQueue_::cond_q, ctx, Packet_::dst, Address_::family, PacketQueue_::mutex_q, ThreadVars_::outctx, PacketEnqueue(), SCCondSignal, SCMutexLock, SCMutexUnlock, Packet_::src, and tv.

Referenced by TmqhFlowPrintAutofpHandler(), and TmqhFlowRegister().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TmqhOutputFlowSetupCtx()

void * TmqhOutputFlowSetupCtx ( const char *  queue_str)

setup the queue handlers ctx

Parses a comma separated string "queuename1,queuename2,etc" and sets the ctx up to devide flows over these queue's.

Parameters
queue_strcomma separated string with output queue names
Return values
ctxqueues handlers ctx or NULL in error

Definition at line 165 of file tmqh-flow.c.

References ctx, SCCalloc, SCLogDebug, SCStrdup, str, and unlikely.

Referenced by TmqhFlowRegister().

Here is the caller graph for this function:
TMQH_FLOW
@ TMQH_FLOW
Definition: tm-queuehandlers.h:31
tmqh_table
Tmqh tmqh_table[TMQH_SIZE]
Definition: tm-queuehandlers.c:37
msg
const char * msg
Definition: app-layer-htp.c:562