use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowWildcardsV10 in project openflowplugin by opendaylight.
the class MatchV10ResponseConvertorTest method testUdpMatch.
/**
* UDP match test for {@link MatchV10ResponseConvertor#convert(MatchV10, VersionDatapathIdConvertorData)}.
*/
@Test
public void testUdpMatch() {
// TP_SRC, TP_DST are wildcarded.
// NW_PROTO is not wildcarded but null.
Long dlType = 0x800L;
FlowWildcardsV10 wc = new FlowWildcardsV10(true, true, false, true, true, true, false, true, true, true);
MatchV10Builder builder = new MatchV10Builder().setWildcards(wc).setDlType(dlType.intValue());
MatchV10 match = builder.build();
BigInteger dpid = BigInteger.valueOf(12345L);
final VersionDatapathIdConvertorData datapathIdConvertorData = new VersionDatapathIdConvertorData(OFConstants.OFP_VERSION_1_0);
datapathIdConvertorData.setDatapathId(dpid);
Match salMatch = convert(match, datapathIdConvertorData).build();
EthernetMatch etherMatch = salMatch.getEthernetMatch();
Assert.assertEquals("Wrong in port", null, salMatch.getInPort());
Assert.assertEquals("Wrong dl src", null, etherMatch.getEthernetSource());
Assert.assertEquals("Wrong dl dst", null, etherMatch.getEthernetDestination());
Assert.assertEquals("Wrong dl type", dlType, etherMatch.getEthernetType().getType().getValue());
Assert.assertEquals("Wrong VLAN match", null, salMatch.getVlanMatch());
Assert.assertEquals("Wrong IP match", null, salMatch.getIpMatch());
Assert.assertEquals("Wrong L3 match", null, salMatch.getLayer3Match());
Assert.assertEquals("Wrong L4 match", null, salMatch.getLayer4Match());
Assert.assertEquals("Wrong ICMPv4 match", null, salMatch.getIcmpv4Match());
// Specify UDP protocol.
Short ipProto = 17;
match = builder.setNwProto(ipProto).build();
salMatch = convert(match, datapathIdConvertorData).build();
etherMatch = salMatch.getEthernetMatch();
IpMatch ipMatch = salMatch.getIpMatch();
Assert.assertEquals("Wrong in port", null, salMatch.getInPort());
Assert.assertEquals("Wrong dl src", null, etherMatch.getEthernetSource());
Assert.assertEquals("Wrong dl dst", null, etherMatch.getEthernetDestination());
Assert.assertEquals("Wrong dl type", dlType, etherMatch.getEthernetType().getType().getValue());
Assert.assertEquals("Wrong VLAN match", null, salMatch.getVlanMatch());
Assert.assertEquals("Wrong ip protocol", ipProto, ipMatch.getIpProtocol());
Assert.assertEquals("Wrong ip proto", null, ipMatch.getIpProto());
Assert.assertEquals("Wrong ip ecn", null, ipMatch.getIpEcn());
Assert.assertEquals("Wrong ip dscp", null, ipMatch.getIpDscp());
Assert.assertEquals("Wrong L3 match", null, salMatch.getLayer3Match());
Assert.assertEquals("Wrong L4 match", null, salMatch.getLayer4Match());
Assert.assertEquals("Wrong ICMPv4 match", null, salMatch.getIcmpv4Match());
// TP_SRC is not wildcarded but null.
wc = new FlowWildcardsV10(true, true, false, true, true, true, false, true, true, false);
match = builder.setWildcards(wc).build();
salMatch = convert(match, datapathIdConvertorData).build();
etherMatch = salMatch.getEthernetMatch();
ipMatch = salMatch.getIpMatch();
Assert.assertEquals("Wrong in port", null, salMatch.getInPort());
Assert.assertEquals("Wrong dl src", null, etherMatch.getEthernetSource());
Assert.assertEquals("Wrong dl dst", null, etherMatch.getEthernetDestination());
Assert.assertEquals("Wrong dl type", dlType, etherMatch.getEthernetType().getType().getValue());
Assert.assertEquals("Wrong VLAN match", null, salMatch.getVlanMatch());
Assert.assertEquals("Wrong ip protocol", ipProto, ipMatch.getIpProtocol());
Assert.assertEquals("Wrong ip proto", null, ipMatch.getIpProto());
Assert.assertEquals("Wrong ip ecn", null, ipMatch.getIpEcn());
Assert.assertEquals("Wrong ip dscp", null, ipMatch.getIpDscp());
Assert.assertEquals("Wrong L3 match", null, salMatch.getLayer3Match());
Assert.assertEquals("Wrong L4 match", null, salMatch.getLayer4Match());
Assert.assertEquals("Wrong ICMPv4 match", null, salMatch.getIcmpv4Match());
// Specify UDP source port.
Integer srcPort = 60000;
match = builder.setTpSrc(srcPort).build();
salMatch = convert(match, datapathIdConvertorData).build();
etherMatch = salMatch.getEthernetMatch();
ipMatch = salMatch.getIpMatch();
UdpMatch udpMatch = (UdpMatch) salMatch.getLayer4Match();
Assert.assertEquals("Wrong in port", null, salMatch.getInPort());
Assert.assertEquals("Wrong dl src", null, etherMatch.getEthernetSource());
Assert.assertEquals("Wrong dl dst", null, etherMatch.getEthernetDestination());
Assert.assertEquals("Wrong dl type", dlType, etherMatch.getEthernetType().getType().getValue());
Assert.assertEquals("Wrong VLAN match", null, salMatch.getVlanMatch());
Assert.assertEquals("Wrong ip protocol", ipProto, ipMatch.getIpProtocol());
Assert.assertEquals("Wrong ip proto", null, ipMatch.getIpProto());
Assert.assertEquals("Wrong ip ecn", null, ipMatch.getIpEcn());
Assert.assertEquals("Wrong ip dscp", null, ipMatch.getIpDscp());
Assert.assertEquals("Wrong L3 match", null, salMatch.getLayer3Match());
Assert.assertEquals("Wrong UDP src", srcPort, udpMatch.getUdpSourcePort().getValue());
Assert.assertEquals("Wrong UDP dst", null, udpMatch.getUdpDestinationPort());
Assert.assertEquals("Wrong ICMPv4 match", null, salMatch.getIcmpv4Match());
// TP_DST is not wildcarded but null.
wc = new FlowWildcardsV10(true, true, false, true, true, true, false, true, false, false);
match = builder.setWildcards(wc).build();
salMatch = convert(match, datapathIdConvertorData).build();
etherMatch = salMatch.getEthernetMatch();
ipMatch = salMatch.getIpMatch();
udpMatch = (UdpMatch) salMatch.getLayer4Match();
Assert.assertEquals("Wrong in port", null, salMatch.getInPort());
Assert.assertEquals("Wrong dl src", null, etherMatch.getEthernetSource());
Assert.assertEquals("Wrong dl dst", null, etherMatch.getEthernetDestination());
Assert.assertEquals("Wrong dl type", dlType, etherMatch.getEthernetType().getType().getValue());
Assert.assertEquals("Wrong VLAN match", null, salMatch.getVlanMatch());
Assert.assertEquals("Wrong ip protocol", ipProto, ipMatch.getIpProtocol());
Assert.assertEquals("Wrong ip proto", null, ipMatch.getIpProto());
Assert.assertEquals("Wrong ip ecn", null, ipMatch.getIpEcn());
Assert.assertEquals("Wrong ip dscp", null, ipMatch.getIpDscp());
Assert.assertEquals("Wrong L3 match", null, salMatch.getLayer3Match());
Assert.assertEquals("Wrong UDP src", srcPort, udpMatch.getUdpSourcePort().getValue());
Assert.assertEquals("Wrong UDP dst", null, udpMatch.getUdpDestinationPort());
Assert.assertEquals("Wrong ICMPv4 match", null, salMatch.getIcmpv4Match());
// Specify UDP destination port only.
Integer dstPort = 6653;
match = builder.setTpSrc(null).setTpDst(dstPort).build();
salMatch = convert(match, datapathIdConvertorData).build();
etherMatch = salMatch.getEthernetMatch();
ipMatch = salMatch.getIpMatch();
udpMatch = (UdpMatch) salMatch.getLayer4Match();
Assert.assertEquals("Wrong in port", null, salMatch.getInPort());
Assert.assertEquals("Wrong dl src", null, etherMatch.getEthernetSource());
Assert.assertEquals("Wrong dl dst", null, etherMatch.getEthernetDestination());
Assert.assertEquals("Wrong dl type", dlType, etherMatch.getEthernetType().getType().getValue());
Assert.assertEquals("Wrong VLAN match", null, salMatch.getVlanMatch());
Assert.assertEquals("Wrong ip protocol", ipProto, ipMatch.getIpProtocol());
Assert.assertEquals("Wrong ip proto", null, ipMatch.getIpProto());
Assert.assertEquals("Wrong ip ecn", null, ipMatch.getIpEcn());
Assert.assertEquals("Wrong ip dscp", null, ipMatch.getIpDscp());
Assert.assertEquals("Wrong L3 match", null, salMatch.getLayer3Match());
Assert.assertEquals("Wrong UDP src", null, udpMatch.getUdpSourcePort());
Assert.assertEquals("Wrong UDP dst", dstPort, udpMatch.getUdpDestinationPort().getValue());
Assert.assertEquals("Wrong ICMPv4 match", null, salMatch.getIcmpv4Match());
// Specify both source and destination port.
srcPort = 32767;
dstPort = 9999;
match = builder.setTpSrc(srcPort).setTpDst(dstPort).build();
salMatch = convert(match, datapathIdConvertorData).build();
etherMatch = salMatch.getEthernetMatch();
ipMatch = salMatch.getIpMatch();
udpMatch = (UdpMatch) salMatch.getLayer4Match();
Assert.assertEquals("Wrong in port", null, salMatch.getInPort());
Assert.assertEquals("Wrong dl src", null, etherMatch.getEthernetSource());
Assert.assertEquals("Wrong dl dst", null, etherMatch.getEthernetDestination());
Assert.assertEquals("Wrong dl type", dlType, etherMatch.getEthernetType().getType().getValue());
Assert.assertEquals("Wrong VLAN match", null, salMatch.getVlanMatch());
Assert.assertEquals("Wrong ip protocol", ipProto, ipMatch.getIpProtocol());
Assert.assertEquals("Wrong ip proto", null, ipMatch.getIpProto());
Assert.assertEquals("Wrong ip ecn", null, ipMatch.getIpEcn());
Assert.assertEquals("Wrong ip dscp", null, ipMatch.getIpDscp());
Assert.assertEquals("Wrong L3 match", null, salMatch.getLayer3Match());
Assert.assertEquals("Wrong UDP src", srcPort, udpMatch.getUdpSourcePort().getValue());
Assert.assertEquals("Wrong UDP dst", dstPort, udpMatch.getUdpDestinationPort().getValue());
Assert.assertEquals("Wrong ICMPv4 match", null, salMatch.getIcmpv4Match());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowWildcardsV10 in project openflowplugin by opendaylight.
the class MatchV10ResponseConvertorTest method testTcpMatch.
/**
* TCP match test for {@link MatchV10ResponseConvertor#convert(MatchV10, VersionDatapathIdConvertorData)}.
*/
@Test
public void testTcpMatch() {
// TP_SRC, TP_DST are wildcarded.
// NW_PROTO is not wildcarded but null.
Long dlType = 0x800L;
FlowWildcardsV10 wc = new FlowWildcardsV10(true, true, false, true, true, true, false, true, true, true);
MatchV10Builder builder = new MatchV10Builder().setWildcards(wc).setDlType(dlType.intValue());
MatchV10 match = builder.build();
BigInteger dpid = BigInteger.valueOf(12345L);
final VersionDatapathIdConvertorData datapathIdConvertorData = new VersionDatapathIdConvertorData(OFConstants.OFP_VERSION_1_0);
datapathIdConvertorData.setDatapathId(dpid);
Match salMatch = convert(match, datapathIdConvertorData).build();
EthernetMatch etherMatch = salMatch.getEthernetMatch();
Assert.assertEquals("Wrong in port", null, salMatch.getInPort());
Assert.assertEquals("Wrong dl src", null, etherMatch.getEthernetSource());
Assert.assertEquals("Wrong dl dst", null, etherMatch.getEthernetDestination());
Assert.assertEquals("Wrong dl type", dlType, etherMatch.getEthernetType().getType().getValue());
Assert.assertEquals("Wrong VLAN match", null, salMatch.getVlanMatch());
Assert.assertEquals("Wrong IP match", null, salMatch.getIpMatch());
Assert.assertEquals("Wrong L3 match", null, salMatch.getLayer3Match());
Assert.assertEquals("Wrong L4 match", null, salMatch.getLayer4Match());
Assert.assertEquals("Wrong ICMPv4 match", null, salMatch.getIcmpv4Match());
// Specify TCP protocol.
Short ipProto = 6;
match = builder.setNwProto(ipProto).build();
salMatch = convert(match, datapathIdConvertorData).build();
etherMatch = salMatch.getEthernetMatch();
IpMatch ipMatch = salMatch.getIpMatch();
Assert.assertEquals("Wrong in port", null, salMatch.getInPort());
Assert.assertEquals("Wrong dl src", null, etherMatch.getEthernetSource());
Assert.assertEquals("Wrong dl dst", null, etherMatch.getEthernetDestination());
Assert.assertEquals("Wrong dl type", dlType, etherMatch.getEthernetType().getType().getValue());
Assert.assertEquals("Wrong VLAN match", null, salMatch.getVlanMatch());
Assert.assertEquals("Wrong ip protocol", ipProto, ipMatch.getIpProtocol());
Assert.assertEquals("Wrong ip proto", null, ipMatch.getIpProto());
Assert.assertEquals("Wrong ip ecn", null, ipMatch.getIpEcn());
Assert.assertEquals("Wrong ip dscp", null, ipMatch.getIpDscp());
Assert.assertEquals("Wrong L3 match", null, salMatch.getLayer3Match());
Assert.assertEquals("Wrong L4 match", null, salMatch.getLayer4Match());
Assert.assertEquals("Wrong ICMPv4 match", null, salMatch.getIcmpv4Match());
// TP_SRC is not wildcarded but null.
wc = new FlowWildcardsV10(true, true, false, true, true, true, false, true, true, false);
match = builder.setWildcards(wc).build();
salMatch = convert(match, datapathIdConvertorData).build();
etherMatch = salMatch.getEthernetMatch();
ipMatch = salMatch.getIpMatch();
Assert.assertEquals("Wrong in port", null, salMatch.getInPort());
Assert.assertEquals("Wrong dl src", null, etherMatch.getEthernetSource());
Assert.assertEquals("Wrong dl dst", null, etherMatch.getEthernetDestination());
Assert.assertEquals("Wrong dl type", dlType, etherMatch.getEthernetType().getType().getValue());
Assert.assertEquals("Wrong VLAN match", null, salMatch.getVlanMatch());
Assert.assertEquals("Wrong ip protocol", ipProto, ipMatch.getIpProtocol());
Assert.assertEquals("Wrong ip proto", null, ipMatch.getIpProto());
Assert.assertEquals("Wrong ip ecn", null, ipMatch.getIpEcn());
Assert.assertEquals("Wrong ip dscp", null, ipMatch.getIpDscp());
Assert.assertEquals("Wrong L3 match", null, salMatch.getLayer3Match());
Assert.assertEquals("Wrong L4 match", null, salMatch.getLayer4Match());
Assert.assertEquals("Wrong ICMPv4 match", null, salMatch.getIcmpv4Match());
// Specify TCP source port.
Integer srcPort = 60000;
match = builder.setTpSrc(srcPort).build();
salMatch = convert(match, datapathIdConvertorData).build();
etherMatch = salMatch.getEthernetMatch();
ipMatch = salMatch.getIpMatch();
TcpMatch tcpMatch = (TcpMatch) salMatch.getLayer4Match();
Assert.assertEquals("Wrong in port", null, salMatch.getInPort());
Assert.assertEquals("Wrong dl src", null, etherMatch.getEthernetSource());
Assert.assertEquals("Wrong dl dst", null, etherMatch.getEthernetDestination());
Assert.assertEquals("Wrong dl type", dlType, etherMatch.getEthernetType().getType().getValue());
Assert.assertEquals("Wrong VLAN match", null, salMatch.getVlanMatch());
Assert.assertEquals("Wrong ip protocol", ipProto, ipMatch.getIpProtocol());
Assert.assertEquals("Wrong ip proto", null, ipMatch.getIpProto());
Assert.assertEquals("Wrong ip ecn", null, ipMatch.getIpEcn());
Assert.assertEquals("Wrong ip dscp", null, ipMatch.getIpDscp());
Assert.assertEquals("Wrong L3 match", null, salMatch.getLayer3Match());
Assert.assertEquals("Wrong TCP src", srcPort, tcpMatch.getTcpSourcePort().getValue());
Assert.assertEquals("Wrong TCP dst", null, tcpMatch.getTcpDestinationPort());
Assert.assertEquals("Wrong ICMPv4 match", null, salMatch.getIcmpv4Match());
// TP_DST is not wildcarded but null.
wc = new FlowWildcardsV10(true, true, false, true, true, true, false, true, false, false);
match = builder.setWildcards(wc).build();
salMatch = convert(match, datapathIdConvertorData).build();
etherMatch = salMatch.getEthernetMatch();
ipMatch = salMatch.getIpMatch();
tcpMatch = (TcpMatch) salMatch.getLayer4Match();
Assert.assertEquals("Wrong in port", null, salMatch.getInPort());
Assert.assertEquals("Wrong dl src", null, etherMatch.getEthernetSource());
Assert.assertEquals("Wrong dl dst", null, etherMatch.getEthernetDestination());
Assert.assertEquals("Wrong dl type", dlType, etherMatch.getEthernetType().getType().getValue());
Assert.assertEquals("Wrong VLAN match", null, salMatch.getVlanMatch());
Assert.assertEquals("Wrong ip protocol", ipProto, ipMatch.getIpProtocol());
Assert.assertEquals("Wrong ip proto", null, ipMatch.getIpProto());
Assert.assertEquals("Wrong ip ecn", null, ipMatch.getIpEcn());
Assert.assertEquals("Wrong ip dscp", null, ipMatch.getIpDscp());
Assert.assertEquals("Wrong L3 match", null, salMatch.getLayer3Match());
Assert.assertEquals("Wrong TCP src", srcPort, tcpMatch.getTcpSourcePort().getValue());
Assert.assertEquals("Wrong TCP dst", null, tcpMatch.getTcpDestinationPort());
Assert.assertEquals("Wrong ICMPv4 match", null, salMatch.getIcmpv4Match());
// Specify TCP destination port only.
Integer dstPort = 6653;
match = builder.setTpSrc(null).setTpDst(dstPort).build();
salMatch = convert(match, datapathIdConvertorData).build();
etherMatch = salMatch.getEthernetMatch();
ipMatch = salMatch.getIpMatch();
tcpMatch = (TcpMatch) salMatch.getLayer4Match();
Assert.assertEquals("Wrong in port", null, salMatch.getInPort());
Assert.assertEquals("Wrong dl src", null, etherMatch.getEthernetSource());
Assert.assertEquals("Wrong dl dst", null, etherMatch.getEthernetDestination());
Assert.assertEquals("Wrong dl type", dlType, etherMatch.getEthernetType().getType().getValue());
Assert.assertEquals("Wrong VLAN match", null, salMatch.getVlanMatch());
Assert.assertEquals("Wrong ip protocol", ipProto, ipMatch.getIpProtocol());
Assert.assertEquals("Wrong ip proto", null, ipMatch.getIpProto());
Assert.assertEquals("Wrong ip ecn", null, ipMatch.getIpEcn());
Assert.assertEquals("Wrong ip dscp", null, ipMatch.getIpDscp());
Assert.assertEquals("Wrong L3 match", null, salMatch.getLayer3Match());
Assert.assertEquals("Wrong TCP src", null, tcpMatch.getTcpSourcePort());
Assert.assertEquals("Wrong TCP dst", dstPort, tcpMatch.getTcpDestinationPort().getValue());
Assert.assertEquals("Wrong ICMPv4 match", null, salMatch.getIcmpv4Match());
// Specify both source and destination port.
srcPort = 32767;
dstPort = 9999;
match = builder.setTpSrc(srcPort).setTpDst(dstPort).build();
salMatch = convert(match, datapathIdConvertorData).build();
etherMatch = salMatch.getEthernetMatch();
ipMatch = salMatch.getIpMatch();
tcpMatch = (TcpMatch) salMatch.getLayer4Match();
Assert.assertEquals("Wrong in port", null, salMatch.getInPort());
Assert.assertEquals("Wrong dl src", null, etherMatch.getEthernetSource());
Assert.assertEquals("Wrong dl dst", null, etherMatch.getEthernetDestination());
Assert.assertEquals("Wrong dl type", dlType, etherMatch.getEthernetType().getType().getValue());
Assert.assertEquals("Wrong VLAN match", null, salMatch.getVlanMatch());
Assert.assertEquals("Wrong ip protocol", ipProto, ipMatch.getIpProtocol());
Assert.assertEquals("Wrong ip proto", null, ipMatch.getIpProto());
Assert.assertEquals("Wrong ip ecn", null, ipMatch.getIpEcn());
Assert.assertEquals("Wrong ip dscp", null, ipMatch.getIpDscp());
Assert.assertEquals("Wrong L3 match", null, salMatch.getLayer3Match());
Assert.assertEquals("Wrong TCP src", srcPort, tcpMatch.getTcpSourcePort().getValue());
Assert.assertEquals("Wrong TCP dst", dstPort, tcpMatch.getTcpDestinationPort().getValue());
Assert.assertEquals("Wrong ICMPv4 match", null, salMatch.getIcmpv4Match());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowWildcardsV10 in project openflowplugin by opendaylight.
the class MatchV10ResponseConvertorTest method testWildcardedMatch.
/**
* Test {@link MatchV10ResponseConvertor#convert(MatchV10, VersionDatapathIdConvertorData)}.
*/
@Test
public void testWildcardedMatch() {
MatchV10Builder builder = new MatchV10Builder();
builder.setWildcards(new FlowWildcardsV10(true, true, true, true, true, true, true, true, true, true));
builder.setNwSrcMask((short) 24);
builder.setNwDstMask((short) 16);
builder.setInPort(6653);
builder.setDlSrc(new MacAddress("01:01:01:01:01:01"));
builder.setDlDst(new MacAddress("02:02:02:02:02:02"));
builder.setDlVlan(128);
builder.setDlVlanPcp((short) 2);
builder.setDlType(15);
builder.setNwTos((short) 14);
builder.setNwProto((short) 6);
builder.setNwSrc(new Ipv4Address("1.1.1.2"));
builder.setNwDst(new Ipv4Address("32.16.8.1"));
builder.setTpSrc(2048);
builder.setTpDst(4096);
MatchV10 match = builder.build();
final VersionDatapathIdConvertorData datapathIdConvertorData = new VersionDatapathIdConvertorData(OFConstants.OFP_VERSION_1_0);
datapathIdConvertorData.setDatapathId(new BigInteger("42"));
final Match salMatch = convert(match, datapathIdConvertorData).build();
Assert.assertEquals("Wrong in port", null, salMatch.getInPort());
Assert.assertEquals("Wrong dl match", null, salMatch.getEthernetMatch());
Assert.assertEquals("Wrong dl vlan match", null, salMatch.getVlanMatch());
Assert.assertEquals("Wrong layer 3 match", null, salMatch.getLayer3Match());
Assert.assertEquals("Wrong layer 4 match", null, salMatch.getLayer4Match());
Assert.assertEquals("Wrong ip match", null, salMatch.getIpMatch());
Assert.assertEquals("Wrong ICMPv4 match", null, salMatch.getIcmpv4Match());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowWildcardsV10 in project openflowplugin by opendaylight.
the class FlowCreatorUtil method createWildcardedMatchV10.
/**
* Method creates openflow 1.0 format match, that can match all the flow entries.
*
* @return V10 Match object
*/
public static MatchV10 createWildcardedMatchV10() {
MatchV10Builder builder = new MatchV10Builder();
builder.setWildcards(new FlowWildcardsV10(true, true, true, true, true, true, true, true, true, true));
builder.setNwSrcMask((short) 0);
builder.setNwDstMask((short) 0);
builder.setInPort(0);
builder.setDlSrc(new MacAddress("00:00:00:00:00:00"));
builder.setDlDst(new MacAddress("00:00:00:00:00:00"));
builder.setDlVlan(0);
builder.setDlVlanPcp((short) 0);
builder.setDlType(0);
builder.setNwTos((short) 0);
builder.setNwProto((short) 0);
builder.setNwSrc(new Ipv4Address("0.0.0.0"));
builder.setNwDst(new Ipv4Address("0.0.0.0"));
builder.setTpSrc(0);
builder.setTpDst(0);
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowWildcardsV10 in project openflowplugin by opendaylight.
the class OF10StatsRequestInputAggregateFactoryTest method createMultipartRequestBody.
private static MultipartRequestBody createMultipartRequestBody() {
final MultipartRequestAggregateCaseBuilder caseBuilder = new MultipartRequestAggregateCaseBuilder();
final MultipartRequestAggregateBuilder aggregateBuilder = new MultipartRequestAggregateBuilder();
MatchV10Builder matchBuilder = new MatchV10Builder();
matchBuilder.setWildcards(new FlowWildcardsV10(false, false, false, false, false, false, false, false, false, false));
matchBuilder.setNwSrcMask((short) 32);
matchBuilder.setNwDstMask((short) 32);
matchBuilder.setInPort(51);
matchBuilder.setDlSrc(new MacAddress("00:01:02:03:04:05"));
matchBuilder.setDlDst(new MacAddress("05:04:03:02:01:00"));
matchBuilder.setDlVlan(52);
matchBuilder.setDlVlanPcp((short) 53);
matchBuilder.setDlType(54);
matchBuilder.setNwTos((short) 55);
matchBuilder.setNwProto((short) 56);
matchBuilder.setNwSrc(new Ipv4Address("10.0.0.1"));
matchBuilder.setNwDst(new Ipv4Address("10.0.0.2"));
matchBuilder.setTpSrc(57);
matchBuilder.setTpDst(58);
aggregateBuilder.setMatchV10(matchBuilder.build());
aggregateBuilder.setTableId((short) 42);
aggregateBuilder.setOutPort(6653L);
caseBuilder.setMultipartRequestAggregate(aggregateBuilder.build());
return caseBuilder.build();
}
Aggregations