本文整理汇总了Java中org.projectfloodlight.openflow.protocol.OFFlowModFailedCode类的典型用法代码示例。如果您正苦于以下问题:Java OFFlowModFailedCode类的具体用法?Java OFFlowModFailedCode怎么用?Java OFFlowModFailedCode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OFFlowModFailedCode类属于org.projectfloodlight.openflow.protocol包,在下文中一共展示了OFFlowModFailedCode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processOFError
import org.projectfloodlight.openflow.protocol.OFFlowModFailedCode; //导入依赖的package包/类
@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);
}
示例2: ofWireValue
import org.projectfloodlight.openflow.protocol.OFFlowModFailedCode; //导入依赖的package包/类
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);
}
}
示例3: toWireValue
import org.projectfloodlight.openflow.protocol.OFFlowModFailedCode; //导入依赖的package包/类
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);
}
}
示例4: ofWireValue
import org.projectfloodlight.openflow.protocol.OFFlowModFailedCode; //导入依赖的package包/类
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);
}
}
示例5: toWireValue
import org.projectfloodlight.openflow.protocol.OFFlowModFailedCode; //导入依赖的package包/类
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);
}
}
示例6: ofWireValue
import org.projectfloodlight.openflow.protocol.OFFlowModFailedCode; //导入依赖的package包/类
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);
}
}
示例7: toWireValue
import org.projectfloodlight.openflow.protocol.OFFlowModFailedCode; //导入依赖的package包/类
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);
}
}
示例8: ofWireValue
import org.projectfloodlight.openflow.protocol.OFFlowModFailedCode; //导入依赖的package包/类
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);
}
}
示例9: toWireValue
import org.projectfloodlight.openflow.protocol.OFFlowModFailedCode; //导入依赖的package包/类
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);
}
}
示例10: ofWireValue
import org.projectfloodlight.openflow.protocol.OFFlowModFailedCode; //导入依赖的package包/类
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);
}
}
示例11: toWireValue
import org.projectfloodlight.openflow.protocol.OFFlowModFailedCode; //导入依赖的package包/类
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);
}
}
示例12: processOFError
import org.projectfloodlight.openflow.protocol.OFFlowModFailedCode; //导入依赖的package包/类
@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);
}
示例13: processOFError
import org.projectfloodlight.openflow.protocol.OFFlowModFailedCode; //导入依赖的package包/类
@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);
}
示例14: readFrom
import org.projectfloodlight.openflow.protocol.OFFlowModFailedCode; //导入依赖的package包/类
public static OFFlowModFailedCode readFrom(ChannelBuffer bb) throws OFParseError {
try {
return ofWireValue(bb.readShort());
} catch (IllegalArgumentException e) {
throw new OFParseError(e);
}
}
示例15: processOFError
import org.projectfloodlight.openflow.protocol.OFFlowModFailedCode; //导入依赖的package包/类
@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);
}