datapath-windows/ovsext/User.c
/*
 * ---------------------------------------------------------------------------
 * Given a pid, returns the corresponding instance.
 * pidHashLock must be acquired before calling this API.
 * ---------------------------------------------------------------------------
 */
Given a pid, returns the corresponding instance.
pidHashLock must be acquired before calling this API.
Given a pid returns the corresponding instance . pidHashLock must be acquired before calling this API .
POVS_OPEN_INSTANCE
OvsGetPidInstance(POVS_SWITCH_CONTEXT switchContext, UINT32 pid)
{
    POVS_OPEN_INSTANCE instance;
    PLIST_ENTRY head, link;
    UINT32 hash = OvsJhashBytes((const VOID *)&pid, sizeof(pid),
                                OVS_HASH_BASIS);
    head = &(switchContext->pidHashArray[hash & OVS_PID_MASK]);
    LIST_FORALL(head, link) {
        instance = CONTAINING_RECORD(link, OVS_OPEN_INSTANCE, pidLink);
        if (instance->pid == pid) {
            return instance;
        }
    }
    return NULL;
}
POVS_OPEN_INSTANCE OvsGetPidInstance ( POVS_SWITCH_CONTEXT switchContext , UINT32 pid ) { POVS_OPEN_INSTANCE instance ; PLIST_ENTRY head , link ; UINT32 hash = OvsJhashBytes ( ( const VOID * ) & pid , sizeof ( pid ) , OVS_HASH_BASIS ) ; head = & ( switchContext -> pidHashArray [ hash & OVS_PID_MASK ] ) ; LIST_FORALL ( head , link ) { instance = CONTAINING_RECORD ( link , OVS_OPEN_INSTANCE , pidLink ) ; if ( instance -> pid == pid ) { return instance ; } } return NULL ; }
Given a pid, returns the corresponding instance.
Given a pid returns the corresponding instance .