Search in sources :

Example 6 with ProtocolMatchFields

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");
    }
}
Also used : ProtocolMatchFieldsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFieldsBuilder)

Example 7 with ProtocolMatchFields

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");
    }
}
Also used : ProtocolMatchFieldsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFieldsBuilder)

Example 8 with ProtocolMatchFields

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());
}
Also used : ProtocolMatchFields(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFields) ByteBuf(io.netty.buffer.ByteBuf) Test(org.junit.Test)

Example 9 with ProtocolMatchFields

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());
}
Also used : ProtocolMatchFields(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFields) ByteBuf(io.netty.buffer.ByteBuf) Test(org.junit.Test)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)4 Test (org.junit.Test)4 ProtocolMatchFields (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFields)4 ProtocolMatchFieldsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFieldsBuilder)4 ArrayList (java.util.ArrayList)1 ConverterExtensionKey (org.opendaylight.openflowplugin.extension.api.ConverterExtensionKey)1 ExtensionConverterProvider (org.opendaylight.openflowplugin.extension.api.core.extension.ExtensionConverterProvider)1 PbbBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.protocol.match.fields.PbbBuilder)1 MatchEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry)1 GeneralExtensionListGrouping (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralExtensionListGrouping)1 ExtensionList (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.list.grouping.ExtensionList)1