use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.queue._case.MultipartRequestQueue in project openflowplugin by opendaylight.
the class MultipartRequestInputFactory method serializeQueueBody.
private static void serializeQueueBody(final MultipartRequestBody multipartRequestBody, final ByteBuf output) {
MultipartRequestQueueCase queueCase = (MultipartRequestQueueCase) multipartRequestBody;
MultipartRequestQueue queue = queueCase.getMultipartRequestQueue();
output.writeInt(queue.getPortNo().intValue());
output.writeInt(queue.getQueueId().intValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.queue._case.MultipartRequestQueue in project openflowplugin by opendaylight.
the class OF10StatsRequestInputFactory method serializeQueueBody.
private static void serializeQueueBody(final MultipartRequestBody multipartRequestBody, final ByteBuf output) {
MultipartRequestQueueCase queueCase = (MultipartRequestQueueCase) multipartRequestBody;
MultipartRequestQueue queue = queueCase.getMultipartRequestQueue();
output.writeShort(queue.getPortNo().intValue());
output.writeZero(PADING_IN_QUEUE_BODY);
output.writeInt(queue.getQueueId().intValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.queue._case.MultipartRequestQueue in project openflowplugin by opendaylight.
the class MultipartRequestInputFactoryTest method testMakeMultipartRequestInputQueue.
@Test
public void testMakeMultipartRequestInputQueue() throws Exception {
final MultipartType mpType = MultipartType.OFPMPQUEUE;
final MultipartRequestInput mpRqInput = (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
checkHeader(mpRqInput, mpType);
final MultipartRequestBody mpRqBody = mpRqInput.getMultipartRequestBody();
Assert.assertTrue(mpRqBody instanceof MultipartRequestQueueCase);
MultipartRequestQueue mpRq = ((MultipartRequestQueueCase) mpRqBody).getMultipartRequestQueue();
Assert.assertEquals(OFConstants.OFPP_ANY, mpRq.getPortNo());
Assert.assertEquals(OFConstants.OFPQ_ALL, mpRq.getQueueId());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.queue._case.MultipartRequestQueue in project openflowplugin by opendaylight.
the class QueueDirectStatisticsServiceTest method testBuildRequestBody.
@Override
public void testBuildRequestBody() throws Exception {
final GetQueueStatisticsInput input = mock(GetQueueStatisticsInput.class);
when(input.getNode()).thenReturn(createNodeRef(NODE_ID));
when(input.getQueueId()).thenReturn(new QueueId(QUEUE_NO));
when(input.getNodeConnectorId()).thenReturn(new NodeConnectorId(NODE_ID + ":" + PORT_NO));
final MultipartRequestQueueCase body = (MultipartRequestQueueCase) ((MultipartRequestInput) service.buildRequest(new Xid(42L), input)).getMultipartRequestBody();
final MultipartRequestQueue queue = body.getMultipartRequestQueue();
assertEquals(PORT_NO, queue.getPortNo());
assertEquals(QUEUE_NO, queue.getQueueId());
}
Aggregations