Java 类org.projectfloodlight.openflow.protocol.OFBarrierRequest 实例源码

项目:fresco_floodlight    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFError(OFErrorMsg m) {
    /*
     * HP ProCurve switches do not support
     * the ofpt_barrier_request message.
     * 
     * Look for an error from a bad ofpt_barrier_request,
     * log a warning, but proceed.
     */
    if (m.getErrType() == OFErrorType.BAD_REQUEST &&
            ((OFBadRequestErrorMsg) m).getCode() == OFBadRequestCode.BAD_TYPE &&
            ((OFBadRequestErrorMsg) m).getData().getParsedMessage().get() instanceof OFBarrierRequest) {
        log.warn("Switch does not support Barrier Request messages. Could be an HP ProCurve.");
    } else {
        logErrorDisconnect(m);
    }
}
项目:fresco_floodlight    文件:OFSwitchHandshakeHandler.java   
/**
 * Send the configuration requests to tell the switch we want full
 * packets
 * @throws IOException
 */
private void sendHandshakeSetConfig() {
    // Ensure we receive the full packet via PacketIn
    // FIXME: We don't set the reassembly flags.
    OFSetConfig configSet = factory.buildSetConfig()
            .setXid(handshakeTransactionIds--)
            .setMissSendLen(0xffff)
            .build();

    // Barrier
    OFBarrierRequest barrier = factory.buildBarrierRequest()
            .setXid(handshakeTransactionIds--)
            .build();

    // Verify (need barrier?)
    OFGetConfigRequest configReq = factory.buildGetConfigRequest()
            .setXid(handshakeTransactionIds--)
            .build();
    List<OFMessage> msgList = ImmutableList.<OFMessage>of(configSet, barrier, configReq);
    mainConnection.write(msgList);
}
项目:iTAP-controller    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFError(OFErrorMsg m) {
    /*
     * HP ProCurve switches do not support
     * the ofpt_barrier_request message.
     * 
     * Look for an error from a bad ofpt_barrier_request,
     * log a warning, but proceed.
     */
    if (m.getErrType() == OFErrorType.BAD_REQUEST &&
            ((OFBadRequestErrorMsg) m).getCode() == OFBadRequestCode.BAD_TYPE &&
            ((OFBadRequestErrorMsg) m).getData().getParsedMessage().get() instanceof OFBarrierRequest) {
        log.warn("Switch does not support Barrier Request messages. Could be an HP ProCurve.");
    } else {
        logErrorDisconnect(m);
    }
}
项目:iTAP-controller    文件:OFSwitchHandshakeHandler.java   
/**
 * Send the configuration requests to tell the switch we want full
 * packets
 * @throws IOException
 */
private void sendHandshakeSetConfig() {
    // Ensure we receive the full packet via PacketIn
    // FIXME: We don't set the reassembly flags.
    OFSetConfig configSet = factory.buildSetConfig()
            .setXid(handshakeTransactionIds--)
            .setMissSendLen(0xffff)
            .build();

    // Barrier
    OFBarrierRequest barrier = factory.buildBarrierRequest()
            .setXid(handshakeTransactionIds--)
            .build();

    // Verify (need barrier?)
    OFGetConfigRequest configReq = factory.buildGetConfigRequest()
            .setXid(handshakeTransactionIds--)
            .build();
    List<OFMessage> msgList = ImmutableList.<OFMessage>of(configSet, barrier, configReq);
    mainConnection.write(msgList);
}
项目:SDN-Multicast    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFError(OFErrorMsg m) {
    /*
     * HP ProCurve switches do not support
     * the ofpt_barrier_request message.
     * 
     * Look for an error from a bad ofpt_barrier_request,
     * log a warning, but proceed.
     */
    if (m.getErrType() == OFErrorType.BAD_REQUEST &&
            ((OFBadRequestErrorMsg) m).getCode() == OFBadRequestCode.BAD_TYPE &&
            ((OFBadRequestErrorMsg) m).getData().getParsedMessage().get() instanceof OFBarrierRequest) {
        log.warn("Switch does not support Barrier Request messages. Could be an HP ProCurve.");
    } else {
        logErrorDisconnect(m);
    }
}
项目:SDN-Multicast    文件:OFSwitchHandshakeHandler.java   
/**
 * Send the configuration requests to tell the switch we want full
 * packets
 * @throws IOException
 */
