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