datapath-windows/ovsext/Conntrack-nat.c
/*
 *----------------------------------------------------------------------------
 * OvsNatLookup
 *     Look up a NAT entry with the given key in the NAT table.
 *     If reverse is TRUE, look up a NAT entry with the given value instead.
 *----------------------------------------------------------------------------
 */
OvsNatLookup
Look up a NAT entry with the given key in the NAT table.
If reverse is TRUE, look up a NAT entry with the given value instead.
OvsNatLookup Look up a NAT entry with the given key in the NAT table . If reverse is TRUE look up a NAT entry with the given value instead .
POVS_NAT_ENTRY
OvsNatLookup(const OVS_CT_KEY *ctKey, BOOLEAN reverse)
{
    PLIST_ENTRY link;
    POVS_NAT_ENTRY entry;
    if (!ovsNatEntries) {
        return NULL;
    }
    NdisAcquireSpinLock(&ovsCtNatLock);
    LIST_FORALL(OvsNatGetBucket(ctKey, reverse), link) {
        if (reverse) {
            entry = CONTAINING_RECORD(link, OVS_NAT_ENTRY, reverseLink);
            if (OvsNatKeyAreSame(ctKey, &entry->value)) {
                NdisReleaseSpinLock(&ovsCtNatLock);
                return entry;
            }
        } else {
            entry = CONTAINING_RECORD(link, OVS_NAT_ENTRY, link);
            if (OvsNatKeyAreSame(ctKey, &entry->key)) {
                NdisReleaseSpinLock(&ovsCtNatLock);
                return entry;
            }
        }
    }
    NdisReleaseSpinLock(&ovsCtNatLock);
    return NULL;
}
POVS_NAT_ENTRY OvsNatLookup ( const OVS_CT_KEY * ctKey , BOOLEAN reverse ) { PLIST_ENTRY link ; POVS_NAT_ENTRY entry ; if ( ! ovsNatEntries ) { return NULL ; } NdisAcquireSpinLock ( & ovsCtNatLock ) ; LIST_FORALL ( OvsNatGetBucket ( ctKey , reverse ) , link ) { if ( reverse ) { entry = CONTAINING_RECORD ( link , OVS_NAT_ENTRY , reverseLink ) ; if ( OvsNatKeyAreSame ( ctKey , & entry -> value ) ) { NdisReleaseSpinLock ( & ovsCtNatLock ) ; return entry ; } } else { entry = CONTAINING_RECORD ( link , OVS_NAT_ENTRY , link ) ; if ( OvsNatKeyAreSame ( ctKey , & entry -> key ) ) { NdisReleaseSpinLock ( & ovsCtNatLock ) ; return entry ; } } } NdisReleaseSpinLock ( & ovsCtNatLock ) ; return NULL ; }
OvsNatLookup
     Look up a NAT entry with the given key in the NAT table.
OvsNatLookup Look up a NAT entry with the given key in the NAT table .