Go to the documentation of this file.
57 void *(*Alloc)(
unsigned int),
void (*Free)(
void *))
66 static void *StorageTestAlloc(
unsigned int size)
71 static void StorageTestFree(
void *x)
77 static int IPPairStorageTest01(
void)
98 memset(&a, 0x00,
sizeof(a));
99 memset(&b, 0x00,
sizeof(b));
100 a.addr_data32[0] = 0x01020304;
101 b.addr_data32[0] = 0x04030201;
106 printf(
"failed to get ippair: ");
137 if (ptr1a != ptr1b) {
141 if (ptr2a != ptr2b) {
145 if (ptr3a != ptr3b) {
160 static int IPPairStorageTest02(
void)
174 memset(&a, 0x00,
sizeof(a));
175 memset(&b, 0x00,
sizeof(b));
176 a.addr_data32[0] = 0x01020304;
177 b.addr_data32[0] = 0x04030201;
182 printf(
"failed to get ippair: ");
198 if (ptr1a != ptr1b) {
213 static int IPPairStorageTest03(
void)
233 memset(&a, 0x00,
sizeof(a));
234 memset(&b, 0x00,
sizeof(b));
235 a.addr_data32[0] = 0x01020304;
236 b.addr_data32[0] = 0x04030201;
241 printf(
"failed to get ippair: ");
268 if (ptr1a != ptr1b) {
272 if (ptr2a != ptr2b) {
276 if (ptr3a != ptr3b) {
IPPairStorageId IPPairStorageRegister(const char *name, const unsigned int size, void *(*Alloc)(unsigned int), void(*Free)(void *))
void StorageFreeAll(Storage *storage, StorageEnum type)
void IPPairInitConfig(bool quiet)
initialize the configuration
void IPPairRelease(IPPair *h)
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
void StorageCleanup(void)
int IPPairSetStorageById(IPPair *h, IPPairStorageId id, void *ptr)
unsigned int IPPairStorageSize(void)
void IPPairShutdown(void)
shutdown the flow engine
IPPair * IPPairGetIPPairFromHash(Address *a, Address *b)
void * IPPairAllocStorageById(IPPair *h, IPPairStorageId id)
int StorageFinalize(void)
void RegisterIPPairStorageTests(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)
void * IPPairGetStorageById(IPPair *h, IPPairStorageId id)
void IPPairFreeStorage(IPPair *h)
void * StorageGetById(const Storage *storage, const StorageEnum type, const int id)
get storage for id
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.