本文整理汇总了Java中org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java Ipv4Prefix.getValue方法的具体用法?Java Ipv4Prefix.getValue怎么用?Java Ipv4Prefix.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix
的用法示例。
在下文中一共展示了Ipv4Prefix.getValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getIpPrefixStr
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix; //导入方法依赖的package包/类
private String getIpPrefixStr(final IpPrefix ipPrefix) {
final Ipv4Prefix ipv4 = ipPrefix.getIpv4Prefix();
if (ipv4 != null) {
return ipv4.getValue();
} else {
return ipPrefix.getIpv6Prefix().getValue();
}
}
示例2: programStaticRoutingInLocalDevice
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix; //导入方法依赖的package包/类
public void programStaticRoutingInLocalDevice(Long dpid, String gwMacAddress, Ipv4Prefix destIpv4Prefix,
Long nexthopSegId, boolean isWriteFlow) {
String nodeName = Constants.OPENFLOW_NODE_PREFIX + dpid;
MatchBuilder matchBuilder = new MatchBuilder();
NodeBuilder nodeBuilder = Openflow13Provider.createNodeBuilder(nodeName);
FlowBuilder flowBuilder = new FlowBuilder();
// Instructions List Stores Individual Instructions
InstructionsBuilder isb = new InstructionsBuilder();
List<Instruction> instructions = Lists.newArrayList();
InstructionBuilder ib = new InstructionBuilder();
ApplyActionsBuilder aab = new ApplyActionsBuilder();
ActionBuilder ab = new ActionBuilder();
List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> actionList = Lists
.newArrayList();
final String prefixString = destIpv4Prefix.getValue();
OfMatchUtils.createDmacDestIpMatch(matchBuilder, gwMacAddress, destIpv4Prefix);
String flowId = "StaticRoutingInLocalDevice_" + nexthopSegId + "_" + prefixString;
flowBuilder.setId(new FlowId(flowId));
FlowKey key = new FlowKey(new FlowId(flowId));
flowBuilder.setBarrier(true);
flowBuilder.setTableId(this.getTable());
flowBuilder.setKey(key);
int mask = IpAddressUtils.getMask(destIpv4Prefix);
flowBuilder.setPriority(BASE_ROUTING_PRIORITY+mask);
flowBuilder.setFlowName(flowId);
flowBuilder.setHardTimeout(0);
flowBuilder.setIdleTimeout(0);
flowBuilder.setMatch(matchBuilder.build());
if (isWriteFlow) {
// Set source Mac address
ab.setAction(OfActionUtils.setDlSrcAction(gwMacAddress));
ab.setOrder(actionList.size());
ab.setKey(new ActionKey(actionList.size()));
actionList.add(ab.build());
// DecTTL
ab.setAction(OfActionUtils.decNwTtlAction());
ab.setOrder(actionList.size());
ab.setKey(new ActionKey(actionList.size()));
actionList.add(ab.build());
// Set Destination Tunnel ID
ab.setAction(OfActionUtils.setTunnelIdAction(BigInteger.valueOf(nexthopSegId.longValue())));
ab.setOrder(actionList.size());
ab.setKey(new ActionKey(actionList.size()));
actionList.add(ab.build());
// Create Apply Actions Instruction
aab.setAction(actionList);
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
ib.setOrder(instructions.size());
ib.setKey(new InstructionKey(instructions.size()));
instructions.add(ib.build());
// Goto Next Table
ib = getMutablePipelineInstructionBuilder();
ib.setOrder(instructions.size());
ib.setKey(new InstructionKey(instructions.size()));
instructions.add(ib.build());
flowBuilder.setInstructions(isb.setInstruction(instructions).build());
writeFlow(flowBuilder, nodeBuilder);
} else {
removeFlow(flowBuilder, nodeBuilder);
}
}
示例3: programStaticRoutingInRemoteDevice
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix; //导入方法依赖的package包/类
public void programStaticRoutingInRemoteDevice(Long dpid, String gwMacAddress, Ipv4Prefix destIpv4Prefix,
Long nexthopSegId, boolean isWriteFlow) {
String nodeName = Constants.OPENFLOW_NODE_PREFIX + dpid;
MatchBuilder matchBuilder = new MatchBuilder();
NodeBuilder nodeBuilder = Openflow13Provider.createNodeBuilder(nodeName);
FlowBuilder flowBuilder = new FlowBuilder();
// Instructions List Stores Individual Instructions
InstructionsBuilder isb = new InstructionsBuilder();
List<Instruction> instructions = Lists.newArrayList();
InstructionBuilder ib = new InstructionBuilder();
ApplyActionsBuilder aab = new ApplyActionsBuilder();
ActionBuilder ab = new ActionBuilder();
List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> actionList = Lists
.newArrayList();
final String prefixString = destIpv4Prefix.getValue();
OfMatchUtils.createDmacDestIpMatch(matchBuilder, gwMacAddress, destIpv4Prefix);
String flowId = "StaticRoutingInRemoteDevice_" + nexthopSegId + "_" + prefixString;
flowBuilder.setId(new FlowId(flowId));
FlowKey key = new FlowKey(new FlowId(flowId));
flowBuilder.setBarrier(true);
flowBuilder.setTableId(this.getTable());
flowBuilder.setKey(key);
int mask = IpAddressUtils.getMask(destIpv4Prefix);
flowBuilder.setPriority(BASE_ROUTING_PRIORITY+mask);
flowBuilder.setFlowName(flowId);
flowBuilder.setHardTimeout(0);
flowBuilder.setIdleTimeout(0);
flowBuilder.setMatch(matchBuilder.build());
if (isWriteFlow) {
// DecTTL
ab.setAction(OfActionUtils.decNwTtlAction());
ab.setOrder(actionList.size());
ab.setKey(new ActionKey(actionList.size()));
actionList.add(ab.build());
ab.setAction(OfActionUtils.nxLoadRegAction(
new DstNxRegCaseBuilder().setNxReg(PipelineTrafficClassifier.REG_FIELD).build(),
BigInteger.valueOf(REG_VALUE_IS_STATIC_ROUTING)));
ab.setOrder(actionList.size());
ab.setKey(new ActionKey(actionList.size()));
actionList.add(ab.build());
// Create Apply Actions Instruction
aab.setAction(actionList);
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
ib.setOrder(instructions.size());
ib.setKey(new InstructionKey(instructions.size()));
instructions.add(ib.build());
// Goto Next Table
ib = getMutablePipelineInstructionBuilder();
ib.setOrder(instructions.size());
ib.setKey(new InstructionKey(instructions.size()));
instructions.add(ib.build());
flowBuilder.setInstructions(isb.setInstruction(instructions).build());
writeFlow(flowBuilder, nodeBuilder);
} else {
removeFlow(flowBuilder, nodeBuilder);
}
}
示例4: programForwardingTableEntry
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix; //导入方法依赖的package包/类
public void programForwardingTableEntry(Long dpid, Long segmentationId, Ipv4Prefix ipv4PrefixAddress,
String macAddress, boolean isWriteFlow) {
String nodeName = Constants.OPENFLOW_NODE_PREFIX + dpid;
MatchBuilder matchBuilder = new MatchBuilder();
NodeBuilder nodeBuilder = Openflow13Provider.createNodeBuilder(nodeName);
// Instructions List Stores Individual Instructions
InstructionsBuilder isb = new InstructionsBuilder();
List<Instruction> instructions = Lists.newArrayList();
InstructionBuilder ib = new InstructionBuilder();
OfMatchUtils.createTunnelIDMatch(matchBuilder, BigInteger.valueOf(segmentationId.longValue()));
OfMatchUtils.createDstL3IPv4Match(matchBuilder, ipv4PrefixAddress);
// Set Dest Mac address
OfInstructionUtils.createDlDstInstructions(ib, macAddress);
ib.setOrder(instructions.size());
ib.setKey(new InstructionKey(instructions.size()));
instructions.add(ib.build());
// Goto Next Table
ib = getMutablePipelineInstructionBuilder();
ib.setOrder(instructions.size());
ib.setKey(new InstructionKey(instructions.size()));
instructions.add(ib.build());
FlowBuilder flowBuilder = new FlowBuilder();
flowBuilder.setMatch(matchBuilder.build());
flowBuilder.setInstructions(isb.setInstruction(instructions).build());
String flowId = "L3Forwarding_" + segmentationId + "_" + ipv4PrefixAddress.getValue();
flowBuilder.setId(new FlowId(flowId));
FlowKey key = new FlowKey(new FlowId(flowId));
flowBuilder.setBarrier(true);
flowBuilder.setTableId(this.getTable());
flowBuilder.setKey(key);
flowBuilder.setPriority(1024);
flowBuilder.setFlowName(flowId);
flowBuilder.setHardTimeout(0);
flowBuilder.setIdleTimeout(0);
if (isWriteFlow) {
writeFlow(flowBuilder, nodeBuilder);
} else {
removeFlow(flowBuilder, nodeBuilder);
}
}