Esempio n. 1
0
 public IOFConnection getConnection(LogicalOFMessageCategory category) {
   if (switchManager.isCategoryRegistered(category)) {
     return getConnection(category.getAuxId());
   } else {
     throw new IllegalArgumentException(
         category + " is not registered with the floodlight provider service.");
   }
 }
Esempio n. 2
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. 3
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. 4
0
 @Override
 @LogMessageDoc(
     level = "WARN",
     message = "Switch {switch} flow table is full",
     explanation =
         "The controller received flow table full "
             + "message from the switch, could be caused by increased "
             + "traffic pattern",
     recommendation = LogMessageDoc.REPORT_CONTROLLER_BUG)
 public void setTableFull(boolean isFull) {
   if (isFull && !flowTableFull) {
     switchManager.addSwitchEvent(
         this.datapathId, "SWITCH_FLOW_TABLE_FULL " + "Table full error from switch", false);
     log.warn("Switch {} flow table is full", datapathId.toString());
   }
   flowTableFull = isFull;
 }
Esempio n. 5
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());
    }
  }