private void sendHandshakeSetConfig() {
    // Ensure we receive the full packet via PacketIn
    // FIXME: We don't set the reassembly flags.
    OFSetConfig configSet = factory.buildSetConfig()
            .setXid(handshakeTransactionIds--)
            .setMissSendLen(0xffff)
            .build();

    // Barrier
    OFBarrierRequest barrier = factory.buildBarrierRequest()
            .setXid(handshakeTransactionIds--)
            .build();

    // Verify (need barrier?)
    OFGetConfigRequest configReq = factory.buildGetConfigRequest()
            .setXid(handshakeTransactionIds--)
            .build();
    List<OFMessage> msgList = ImmutableList.<OFMessage>of(configSet, barrier, configReq);
    mainConnection.write(msgList);
}
项目:arscheduler    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFError(OFErrorMsg m) {
    /*
     * HP ProCurve switches do not support
     * the ofpt_barrier_request message.
     * 
     * Look for an error from a bad ofpt_barrier_request,
     * log a warning, but proceed.
     */
    if (m.getErrType() == OFErrorType.BAD_REQUEST &&
            ((OFBadRequestErrorMsg) m).getCode() == OFBadRequestCode.BAD_TYPE &&
            ((OFBadRequestErrorMsg) m).getData().getParsedMessage().get() instanceof OFBarrierRequest) {
        log.warn("Switch does not support Barrier Request messages. Could be an HP ProCurve.");
    } else {
        logErrorDisconnect(m);
    }
}
项目:arscheduler    文件:OFSwitchHandshakeHandler.java   
/**
 * Send the configuration requests to tell the switch we want full
 * packets
 * @throws IOException
 */
private void sendHandshakeSetConfig() {
    // Ensure we receive the full packet via PacketIn
    // FIXME: We don't set the reassembly flags.
    OFSetConfig configSet = factory.buildSetConfig()
            .setXid(handshakeTransactionIds--)
            .setMissSendLen(0xffff)
            .build();

    // Barrier
    OFBarrierRequest barrier = factory.buildBarrierRequest()
            .setXid(handshakeTransactionIds--)
            .build();

    // Verify (need barrier?)
    OFGetConfigRequest configReq = factory.buildGetConfigRequest()
            .setXid(handshakeTransactionIds--)
            .build();
    List<OFMessage> msgList = ImmutableList.<OFMessage>of(configSet, barrier, configReq);
    mainConnection.write(msgList);
}
项目:floodlight1.2-delay    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFError(OFErrorMsg m) {
    /*
     * HP ProCurve switches do not support
     * the ofpt_barrier_request message.
     * 
     * Look for an error from a bad ofpt_barrier_request,
     * log a warning, but proceed.
     */
    if (m.getErrType() == OFErrorType.BAD_REQUEST &&
            ((OFBadRequestErrorMsg) m).getCode() == OFBadRequestCode.BAD_TYPE &&
            ((OFBadRequestErrorMsg) m).getData().getParsedMessage().get() instanceof OFBarrierRequest) {
        log.warn("Switch does not support Barrier Request messages. Could be an HP ProCurve.");
    } else {
        logErrorDisconnect(m);
    }
}
项目:floodlight1.2-delay    文件:OFSwitchHandshakeHandler.java   
/**
 * Send the configuration requests to tell the switch we want full
 * packets
 * @throws IOException
 */
private void sendHandshakeSetConfig() {
    // Ensure we receive the full packet via PacketIn
    // FIXME: We don't set the reassembly flags.
    OFSetConfig configSet = factory.buildSetConfig()
            .setXid(handshakeTransactionIds--)
            .setMissSendLen(0xffff)
            .build();

    // Barrier
    OFBarrierRequest barrier = factory.buildBarrierRequest()
            .setXid(handshakeTransactionIds--)
            .build();

    // Verify (need barrier?)
    OFGetConfigRequest configReq = factory.buildGetConfigRequest()
            .setXid(handshakeTransactionIds--)
            .build();
    List<OFMessage> msgList = ImmutableList.<OFMessage>of(configSet, barrier, configReq);
    mainConnection.write(msgList);
}
项目:floodlight-hardware    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFError(OFErrorMsg m) {
    /*
     * HP ProCurve switches do not support
     * the ofpt_barrier_request message.
     *
     * Look for an error from a bad ofpt_barrier_request,
     * log a warning, but proceed.
     */
    if (m.getErrType() == OFErrorType.BAD_REQUEST &&
            ((OFBadRequestErrorMsg) m).getCode() == OFBadRequestCode.BAD_TYPE &&
            ((OFBadRequestErrorMsg) m).getData().getParsedMessage().get() instanceof OFBarrierRequest) {
        log.warn("Switch does not support Barrier Request messages. Could be an HP ProCurve.");
    } else {
        logErrorDisconnect(m);
    }
}
项目:floodlight-hardware    文件:OFSwitchHandshakeHandler.java   
/**
 * Send the configuration requests to tell the switch we want full
 * packets
 * @throws IOException
 */
private void sendHandshakeSetConfig() {
    // Ensure we receive the full packet via PacketIn
    // FIXME: We don't set the reassembly flags.
    OFSetConfig configSet = factory.buildSetConfig()
            .setXid(handshakeTransactionIds--)
            .setMissSendLen(0xffff)
            .build();

    // Barrier
    OFBarrierRequest barrier = factory.buildBarrierRequest()
            .setXid(handshakeTransactionIds--)
            .build();

    // Verify (need barrier?)
    OFGetConfigRequest configReq = factory.buildGetConfigRequest()
            .setXid(handshakeTransactionIds--)
            .build();
    List<OFMessage> msgList = ImmutableList.<OFMessage>of(configSet, barrier, configReq);
    mainConnection.write(msgList);
}
项目:ACAMPController    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFError(OFErrorMsg m) {
    /*
     * HP ProCurve switches do not support
     * the ofpt_barrier_request message.
     * 
     * Look for an error from a bad ofpt_barrier_request,
     * log a warning, but proceed.
     */
    if (m.getErrType() == OFErrorType.BAD_REQUEST &&
            ((OFBadRequestErrorMsg) m).getCode() == OFBadRequestCode.BAD_TYPE &&
            ((OFBadRequestErrorMsg) m).getData().getParsedMessage().get() instanceof OFBarrierRequest) {
        log.warn("Switch does not support Barrier Request messages. Could be an HP ProCurve.");
    } else {
        logErrorDisconnect(m);
    }
}
项目:ACAMPController    文件:OFSwitchHandshakeHandler.java   
/**
 * Send the configuration requests to tell the switch we want full
 * packets
 * @throws IOException
 */
private void sendHandshakeSetConfig() {
    // Ensure we receive the full packet via PacketIn
    // FIXME: We don't set the reassembly flags.
    OFSetConfig configSet = factory.buildSetConfig()
            .setXid(handshakeTransactionIds--)
            .setMissSendLen(0xffff)
            .build();

    // Barrier
    OFBarrierRequest barrier = factory.buildBarrierRequest()
            .setXid(handshakeTransactionIds--)
            .build();

    // Verify (need barrier?)
    OFGetConfigRequest configReq = factory.buildGetConfigRequest()
            .setXid(handshakeTransactionIds--)
            .build();
    List<OFMessage> msgList = ImmutableList.<OFMessage>of(configSet, barrier, configReq);
    mainConnection.write(msgList);
}
项目:fast-failover-demo    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFError(OFErrorMsg m) {
    /*
     * HP ProCurve switches do not support
     * the ofpt_barrier_request message.
     * 
     * Look for an error from a bad ofpt_barrier_request,
     * log a warning, but proceed.
     */
    if (m.getErrType() == OFErrorType.BAD_REQUEST &&
            ((OFBadRequestErrorMsg) m).getCode() == OFBadRequestCode.BAD_TYPE &&
            ((OFBadRequestErrorMsg) m).getData().getParsedMessage().get() instanceof OFBarrierRequest) {
        log.warn("Switch does not support Barrier Request messages. Could be an HP ProCurve.");
    } else {
        logErrorDisconnect(m);
    }
}
项目:fast-failover-demo    文件:OFSwitchHandshakeHandler.java   
/**
 * Send the configuration requests to tell the switch we want full
 * packets
 * @throws IOException
 */
