use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFields in project openflowplugin by opendaylight.
the class MplsTcEntryDeserializer method deserializeEntry.
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
processHeader(message);
final short mplsTc = message.readUnsignedByte();
if (Objects.isNull(builder.getProtocolMatchFields())) {
builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder().setMplsTc(mplsTc).build());
} else if (Objects.isNull(builder.getProtocolMatchFields().getMplsTc())) {
builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder(builder.getProtocolMatchFields()).setMplsTc(mplsTc).build());
} else {
throwErrorOnMalformed(builder, "protocolMatchFields", "mplsTc");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFields in project openflowplugin by opendaylight.
the class MplsLabelEntryDeserializer method deserializeEntry.
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
processHeader(message);
final long mplsLabel = message.readUnsignedInt();
if (Objects.isNull(builder.getProtocolMatchFields())) {
builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder().setMplsLabel(mplsLabel).build());
} else if (Objects.isNull(builder.getProtocolMatchFields().getMplsLabel())) {
builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder(builder.getProtocolMatchFields()).setMplsLabel(mplsLabel).build());
} else {
throwErrorOnMalformed(builder, "protocolMatchFields", "mplsLabel");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFields in project openflowplugin by opendaylight.
the class MplsBosEntryDeserializerTest method deserializeEntry.
@Test
public void deserializeEntry() throws Exception {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final short mplsBos = 6;
writeHeader(in, false);
in.writeByte(mplsBos);
ProtocolMatchFields match = deserialize(in).getProtocolMatchFields();
assertEquals(mplsBos, match.getMplsBos().shortValue());
assertEquals(0, in.readableBytes());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFields in project openflowplugin by opendaylight.
the class MplsTcEntryDeserializerTest method deserializeEntry.
@Test
public void deserializeEntry() throws Exception {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final short mplsTc = 6;
writeHeader(in, false);
in.writeByte(mplsTc);
ProtocolMatchFields match = deserialize(in).getProtocolMatchFields();
assertEquals(mplsTc, match.getMplsTc().shortValue());
assertEquals(0, in.readableBytes());
}
Aggregations