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 "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 undertsand the various q handlers we provide.

Definition in file tmqh-flow.c.

Macro Definition Documentation

#define PRINT_IF_FUNC (   f,
  msg 
)
Value:
if (tmqh_table[TMQH_FLOW].OutHandler == (f)) \
SCLogConfig("AutoFP mode using \"%s\" flow load balancer", (msg))
Tmqh tmqh_table[TMQH_SIZE]
const char * msg
struct SCLogConfig_ SCLogConfig
Holds the config state used by the logging api.

Referenced by TmqhFlowPrintAutofpHandler().

Function Documentation

void TmqhFlowPrintAutofpHandler ( void  )

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

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

Referenced by RunModeDispatch().

Here is the call graph for this function:

Here is the caller graph for this function:

void TmqhFlowRegisterTests ( void  )

Definition at line 423 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:

void TmqhOutputFlowFreeCtx ( void *  ctx)

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

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

Referenced by TmqhFlowRegister(), and TmqhOutputFlowIPPair().

Here is the caller graph for this function:

void TmqhOutputFlowHash ( ThreadVars t,
Packet p 
)
void TmqhOutputFlowIPPair ( ThreadVars tv,
Packet p 
)

select the queue to output based on IP address pair.

Parameters
tvthread vars.
ppacket.

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

References PacketQueue_::cond_q, Packet_::dst, Address_::family, PacketQueue_::mutex_q, ThreadVars_::outctx, PacketEnqueue(), TmqhFlowMode_::q, TmqhFlowCtx_::queues, SCCondSignal, SCMutexLock, SCMutexUnlock, TmqhFlowCtx_::size, Packet_::src, str, TmqCreateQueue(), TmqhOutputFlowFreeCtx(), TmqhOutputFlowSetupCtx(), TmqResetQueues(), and trans_q.

Referenced by TmqhFlowPrintAutofpHandler(), and TmqhFlowRegister().

Here is the call graph for this function:

Here is the caller graph for this function:

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 SCFree, SCLogDebug, SCMalloc, SCStrdup, str, and unlikely.

Referenced by TmqhFlowRegister(), and TmqhOutputFlowIPPair().

Here is the caller graph for this function: