Search in sources :

Example 6 with MultipartRequestFlowBuilder

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();
}
Also used : 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) BigInteger(java.math.BigInteger)

Example 7 with MultipartRequestFlowBuilder

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());
}
Also used : MultipartRequestFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlow) MultipartRequestFlowBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlowBuilder) Test(org.junit.Test)

Example 8 with MultipartRequestFlowBuilder

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();
}
Also used : MessageCodeKey(org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey) 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) BigInteger(java.math.BigInteger) Match(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match)

Example 9 with MultipartRequestFlowBuilder

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();
}
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 10 with MultipartRequestFlowBuilder

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();
}
Also used : 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) BigInteger(java.math.BigInteger)

Aggregations

MultipartRequestFlowBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlowBuilder)14 MultipartRequestFlowCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestFlowCaseBuilder)12 BigInteger (java.math.BigInteger)4 MatchV10Builder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10Builder)4 MultipartRequestInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInputBuilder)4 Test (org.junit.Test)3 Ipv4Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)3 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)3 FlowWildcardsV10 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowWildcardsV10)3 ByteBuf (io.netty.buffer.ByteBuf)2 MessageCodeKey (org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey)2 MultipartRequestFlags (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartRequestFlags)2 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder)2 MatchV10 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10)2 MultipartRequestInput (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput)2 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 EncodeConstants (org.opendaylight.openflowjava.protocol.api.util.EncodeConstants)1