예제 #1
0
  /**
   * Send a hello message to the switch using the handshake transactions ids.
   *
   * @throws IOException
   */
  private void sendHelloMessage() throws IOException {
    // Send initial hello message

    OFHello.Builder builder = factory.buildHello();

    /* Our highest-configured OFVersion does support version bitmaps, so include it */
    if (factory.getVersion().compareTo(OFVersion.OF_13) >= 0) {
      List<OFHelloElem> he = new ArrayList<OFHelloElem>();
      he.add(factory.buildHelloElemVersionbitmap().setBitmaps(ofBitmaps).build());
      builder.setElements(he);
    }

    OFHello m = builder.setXid(handshakeTransactionIds--).build();

    write(m);
    log.debug("Send hello: {}", m);
  }
예제 #2
0
 private void sendEchoReply(OFEchoRequest request) {
   OFEchoReply reply =
       factory.buildEchoReply().setXid(request.getXid()).setData(request.getData()).build();
   write(reply);
 }
예제 #3
0
 private void sendEchoRequest() {
   OFEchoRequest request = factory.buildEchoRequest().setXid(handshakeTransactionIds--).build();
   /* Record for latency calculation */
   echoSendTime = System.currentTimeMillis();
   write(request);
 }
예제 #4
0
 /**
  * Send a features request message to the switch using the handshake transactions ids.
  *
  * @throws IOException
  */
 private void sendFeaturesRequest() throws IOException {
   // Send initial Features Request
   OFFeaturesRequest m = factory.buildFeaturesRequest().setXid(handshakeTransactionIds--).build();
   write(m);
 }