private void sendHandshakeSetConfig() {
    // Ensure we receive the full packet via PacketIn
    // FIXME: We don't set the reassembly flags.
    OFSetConfig configSet = factory.buildSetConfig()
            .setXid(handshakeTransactionIds--)
            .setMissSendLen(0xffff)
            .build();

    // Barrier
    OFBarrierRequest barrier = factory.buildBarrierRequest()
            .setXid(handshakeTransactionIds--)
            .build();

    // Verify (need barrier?)
    OFGetConfigRequest configReq = factory.buildGetConfigRequest()
            .setXid(handshakeTransactionIds--)
            .build();
    List<OFMessage> msgList = ImmutableList.<OFMessage>of(configSet, barrier, configReq);
    mainConnection.write(msgList);
}
项目:ravikumaran201504    文件:OFCorsaSwitchDriver.java   
@Override
public void startDriverHandshake() {
    if (startDriverHandshakeCalled) {
        throw new SwitchDriverSubHandshakeAlreadyStarted();
    }
    startDriverHandshakeCalled = true;
    OFFlowMod fm = factory().buildFlowDelete()
            .setTableId(TableId.ALL)
            .setOutGroup(OFGroup.ANY)
            .build();

    channel.write(Collections.singletonList(fm));

    barrierXid = getNextTransactionId();
    OFBarrierRequest barrier = factory().buildBarrierRequest()
            .setXid(barrierXid).build();


    channel.write(Collections.singletonList(barrier));

}
项目:floodlightLB    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFError(OFErrorMsg m) {
    /*
     * HP ProCurve switches do not support
     * the ofpt_barrier_request message.
     * 
     * Look for an error from a bad ofpt_barrier_request,
     * log a warning, but proceed.
     */
    if (m.getErrType() == OFErrorType.BAD_REQUEST &&
            ((OFBadRequestErrorMsg) m).getCode() == OFBadRequestCode.BAD_TYPE &&
            ((OFBadRequestErrorMsg) m).getData().getParsedMessage().get() instanceof OFBarrierRequest) {
        log.warn("Switch does not support Barrier Request messages. Could be an HP ProCurve.");
    } else {
        logErrorDisconnect(m);
    }
}
项目:floodlightLB    文件:OFSwitchHandshakeHandler.java   
/**
 * Send the configuration requests to tell the switch we want full
 * packets
 * @throws IOException
 */
private void sendHandshakeSetConfig() {
    // Ensure we receive the full packet via PacketIn
    // FIXME: We don't set the reassembly flags.
    OFSetConfig configSet = factory.buildSetConfig()
            .setXid(handshakeTransactionIds--)
            .setMissSendLen(0xffff)
            .build();

    // Barrier
    OFBarrierRequest barrier = factory.buildBarrierRequest()
            .setXid(handshakeTransactionIds--)
            .build();

    // Verify (need barrier?)
    OFGetConfigRequest configReq = factory.buildGetConfigRequest()
            .setXid(handshakeTransactionIds--)
            .build();
    List<OFMessage> msgList = ImmutableList.<OFMessage>of(configSet, barrier, configReq);
    mainConnection.write(msgList);
}
项目:DSC    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFError(OFErrorMsg m) {
    /*
     * HP ProCurve switches do not support
     * the ofpt_barrier_request message.
     * 
     * Look for an error from a bad ofpt_barrier_request,
     * log a warning, but proceed.
     */
    if (m.getErrType() == OFErrorType.BAD_REQUEST &&
            ((OFBadRequestErrorMsg) m).getCode() == OFBadRequestCode.BAD_TYPE &&
            ((OFBadRequestErrorMsg) m).getData().getParsedMessage().get() instanceof OFBarrierRequest) {
        log.warn("Switch does not support Barrier Request messages. Could be an HP ProCurve.");
    } else {
        logErrorDisconnect(m);
    }
}
项目:DSC    文件:OFSwitchHandshakeHandler.java   
/**
 * Send the configuration requests to tell the switch we want full
 * packets
 * @throws IOException
 */
