lib/learning-switch.c
/* Takes care of necessary 'sw' activity, except for receiving packets (which
 * the caller must do). */
Takes care of necessary 'sw' activity, except for receiving packets (which
the caller must do).
Takes care of necessary ' sw ' activity except for receiving packets ( which the caller must do ) .
void
lswitch_run(struct lswitch *sw)
{
    int i;
    if (sw->ml) {
        ovs_rwlock_wrlock(&sw->ml->rwlock);
        mac_learning_run(sw->ml);
        ovs_rwlock_unlock(&sw->ml->rwlock);
    }
    rconn_run(sw->rconn);
    if (sw->state == S_CONNECTING) {
        if (rconn_is_connected(sw->rconn)) {
            lswitch_handshake(sw);
            sw->state = S_FEATURES_REPLY;
        }
        return;
    }
    for (i = 0; i < 50; i++) {
        struct ofpbuf *msg;
        msg = rconn_recv(sw->rconn);
        if (!msg) {
            break;
        }
        if (!sw->mute) {
            lswitch_process_packet(sw, msg);
        }
        ofpbuf_delete(msg);
    }
}
void lswitch_run ( struct lswitch * sw ) { int i ; if ( sw -> ml ) { ovs_rwlock_wrlock ( & sw -> ml -> rwlock ) ; mac_learning_run ( sw -> ml ) ; ovs_rwlock_unlock ( & sw -> ml -> rwlock ) ; } rconn_run ( sw -> rconn ) ; if ( sw -> state == S_CONNECTING ) { if ( rconn_is_connected ( sw -> rconn ) ) { lswitch_handshake ( sw ) ; sw -> state = S_FEATURES_REPLY ; } return ; } for ( i = 0 ; i < 50 ; i ++ ) { struct ofpbuf * msg ; msg = rconn_recv ( sw -> rconn ) ; if ( ! msg ) { break ; } if ( ! sw -> mute ) { lswitch_process_packet ( sw , msg ) ; } ofpbuf_delete ( msg ) ; } }
Takes care of necessary 'sw' activity, except for receiving packets (which
 the caller must do).
Takes care of necessary ' sw ' activity except for receiving packets ( which the caller must do ) .