use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlowBuilder in project openflowplugin by opendaylight.
the class MultipartRequestFlowInputMessageFactoryTest method createRequestFlow.
private static MultipartRequestFlowCase createRequestFlow() {
final MultipartRequestFlowCaseBuilder caseBuilder = new MultipartRequestFlowCaseBuilder();
MultipartRequestFlowBuilder builder = new MultipartRequestFlowBuilder();
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.setMultipartRequestFlow(builder.build());
return caseBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlowBuilder 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());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlowBuilder in project openflowplugin by opendaylight.
the class MultipartRequestInputMessageFactory method setFlow.
private MultipartRequestFlowCase setFlow(ByteBuf input) {
final MultipartRequestFlowCaseBuilder caseBuilder = new MultipartRequestFlowCaseBuilder();
MultipartRequestFlowBuilder flowBuilder = new MultipartRequestFlowBuilder();
flowBuilder.setTableId(input.readUnsignedByte());
input.skipBytes(FLOW_PADDING_1);
flowBuilder.setOutPort(input.readUnsignedInt());
flowBuilder.setOutGroup(input.readUnsignedInt());
input.skipBytes(FLOW_PADDING_2);
byte[] cookie = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
input.readBytes(cookie);
flowBuilder.setCookie(new BigInteger(1, cookie));
final byte[] cookieMask = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
input.readBytes(cookieMask);
flowBuilder.setCookieMask(new BigInteger(1, cookieMask));
OFDeserializer<Match> matchDeserializer = registry.getDeserializer(new MessageCodeKey(EncodeConstants.OF13_VERSION_ID, EncodeConstants.EMPTY_VALUE, Match.class));
flowBuilder.setMatch(matchDeserializer.deserialize(input));
caseBuilder.setMultipartRequestFlow(flowBuilder.build());
return caseBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlowBuilder 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.multipart.request.body.multipart.request.flow._case.MultipartRequestFlowBuilder in project openflowplugin by opendaylight.
the class MultipartRequestInputFactoryTest method createRequestFlow.
private static MultipartRequestFlowCase createRequestFlow() {
final MultipartRequestFlowCaseBuilder caseBuilder = new MultipartRequestFlowCaseBuilder();
MultipartRequestFlowBuilder builder = new MultipartRequestFlowBuilder();
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.setMultipartRequestFlow(builder.build());
// TODO match field
return caseBuilder.build();
}
Aggregations