Go to the documentation of this file.
65 int FlowStorageRegister(
const char *name,
const unsigned int size,
void *(*Alloc)(
unsigned int),
void (*Free)(
void *)) {
71 static void *StorageTestAlloc(
unsigned int size)
76 static void StorageTestFree(
void *x)
82 static int FlowStorageTest01(
void)
135 if (ptr1a != ptr1b) {
139 if (ptr2a != ptr2b) {
143 if (ptr3a != ptr3b) {
162 static int FlowStorageTest02(
void)
193 if (ptr1a != ptr1b) {
213 static int FlowStorageTest03(
void)
261 if (ptr1a != ptr1b) {
265 if (ptr2a != ptr2b) {
269 if (ptr3a != ptr3b) {
void StorageFreeAll(Storage *storage, StorageEnum type)
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
void FlowInitConfig(char quiet)
initialize the configuration
void StorageCleanup(void)
int FlowStorageRegister(const char *name, const unsigned int size, void *(*Alloc)(unsigned int), void(*Free)(void *))
unsigned int FlowStorageSize(void)
int StorageFinalize(void)
int FlowClearMemory(Flow *f, uint8_t proto_map)
Function clear the flow memory before queueing it to spare flow queue.
int FlowSetStorageById(Flow *f, int id, void *ptr)
void FlowFree(Flow *f)
cleanup & free the memory of a flow
void FlowShutdown(void)
shutdown the flow engine
int StorageSetById(Storage *storage, const StorageEnum type, const int id, void *ptr)
set storage for id
void * StorageAllocByIdPrealloc(Storage *storage, StorageEnum type, int id)
AllocById func for prealloc'd base storage (storage ptrs are part of another memory block)
void StorageFreeById(Storage *storage, StorageEnum type, int id)
void FlowFreeStorage(Flow *f)
void * FlowGetStorageById(Flow *f, int id)
void * FlowAllocStorageById(Flow *f, int id)
Flow * FlowAlloc(void)
allocate a flow
void * StorageGetById(const Storage *storage, const StorageEnum type, const int id)
get storage for id
void FlowFreeStorageById(Flow *f, int id)
void RegisterFlowStorageTests(void)
unsigned int StorageGetSize(StorageEnum type)
get the size of the void array used to store the pointers
int StorageRegister(const StorageEnum type, const char *name, const unsigned int size, void *(*Alloc)(unsigned int), void(*Free)(void *))
Register new storage.