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();
}
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);
}
Aggregations