lib/stp.c
/* Returns the index of port 'p' within its bridge. */
Returns the index of port 'p' within its bridge.
Returns the index of port ' p ' within its bridge .
int
stp_port_no(const struct stp_port *p)
{
    struct stp *stp;
    int index;
    ovs_mutex_lock(&mutex);
    stp = p->stp;
    ovs_assert(p >= stp->ports && p < &stp->ports[ARRAY_SIZE(stp->ports)]);
    index = p - p->stp->ports;
    ovs_mutex_unlock(&mutex);
    return index;
}
int stp_port_no ( const struct stp_port * p ) { struct stp * stp ; int index ; ovs_mutex_lock ( & mutex ) ; stp = p -> stp ; ovs_assert ( p >= stp -> ports && p < & stp -> ports [ ARRAY_SIZE ( stp -> ports ) ] ) ; index = p - p -> stp -> ports ; ovs_mutex_unlock ( & mutex ) ; return index ; }
Returns the index of port 'p' within its bridge.
Returns the index of port ' p ' within its bridge .