Search in sources :

Example 31 with MultipartRequestBody

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

the class OF10StatsRequestInputFlowFactoryTest method createMultipartRequestBody.

private static MultipartRequestBody createMultipartRequestBody() {
    final MultipartRequestFlowCaseBuilder caseBuilder = new MultipartRequestFlowCaseBuilder();
    final MultipartRequestFlowBuilder flowBuilder = new MultipartRequestFlowBuilder();
    MatchV10Builder matchBuilder = new MatchV10Builder();
    matchBuilder.setWildcards(new FlowWildcardsV10(true, true, true, true, true, true, true, true, true, true));
    matchBuilder.setNwSrcMask((short) 8);
    matchBuilder.setNwDstMask((short) 16);
    matchBuilder.setInPort(51);
    matchBuilder.setDlSrc(new MacAddress("00:01:02:03:04:05"));
    matchBuilder.setDlDst(new MacAddress("05:04:03:02:01:00"));
    matchBuilder.setDlVlan(52);
    matchBuilder.setDlVlanPcp((short) 53);
    matchBuilder.setDlType(54);
    matchBuilder.setNwTos((short) 55);
    matchBuilder.setNwProto((short) 56);
    matchBuilder.setNwSrc(new Ipv4Address("10.0.0.1"));
    matchBuilder.setNwDst(new Ipv4Address("10.0.0.2"));
    matchBuilder.setTpSrc(57);
    matchBuilder.setTpDst(58);
    flowBuilder.setMatchV10(matchBuilder.build());
    flowBuilder.setTableId((short) 1);
    flowBuilder.setOutPort(42L);
    caseBuilder.setMultipartRequestFlow(flowBuilder.build());
    return caseBuilder.build();
}
Also used : FlowWildcardsV10(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowWildcardsV10) MultipartRequestFlowCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestFlowCaseBuilder) MultipartRequestFlowBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlowBuilder) MatchV10Builder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10Builder) MacAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress) Ipv4Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)

Example 32 with MultipartRequestBody

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

the class MultipartRequestMessageSerializer method serialize.

@Override
public void serialize(final MultipartRequest message, final ByteBuf outBuffer) {
    final MultipartRequestBody multipartRequestBody = message.getMultipartRequestBody();
    final MultipartType multipartType = getMultipartType(multipartRequestBody);
    final int index = outBuffer.writerIndex();
    super.serialize(message, outBuffer);
    outBuffer.writeShort(multipartType.getIntValue());
    outBuffer.writeShort(ByteBufUtils.fillBitMask(0, message.isRequestMore()));
    outBuffer.writeZero(PADDING_IN_MULTIPART_REQUEST_MESSAGE);
    final OFSerializer<MultipartRequestBody> serializer = Preconditions.checkNotNull(registry).getSerializer(new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, multipartRequestBody.getImplementedInterface()));
    serializer.serialize(multipartRequestBody, outBuffer);
    outBuffer.setShort(index + 2, outBuffer.writerIndex() - index);
}
Also used : MultipartType(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType) MultipartRequestBody(org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody)

Aggregations

MultipartType (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType)10 Test (org.junit.Test)8 MultipartRequestInput (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput)8 MultipartRequestBody (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.MultipartRequestBody)8 MultipartRequestDescCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestDescCaseBuilder)3 MultipartRequestFlowCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestFlowCase)3 MultipartRequestQueueCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestQueueCase)3 MultipartRequestFlow (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlow)3 MultipartRequestQueue (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.queue._case.MultipartRequestQueue)3 Ipv4Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)2 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)2 MultipartRequestDesc (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.multipart.request.multipart.request.body.MultipartRequestDesc)2 MultipartRequestPortDesc (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.multipart.request.multipart.request.body.MultipartRequestPortDesc)2 MultipartRequestFlowStats (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.MultipartRequestFlowStats)2 MultipartRequestGroupDesc (org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestGroupDesc)2 MultipartRequestGroupStats (org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestGroupStats)2 MultipartRequestBody (org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.multipart.request.MultipartRequestBody)2 MatchV10 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10)2 MatchV10Builder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10Builder)2 MultipartRequestAggregateCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestAggregateCase)2