Example #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
   // FIXME:LOJI: Haven't negotiated version yet, assume 1.3
   OFHello.Builder builder = factory.buildHello().setXid(handshakeTransactionIds--);
   // FIXME: Need to add code here to set the version bitmap hello element
   OFHello m = builder.build();
   channel.write(Collections.singletonList(m));
   log.debug("Send hello: {}", m);
 }
  /**
   * 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);
  }