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)
216 XBit *fb = HostBitGet(h,0);
226 static int HostBitTest02 (
void)
235 XBit *fb = HostBitGet(h,0);
245 static int HostBitTest03 (
void)
256 XBit *fb = HostBitGet(h,0);
258 printf(
"fb == NULL although it was just added: ");
264 fb = HostBitGet(h,0);
266 printf(
"fb != NULL although it was just removed: ");
278 static int HostBitTest04 (
void)
292 XBit *fb = HostBitGet(h,0);
302 static int HostBitTest05 (
void)
316 XBit *fb = HostBitGet(h,1);
326 static int HostBitTest06 (
void)
340 XBit *fb = HostBitGet(h,2);
350 static int HostBitTest07 (
void)
364 XBit *fb = HostBitGet(h,3);
374 static int HostBitTest08 (
void)
388 XBit *fb = HostBitGet(h,0);
394 fb = HostBitGet(h,0);
396 printf(
"fb != NULL even though it was removed: ");
407 static int HostBitTest09 (
void)
421 XBit *fb = HostBitGet(h,1);
427 fb = HostBitGet(h,1);
429 printf(
"fb != NULL even though it was removed: ");
440 static int HostBitTest10 (
void)
454 XBit *fb = HostBitGet(h,2);
460 fb = HostBitGet(h,2);
462 printf(
"fb != NULL even though it was removed: ");
473 static int HostBitTest11 (
void)
487 XBit *fb = HostBitGet(h,3);
493 fb = HostBitGet(h,3);
495 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 * 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)
void HostCleanup(void)
Cleanup the host engine.
int HostHasHostBits(Host *host)
void GenericVarRemove(GenericVar **list, GenericVar *gv)
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)
int HostBitIsnotset(Host *h, uint32_t idx, SCTime_t ts)
int HostBitsTimedoutCheck(Host *h, SCTime_t ts)
#define SCTIME_CMP_GT(a, b)
void HostInitConfig(bool quiet)
initialize the configuration
void GenericVarFree(GenericVar *gv)
int HostSetStorageById(Host *h, HostStorageId id, void *ptr)
Store a pointer in a given Host storage.