本文整理汇总了Java中org.openflow.protocol.action.OFActionVirtualLanPriorityCodePoint类的典型用法代码示例。如果您正苦于以下问题:Java OFActionVirtualLanPriorityCodePoint类的具体用法?Java OFActionVirtualLanPriorityCodePoint怎么用?Java OFActionVirtualLanPriorityCodePoint使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OFActionVirtualLanPriorityCodePoint类属于org.openflow.protocol.action包,在下文中一共展示了OFActionVirtualLanPriorityCodePoint类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decode_set_vlan_priority
import org.openflow.protocol.action.OFActionVirtualLanPriorityCodePoint; //导入依赖的package包/类
private static SubActionStruct decode_set_vlan_priority(String subaction, Logger log) {
SubActionStruct sa = null;
Matcher n = Pattern.compile("set-vlan-priority=((?:0x)?\\d+)").matcher(subaction);
if (n.matches()) {
if (n.group(1) != null) {
try {
byte prior = get_byte(n.group(1));
OFActionVirtualLanPriorityCodePoint action = new OFActionVirtualLanPriorityCodePoint();
action.setVirtualLanPriorityCodePoint(prior);
log.debug(" action {}", action);
sa = new SubActionStruct();
sa.action = action;
sa.len = OFActionVirtualLanPriorityCodePoint.MINIMUM_LENGTH;
}
catch (NumberFormatException e) {
log.debug("Invalid VLAN priority in: {} (error ignored)", subaction);
return null;
}
}
}
else {
log.debug("Invalid action: '{}'", subaction);
return null;
}
return sa;
}
示例2: decode_set_vlan_priority
import org.openflow.protocol.action.OFActionVirtualLanPriorityCodePoint; //导入依赖的package包/类
private static SubActionStruct decode_set_vlan_priority(String subaction, Logger log) {
SubActionStruct sa = null;
Matcher n = Pattern.compile("set-vlan-priority=((?:0x)?\\d+)").matcher(subaction);
if (n.matches()) {
if (n.group(1) != null) {
try {
byte prior = get_byte(n.group(1));
OFActionVirtualLanPriorityCodePoint action = new OFActionVirtualLanPriorityCodePoint();
action.setVirtualLanPriorityCodePoint(prior);
log.debug(" action {}", action);
sa = new SubActionStruct();
sa.action = action;
sa.len = OFActionVirtualLanPriorityCodePoint.MINIMUM_LENGTH;
}
catch (NumberFormatException e) {
log.debug("Invalid VLAN priority in: {} (error ignored)", subaction);
return null;
}
}
}
else {
log.debug("Invalid action: '{}'", subaction);
return null;
}
return sa;
}
示例3: decode_set_vlan_priority
import org.openflow.protocol.action.OFActionVirtualLanPriorityCodePoint; //导入依赖的package包/类
private static SubActionStruct decode_set_vlan_priority(String subaction, Logger log) {
SubActionStruct sa = null;
Matcher n = Pattern.compile("set-vlan-priority=((?:0x)?\\d+)").matcher(subaction);
if (n.matches()) {
if (n.group(1) != null) {
try {
byte prior = get_byte(n.group(1));
OFActionVirtualLanPriorityCodePoint action = new OFActionVirtualLanPriorityCodePoint();
action.setVirtualLanPriorityCodePoint(prior);
log.debug(" action {}", action);
sa = new SubActionStruct();
sa.action = action;
sa.len = OFActionVirtualLanPriorityCodePoint.MINIMUM_LENGTH;
}
catch (NumberFormatException e) {
log.debug("Invalid VLAN priority in: {} (error ignored)", subaction);
return null;
}
}
}
else {
log.debug("Invalid action: '{}'", subaction);
return null;
}
return sa;
}
示例4: flowModActionsToString
import org.openflow.protocol.action.OFActionVirtualLanPriorityCodePoint; //导入依赖的package包/类
/**
* Returns a String representation of all the openflow actions.
* @param fmActions A list of OFActions to encode into one string
* @return A string of the actions encoded for our database
*/
@LogMessageDoc(level="ERROR",
message="Could not decode action {action}",
explanation="A static flow entry contained an invalid action",
recommendation=LogMessageDoc.REPORT_CONTROLLER_BUG)
private static String flowModActionsToString(List<OFAction> fmActions) {
StringBuilder sb = new StringBuilder();
for (OFAction a : fmActions) {
if (sb.length() > 0) {
sb.append(',');
}
switch(a.getType()) {
case OUTPUT:
sb.append("output=" + Short.toString(((OFActionOutput)a).getPort()));
break;
case OPAQUE_ENQUEUE:
int queue = ((OFActionEnqueue)a).getQueueId();
short port = ((OFActionEnqueue)a).getPort();
sb.append("enqueue=" + Short.toString(port) + ":0x" + String.format("%02x", queue));
break;
case STRIP_VLAN:
sb.append("strip-vlan");
break;
case SET_VLAN_ID:
sb.append("set-vlan-id=" +
Short.toString(((OFActionVirtualLanIdentifier)a).getVirtualLanIdentifier()));
break;
case SET_VLAN_PCP:
sb.append("set-vlan-priority=" +
Byte.toString(((OFActionVirtualLanPriorityCodePoint)a).getVirtualLanPriorityCodePoint()));
break;
case SET_DL_SRC:
sb.append("set-src-mac=" +
HexString.toHexString(((OFActionDataLayerSource)a).getDataLayerAddress()));
break;
case SET_DL_DST:
sb.append("set-dst-mac=" +
HexString.toHexString(((OFActionDataLayerDestination)a).getDataLayerAddress()));
break;
case SET_NW_TOS:
sb.append("set-tos-bits=" +
Byte.toString(((OFActionNetworkTypeOfService)a).getNetworkTypeOfService()));
break;
case SET_NW_SRC:
sb.append("set-src-ip=" +
IPv4.fromIPv4Address(((OFActionNetworkLayerSource)a).getNetworkAddress()));
break;
case SET_NW_DST:
sb.append("set-dst-ip=" +
IPv4.fromIPv4Address(((OFActionNetworkLayerDestination)a).getNetworkAddress()));
break;
case SET_TP_SRC:
sb.append("set-src-port=" +
Short.toString(((OFActionTransportLayerSource)a).getTransportPort()));
break;
case SET_TP_DST:
sb.append("set-dst-port=" +
Short.toString(((OFActionTransportLayerDestination)a).getTransportPort()));
break;
default:
log.error("Could not decode action: {}", a);
break;
}
}
return sb.toString();
}
示例5: flowModActionsToString
import org.openflow.protocol.action.OFActionVirtualLanPriorityCodePoint; //导入依赖的package包/类
/**
* Returns a String representation of all the openflow actions.
* @param fmActions A list of OFActions to encode into one string
* @return A string of the actions encoded for our database
*/
@LogMessageDoc(level="ERROR",
message="Could not decode action {action}",
explanation="A static flow entry contained an invalid action",
recommendation=LogMessageDoc.REPORT_CONTROLLER_BUG)
private static String flowModActionsToString(List<OFAction> fmActions) {
StringBuilder sb = new StringBuilder();
for (OFAction a : fmActions) {
if (sb.length() > 0) {
sb.append(',');
}
switch(a.getType()) {
case OUTPUT:
sb.append("output=" + Short.toString(((OFActionOutput)a).getPort()));
break;
case OPAQUE_ENQUEUE:
int queue = ((OFActionEnqueue)a).getQueueId();
short port = ((OFActionEnqueue)a).getPort();
sb.append("enqueue=" + Short.toString(port) + ":0x" + String.format("%02x", queue));
break;
case STRIP_VLAN:
sb.append("strip-vlan");
break;
case SET_VLAN_ID:
sb.append("set-vlan-id=" +
Short.toString(((OFActionVirtualLanIdentifier)a).getVirtualLanIdentifier()));
break;
case SET_VLAN_PCP:
sb.append("set-vlan-priority=" +
Byte.toString(((OFActionVirtualLanPriorityCodePoint)a).getVirtualLanPriorityCodePoint()));
break;
case SET_DL_SRC:
sb.append("set-src-mac=" +
HexString.toHexString(((OFActionDataLayerSource)a).getDataLayerAddress()));
break;
case SET_DL_DST:
sb.append("set-dst-mac=" +
HexString.toHexString(((OFActionDataLayerDestination)a).getDataLayerAddress()));
break;
case SET_NW_TOS:
sb.append("set-tos-bits=" +
Byte.toString(((OFActionNetworkTypeOfService)a).getNetworkTypeOfService()));
break;
case SET_NW_SRC:
sb.append("set-src-ip=" +
IPv4.fromIPv4Address(((OFActionNetworkLayerSource)a).getNetworkAddress()));
break;
case SET_NW_DST:
sb.append("set-dst-ip=" +
IPv4.fromIPv4Address(((OFActionNetworkLayerDestination)a).getNetworkAddress()));
break;
case SET_TP_SRC:
sb.append("set-src-port=" +
Short.toString(((OFActionTransportLayerSource)a).getTransportPort()));
break;
case SET_TP_DST:
sb.append("set-dst-port=" +
Short.toString(((OFActionTransportLayerDestination)a).getTransportPort()));
break;
default:
log.error("Could not decode action: {}", a);
break;
}
}
return sb.toString();
}