use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match in project openflowplugin by opendaylight.
the class SctpDestinationPortEntrySerializerTest method testSerialize.
@Test
public void testSerialize() throws Exception {
final int sctp = 10;
final Match sctpMatch = new MatchBuilder().setLayer4Match(new SctpMatchBuilder().setSctpDestinationPort(new PortNumber(sctp)).build()).build();
assertMatch(sctpMatch, false, (out) -> assertEquals(out.readUnsignedShort(), sctp));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match in project openflowplugin by opendaylight.
the class Ipv6ExtHeaderEntryDeserializerTest method deserializeEntry.
@Test
public void deserializeEntry() throws Exception {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int extHeader = 10;
final int extHeaderMask = 8;
writeHeader(in, false);
in.writeShort(extHeader);
Ipv6Match match = Ipv6Match.class.cast(deserialize(in).getLayer3Match());
assertEquals(extHeader, match.getIpv6ExtHeader().getIpv6Exthdr().intValue());
assertEquals(0, in.readableBytes());
writeHeader(in, true);
in.writeShort(extHeader);
in.writeShort(extHeaderMask);
match = Ipv6Match.class.cast(deserialize(in).getLayer3Match());
assertEquals(extHeader, match.getIpv6ExtHeader().getIpv6Exthdr().intValue());
assertEquals(extHeaderMask, match.getIpv6ExtHeader().getIpv6ExthdrMask().intValue());
assertEquals(0, in.readableBytes());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match in project openflowplugin by opendaylight.
the class Ipv6NdSllEntryDeserializerTest method deserializeEntry.
@Test
public void deserializeEntry() throws Exception {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final MacAddress address = new MacAddress("00:01:02:03:04:05");
writeHeader(in, false);
in.writeBytes(IetfYangUtil.INSTANCE.bytesFor(address));
Ipv6Match match = Ipv6Match.class.cast(deserialize(in).getLayer3Match());
assertEquals(address.getValue(), match.getIpv6NdSll().getValue());
assertEquals(0, in.readableBytes());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match in project openflowplugin by opendaylight.
the class MplsLabelEntryDeserializerTest method deserializeEntry.
@Test
public void deserializeEntry() throws Exception {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int mplsLabel = 10;
writeHeader(in, false);
in.writeInt(mplsLabel);
ProtocolMatchFields match = deserialize(in).getProtocolMatchFields();
assertEquals(mplsLabel, match.getMplsLabel().intValue());
assertEquals(0, in.readableBytes());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match in project openflowplugin by opendaylight.
the class PbbEntryDeserializerTest method deserializeEntry.
@Test
public void deserializeEntry() throws Exception {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final long pbb = 6;
final long pbbMask = 5;
writeHeader(in, false);
in.writeMedium((int) pbb);
ProtocolMatchFields match = deserialize(in).getProtocolMatchFields();
assertEquals(pbb, match.getPbb().getPbbIsid().longValue());
assertEquals(0, in.readableBytes());
writeHeader(in, true);
in.writeMedium((int) pbb);
in.writeMedium((int) pbbMask);
match = deserialize(in).getProtocolMatchFields();
assertEquals(pbb, match.getPbb().getPbbIsid().longValue());
assertEquals(pbbMask, match.getPbb().getPbbMask().longValue());
assertEquals(0, in.readableBytes());
}
Aggregations