Search in sources :

Example 1 with MultipartRequestAggregateCase

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

the class MultipartRequestInputMessageFactory method setAggregate.

private MultipartRequestAggregateCase setAggregate(ByteBuf input) {
    final MultipartRequestAggregateCaseBuilder caseBuilder = new MultipartRequestAggregateCaseBuilder();
    MultipartRequestAggregateBuilder aggregateBuilder = new MultipartRequestAggregateBuilder();
    aggregateBuilder.setTableId(input.readUnsignedByte());
    input.skipBytes(AGGREGATE_PADDING_1);
    aggregateBuilder.setOutPort(input.readUnsignedInt());
    aggregateBuilder.setOutGroup(input.readUnsignedInt());
    input.skipBytes(AGGREGATE_PADDING_2);
    byte[] cookie = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
    input.readBytes(cookie);
    aggregateBuilder.setCookie(new BigInteger(1, cookie));
    final byte[] cookieMask = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
    input.readBytes(cookieMask);
    aggregateBuilder.setCookieMask(new BigInteger(1, cookieMask));
    OFDeserializer<Match> matchDeserializer = registry.getDeserializer(new MessageCodeKey(EncodeConstants.OF13_VERSION_ID, EncodeConstants.EMPTY_VALUE, Match.class));
    aggregateBuilder.setMatch(matchDeserializer.deserialize(input));
    caseBuilder.setMultipartRequestAggregate(aggregateBuilder.build());
    return caseBuilder.build();
}
Also used : MessageCodeKey(org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey) MultipartRequestAggregateBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.aggregate._case.MultipartRequestAggregateBuilder) BigInteger(java.math.BigInteger) MultipartRequestAggregateCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestAggregateCaseBuilder) Match(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match)

Example 2 with MultipartRequestAggregateCase

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

the class OF10StatsRequestInputFactory method setAggregate.

private MultipartRequestAggregateCase setAggregate(ByteBuf input) {
    final MultipartRequestAggregateCaseBuilder caseBuilder = new MultipartRequestAggregateCaseBuilder();
    MultipartRequestAggregateBuilder aggregateBuilder = new MultipartRequestAggregateBuilder();
    OFDeserializer<MatchV10> matchDeserializer = registry.getDeserializer(new MessageCodeKey(EncodeConstants.OF10_VERSION_ID, EncodeConstants.EMPTY_VALUE, MatchV10.class));
    aggregateBuilder.setMatchV10(matchDeserializer.deserialize(input));
    aggregateBuilder.setTableId(input.readUnsignedByte());
    input.skipBytes(AGGREGATE_PADDING_1);
    aggregateBuilder.setOutPort((long) input.readUnsignedShort());
    caseBuilder.setMultipartRequestAggregate(aggregateBuilder.build());
    return caseBuilder.build();
}
Also used : MessageCodeKey(org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey) MultipartRequestAggregateBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.aggregate._case.MultipartRequestAggregateBuilder) MultipartRequestAggregateCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestAggregateCaseBuilder) MatchV10(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10)

Example 3 with MultipartRequestAggregateCase

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

the class MultipartRequestInputFactoryTest method decodeRequestAggregate.

private static MultipartRequestAggregateCase decodeRequestAggregate(ByteBuf output) {
    final MultipartRequestAggregateCaseBuilder caseBuilder = new MultipartRequestAggregateCaseBuilder();
    MultipartRequestAggregateBuilder builder = new MultipartRequestAggregateBuilder();
    builder.setTableId(output.readUnsignedByte());
    output.skipBytes(PADDING_IN_MULTIPART_REQUEST_AGGREGATE_BODY_01);
    builder.setOutPort(output.readUnsignedInt());
    builder.setOutGroup(output.readUnsignedInt());
    output.skipBytes(PADDING_IN_MULTIPART_REQUEST_AGGREGATE_BODY_02);
    byte[] cookie = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
    output.readBytes(cookie);
    builder.setCookie(new BigInteger(1, cookie));
    byte[] cookieMask = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
    output.readBytes(cookieMask);
    builder.setCookieMask(new BigInteger(1, cookieMask));
    caseBuilder.setMultipartRequestAggregate(builder.build());
    return caseBuilder.build();
}
Also used : MultipartRequestAggregateBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.aggregate._case.MultipartRequestAggregateBuilder) BigInteger(java.math.BigInteger) MultipartRequestAggregateCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestAggregateCaseBuilder)

Example 4 with MultipartRequestAggregateCase

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

the class MultipartRequestInputFactoryTest method createRequestAggregate.

private static MultipartRequestAggregateCase createRequestAggregate() {
    final MultipartRequestAggregateCaseBuilder caseBuilder = new MultipartRequestAggregateCaseBuilder();
    MultipartRequestAggregateBuilder builder = new MultipartRequestAggregateBuilder();
    builder.setTableId((short) 8);
    builder.setOutPort(85L);
    builder.setOutGroup(95L);
    byte[] cookie = new byte[] { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 };
    builder.setCookie(new BigInteger(1, cookie));
    byte[] cookieMask = new byte[] { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 };
    builder.setCookieMask(new BigInteger(1, cookieMask));
    caseBuilder.setMultipartRequestAggregate(builder.build());
    // TODO match field
    return caseBuilder.build();
}
Also used : MultipartRequestAggregateBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.aggregate._case.MultipartRequestAggregateBuilder) BigInteger(java.math.BigInteger) MultipartRequestAggregateCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestAggregateCaseBuilder)

Example 5 with MultipartRequestAggregateCase

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

the class MultipartRequestAggregateInputMessageFactoryTest method createRequestAggregate.

private static MultipartRequestAggregateCase createRequestAggregate() {
    final MultipartRequestAggregateCaseBuilder caseBuilder = new MultipartRequestAggregateCaseBuilder();
    MultipartRequestAggregateBuilder builder = new MultipartRequestAggregateBuilder();
    builder.setTableId((short) 8);
    builder.setOutPort(85L);
    builder.setOutGroup(95L);
    byte[] cookie = new byte[] { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 };
    builder.setCookie(new BigInteger(1, cookie));
    byte[] cookieMask = new byte[] { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 };
    builder.setCookieMask(new BigInteger(1, cookieMask));
    caseBuilder.setMultipartRequestAggregate(builder.build());
    return caseBuilder.build();
}
Also used : MultipartRequestAggregateBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.aggregate._case.MultipartRequestAggregateBuilder) BigInteger(java.math.BigInteger) MultipartRequestAggregateCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestAggregateCaseBuilder)

Aggregations

MultipartRequestAggregateCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestAggregateCaseBuilder)5 MultipartRequestAggregateBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.aggregate._case.MultipartRequestAggregateBuilder)5 BigInteger (java.math.BigInteger)4 MessageCodeKey (org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey)2 Match (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match)2 MatchV10 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10)2 MultipartRequestAggregateCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestAggregateCase)2 MultipartRequestAggregate (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.aggregate._case.MultipartRequestAggregate)2