suricata
ippair-bit.c File Reference
#include "suricata-common.h"
#include "threads.h"
#include "ippair-bit.h"
#include "ippair.h"
#include "detect.h"
#include "util-var.h"
#include "util-debug.h"
#include "util-unittest.h"
#include "ippair-storage.h"
Include dependency graph for ippair-bit.c:

Go to the source code of this file.

Functions

void IPPairBitInitCtx (void)
 
int IPPairHasBits (IPPair *ippair)
 
int IPPairBitsTimedoutCheck (IPPair *h, struct timeval *ts)
 
void IPPairBitSet (IPPair *h, uint32_t idx, uint32_t expire)
 
void IPPairBitUnset (IPPair *h, uint32_t idx)
 
void IPPairBitToggle (IPPair *h, uint32_t idx, uint32_t expire)
 
int IPPairBitIsset (IPPair *h, uint32_t idx, uint32_t ts)
 
int IPPairBitIsnotset (IPPair *h, uint32_t idx, uint32_t ts)
 
void IPPairBitRegisterTests (void)
 

Detailed Description

Author
Victor Julien victo.nosp@m.r@in.nosp@m.linia.nosp@m.c.ne.nosp@m.t

Implements per ippair bits. Actually, not a bit, but called that way because of Snort's flowbits. It's a binary storage.

Todo:

move away from a linked list implementation

use different datatypes, such as string, int, etc.

Definition in file ippair-bit.c.

Function Documentation

void IPPairBitInitCtx ( void  )

Definition at line 49 of file ippair-bit.c.

References IPPairStorageRegister(), SC_ERR_IPPAIR_INIT, and SCLogError.

Referenced by DetectXbitFree(), and PostRunDeinit().

Here is the call graph for this function:

Here is the caller graph for this function:

int IPPairBitIsnotset ( IPPair h,
uint32_t  idx,
uint32_t  ts 
)

Definition at line 172 of file ippair-bit.c.

References XBit_::expire, IPPairAlloc(), IPPairCleanup(), IPPairFree(), IPPairInitConfig(), and TRUE.

Referenced by DetectXbitsRegister().

Here is the call graph for this function:

Here is the caller graph for this function:

int IPPairBitIsset ( IPPair h,
uint32_t  idx,
uint32_t  ts 
)

Definition at line 158 of file ippair-bit.c.

References XBit_::expire.

Referenced by DetectXbitsRegister().

Here is the caller graph for this function:

void IPPairBitRegisterTests ( void  )

Definition at line 493 of file ippair-bit.c.

References UtRegisterTest().

Here is the call graph for this function:

void IPPairBitSet ( IPPair h,
uint32_t  idx,
uint32_t  expire 
)

Definition at line 132 of file ippair-bit.c.

Referenced by DetectXbitsRegister().

Here is the caller graph for this function:

int IPPairBitsTimedoutCheck ( IPPair h,
struct timeval *  ts 
)
Return values
1ippair timed out wrt xbits
0ippair still has active (non-expired) xbits

Definition at line 68 of file ippair-bit.c.

References DETECT_XBITS, XBit_::expire, GenericVarAppend(), GenericVarRemove(), GenericVar_::idx, XBit_::idx, IPPairGetStorageById(), IPPairSetStorageById(), GenericVar_::next, XBit_::next, SCMalloc, GenericVar_::type, XBit_::type, unlikely, and XBitFree().

Referenced by IPPairGetActiveCount().

Here is the call graph for this function:

Here is the caller graph for this function:

void IPPairBitToggle ( IPPair h,
uint32_t  idx,
uint32_t  expire 
)

Definition at line 148 of file ippair-bit.c.

Referenced by DetectXbitsRegister().

Here is the caller graph for this function:

void IPPairBitUnset ( IPPair h,
uint32_t  idx 
)

Definition at line 140 of file ippair-bit.c.

Referenced by DetectXbitsRegister().

Here is the caller graph for this function:

int IPPairHasBits ( IPPair ippair)

Definition at line 59 of file ippair-bit.c.

References IPPairGetStorageById().

Referenced by IPPairGetActiveCount().

Here is the call graph for this function:

Here is the caller graph for this function: