@Override void processOFError(OFChannelHandler h, OFErrorMsg m) throws IOException, SwitchStateException { // if we get here, then the error message is for something else if (m.getErrType() == OFErrorType.BAD_REQUEST && ((OFBadRequestErrorMsg) m).getCode() == OFBadRequestCode.EPERM) { // We are the master controller and the switch returned // a permission error. This is a likely indicator that // the switch thinks we are slave. Reassert our // role // FIXME: this could be really bad during role transitions // if two controllers are master (even if its only for // a brief period). We might need to see if these errors // persist before we reassert h.sw.reassertRole(); } else if (m.getErrType() == OFErrorType.FLOW_MOD_FAILED && ((OFFlowModFailedErrorMsg) m).getCode() == OFFlowModFailedCode.ALL_TABLES_FULL) { h.sw.setTableFull(true); } else { logError(h, m); } h.dispatchMessage(m); }
public static OFFlowModFailedCode ofWireValue(short val) { switch(val) { case UNKNOWN_VAL: return OFFlowModFailedCode.UNKNOWN; case TABLE_FULL_VAL: return OFFlowModFailedCode.TABLE_FULL; case BAD_TABLE_ID_VAL: return OFFlowModFailedCode.BAD_TABLE_ID; case OVERLAP_VAL: return OFFlowModFailedCode.OVERLAP; case EPERM_VAL: return OFFlowModFailedCode.EPERM; case BAD_TIMEOUT_VAL: return OFFlowModFailedCode.BAD_TIMEOUT; case BAD_COMMAND_VAL: return OFFlowModFailedCode.BAD_COMMAND; case BAD_FLAGS_VAL: return OFFlowModFailedCode.BAD_FLAGS; default: throw new IllegalArgumentException("Illegal wire value for type OFFlowModFailedCode in version 1.2: " + val); } }
public static short toWireValue(OFFlowModFailedCode e) { switch(e) { case UNKNOWN: return UNKNOWN_VAL; case TABLE_FULL: return TABLE_FULL_VAL; case BAD_TABLE_ID: return BAD_TABLE_ID_VAL; case OVERLAP: return OVERLAP_VAL; case EPERM: return EPERM_VAL; case BAD_TIMEOUT: return BAD_TIMEOUT_VAL; case BAD_COMMAND: return BAD_COMMAND_VAL; case BAD_FLAGS: return BAD_FLAGS_VAL; default: throw new IllegalArgumentException("Illegal enum value for type OFFlowModFailedCode in version 1.2: " + e); } }
public static OFFlowModFailedCode ofWireValue(short val) { switch(val) { case UNKNOWN_VAL: return OFFlowModFailedCode.UNKNOWN; case TABLE_FULL_VAL: return OFFlowModFailedCode.TABLE_FULL; case BAD_TABLE_ID_VAL: return OFFlowModFailedCode.BAD_TABLE_ID; case OVERLAP_VAL: return OFFlowModFailedCode.OVERLAP; case EPERM_VAL: return OFFlowModFailedCode.EPERM; case BAD_TIMEOUT_VAL: return OFFlowModFailedCode.BAD_TIMEOUT; case BAD_COMMAND_VAL: return OFFlowModFailedCode.BAD_COMMAND; case BAD_FLAGS_VAL: return OFFlowModFailedCode.BAD_FLAGS; default: throw new IllegalArgumentException("Illegal wire value for type OFFlowModFailedCode in version 1.3: " + val); } }
public static short toWireValue(OFFlowModFailedCode e) { switch(e) { case UNKNOWN: return UNKNOWN_VAL; case TABLE_FULL: return TABLE_FULL_VAL; case BAD_TABLE_ID: return BAD_TABLE_ID_VAL; case OVERLAP: return OVERLAP_VAL; case EPERM: return EPERM_VAL; case BAD_TIMEOUT: return BAD_TIMEOUT_VAL; case BAD_COMMAND: return BAD_COMMAND_VAL; case BAD_FLAGS: return BAD_FLAGS_VAL; default: throw new IllegalArgumentException("Illegal enum value for type OFFlowModFailedCode in version 1.3: " + e); } }
public static OFFlowModFailedCode ofWireValue(short val) { switch(val) { case ALL_TABLES_FULL_VAL: return OFFlowModFailedCode.ALL_TABLES_FULL; case OVERLAP_VAL: return OFFlowModFailedCode.OVERLAP; case EPERM_VAL: return OFFlowModFailedCode.EPERM; case BAD_EMERG_TIMEOUT_VAL: return OFFlowModFailedCode.BAD_EMERG_TIMEOUT; case BAD_COMMAND_VAL: return OFFlowModFailedCode.BAD_COMMAND; case UNSUPPORTED_VAL: return OFFlowModFailedCode.UNSUPPORTED; default: throw new IllegalArgumentException("Illegal wire value for type OFFlowModFailedCode in version 1.0: " + val); } }
public static short toWireValue(OFFlowModFailedCode e) { switch(e) { case ALL_TABLES_FULL: return ALL_TABLES_FULL_VAL; case OVERLAP: return OVERLAP_VAL; case EPERM: return EPERM_VAL; case BAD_EMERG_TIMEOUT: return BAD_EMERG_TIMEOUT_VAL; case BAD_COMMAND: return BAD_COMMAND_VAL; case UNSUPPORTED: return UNSUPPORTED_VAL; default: throw new IllegalArgumentException("Illegal enum value for type OFFlowModFailedCode in version 1.0: " + e); } }
public static OFFlowModFailedCode ofWireValue(short val) { switch(val) { case UNKNOWN_VAL: return OFFlowModFailedCode.UNKNOWN; case TABLE_FULL_VAL: return OFFlowModFailedCode.TABLE_FULL; case BAD_TABLE_ID_VAL: return OFFlowModFailedCode.BAD_TABLE_ID; case OVERLAP_VAL: return OFFlowModFailedCode.OVERLAP; case EPERM_VAL: return OFFlowModFailedCode.EPERM; case BAD_TIMEOUT_VAL: return OFFlowModFailedCode.BAD_TIMEOUT; case BAD_COMMAND_VAL: return OFFlowModFailedCode.BAD_COMMAND; default: throw new IllegalArgumentException("Illegal wire value for type OFFlowModFailedCode in version 1.1: " + val); } }
public static short toWireValue(OFFlowModFailedCode e) { switch(e) { case UNKNOWN: return UNKNOWN_VAL; case TABLE_FULL: return TABLE_FULL_VAL; case BAD_TABLE_ID: return BAD_TABLE_ID_VAL; case OVERLAP: return OVERLAP_VAL; case EPERM: return EPERM_VAL; case BAD_TIMEOUT: return BAD_TIMEOUT_VAL; case BAD_COMMAND: return BAD_COMMAND_VAL; default: throw new IllegalArgumentException("Illegal enum value for type OFFlowModFailedCode in version 1.1: " + e); } }
public static OFFlowModFailedCode ofWireValue(short val) { switch(val) { case UNKNOWN_VAL: return OFFlowModFailedCode.UNKNOWN; case TABLE_FULL_VAL: return OFFlowModFailedCode.TABLE_FULL; case BAD_TABLE_ID_VAL: return OFFlowModFailedCode.BAD_TABLE_ID; case OVERLAP_VAL: return OFFlowModFailedCode.OVERLAP; case EPERM_VAL: return OFFlowModFailedCode.EPERM; case BAD_TIMEOUT_VAL: return OFFlowModFailedCode.BAD_TIMEOUT; case BAD_COMMAND_VAL: return OFFlowModFailedCode.BAD_COMMAND; case BAD_FLAGS_VAL: return OFFlowModFailedCode.BAD_FLAGS; case CANT_SYNC_VAL: return OFFlowModFailedCode.CANT_SYNC; case BAD_PRIORITY_VAL: return OFFlowModFailedCode.BAD_PRIORITY; default: throw new IllegalArgumentException("Illegal wire value for type OFFlowModFailedCode in version 1.4: " + val); } }
public static short toWireValue(OFFlowModFailedCode e) { switch(e) { case UNKNOWN: return UNKNOWN_VAL; case TABLE_FULL: return TABLE_FULL_VAL; case BAD_TABLE_ID: return BAD_TABLE_ID_VAL; case OVERLAP: return OVERLAP_VAL; case EPERM: return EPERM_VAL; case BAD_TIMEOUT: return BAD_TIMEOUT_VAL; case BAD_COMMAND: return BAD_COMMAND_VAL; case BAD_FLAGS: return BAD_FLAGS_VAL; case CANT_SYNC: return CANT_SYNC_VAL; case BAD_PRIORITY: return BAD_PRIORITY_VAL; default: throw new IllegalArgumentException("Illegal enum value for type OFFlowModFailedCode in version 1.4: " + e); } }
@Override void processOFError(OFErrorMsg m) { // role changer will ignore the error if it isn't for it boolean didHandle = roleChanger.deliverError(m); if (didHandle) return; if ((m.getErrType() == OFErrorType.BAD_REQUEST) && (((OFBadRequestErrorMsg)m).getCode() == OFBadRequestCode.EPERM)) { // We are the master controller and the switch returned // a permission error. This is a likely indicator that // the switch thinks we are slave. Reassert our // role // FIXME: this could be really bad during role transitions // if two controllers are master (even if its only for // a brief period). We might need to see if these errors // persist before we reassert switchManagerCounters.epermErrorWhileSwitchIsMaster.increment(); log.warn("Received permission error from switch {} while" + "being master. Reasserting master role.", getSwitchInfoString()); reassertRole(OFControllerRole.ROLE_MASTER); } else if ((m.getErrType() == OFErrorType.FLOW_MOD_FAILED) && (((OFFlowModFailedErrorMsg)m).getCode() == OFFlowModFailedCode.ALL_TABLES_FULL)) { sw.setTableFull(true); } else { logError(m); } dispatchMessage(m); }
@LogMessageDoc(level="WARN", message="Received permission error from switch {} while" + "being master. Reasserting master role.", explanation="The switch has denied an operation likely " + "indicating inconsistent controller roles", recommendation="This situation can occurs transiently during role" + " changes. If, however, the condition persists or happens" + " frequently this indicates a role inconsistency. " + LogMessageDoc.CHECK_CONTROLLER ) @Override void processOFError(OFErrorMsg m) { // role changer will ignore the error if it isn't for it boolean didHandle = roleChanger.deliverError(m); if (didHandle) return; if ((m.getErrType() == OFErrorType.BAD_REQUEST) && (((OFBadRequestErrorMsg)m).getCode() == OFBadRequestCode.EPERM)) { // We are the master controller and the switch returned // a permission error. This is a likely indicator that // the switch thinks we are slave. Reassert our // role // FIXME: this could be really bad during role transitions // if two controllers are master (even if its only for // a brief period). We might need to see if these errors // persist before we reassert switchManagerCounters.epermErrorWhileSwitchIsMaster.increment(); log.warn("Received permission error from switch {} while" + "being master. Reasserting master role.", getSwitchInfoString()); reassertRole(OFControllerRole.ROLE_MASTER); } else if ((m.getErrType() == OFErrorType.FLOW_MOD_FAILED) && (((OFFlowModFailedErrorMsg)m).getCode() == OFFlowModFailedCode.ALL_TABLES_FULL)) { sw.setTableFull(true); } else { logError(m); } dispatchMessage(m); }
@Override void processOFError(OFErrorMsg m) { // role changer will ignore the error if it isn't for it boolean didHandle = roleChanger.deliverError(m); if (didHandle) return; if ((m.getErrType() == OFErrorType.BAD_REQUEST) && (((OFBadRequestErrorMsg)m).getCode() == OFBadRequestCode.EPERM)) { // We are the EQUAL controller and the switch returned // a permission error. This is a likely indicator that // the switch thinks we are slave. Reassert our // role // FIXME: this could be really bad during role transitions // if two controllers are master (even if its only for // a brief period). We might need to see if these errors // persist before we reassert switchManagerCounters.epermErrorWhileSwitchIsMaster.increment(); log.warn("Received permission error from switch {} while" + "being master. Reasserting master role.", getSwitchInfoString()); reassertRole(OFControllerRole.ROLE_EQUAL); } else if ((m.getErrType() == OFErrorType.FLOW_MOD_FAILED) && (((OFFlowModFailedErrorMsg)m).getCode() == OFFlowModFailedCode.ALL_TABLES_FULL)) { sw.setTableFull(true); } else { logError(m); } dispatchMessage(m); }
public static OFFlowModFailedCode readFrom(ChannelBuffer bb) throws OFParseError { try { return ofWireValue(bb.readShort()); } catch (IllegalArgumentException e) { throw new OFParseError(e); } }
@Override void processOFError(OFChannelHandler h, OFErrorMsg m) throws IOException, SwitchStateException { // if we get here, then the error message is for something else if (m.getErrType() == OFErrorType.BAD_REQUEST && (((OFBadRequestErrorMsg) m).getCode() == OFBadRequestCode.EPERM || ((OFBadRequestErrorMsg) m).getCode() == OFBadRequestCode.IS_SLAVE)) { // We are the master controller and the switch returned // a permission error. This is a likely indicator that // the switch thinks we are slave. Reassert our // role // FIXME: this could be really bad during role transitions // if two controllers are master (even if its only for // a brief period). We might need to see if these errors // persist before we reassert h.sw.reassertRole(); } else if (m.getErrType() == OFErrorType.FLOW_MOD_FAILED && ((OFFlowModFailedErrorMsg) m).getCode() == OFFlowModFailedCode.ALL_TABLES_FULL) { h.sw.setTableFull(true); } else { logError(h, m); } h.dispatchMessage(m); }