datapath-windows/ovsext/Conntrack-nat.c
/*
 *----------------------------------------------------------------------------
 * OvsNatFlush
 *     Flushes out all NAT entries that match the given zone.
 *----------------------------------------------------------------------------
 */
OvsNatFlush
Flushes out all NAT entries that match the given zone.
OvsNatFlush Flushes out all NAT entries that match the given zone .
VOID OvsNatFlush(UINT16 zone)
{
    PLIST_ENTRY link, next;
    if (!ovsNatEntries) {
        return;
    }
    NdisAcquireSpinLock(&ovsCtNatLock);
    for (int i = 0; i < NAT_HASH_TABLE_SIZE; i++) {
        LIST_FORALL_SAFE(&ovsNatTable[i], link, next) {
            POVS_NAT_ENTRY entry =
                CONTAINING_RECORD(link, OVS_NAT_ENTRY, link);
            if (!zone || zone == entry->key.zone) {
                OvsNatDeleteEntry(entry);
            }
        }
    }
    NdisReleaseSpinLock(&ovsCtNatLock);
}
VOID OvsNatFlush ( UINT16 zone ) { PLIST_ENTRY link , next ; if ( ! ovsNatEntries ) { return ; } NdisAcquireSpinLock ( & ovsCtNatLock ) ; for ( int i = 0 ; i < NAT_HASH_TABLE_SIZE ; i ++ ) { LIST_FORALL_SAFE ( & ovsNatTable [ i ] , link , next ) { POVS_NAT_ENTRY entry = CONTAINING_RECORD ( link , OVS_NAT_ENTRY , link ) ; if ( ! zone || zone == entry -> key . zone ) { OvsNatDeleteEntry ( entry ) ; } } } NdisReleaseSpinLock ( & ovsCtNatLock ) ; }
OvsNatFlush
     Flushes out all NAT entries that match the given zone.
OvsNatFlush Flushes out all NAT entries that match the given zone .
/* zone is a non-zero value */