private void sendHandshakeSetConfig() {
    // Ensure we receive the full packet via PacketIn
    // FIXME: We don't set the reassembly flags.
    OFSetConfig configSet = factory.buildSetConfig()
            .setXid(handshakeTransactionIds--)
            .setMissSendLen(0xffff)
            .build();

    // Barrier
    OFBarrierRequest barrier = factory.buildBarrierRequest()
            .setXid(handshakeTransactionIds--)
            .build();

    // Verify (need barrier?)
    OFGetConfigRequest configReq = factory.buildGetConfigRequest()
            .setXid(handshakeTransactionIds--)
            .build();
    List<OFMessage> msgList = ImmutableList.<OFMessage>of(configSet, barrier, configReq);
    mainConnection.write(msgList);
}
项目:floodlight    文件:OFSwitchHandshakeHandler.java   
/**
 * Send the configuration requests to tell the switch we want full
 * packets
 * @throws IOException
 */
private void sendHandshakeSetConfig() {
    // Ensure we receive the full packet via PacketIn
    // FIXME: We don't set the reassembly flags.
    OFSetConfig configSet = factory.buildSetConfig()
            .setXid(handshakeTransactionIds--)
            .setMissSendLen(0xffff)
            .build();

    // Barrier
    OFBarrierRequest barrier = factory.buildBarrierRequest()
            .setXid(handshakeTransactionIds--)
            .build();

    // Verify (need barrier?)
    OFGetConfigRequest configReq = factory.buildGetConfigRequest()
            .setXid(handshakeTransactionIds--)
            .build();
    List<OFMessage> msgList = ImmutableList.<OFMessage>of(configSet, barrier, configReq);
    mainConnection.write(msgList);
}
项目:athena    文件:CorsaSwitchHandshaker.java   
@Override
public void startDriverHandshake() {
    if (startDriverHandshakeCalled) {
        throw new SwitchDriverSubHandshakeAlreadyStarted();
    }
    startDriverHandshakeCalled = true;
    OFFlowMod fm = factory().buildFlowDelete()
            .setTableId(TableId.ALL)
            .setOutGroup(OFGroup.ANY)
            .build();

    sendMsg(Collections.singletonList(fm));

    OFGroupMod gm = factory().buildGroupDelete()
            .setGroup(OFGroup.ALL)
            .setGroupType(OFGroupType.ALL)
            .build();

    sendMsg(Collections.singletonList(gm));

    OFMeterMod mm = factory().buildMeterMod()
            .setMeterId(MeterId.ALL.id())
            .build();

    sendMsg(Collections.singletonList(mm));

    barrierXid = getNextTransactionId();
    OFBarrierRequest barrier = factory().buildBarrierRequest()
            .setXid(barrierXid).build();


    sendHandshakeMessage(barrier);

}
项目:athena    文件:OFChannelHandler.java   
/**
    * Send the configuration requests to tell the switch we want full
    * packets.
    * @throws IOException
    */
   private void sendHandshakeSetConfig() throws IOException {
       OFFactory factory = (ofVersion == OFVersion.OF_13) ? factory13 : factory10;
       //log.debug("Sending CONFIG_REQUEST to {}", channel.getRemoteAddress());
       List<OFMessage> msglist = new ArrayList<OFMessage>(3);

       // Ensure we receive the full packet via PacketIn
       // FIXME: We don't set the reassembly flags.
// Only send config to switches to send full packets, if they have a buffer.
       // Saves a packet & OFSetConfig can't be handled by certain switches.
       if(this.featuresReply.getNBuffers() > 0) {
           OFSetConfig sc = factory
                   .buildSetConfig()
                   .setMissSendLen((short) 0xffff)
                   .setXid(this.handshakeTransactionIds--)
                   .build();
           msglist.add(sc);
       }

       // Barrier
       OFBarrierRequest br = factory
               .buildBarrierRequest()
               .setXid(this.handshakeTransactionIds--)
               .build();
       msglist.add(br);

       // Verify (need barrier?)
       OFGetConfigRequest gcr = factory
               .buildGetConfigRequest()
               .setXid(this.handshakeTransactionIds--)
               .build();
       msglist.add(gcr);
       channel.write(msglist);
   }
