suricata
|
#include "suricata-common.h"
#include "suricata.h"
#include "flow-util.h"
#include "flow-private.h"
#include "flow-storage.h"
#include "util-macset.h"
#include "util-unittest.h"
#include "util-unittest-helper.h"
#include "conf.h"
Go to the source code of this file.
Data Structures | |
struct | MacSet_ |
Typedefs | |
typedef uint8_t | MacAddr[6] |
Enumerations | |
enum | MacSetState { EMPTY_SET, SINGLE_MAC, MULTI_MAC } |
Functions | |
void | MacSetRegisterFlowStorage (void) |
bool | MacSetFlowStorageEnabled (void) |
MacSet * | MacSetInit (int size) |
FlowStorageId | MacSetGetFlowStorageID (void) |
void | MacSetAddWithCtr (MacSet *ms, const uint8_t *src_addr, const uint8_t *dst_addr, ThreadVars *tv, uint16_t ctr_src, uint16_t ctr_dst) |
void | MacSetAdd (MacSet *ms, const uint8_t *src_addr, const uint8_t *dst_addr) |
int | MacSetForEach (const MacSet *ms, MacSetIteratorFunc IterFunc, void *data) |
int | MacSetSize (const MacSet *ms) |
void | MacSetFree (MacSet *ms) |
void | MacSetRegisterTests (void) |
Variables | |
FlowStorageId | g_macset_storage_id = { .id = -1 } |
Set-like data store for MAC addresses. Implemented as array for memory locality reasons as the expected number of items is typically low.
Definition in file util-macset.c.
typedef uint8_t MacAddr[6] |
Definition at line 38 of file util-macset.c.
enum MacSetState |
Enumerator | |
---|---|
EMPTY_SET | |
SINGLE_MAC | |
MULTI_MAC |
Definition at line 39 of file util-macset.c.
void MacSetAdd | ( | MacSet * | ms, |
const uint8_t * | src_addr, | ||
const uint8_t * | dst_addr | ||
) |
Definition at line 190 of file util-macset.c.
References MacSetAddWithCtr().
void MacSetAddWithCtr | ( | MacSet * | ms, |
const uint8_t * | src_addr, | ||
const uint8_t * | dst_addr, | ||
ThreadVars * | tv, | ||
uint16_t | ctr_src, | ||
uint16_t | ctr_dst | ||
) |
Definition at line 181 of file util-macset.c.
Referenced by MacSetAdd().
bool MacSetFlowStorageEnabled | ( | void | ) |
Definition at line 85 of file util-macset.c.
References g_macset_storage_id, and FlowStorageId::id.
int MacSetForEach | ( | const MacSet * | ms, |
MacSetIteratorFunc | IterFunc, | ||
void * | data | ||
) |
Definition at line 220 of file util-macset.c.
void MacSetFree | ( | MacSet * | ms | ) |
Definition at line 264 of file util-macset.c.
References MacSet_::buf, MAC_SET_DST, MAC_SET_SRC, SC_ATOMIC_SUB, SCFree, and MacSet_::size.
FlowStorageId MacSetGetFlowStorageID | ( | void | ) |
Definition at line 114 of file util-macset.c.
References g_macset_storage_id.
MacSet* MacSetInit | ( | int | size | ) |
Definition at line 91 of file util-macset.c.
References EMPTY_SET, FLOW_CHECK_MEMCAP, MacSet_::last, MAC_SET_DST, MAC_SET_SRC, SC_ATOMIC_ADD, SCCalloc, SCLogError, MacSet_::size, MacSet_::state, and unlikely.
void MacSetRegisterFlowStorage | ( | void | ) |
Definition at line 62 of file util-macset.c.
Referenced by PostConfLoadedSetup().
void MacSetRegisterTests | ( | void | ) |
Definition at line 421 of file util-macset.c.
References UtRegisterTest().
int MacSetSize | ( | const MacSet * | ms | ) |
Definition at line 233 of file util-macset.c.
References EMPTY_SET, MacSet_::last, MAC_SET_DST, MAC_SET_SRC, MULTI_MAC, SINGLE_MAC, and MacSet_::state.
FlowStorageId g_macset_storage_id = { .id = -1 } |
Definition at line 60 of file util-macset.c.
Referenced by MacSetFlowStorageEnabled(), and MacSetGetFlowStorageID().