use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInputBuilder 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();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInputBuilder 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);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInputBuilder 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();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInputBuilder 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);
}
Aggregations