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

Go to the source code of this file.

Functions

void HostBitInitCtx (void)
 
int HostHasHostBits (Host *host)
 
int HostBitsTimedoutCheck (Host *h, SCTime_t ts)
 
void HostBitSet (Host *h, uint32_t idx, uint32_t expire)
 
void HostBitUnset (Host *h, uint32_t idx)
 
void HostBitToggle (Host *h, uint32_t idx, uint32_t expire)
 
int HostBitIsset (Host *h, uint32_t idx, uint32_t ts)
 
int HostBitIsnotset (Host *h, uint32_t idx, uint32_t ts)
 
int HostBitList (Host *h, XBit **iter)
 
void HostBitRegisterTests (void)
 

Detailed Description

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

Implements per host 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 host-bit.c.

Function Documentation

◆ HostBitInitCtx()

void HostBitInitCtx ( void  )

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

Referenced by RunUnittests().

Here is the caller graph for this function:

◆ HostBitIsnotset()

int HostBitIsnotset ( Host h,
uint32_t  idx,
uint32_t  ts 
)

Definition at line 170 of file host-bit.c.

◆ HostBitIsset()

int HostBitIsset ( Host h,
uint32_t  idx,
uint32_t  ts 
)

Definition at line 157 of file host-bit.c.

◆ HostBitList()

int HostBitList ( Host h,
XBit **  iter 
)

Definition at line 184 of file host-bit.c.

References HostGetStorageById().

Here is the call graph for this function:

◆ HostBitRegisterTests()

void HostBitRegisterTests ( void  )

Definition at line 508 of file host-bit.c.

References UtRegisterTest().

Here is the call graph for this function:

◆ HostBitSet()

void HostBitSet ( Host h,
uint32_t  idx,
uint32_t  expire 
)

Definition at line 131 of file host-bit.c.

◆ HostBitsTimedoutCheck()

int HostBitsTimedoutCheck ( Host h,
SCTime_t  ts 
)
Return values
1host timed out wrt xbits
0host still has active (non-expired) xbits

Definition at line 67 of file host-bit.c.

References HostGetStorageById().

Here is the call graph for this function:

◆ HostBitToggle()

void HostBitToggle ( Host h,
uint32_t  idx,
uint32_t  expire 
)

Definition at line 147 of file host-bit.c.

◆ HostBitUnset()

void HostBitUnset ( Host h,
uint32_t  idx 
)

Definition at line 139 of file host-bit.c.

◆ HostHasHostBits()

int HostHasHostBits ( Host host)

Definition at line 58 of file host-bit.c.

References HostGetStorageById().

Here is the call graph for this function: