Search in sources :

Example 6 with MatchV10

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10 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 7 with MatchV10

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10 in project openflowplugin by opendaylight.

the class OF10StatsRequestInputFactory method setFlow.

private MultipartRequestFlowCase setFlow(ByteBuf input) {
    final MultipartRequestFlowCaseBuilder caseBuilder = new MultipartRequestFlowCaseBuilder();
    MultipartRequestFlowBuilder flowBuilder = new MultipartRequestFlowBuilder();
    OFDeserializer<MatchV10> matchDeserializer = registry.getDeserializer(new MessageCodeKey(EncodeConstants.OF10_VERSION_ID, EncodeConstants.EMPTY_VALUE, MatchV10.class));
    flowBuilder.setMatchV10(matchDeserializer.deserialize(input));
    flowBuilder.setTableId(input.readUnsignedByte());
    input.skipBytes(FLOW_PADDING_1);
    flowBuilder.setOutPort((long) input.readUnsignedShort());
    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) MatchV10(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10)

Example 8 with MatchV10

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10 in project openflowplugin by opendaylight.

the class FlowCreatorUtil method createWildcardedMatchV10.

/**
 * Method creates openflow 1.0 format match, that can match all the flow entries.
 *
 * @return V10 Match object
 */
public static MatchV10 createWildcardedMatchV10() {
    MatchV10Builder builder = new MatchV10Builder();
    builder.setWildcards(new FlowWildcardsV10(true, true, true, true, true, true, true, true, true, true));
    builder.setNwSrcMask((short) 0);
    builder.setNwDstMask((short) 0);
    builder.setInPort(0);
    builder.setDlSrc(new MacAddress("00:00:00:00:00:00"));
    builder.setDlDst(new MacAddress("00:00:00:00:00:00"));
    builder.setDlVlan(0);
    builder.setDlVlanPcp((short) 0);
    builder.setDlType(0);
    builder.setNwTos((short) 0);
    builder.setNwProto((short) 0);
    builder.setNwSrc(new Ipv4Address("0.0.0.0"));
    builder.setNwDst(new Ipv4Address("0.0.0.0"));
    builder.setTpSrc(0);
    builder.setTpDst(0);
    return builder.build();
}
Also used : FlowWildcardsV10(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowWildcardsV10) 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 9 with MatchV10

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10 in project openflowplugin by opendaylight.

the class DeserializerRegistryImplTest method testGetDeserializer.

/**
 * Test - get deserializer.
 */
@Test(expected = IllegalStateException.class)
public void testGetDeserializer() {
    DeserializerRegistryImpl registry = new DeserializerRegistryImpl();
    registry.init();
    registry.getDeserializer(new MessageCodeKey((short) 5000, EncodeConstants.EMPTY_VALUE, MatchV10.class));
    Assert.fail();
}
Also used : MessageCodeKey(org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey) MatchV10(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10) Test(org.junit.Test)

Example 10 with MatchV10

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10 in project openflowplugin by opendaylight.

the class MatchInjector method addInjectors.

private static void addInjectors(final Map<ConvertorKey, ResultInjector<?, ?>> injectionMapping) {
    // OF-1.3|List<MatchEntries> --> FlowModInputBuilder
    injectionMapping.put(new ConvertorKey(OFConstants.OFP_VERSION_1_3, FlowModInputBuilder.class), (ResultInjector<List<MatchEntry>, FlowModInputBuilder>) (value, target) -> target.setMatch(wrapMatchV13(value).build()));
    // OF-1.3|List<MatchEntries> --> OxmFieldsActionBuilder
    injectionMapping.put(new ConvertorKey(OFConstants.OFP_VERSION_1_3, SetFieldActionBuilder.class), (ResultInjector<List<MatchEntry>, SetFieldActionBuilder>) (value, target) -> target.setMatchEntry(value));
    // OF-1.0|MatchV10Builder --> FlowModInputBuilder
    injectionMapping.put(new ConvertorKey(OFConstants.OFP_VERSION_1_0, FlowModInputBuilder.class), (ResultInjector<MatchV10, FlowModInputBuilder>) (value, target) -> target.setMatchV10(value));
    // OF-1.3|List<MatchEntries> --> MultipartRequestFlowBuilder
    injectionMapping.put(new ConvertorKey(OFConstants.OFP_VERSION_1_3, MultipartRequestFlowBuilder.class), (ResultInjector<List<MatchEntry>, MultipartRequestFlowBuilder>) (value, target) -> target.setMatch(wrapMatchV13(value).build()));
    // OF-1.0|List<MatchEntries> --> MultipartRequestFlowBuilder
    injectionMapping.put(new ConvertorKey(OFConstants.OFP_VERSION_1_0, MultipartRequestFlowBuilder.class), (ResultInjector<MatchV10, MultipartRequestFlowBuilder>) (value, target) -> target.setMatchV10(value));
    // OF-1.3|List<MatchEntries> --> MultipartRequestAggregateBuilder
    injectionMapping.put(new ConvertorKey(OFConstants.OFP_VERSION_1_3, MultipartRequestAggregateBuilder.class), (ResultInjector<List<MatchEntry>, MultipartRequestAggregateBuilder>) (value, target) -> target.setMatch(wrapMatchV13(value).build()));
    // OF-1.0|List<MatchEntries> --> MultipartRequestAggregateBuilder
    injectionMapping.put(new ConvertorKey(OFConstants.OFP_VERSION_1_0, MultipartRequestAggregateBuilder.class), (ResultInjector<MatchV10, MultipartRequestAggregateBuilder>) (value, target) -> target.setMatchV10(value));
}
Also used : MultipartRequestAggregateBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.aggregate._case.MultipartRequestAggregateBuilder) ConvertorKey(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.ConvertorKey) HashMap(java.util.HashMap) OFConstants(org.opendaylight.openflowplugin.api.OFConstants) List(java.util.List) MatchEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry) EncodeConstants(org.opendaylight.openflowjava.protocol.api.util.EncodeConstants) Map(java.util.Map) SetFieldActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.field._case.SetFieldActionBuilder) Optional(java.util.Optional) MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder) MatchV10(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10) ResultInjector(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.ResultInjector) MultipartRequestFlowBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlowBuilder) FlowModInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInputBuilder) FlowConvertor(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.flow.FlowConvertor) MultipartRequestAggregateBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.aggregate._case.MultipartRequestAggregateBuilder) MultipartRequestFlowBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlowBuilder) ConvertorKey(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.ConvertorKey) List(java.util.List) SetFieldActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.field._case.SetFieldActionBuilder) FlowModInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInputBuilder) MatchV10(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10)

Aggregations

MatchV10 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10)27 Test (org.junit.Test)16 FlowWildcardsV10 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowWildcardsV10)16 MatchV10Builder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10Builder)15 BigInteger (java.math.BigInteger)12 Match (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match)10 EthernetMatch (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatch)10 IpMatch (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatch)10 Ipv4Match (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4Match)10 VersionDatapathIdConvertorData (org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionDatapathIdConvertorData)9 Icmpv4Match (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4Match)9 TcpMatch (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatch)9 UdpMatch (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatch)9 Ipv4Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)8 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)8 MessageCodeKey (org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey)7 ByteBuf (io.netty.buffer.ByteBuf)5 SuppressFBWarnings (edu.umd.cs.findbugs.annotations.SuppressFBWarnings)2 CodeKeyMaker (org.opendaylight.openflowjava.protocol.impl.util.CodeKeyMaker)2 VersionConvertorData (org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionConvertorData)2