本文整理汇总了Java中org.projectfloodlight.openflow.types.IPv6FlowLabel类的典型用法代码示例。如果您正苦于以下问题:Java IPv6FlowLabel类的具体用法?Java IPv6FlowLabel怎么用?Java IPv6FlowLabel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IPv6FlowLabel类属于org.projectfloodlight.openflow.types包,在下文中一共展示了IPv6FlowLabel类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildL3Modification
import org.projectfloodlight.openflow.types.IPv6FlowLabel; //导入依赖的package包/类
private OFAction buildL3Modification(Instruction i) {
L3ModificationInstruction l3m = (L3ModificationInstruction) i;
L3ModificationInstruction.ModIPInstruction ip;
Ip4Address ip4;
Ip6Address ip6;
OFOxm<?> oxm = null;
switch (l3m.subtype()) {
case IPV4_SRC:
ip = (L3ModificationInstruction.ModIPInstruction) i;
ip4 = ip.ip().getIp4Address();
oxm = factory.oxms().ipv4Src(IPv4Address.of(ip4.toInt()));
break;
case IPV4_DST:
ip = (L3ModificationInstruction.ModIPInstruction) i;
ip4 = ip.ip().getIp4Address();
oxm = factory.oxms().ipv4Dst(IPv4Address.of(ip4.toInt()));
break;
case IPV6_SRC:
ip = (L3ModificationInstruction.ModIPInstruction) i;
ip6 = ip.ip().getIp6Address();
oxm = factory.oxms().ipv6Src(IPv6Address.of(ip6.toOctets()));
break;
case IPV6_DST:
ip = (L3ModificationInstruction.ModIPInstruction) i;
ip6 = ip.ip().getIp6Address();
oxm = factory.oxms().ipv6Dst(IPv6Address.of(ip6.toOctets()));
break;
case IPV6_FLABEL:
L3ModificationInstruction.ModIPv6FlowLabelInstruction flowLabelInstruction =
(L3ModificationInstruction.ModIPv6FlowLabelInstruction) i;
int flowLabel = flowLabelInstruction.flowLabel();
oxm = factory.oxms().ipv6Flabel(IPv6FlowLabel.of(flowLabel));
break;
case DEC_TTL:
return factory.actions().decNwTtl();
case TTL_IN:
return factory.actions().copyTtlIn();
case TTL_OUT:
return factory.actions().copyTtlOut();
default:
log.warn("Unimplemented action type {}.", l3m.subtype());
break;
}
if (oxm != null) {
return factory.actions().buildSetField().setField(oxm).build();
}
return null;
}