Go to the documentation of this file.
43 static void HostBitFreeAll(
void *store)
52 if (host_bit_id.
id == -1) {
53 FatalError(
"Can't initiate host storage for bits");
70 for ( ; gv != NULL; gv = gv->
next) {
81 static XBit *HostBitGet(
Host *h, uint32_t idx)
84 for ( ; gv != NULL; gv = gv->
next) {
94 static void HostBitAdd(
Host *h, uint32_t idx,
SCTime_t expire)
96 XBit *fb = HostBitGet(h, idx);
117 static void HostBitRemove(
Host *h, uint32_t idx)
119 XBit *fb = HostBitGet(h, idx);
133 XBit *fb = HostBitGet(h, idx);
135 HostBitAdd(h, idx, expire);
141 XBit *fb = HostBitGet(h, idx);
143 HostBitRemove(h, idx);
149 XBit *fb = HostBitGet(h, idx);
151 HostBitRemove(h, idx);
153 HostBitAdd(h, idx, expire);
159 XBit *fb = HostBitGet(h, idx);
162 HostBitRemove(h,idx);
172 XBit *fb = HostBitGet(h, idx);
178 HostBitRemove(h,idx);
193 for ( ; gv != NULL; gv = gv->
next) {
205 static int HostBitTest01 (
void)
221 XBit *fb = HostBitGet(h,0);
232 static int HostBitTest02 (
void)
246 XBit *fb = HostBitGet(h,0);
257 static int HostBitTest03 (
void)
273 XBit *fb = HostBitGet(h,0);
275 printf(
"fb == NULL although it was just added: ");
281 fb = HostBitGet(h,0);
283 printf(
"fb != NULL although it was just removed: ");
296 static int HostBitTest04 (
void)
315 XBit *fb = HostBitGet(h,0);
326 static int HostBitTest05 (
void)
345 XBit *fb = HostBitGet(h,1);
356 static int HostBitTest06 (
void)
375 XBit *fb = HostBitGet(h,2);
386 static int HostBitTest07 (
void)
405 XBit *fb = HostBitGet(h,3);
416 static int HostBitTest08 (
void)
435 XBit *fb = HostBitGet(h,0);
441 fb = HostBitGet(h,0);
443 printf(
"fb != NULL even though it was removed: ");
455 static int HostBitTest09 (
void)
474 XBit *fb = HostBitGet(h,1);
480 fb = HostBitGet(h,1);
482 printf(
"fb != NULL even though it was removed: ");
494 static int HostBitTest10 (
void)
513 XBit *fb = HostBitGet(h,2);
519 fb = HostBitGet(h,2);
521 printf(
"fb != NULL even though it was removed: ");
533 static int HostBitTest11 (
void)
552 XBit *fb = HostBitGet(h,3);
558 fb = HostBitGet(h,3);
560 printf(
"fb != NULL even though it was removed: ");
int HostBitList(Host *h, XBit **iter)
void GenericVarAppend(GenericVar **list, GenericVar *gv)
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
HostStorageId HostStorageRegister(const char *name, const unsigned int size, void *(*Alloc)(unsigned int), void(*Free)(void *))
Register a Host storage.
void HostBitSet(Host *h, uint32_t idx, SCTime_t expire)
void StorageCleanup(void)
void * HostGetStorageById(Host *h, HostStorageId id)
Get a value from a given Host storage.
void HostBitInitCtx(void)
#define SCTIME_FROM_SECS(s)
struct GenericVar_ * next
void HostBitUnset(Host *h, uint32_t idx)
int HostHasHostBits(Host *host)
void GenericVarRemove(GenericVar **list, GenericVar *gv)
int StorageFinalize(void)
int HostBitIsset(Host *h, uint32_t idx, SCTime_t ts)
void HostBitRegisterTests(void)
#define SCTIME_CMP_LT(a, b)
void HostBitToggle(Host *h, uint32_t idx, SCTime_t expire)
void SCGenericVarFree(GenericVar *gv)
int HostBitIsnotset(Host *h, uint32_t idx, SCTime_t ts)
void HostShutdown(void)
shutdown the flow engine
int HostBitsTimedoutCheck(Host *h, SCTime_t ts)
#define SCTIME_CMP_GT(a, b)
void HostInitConfig(bool quiet)
initialize the configuration
int HostSetStorageById(Host *h, HostStorageId id, void *ptr)
Store a pointer in a given Host storage.