Search in sources :

Example 1 with GetQueueConfigInput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput in project openflowplugin by opendaylight.

the class OF10GetQueueConfigInputMessageFactory method deserialize.

@Override
public GetQueueConfigInput deserialize(ByteBuf rawMessage) {
    GetQueueConfigInputBuilder builder = new GetQueueConfigInputBuilder();
    builder.setVersion((short) EncodeConstants.OF10_VERSION_ID);
    builder.setXid(rawMessage.readUnsignedInt());
    builder.setPort(new PortNumber((long) rawMessage.readUnsignedShort()));
    return builder.build();
}
Also used : GetQueueConfigInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInputBuilder) PortNumber(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber)

Example 2 with GetQueueConfigInput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput in project openflowplugin by opendaylight.

the class OF10GetQueueConfigInputMessageFactoryTest method test.

@Test
public void test() {
    ByteBuf bb = BufferHelper.buildBuffer("19 fd 00 00");
    GetQueueConfigInput deserializedMessage = BufferHelper.deserialize(factory, bb);
    BufferHelper.checkHeaderV10(deserializedMessage);
    Assert.assertEquals("Wrong port", new PortNumber(6653L), deserializedMessage.getPort());
}
Also used : GetQueueConfigInput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput) ByteBuf(io.netty.buffer.ByteBuf) PortNumber(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber) Test(org.junit.Test)

Example 3 with GetQueueConfigInput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput in project openflowplugin by opendaylight.

the class GetQueueConfigInputMessageFactoryTest method testGetQueueConfigInputMessage.

/**
 * Testing of {@link GetQueueConfigInputMessageFactory} for correct translation from POJO.
 */
@Test
public void testGetQueueConfigInputMessage() throws Exception {
    GetQueueConfigInputBuilder builder = new GetQueueConfigInputBuilder();
    BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
    builder.setPort(new PortNumber(0x00010203L));
    GetQueueConfigInput message = builder.build();
    ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
    getQueueFactory.serialize(message, out);
    BufferHelper.checkHeaderV13(out, GET_QUEUE_CONFIG_INPUT_MESSAGE_CODE_TYPE, 16);
    Assert.assertEquals("Wrong port", 0x00010203, out.readUnsignedInt());
    out.skipBytes(PADDING_IN_QUEUE_CONFIG_INPUT_MESSAGE);
}
Also used : GetQueueConfigInput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput) GetQueueConfigInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInputBuilder) PortNumber(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber) ByteBuf(io.netty.buffer.ByteBuf) Test(org.junit.Test)

Example 4 with GetQueueConfigInput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput in project openflowplugin by opendaylight.

the class GetQueueConfigInputMessageFactory method deserialize.

@Override
public GetQueueConfigInput deserialize(ByteBuf rawMessage) {
    GetQueueConfigInputBuilder builder = new GetQueueConfigInputBuilder();
    builder.setVersion((short) EncodeConstants.OF13_VERSION_ID);
    builder.setXid(rawMessage.readUnsignedInt());
    builder.setPort(new PortNumber(rawMessage.readUnsignedInt()));
    return builder.build();
}
Also used : GetQueueConfigInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInputBuilder) PortNumber(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber)

Example 5 with GetQueueConfigInput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput in project openflowplugin by opendaylight.

the class OF10QueueGetConfigInputMessageFactoryTest method test.

/**
 * Testing of {@link OF10QueueGetConfigInputMessageFactory} for correct translation from POJO.
 */
@Test
public void test() throws Exception {
    GetQueueConfigInputBuilder builder = new GetQueueConfigInputBuilder();
    BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
    builder.setPort(new PortNumber(6653L));
    GetQueueConfigInput message = builder.build();
    ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
    queueFactory.serialize(message, out);
    BufferHelper.checkHeaderV10(out, (byte) 20, 12);
    Assert.assertEquals("Wrong port", 6653L, out.readUnsignedShort());
    out.skipBytes(2);
}
Also used : GetQueueConfigInput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput) GetQueueConfigInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInputBuilder) PortNumber(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber) ByteBuf(io.netty.buffer.ByteBuf) Test(org.junit.Test)

Aggregations

PortNumber (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber)6 ByteBuf (io.netty.buffer.ByteBuf)4 Test (org.junit.Test)4 GetQueueConfigInput (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput)4 GetQueueConfigInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInputBuilder)4