Esempio n. 1
0
 @Override
 public void write(OFMessage m, LogicalOFMessageCategory category) {
   if (isActive()) {
     this.getConnection(category).write(m);
     switchManager.handleOutgoingMessage(this, m);
   } else {
     log.warn("Attempted to write to switch {} that is SLAVE.", this.getId().toString());
   }
 }
Esempio n. 2
0
 @Override
 public void write(OFMessage m) {
   log.trace(
       "Channel: {}, Connected: {}",
       connections.get(OFAuxId.MAIN).getRemoteInetAddress(),
       connections.get(OFAuxId.MAIN).isConnected());
   if (isActive()) {
     connections.get(OFAuxId.MAIN).write(m);
     switchManager.handleOutgoingMessage(this, m);
   } else {
     log.warn("Attempted to write to switch {} that is SLAVE.", this.getId().toString());
   }
 }
Esempio n. 3
0
  @Override
  @LogMessageDoc(
      level = "WARN",
      message =
          "Sending OF message that modifies switch " + "state while in the slave role: {switch}",
      explanation =
          "An application has sent a message to a switch "
              + "that is not valid when the switch is in a slave role",
      recommendation = LogMessageDoc.REPORT_CONTROLLER_BUG)
  public void write(Iterable<OFMessage> msglist) {
    if (isActive()) {
      connections.get(OFAuxId.MAIN).write(msglist);

      for (OFMessage m : msglist) {
        switchManager.handleOutgoingMessage(this, m);
      }
    } else {
      log.warn("Attempted to write to switch {} that is SLAVE.", this.getId().toString());
    }
  }