项目:fresco_floodlight    文件:OFSwitchHandshakeHandler.java   
private long sendBarrier() {
    long xid = handshakeTransactionIds--;
    OFBarrierRequest barrier = factory.buildBarrierRequest()
            .setXid(xid)
            .build();
    sw.write(barrier); /* don't use ListenableFuture here; we receive via barrier reply OR error (barrier unsupported) */
    return xid;
}
项目:SDN-Multicast    文件:OFSwitchHandshakeHandler.java   
private long sendBarrier() {
    long xid = handshakeTransactionIds--;
    OFBarrierRequest barrier = factory.buildBarrierRequest()
            .setXid(xid)
            .build();
    sw.write(barrier); /* don't use ListenableFuture here; we receive via barrier reply OR error (barrier unsupported) */
    return xid;
}
项目:SDN-Multicast    文件:OFSwitchHandshakeHandler.java   
private long sendBarrier() {
    long xid = handshakeTransactionIds--;
    OFBarrierRequest barrier = factory.buildBarrierRequest()
            .setXid(xid)
            .build();
    sw.write(barrier); /* don't use ListenableFuture here; we receive via barrier reply OR error (barrier unsupported) */
    return xid;
}
项目:arscheduler    文件:OFSwitchHandshakeHandler.java   
private long sendBarrier() {
    long xid = handshakeTransactionIds--;
    OFBarrierRequest barrier = factory.buildBarrierRequest()
            .setXid(xid)
            .build();
    sw.write(barrier); /* don't use ListenableFuture here; we receive via barrier reply OR error (barrier unsupported) */
    return xid;
}
项目:floodlight1.2-delay    文件:OFSwitchHandshakeHandler.java   
private long sendBarrier() {
    long xid = handshakeTransactionIds--;
    OFBarrierRequest barrier = factory.buildBarrierRequest()
            .setXid(xid)
            .build();
    sw.write(barrier); /* don't use ListenableFuture here; we receive via barrier reply OR error (barrier unsupported) */
    return xid;
}
项目:floodlight-hardware    文件:OFSwitchHandshakeHandler.java   
private long sendBarrier() {
    long xid = handshakeTransactionIds--;
    OFBarrierRequest barrier = factory.buildBarrierRequest()
            .setXid(xid)
            .build();
    sw.write(barrier); /* don't use ListenableFuture here; we receive via barrier reply OR error (barrier unsupported) */
    return xid;
}
项目:ACAMPController    文件:OFSwitchHandshakeHandler.java   
private long sendBarrier() {
    long xid = handshakeTransactionIds--;
    OFBarrierRequest barrier = factory.buildBarrierRequest()
            .setXid(xid)
            .build();
    sw.write(barrier); /* don't use ListenableFuture here; we receive via barrier reply OR error (barrier unsupported) */
    return xid;
}
项目:fast-failover-demo    文件:FastFailoverDemo.java   
private void sendBarrier(IOFSwitch sw) {
    OFBarrierRequest barrierRequest = sw.getOFFactory().buildBarrierRequest()
            .build();
    ListenableFuture<OFBarrierReply> future = sw.writeRequest(barrierRequest);
    try {
        future.get(10, TimeUnit.SECONDS); /* If successful, we can discard the reply. */
    } catch (InterruptedException | ExecutionException
            | TimeoutException e) {
        log.error("Switch {} doesn't support barrier messages? OVS should.", sw.toString());
    }
}
项目:ravikumaran201504    文件:OFSwitchImplOVS13.java   
private void sendBarrier(boolean finalBarrier) {
    int xid = getNextTransactionId();
    if (finalBarrier) {
        barrierXidToWaitFor = xid;
    }
    OFBarrierRequest br = factory
            .buildBarrierRequest()
            .setXid(xid)
            .build();
    write(br);
}
项目:ravikumaran201504    文件:OFSwitchImplCPqD13.java   
private void sendBarrier(boolean finalBarrier) {
    int xid = getNextTransactionId();
    if (finalBarrier) {
        barrierXidToWaitFor = xid;
    }
    OFBarrierRequest br = factory
            .buildBarrierRequest()
            .setXid(xid)
            .build();

    write(br);
}
项目:ravikumaran201504    文件:OFChannelHandler.java   
/**
 * Send the configuration requests to tell the switch we want full
 * packets.
 * @throws IOException
 */
