Go to the documentation of this file.
67 void *(*Alloc)(
unsigned int),
void (*Free)(
void *))
76 static void *StorageTestAlloc(
unsigned int size)
81 static void StorageTestFree(
void *x)
87 static int FlowStorageTest01(
void)
141 if (ptr1a != ptr1b) {
145 if (ptr2a != ptr2b) {
149 if (ptr3a != ptr3b) {
168 static int FlowStorageTest02(
void)
199 if (ptr1a != ptr1b) {
219 static int FlowStorageTest03(
void)
267 if (ptr1a != ptr1b) {
271 if (ptr2a != ptr2b) {
275 if (ptr3a != ptr3b) {
void StorageFreeAll(Storage *storage, StorageEnum type)
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
void StorageCleanup(void)
void * FlowAllocStorageById(Flow *f, FlowStorageId id)
void FlowInitConfig(bool quiet)
initialize the configuration
unsigned int FlowStorageSize(void)
int FlowSetStorageById(Flow *f, FlowStorageId id, void *ptr)
FlowStorageId FlowStorageRegister(const char *name, const unsigned int size, void *(*Alloc)(unsigned int), void(*Free)(void *))
int StorageFinalize(void)
int FlowClearMemory(Flow *f, uint8_t proto_map)
Function clear the flow memory before queueing it to spare flow queue.
void * FlowGetStorageById(const Flow *f, FlowStorageId id)
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 FlowFreeStorageById(Flow *f, FlowStorageId id)
void FlowFreeStorage(Flow *f)
Flow * FlowAlloc(void)
allocate a flow
void * StorageGetById(const Storage *storage, const StorageEnum type, const int id)
get storage for 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.