Search in sources :

Example 1 with MultipartRequestFlow

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlow in project openflowplugin by opendaylight.

the class MultipartRequestInputFactory method serializeFlowBody.

private void serializeFlowBody(final MultipartRequestBody multipartRequestBody, final ByteBuf output) {
    MultipartRequestFlowCase flowCase = (MultipartRequestFlowCase) multipartRequestBody;
    MultipartRequestFlow flow = flowCase.getMultipartRequestFlow();
    output.writeByte(flow.getTableId().byteValue());
    output.writeZero(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_01);
    output.writeInt(flow.getOutPort().intValue());
    output.writeInt(flow.getOutGroup().intValue());
    output.writeZero(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_02);
    output.writeLong(flow.getCookie().longValue());
    output.writeLong(flow.getCookieMask().longValue());
    OFSerializer<Match> serializer = registry.getSerializer(new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, Match.class));
    serializer.serialize(flow.getMatch(), output);
}
Also used : MultipartRequestFlowCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestFlowCase) MultipartRequestFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlow) Match(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match)

Example 2 with MultipartRequestFlow

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlow in project openflowplugin by opendaylight.

the class MultipartRequestInputFactoryTest method testMakeMultipartRequestInput_FLOW_10.

@Test
public void testMakeMultipartRequestInput_FLOW_10() throws Exception {
    final MultipartType mpType = MultipartType.OFPMPFLOW;
    ofVersion = OFConstants.OFP_VERSION_1_0;
    final MultipartRequestInput mpRqInput = (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
    checkHeader(mpRqInput, mpType);
    final MultipartRequestBody mpRqBody = mpRqInput.getMultipartRequestBody();
    Assert.assertTrue(mpRqBody instanceof MultipartRequestFlowCase);
    MultipartRequestFlow mpRq = ((MultipartRequestFlowCase) mpRqBody).getMultipartRequestFlow();
    Assert.assertEquals(OFConstants.OFPTT_ALL, mpRq.getTableId());
    Assert.assertEquals(OFConstants.OFPP_ANY, mpRq.getOutPort());
    Assert.assertEquals(OFConstants.OFPG_ANY, mpRq.getOutGroup());
    Assert.assertEquals(0, mpRq.getCookie().intValue());
    Assert.assertEquals(0, mpRq.getCookieMask().intValue());
    Assert.assertNull(mpRq.getMatch());
    Assert.assertNotNull(mpRq.getMatchV10());
}
Also used : MultipartRequestFlowCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestFlowCase) MultipartRequestFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlow) MultipartType(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType) MultipartRequestBody(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.MultipartRequestBody) MultipartRequestInput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput) Test(org.junit.Test)

Example 3 with MultipartRequestFlow

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlow in project openflowplugin by opendaylight.

the class MultipartRequestInputFactoryTest method testMakeMultipartRequestInput_FLOW_13.

@Test
public void testMakeMultipartRequestInput_FLOW_13() throws Exception {
    final MultipartType mpType = MultipartType.OFPMPFLOW;
    final MultipartRequestInput mpRqInput = (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
    checkHeader(mpRqInput, mpType);
    final MultipartRequestBody mpRqBody = mpRqInput.getMultipartRequestBody();
    Assert.assertTrue(mpRqBody instanceof MultipartRequestFlowCase);
    MultipartRequestFlow mpRq = ((MultipartRequestFlowCase) mpRqBody).getMultipartRequestFlow();
    Assert.assertEquals(OFConstants.OFPTT_ALL, mpRq.getTableId());
    Assert.assertEquals(OFConstants.OFPP_ANY, mpRq.getOutPort());
    Assert.assertEquals(OFConstants.OFPG_ANY, mpRq.getOutGroup());
    Assert.assertEquals(0, mpRq.getCookie().intValue());
    Assert.assertEquals(0, mpRq.getCookieMask().intValue());
    Assert.assertNotNull(mpRq.getMatch());
    Assert.assertNull(mpRq.getMatchV10());
    Assert.assertEquals(OxmMatchType.class, mpRq.getMatch().getType());
}
Also used : MultipartRequestFlowCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestFlowCase) MultipartRequestFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlow) MultipartType(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType) MultipartRequestBody(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.MultipartRequestBody) MultipartRequestInput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput) Test(org.junit.Test)

Example 4 with MultipartRequestFlow

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlow in project openflowplugin by opendaylight.

the class FlowCreatorUtilTest method testSetWildcardedFlowMatch_1_0.

/**
 * Test method for
 * {@link FlowCreatorUtil#setWildcardedFlowMatch(short version, MultipartRequestFlowBuilder flowBuilder)}.
 */
@Test
public void testSetWildcardedFlowMatch_1_0() {
    MultipartRequestFlowBuilder multipartRequestFlowBuilder = new MultipartRequestFlowBuilder();
    FlowCreatorUtil.setWildcardedFlowMatch(OFConstants.OFP_VERSION_1_0, multipartRequestFlowBuilder);
    MultipartRequestFlow multipartRequestFlow = multipartRequestFlowBuilder.build();
    assertMatch(multipartRequestFlow.getMatchV10());
    multipartRequestFlowBuilder = new MultipartRequestFlowBuilder();
    FlowCreatorUtil.setWildcardedFlowMatch(OFConstants.OFP_VERSION_1_3, multipartRequestFlowBuilder);
    multipartRequestFlow = multipartRequestFlowBuilder.build();
    assertMatch(multipartRequestFlow.getMatch());
}
Also used : MultipartRequestFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlow) MultipartRequestFlowBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlowBuilder) Test(org.junit.Test)

Example 5 with MultipartRequestFlow

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlow in project openflowplugin by opendaylight.

the class OF10StatsRequestInputFactory method serializeFlowBody.

private void serializeFlowBody(final MultipartRequestBody multipartRequestBody, final ByteBuf output) {
    MultipartRequestFlowCase flowCase = (MultipartRequestFlowCase) multipartRequestBody;
    MultipartRequestFlow flow = flowCase.getMultipartRequestFlow();
    OFSerializer<MatchV10> matchSerializer = registry.getSerializer(new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, MatchV10.class));
    matchSerializer.serialize(flow.getMatchV10(), output);
    output.writeByte(flow.getTableId().shortValue());
    output.writeZero(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY);
    output.writeShort(flow.getOutPort().intValue());
}
Also used : MultipartRequestFlowCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestFlowCase) MultipartRequestFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlow) MatchV10(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10)

Aggregations

MultipartRequestFlow (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlow)6 MultipartRequestFlowCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestFlowCase)5 Test (org.junit.Test)3 MultipartType (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType)2 MultipartRequestInput (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput)2 MultipartRequestBody (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.MultipartRequestBody)2 Xid (org.opendaylight.openflowplugin.api.openflow.device.Xid)1 GetFlowStatisticsInput (org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetFlowStatisticsInput)1 Match (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match)1 MatchV10 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10)1 MultipartRequestFlowBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlowBuilder)1