Go to the documentation of this file.
42 static void HostBitFreeAll(
void *store)
51 if (host_bit_id.
id == -1) {
52 FatalError(
"Can't initiate host storage for bits");
69 for ( ; gv != NULL; gv = gv->
next) {
80 static XBit *HostBitGet(
Host *h, uint32_t idx)
83 for ( ; gv != NULL; gv = gv->
next) {
93 static void HostBitAdd(
Host *h, uint32_t idx,
SCTime_t expire)
95 XBit *fb = HostBitGet(h, idx);
116 static void HostBitRemove(
Host *h, uint32_t idx)
118 XBit *fb = HostBitGet(h, idx);
132 XBit *fb = HostBitGet(h, idx);
134 HostBitAdd(h, idx, expire);
140 XBit *fb = HostBitGet(h, idx);
142 HostBitRemove(h, idx);
148 XBit *fb = HostBitGet(h, idx);
150 HostBitRemove(h, idx);
152 HostBitAdd(h, idx, expire);
158 XBit *fb = HostBitGet(h, idx);
161 HostBitRemove(h,idx);
171 XBit *fb = HostBitGet(h, idx);
177 HostBitRemove(h,idx);
192 for ( ; gv != NULL; gv = gv->
next) {
204 static int HostBitTest01 (
void)
220 XBit *fb = HostBitGet(h,0);
231 static int HostBitTest02 (
void)
245 XBit *fb = HostBitGet(h,0);
256 static int HostBitTest03 (
void)
272 XBit *fb = HostBitGet(h,0);
274 printf(
"fb == NULL although it was just added: ");
280 fb = HostBitGet(h,0);
282 printf(
"fb != NULL although it was just removed: ");
295 static int HostBitTest04 (
void)
314 XBit *fb = HostBitGet(h,0);
325 static int HostBitTest05 (
void)
344 XBit *fb = HostBitGet(h,1);
355 static int HostBitTest06 (
void)
374 XBit *fb = HostBitGet(h,2);
385 static int HostBitTest07 (
void)
404 XBit *fb = HostBitGet(h,3);
415 static int HostBitTest08 (
void)
434 XBit *fb = HostBitGet(h,0);
440 fb = HostBitGet(h,0);
442 printf(
"fb != NULL even though it was removed: ");
454 static int HostBitTest09 (
void)
473 XBit *fb = HostBitGet(h,1);
479 fb = HostBitGet(h,1);
481 printf(
"fb != NULL even though it was removed: ");
493 static int HostBitTest10 (
void)
512 XBit *fb = HostBitGet(h,2);
518 fb = HostBitGet(h,2);
520 printf(
"fb != NULL even though it was removed: ");
532 static int HostBitTest11 (
void)
551 XBit *fb = HostBitGet(h,3);
557 fb = HostBitGet(h,3);
559 printf(
"fb != NULL even though it was removed: ");
int HostBitList(Host *h, XBit **iter)
void GenericVarAppend(GenericVar **list, GenericVar *gv)
void * SCHostGetStorageById(Host *h, SCHostStorageId id)
Get a value from a given Host storage.
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
int SCHostSetStorageById(Host *h, SCHostStorageId id, void *ptr)
Store a pointer in a given Host storage.
void HostBitSet(Host *h, uint32_t idx, SCTime_t expire)
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 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 SCStorageCleanup(void)
void HostInitConfig(bool quiet)
initialize the configuration
SCHostStorageId SCHostStorageRegister(const char *name, void(*Free)(void *))
Register a Host storage.
int SCStorageFinalize(void)