use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder in project openflowplugin by opendaylight.
the class OxmMplsTcSerializerTest method testSerializeHeader.
/**
* Test correct header serialization.
*/
@Test
public void testSerializeHeader() {
MatchEntryBuilder builder = prepareMplsTcHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
checkHeader(buffer, false);
assertTrue("Unexpected data", buffer.readableBytes() == 0);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder in project openflowplugin by opendaylight.
the class OxmMplsTcSerializerTest method prepareMplsTcMatchEntry.
private static MatchEntryBuilder prepareMplsTcMatchEntry(short value) {
MatchEntryBuilder builder = prepareMplsTcHeader(false);
MplsTcCaseBuilder casebuilder = new MplsTcCaseBuilder();
MplsTcBuilder valueBuilder = new MplsTcBuilder();
valueBuilder.setTc(value);
casebuilder.setMplsTc(valueBuilder.build());
builder.setMatchEntryValue(casebuilder.build());
return builder;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder in project openflowplugin by opendaylight.
the class OxmTcpDstSerializerTest method prepareMatchEntry.
private static MatchEntryBuilder prepareMatchEntry(int value) {
MatchEntryBuilder builder = prepareHeader(false);
TcpDstCaseBuilder casebuilder = new TcpDstCaseBuilder();
TcpDstBuilder valueBuilder = new TcpDstBuilder();
valueBuilder.setPort(new PortNumber(value));
casebuilder.setTcpDst(valueBuilder.build());
builder.setMatchEntryValue(casebuilder.build());
return builder;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder in project openflowplugin by opendaylight.
the class OxmTunnelIdSerializerTest method testSerializeWithoutMask.
/**
* Test correct serialization.
*/
@Test
public void testSerializeWithoutMask() {
MatchEntryBuilder builder = prepareMatchEntry(false, new byte[] { 0, 1, 2, 3, 4, 5, 6, 7 });
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
checkHeader(buffer, false);
byte[] address = new byte[8];
buffer.readBytes(address);
Assert.assertArrayEquals("Wrong address", new byte[] { 0, 1, 2, 3, 4, 5, 6, 7 }, address);
assertTrue("Unexpected data", buffer.readableBytes() == 0);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder in project openflowplugin by opendaylight.
the class OxmTunnelIdSerializerTest method prepareMatchEntry.
private static MatchEntryBuilder prepareMatchEntry(boolean hasMask, byte[] value) {
final MatchEntryBuilder builder = prepareHeader(hasMask);
TunnelIdCaseBuilder casebuilder = new TunnelIdCaseBuilder();
TunnelIdBuilder valueBuilder = new TunnelIdBuilder();
if (hasMask) {
valueBuilder.setMask(new byte[] { 30, 30, 25, 25, 15, 15, 0, 0 });
}
valueBuilder.setTunnelId(value);
casebuilder.setTunnelId(valueBuilder.build());
builder.setMatchEntryValue(casebuilder.build());
return builder;
}
Aggregations