static void FlowBitRemove(Flow *f, uint16_t idx) { FlowBit *fb = FlowBitGet(f, idx); if (fb == NULL) return; GenericVarRemove(&f->flowvar, (GenericVar *)fb); FlowBitFree(fb); }
static void HostBitRemove(Host *h, uint16_t idx) { XBit *fb = HostBitGet(h, idx); if (fb == NULL) return; GenericVar *gv = HostGetStorageById(h, host_bit_id); if (gv) { GenericVarRemove(&gv, (GenericVar *)fb); HostSetStorageById(h, host_bit_id, gv); } }
static void IPPairBitRemove(IPPair *h, uint16_t idx) { XBit *fb = IPPairBitGet(h, idx); if (fb == NULL) return; GenericVar *gv = IPPairGetStorageById(h, ippair_bit_id); if (gv) { GenericVarRemove(&gv, (GenericVar *)fb); IPPairSetStorageById(h, ippair_bit_id, gv); } }
static void FlowBitRemove(Flow *f, uint16_t idx) { FlowBit *fb = FlowBitGet(f, idx); if (fb == NULL) return; GenericVarRemove(&f->flowvar, (GenericVar *)fb); //printf("FlowBitRemove: remove flowbit with idx %" PRIu32 "\n", idx); #ifdef FLOWBITS_STATS SCMutexLock(&flowbits_mutex); flowbits_removed++; if (flowbits_memuse >= sizeof(FlowBit)) flowbits_memuse -= sizeof(FlowBit); else { printf("ERROR: flowbits memory usage going below 0!\n"); flowbits_memuse = 0; } SCMutexUnlock(&flowbits_mutex); #endif /* FLOWBITS_STATS */ }