Search in sources :

Example 1 with MultipartRequestAggregate

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

the class FlowCreatorUtilTest method testSetWildcardedFlowMatch_.

/**
 * Test method for
 * {@link FlowCreatorUtil#setWildcardedFlowMatch(short version, MultipartRequestAggregateBuilder aggregateBuilder)}.
 */
@Test
public void testSetWildcardedFlowMatch_() {
    MultipartRequestAggregateBuilder multipartRequestAggregateBuilder = new MultipartRequestAggregateBuilder();
    FlowCreatorUtil.setWildcardedFlowMatch(OFConstants.OFP_VERSION_1_0, multipartRequestAggregateBuilder);
    MultipartRequestAggregate multipartRequestAggregate = multipartRequestAggregateBuilder.build();
    assertMatch(multipartRequestAggregate.getMatchV10());
    multipartRequestAggregateBuilder = new MultipartRequestAggregateBuilder();
    FlowCreatorUtil.setWildcardedFlowMatch(OFConstants.OFP_VERSION_1_3, multipartRequestAggregateBuilder);
    multipartRequestAggregate = multipartRequestAggregateBuilder.build();
    assertMatch(multipartRequestAggregate.getMatch());
}
Also used : MultipartRequestAggregateBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.aggregate._case.MultipartRequestAggregateBuilder) MultipartRequestAggregate(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.aggregate._case.MultipartRequestAggregate) Test(org.junit.Test)

Example 2 with MultipartRequestAggregate

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

the class MultipartRequestInputFactory method serializeAggregateBody.

private void serializeAggregateBody(final MultipartRequestBody multipartRequestBody, final ByteBuf output) {
    MultipartRequestAggregateCase aggregateCase = (MultipartRequestAggregateCase) multipartRequestBody;
    MultipartRequestAggregate aggregate = aggregateCase.getMultipartRequestAggregate();
    output.writeByte(aggregate.getTableId().byteValue());
    output.writeZero(PADDING_IN_MULTIPART_REQUEST_AGREGGATE_BODY_01);
    output.writeInt(aggregate.getOutPort().intValue());
    output.writeInt(aggregate.getOutGroup().intValue());
    output.writeZero(PADDING_IN_MULTIPART_REQUEST_AGREGGATE_BODY_02);
    output.writeLong(aggregate.getCookie().longValue());
    output.writeLong(aggregate.getCookieMask().longValue());
    OFSerializer<Match> serializer = registry.getSerializer(new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, Match.class));
    serializer.serialize(aggregate.getMatch(), output);
}
Also used : MultipartRequestAggregate(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.aggregate._case.MultipartRequestAggregate) MultipartRequestAggregateCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestAggregateCase) Match(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match)

Example 3 with MultipartRequestAggregate

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

the class OF10StatsRequestInputFactory method serializeAggregateBody.

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

Aggregations

MultipartRequestAggregate (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.aggregate._case.MultipartRequestAggregate)3 MultipartRequestAggregateCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestAggregateCase)2 Test (org.junit.Test)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 MultipartRequestAggregateBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.aggregate._case.MultipartRequestAggregateBuilder)1