Exemplo n.º 1
0
bool
FlowExecutor::ExecuteInt(const T& fe) {
    if (fe.edits.empty()) {
        return true;
    }
    /* create the barrier request first to setup request-map */
    OfpBuf barrReq(ofputil_encode_barrier_request(
       (ofp_version)swConn->GetProtocolVersion()));
    ovs_be32 barrXid = ((ofp_header *)barrReq->data)->xid;

    {
        mutex_guard lock(reqMtx);
        requests[barrXid];
    }

    int error = DoExecuteNoBlock<T>(fe, barrXid);
    if (error == 0) {
        error = WaitOnBarrier(barrReq);
    } else {
        mutex_guard lock(reqMtx);
        requests.erase(barrXid);
    }
    return error == 0;
}
Exemplo n.º 2
0
struct ofpbuf *
barrier_request(enum ofputil_protocol proto)
{
    return ofputil_encode_barrier_request(
        ofputil_protocol_to_ofp_version(proto));
}