本文整理汇总了Java中org.openflow.protocol.action.OFActionNetworkTypeOfService.setNetworkTypeOfService方法的典型用法代码示例。如果您正苦于以下问题:Java OFActionNetworkTypeOfService.setNetworkTypeOfService方法的具体用法?Java OFActionNetworkTypeOfService.setNetworkTypeOfService怎么用?Java OFActionNetworkTypeOfService.setNetworkTypeOfService使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openflow.protocol.action.OFActionNetworkTypeOfService
的用法示例。
在下文中一共展示了OFActionNetworkTypeOfService.setNetworkTypeOfService方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decode_set_tos_bits
import org.openflow.protocol.action.OFActionNetworkTypeOfService; //导入方法依赖的package包/类
private static SubActionStruct decode_set_tos_bits(String subaction, Logger log) {
SubActionStruct sa = null;
Matcher n = Pattern.compile("set-tos-bits=((?:0x)?\\d+)").matcher(subaction);
if (n.matches()) {
if (n.group(1) != null) {
try {
byte tosbits = get_byte(n.group(1));
OFActionNetworkTypeOfService action = new OFActionNetworkTypeOfService();
action.setNetworkTypeOfService(tosbits);
log.debug(" action {}", action);
sa = new SubActionStruct();
sa.action = action;
sa.len = OFActionNetworkTypeOfService.MINIMUM_LENGTH;
}
catch (NumberFormatException e) {
log.debug("Invalid dst-port in: {} (error ignored)", subaction);
return null;
}
}
}
else {
log.debug("Invalid action: '{}'", subaction);
return null;
}
return sa;
}
示例2: decode_set_tos_bits
import org.openflow.protocol.action.OFActionNetworkTypeOfService; //导入方法依赖的package包/类
private static SubActionStruct decode_set_tos_bits(String subaction, Logger log) {
SubActionStruct sa = null;
Matcher n = Pattern.compile("set-tos-bits=((?:0x)?\\d+)").matcher(subaction);
if (n.matches()) {
if (n.group(1) != null) {
try {
byte tosbits = get_byte(n.group(1));
OFActionNetworkTypeOfService action = new OFActionNetworkTypeOfService();
action.setNetworkTypeOfService(tosbits);
log.debug(" action {}", action);
sa = new SubActionStruct();
sa.action = action;
sa.len = OFActionNetworkTypeOfService.MINIMUM_LENGTH;
}
catch (NumberFormatException e) {
log.debug("Invalid dst-port in: {} (error ignored)", subaction);
return null;
}
}
}
else {
log.debug("Invalid action: '{}'", subaction);
return null;
}
return sa;
}