예제 #1
0
파일: flow-bit.c 프로젝트: P1sec/suricata
static void FlowBitRemove(Flow *f, uint16_t idx)
{
    FlowBit *fb = FlowBitGet(f, idx);
    if (fb == NULL)
        return;

    GenericVarRemove(&f->flowvar, (GenericVar *)fb);
    FlowBitFree(fb);
}
예제 #2
0
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);
    }
}
예제 #3
0
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);
    }
}
예제 #4
0
파일: flow-bit.c 프로젝트: JakeGNA/suricata
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 */
}