private void sendHandshakeSetConfig() throws IOException {
    OFFactory factory = (ofVersion == OFVersion.OF_13) ? factory13 : factory10;
    //log.debug("Sending CONFIG_REQUEST to {}", channel.getRemoteAddress());
    List<OFMessage> msglist = new ArrayList<OFMessage>(3);

    // Ensure we receive the full packet via PacketIn
    // FIXME: We don't set the reassembly flags.
    OFSetConfig sc = factory
            .buildSetConfig()
            .setMissSendLen((short) 0xffff)
            .setXid(this.handshakeTransactionIds--)
            .build();
    msglist.add(sc);

    // Barrier
    OFBarrierRequest br = factory
            .buildBarrierRequest()
            .setXid(this.handshakeTransactionIds--)
            .build();
    msglist.add(br);

    // Verify (need barrier?)
    OFGetConfigRequest gcr = factory
            .buildGetConfigRequest()
            .setXid(this.handshakeTransactionIds--)
            .build();
    msglist.add(gcr);
    channel.write(msglist);
}
项目:floodlightLB    文件:OFSwitchHandshakeHandler.java   
private long sendBarrier() {
    long xid = handshakeTransactionIds--;
    OFBarrierRequest barrier = factory.buildBarrierRequest()
            .setXid(xid)
            .build();
    sw.write(barrier); /* don't use ListenableFuture here; we receive via barrier reply OR error (barrier unsupported) */
    return xid;
}
项目:spring-open    文件:OFSwitchImplOVS13.java   
private void sendBarrier(boolean finalBarrier) throws IOException {
    int xid = getNextTransactionId();
    if (finalBarrier) {
        barrierXidToWaitFor = xid;
    }
    OFBarrierRequest br = getFactory()
            .buildBarrierRequest()
            .setXid(xid)
            .build();
    write(br, null);
}
项目:spring-open    文件:OFSwitchImplSpringOpenTTP.java   
private void sendHandshakeBarrier() throws IOException {
    long xid = getNextTransactionId();
    barrierXidToWaitFor = xid;
    OFBarrierRequest br = getFactory()
            .buildBarrierRequest()
            .setXid(xid)
            .build();
    write(br, null);
}
项目:spring-open    文件:FlowPusher.java   
@Override
public OFMessageFuture<OFBarrierReply> barrierAsync(Dpid dpid) {
    // TODO creation of message and future should be moved to OFSwitchImpl
    IOFSwitch sw = floodlightProvider.getMasterSwitch(dpid.value());
    if (sw == null) {
        return null;
    }

    OFBarrierRequest msg = createBarrierRequest(sw);
    OFBarrierReplyFuture future = new OFBarrierReplyFuture(threadPool, sw,
            (int) msg.getXid());
    barrierFutures.put(BarrierInfo.create(dpid.value(), msg), future);
    addMessageImpl(dpid, msg, MsgPriority.NORMAL);
    return future;
}
项目:spring-open    文件:FlowPusher.java   
protected OFBarrierRequest createBarrierRequest(IOFSwitch sw) {
    OFFactory factory = sw.getFactory();
    if (factory == null) {
        log.error("No OF Message Factory for switch {} with OFVersion {}", sw,
                sw.getOFVersion());
        return null;
    }
    return factory.buildBarrierRequest()
            .setXid(sw.getNextTransactionId())
            .build();
}