}
if ((inetSourceAddress instanceof Inet4Address)
- && (inetDestAddress instanceof Inet4Address)) {
+ || (inetDestAddress instanceof Inet4Address)) {
MatchField dataLinkType = sourceMatch.getField(DL_TYPE);
Short dLType = null;
if (dataLinkType != null && dataLinkType.getValue() != null) {
(Inet4Address) inetDestAddress);
}
} else if ((inetSourceAddress instanceof Inet6Address)
- && (inetDestAddress instanceof Inet6Address)) {
+ || (inetDestAddress instanceof Inet6Address)) {
return setLayer3MatchAsIpv6((Inet6Address) inetSourceAddress,
(Inet6Address) inetDestAddress);
}
private static Layer3Match setLayer3MatchAsIpv4(
final Inet4Address inetSourceAddress,
final Inet4Address inetDestAddress) {
- String inetSrcAddressString = InetAddresses
- .toAddrString(inetSourceAddress);
- String inetDstAddressString = InetAddresses
- .toAddrString(inetDestAddress);
-
Ipv4MatchBuilder layer4MatchBuild = new Ipv4MatchBuilder();
- layer4MatchBuild.setIpv4Source(new Ipv4Prefix(inetSrcAddressString));
- layer4MatchBuild
- .setIpv4Destination(new Ipv4Prefix(inetDstAddressString));
+ if(inetSourceAddress != null) {
+ String inetSrcAddressString = InetAddresses
+ .toAddrString(inetSourceAddress);
+ layer4MatchBuild.setIpv4Source(new Ipv4Prefix(inetSrcAddressString));
+ }
+ if(inetDestAddress != null) {
+ String inetDstAddressString = InetAddresses
+ .toAddrString(inetDestAddress);
+ layer4MatchBuild
+ .setIpv4Destination(new Ipv4Prefix(inetDstAddressString));
+ }
return layer4MatchBuild.build();
}
private static Layer3Match setLayer3MatchAsIpv6(
final Inet6Address inetSourceAddress,
final Inet6Address inetDestAddress) {
- String inetSrcAddressString = InetAddresses
- .toAddrString(inetSourceAddress);
- String inetDstAddressString = InetAddresses
- .toAddrString(inetDestAddress);
Ipv6MatchBuilder layer6MatchBuild = new Ipv6MatchBuilder();
-
- layer6MatchBuild.setIpv6Source(new Ipv6Prefix(inetSrcAddressString));
- layer6MatchBuild
- .setIpv6Destination(new Ipv6Prefix(inetDstAddressString));
+ if(inetSourceAddress != null) {
+ String inetSrcAddressString = InetAddresses
+ .toAddrString(inetSourceAddress);
+ layer6MatchBuild.setIpv6Source(new Ipv6Prefix(inetSrcAddressString));
+ }
+ if(inetDestAddress != null) {
+ String inetDstAddressString = InetAddresses
+ .toAddrString(inetDestAddress);
+ layer6MatchBuild
+ .setIpv6Destination(new Ipv6Prefix(inetDstAddressString));
+ }
return layer6MatchBuild.build();
}
}
instructions = targetActions.toApplyInstruction();
match = sourceFlow.match.toMatch();
+ tableId = new Integer(0).shortValue
return it.build();
}
val it = new InstructionsBuilder;
val applyActions = new InstructionBuilder;
applyActions.instruction = new ApplyActionsCaseBuilder().setApplyActions(new ApplyActionsBuilder().setAction(actions).build()).build()
+ applyActions.setOrder(new Integer(0))
instruction = Collections.<Instruction>singletonList(applyActions.build)
return it.build;
}
public static def addFlowInput(Node sourceNode, Flow sourceFlow) {
val source = flowAdded(sourceFlow);
val it = new AddFlowInputBuilder(source as org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow);
+ it.setNode(sourceNode.toNodeRef)
return it.build();
}