hostbits: add list API

pull/2559/head
Victor Julien 9 years ago
parent 996112edf5
commit b6e4276792

@ -181,6 +181,25 @@ int HostBitIsnotset(Host *h, uint32_t idx, uint32_t ts)
return 0;
}
int HostBitList(Host *h, XBit **iter)
{
GenericVar *gv = (GenericVar *)*iter;
if (gv == NULL) {
gv = HostGetStorageById(h, host_bit_id);
} else {
gv = gv->next;
}
for ( ; gv != NULL; gv = gv->next) {
if (gv->type == DETECT_XBITS) {
*iter = (XBit *)gv;
return 1;
}
}
*iter = NULL;
return 0;
}
/* TESTS */
#ifdef UNITTESTS
static int HostBitTest01 (void)

@ -38,4 +38,6 @@ void HostBitUnset(Host *, uint32_t);
void HostBitToggle(Host *, uint32_t, uint32_t);
int HostBitIsset(Host *, uint32_t, uint32_t);
int HostBitIsnotset(Host *, uint32_t, uint32_t);
int HostBitList(Host *, XBit **);
#endif /* __HOST_BIT_H__ */

Loading…
Cancel
Save