suricata
flow-callbacks.c File Reference
#include "flow-callbacks.h"
Include dependency graph for flow-callbacks.c:

Go to the source code of this file.

Data Structures

struct  FlowInitCallback_
 
struct  FlowUpdateCallback_
 
struct  FlowFinishCallback_
 

Typedefs

typedef struct FlowInitCallback_ FlowInitCallback
 
typedef struct FlowUpdateCallback_ FlowUpdateCallback
 
typedef struct FlowFinishCallback_ FlowFinishCallback
 

Functions

bool SCFlowRegisterInitCallback (SCFlowInitCallbackFn fn, void *user)
 Register a flow init callback. More...
 
void SCFlowRunInitCallbacks (ThreadVars *tv, Flow *f, const Packet *p)
 
bool SCFlowRegisterUpdateCallback (SCFlowUpdateCallbackFn fn, void *user)
 Register a flow update callback. More...
 
void SCFlowRunUpdateCallbacks (ThreadVars *tv, Flow *f, Packet *p)
 
bool SCFlowRegisterFinishCallback (SCFlowFinishCallbackFn fn, void *user)
 Register a flow init callback. More...
 
void SCFlowRunFinishCallbacks (ThreadVars *tv, Flow *f)
 

Typedef Documentation

◆ FlowFinishCallback

◆ FlowInitCallback

◆ FlowUpdateCallback

Function Documentation

◆ SCFlowRegisterFinishCallback()

bool SCFlowRegisterFinishCallback ( SCFlowFinishCallbackFn  fn,
void *  user 
)

Register a flow init callback.

Register a user provided function to be called every time a flow is finished.

Parameters
fnPointer to function to be called
userAdditional user data to be passed to callback
Returns
true if callback was registered, otherwise false if the callback could not be registered due to memory allocation error.

Definition at line 102 of file flow-callbacks.c.

References FlowFinishCallback_::Callback, SCCalloc, and FlowFinishCallback_::user.

◆ SCFlowRegisterInitCallback()

bool SCFlowRegisterInitCallback ( SCFlowInitCallbackFn  fn,
void *  user 
)

Register a flow init callback.

Register a user provided function to be called every time a flow is initialized for use.

Parameters
fnPointer to function to be called
userAdditional user data to be passed to callback
Returns
true if callback was registered, otherwise false if the callback could not be registered due to memory allocation error.

Definition at line 44 of file flow-callbacks.c.

References FlowInitCallback_::Callback, SCCalloc, FlowInitCallback_::user, and FlowFinishCallback_::user.

◆ SCFlowRegisterUpdateCallback()

bool SCFlowRegisterUpdateCallback ( SCFlowUpdateCallbackFn  fn,
void *  user 
)

Register a flow update callback.

Register a user provided function to be called everytime a flow is updated.

Parameters
fnPointer to function to be called
userAdditional user data to be passed to callback
Returns
true if callback was registered, otherwise false if the callback could not be registered due to memory allocation error.

Definition at line 73 of file flow-callbacks.c.

References FlowUpdateCallback_::Callback, SCCalloc, FlowUpdateCallback_::user, and FlowFinishCallback_::user.

◆ SCFlowRunFinishCallbacks()

void SCFlowRunFinishCallbacks ( ThreadVars tv,
Flow f 
)

Definition at line 122 of file flow-callbacks.c.

◆ SCFlowRunInitCallbacks()

void SCFlowRunInitCallbacks ( ThreadVars tv,
Flow f,
const Packet p 
)

Definition at line 64 of file flow-callbacks.c.

◆ SCFlowRunUpdateCallbacks()

void SCFlowRunUpdateCallbacks ( ThreadVars tv,
Flow f,
Packet p 
)

Definition at line 93 of file flow-callbacks.c.