Search in sources :

Example 1 with MatchField

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField in project openflowplugin by opendaylight.

the class MatchResponseConvertor method convert.

@Override
public MatchBuilder convert(MatchEntriesGrouping source, VersionDatapathIdConvertorData datapathIdConvertorData) {
    final MatchBuilder matchBuilder = new MatchBuilder();
    final MatchResponseConvertorData data = new MatchResponseConvertorData(datapathIdConvertorData.getVersion());
    data.setDatapathId(datapathIdConvertorData.getDatapathId());
    data.setMatchBuilder(matchBuilder);
    data.setEthernetMatchBuilder(new EthernetMatchBuilder());
    data.setVlanMatchBuilder(new VlanMatchBuilder());
    data.setIpMatchBuilder(new IpMatchBuilder());
    data.setTcpMatchBuilder(new TcpMatchBuilder());
    data.setUdpMatchBuilder(new UdpMatchBuilder());
    data.setSctpMatchBuilder(new SctpMatchBuilder());
    data.setIcmpv4MatchBuilder(new Icmpv4MatchBuilder());
    data.setIcmpv6MatchBuilder(new Icmpv6MatchBuilder());
    data.setIpv4MatchBuilder(new Ipv4MatchBuilder());
    data.setIpv4MatchArbitraryBitMaskBuilder(new Ipv4MatchArbitraryBitMaskBuilder());
    data.setIpv6MatchArbitraryBitMaskBuilder(new Ipv6MatchArbitraryBitMaskBuilder());
    data.setArpMatchBuilder(new ArpMatchBuilder());
    data.setIpv6MatchBuilder(new Ipv6MatchBuilder());
    data.setProtocolMatchFieldsBuilder(new ProtocolMatchFieldsBuilder());
    data.setTunnelIpv4MatchBuilder(new TunnelIpv4MatchBuilder());
    data.setTcpFlagsMatchBuilder(new TcpFlagsMatchBuilder());
    for (MatchEntry ofMatch : source.getMatchEntry()) {
        if (TunnelIpv4Dst.class.isAssignableFrom(ofMatch.getOxmMatchField()) || TunnelIpv4Src.class.isAssignableFrom(ofMatch.getOxmMatchField())) {
            /*
                 * TODO: Fix TunnelIpv4Src and Ipv4Dst, because current implementation do not work
                 * TunnelIpv4Src and TunnelIpv4Dst are not compatible with
                 * org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField
                 * and so you cannot even set them to OxmMatchField.
                 * Creation of TunnelIpv4SrcCase and TunnelIpv4DstCase in
                 * org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value
                 *     .grouping.match.entry.value
                 * and proper use of it can fix this bug.
                 */
            OF_TO_SAL_TUNNEL_PROCESSOR.process(ofMatch.getMatchEntryValue(), data, getConvertorExecutor());
        } else {
            data.setOxmMatchField(ofMatch.getOxmMatchField());
            OF_TO_SAL_PROCESSOR.process(ofMatch.getMatchEntryValue(), data, getConvertorExecutor());
        }
    }
    return matchBuilder;
}
Also used : SctpMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatchBuilder) IpMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder) TunnelIpv4MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.TunnelIpv4MatchBuilder) Ipv4MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder) MatchEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry) Ipv4MatchArbitraryBitMaskBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchArbitraryBitMaskBuilder) ProtocolMatchFieldsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFieldsBuilder) TunnelIpv4Dst(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TunnelIpv4Dst) Ipv6MatchArbitraryBitMaskBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6MatchArbitraryBitMaskBuilder) TcpFlagsMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.TcpFlagsMatchBuilder) TunnelIpv4Src(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TunnelIpv4Src) VlanMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatchBuilder) MatchResponseConvertorData(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.match.data.MatchResponseConvertorData) UdpMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatchBuilder) ArpMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatchBuilder) EthernetMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder) TcpMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatchBuilder) Icmpv4MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder) TunnelIpv4MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.TunnelIpv4MatchBuilder) ArpMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatchBuilder) Icmpv4MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder) TunnelIpv4MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.TunnelIpv4MatchBuilder) VlanMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatchBuilder) UdpMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatchBuilder) EthernetMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder) TcpFlagsMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.TcpFlagsMatchBuilder) Ipv4MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder) Ipv6MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6MatchBuilder) IpMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder) TcpMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatchBuilder) MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder) Icmpv6MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv6MatchBuilder) SctpMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatchBuilder) Icmpv6MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv6MatchBuilder) Ipv6MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6MatchBuilder)

Example 2 with MatchField

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField in project openflowplugin by opendaylight.

the class MultipartMatchFieldSerializerInjector method injectSerializers.

/**
 * Injects multipart match field serializers into provided
 * {@link org.opendaylight.openflowjava.protocol.api.extensibility.SerializerExtensionProvider}.
 *
 * @param provider OpenflowJava serializer extension provider
 */
static void injectSerializers(final SerializerExtensionProvider provider) {
    // Inject new message serializers here using injector created by createInjector method
    final Function<Class<? extends MatchField>, Consumer<OFSerializer<SetFieldMatch>>> injector = createInjector(provider, EncodeConstants.OF13_VERSION_ID);
    injector.apply(ArpOp.class).accept(new ArpOpMatchFieldSerializer());
    injector.apply(ArpSha.class).accept(new ArpShaMatchFieldSerializer());
    injector.apply(ArpSpa.class).accept(new ArpSpaMatchFieldSerializer());
    injector.apply(ArpTha.class).accept(new ArpThaMatchFieldSerializer());
    injector.apply(ArpTpa.class).accept(new ArpTpaMatchFieldSerializer());
    injector.apply(EthDst.class).accept(new EthDstMatchFieldSerializer());
    injector.apply(EthSrc.class).accept(new EthSrcMatchFieldSerializer());
    injector.apply(EthType.class).accept(new EthTypeMatchFieldSerializer());
    injector.apply(Icmpv4Code.class).accept(new Icmpv4CodeMatchFieldSerializer());
    injector.apply(Icmpv4Type.class).accept(new Icmpv4TypeMatchFieldSerializer());
    injector.apply(Icmpv6Code.class).accept(new Icmpv6CodeMatchFieldSerializer());
    injector.apply(Icmpv6Type.class).accept(new Icmpv6TypeMatchFieldSerializer());
    injector.apply(InPhyPort.class).accept(new InPhyPortMatchFieldSerializer());
    injector.apply(InPort.class).accept(new InPortMatchFieldSerializer());
    injector.apply(IpDscp.class).accept(new IpDscpMatchFieldSerializer());
    injector.apply(IpEcn.class).accept(new IpEcnMatchFieldSerializer());
    injector.apply(IpProto.class).accept(new IpProtoMatchFieldSerializer());
    injector.apply(Ipv4Dst.class).accept(new Ipv4DstMatchFieldSerializer());
    injector.apply(Ipv4Src.class).accept(new Ipv4SrcMatchFieldSerializer());
    injector.apply(Ipv6Dst.class).accept(new Ipv6DstMatchFieldSerializer());
    injector.apply(Ipv6Exthdr.class).accept(new Ipv6ExtHdrMatchFieldSerializer());
    injector.apply(Ipv6Flabel.class).accept(new Ipv6FlabelMatchFieldSerializer());
    injector.apply(Ipv6NdSll.class).accept(new Ipv6NdSllMatchFieldSerializer());
    injector.apply(Ipv6NdTarget.class).accept(new Ipv6NdTargetMatchFieldSerializer());
    injector.apply(Ipv6NdTll.class).accept(new Ipv6NdTllMatchFieldSerializer());
    injector.apply(Ipv6Src.class).accept(new Ipv6SrcMatchFieldSerializer());
    injector.apply(Metadata.class).accept(new MetadataMatchFieldSerializer());
    injector.apply(MplsBos.class).accept(new MplsBosMatchFieldSerializer());
    injector.apply(MplsLabel.class).accept(new MplsLabelMatchFieldSerializer());
    injector.apply(MplsTc.class).accept(new MplsTcMatchFieldSerializer());
    injector.apply(PbbIsid.class).accept(new PbbIsidMatchFieldSerializer());
    injector.apply(SctpDst.class).accept(new SctpDstMatchFieldSerializer());
    injector.apply(SctpSrc.class).accept(new SctpSrcMatchFieldSerializer());
    injector.apply(TcpDst.class).accept(new TcpDstMatchFieldSerializer());
    injector.apply(TcpFlags.class).accept(new TcpFlagsMatchFieldSerializer());
    injector.apply(TcpSrc.class).accept(new TcpSrcMatchFieldSerializer());
    injector.apply(TunnelId.class).accept(new TunnelIdMatchFieldSerializer());
    // TODO: Finish implementation of Tunnel Ipv4 src and dst
    injector.apply(TunnelIpv4Dst.class).accept(new Ipv4DstMatchFieldSerializer());
    injector.apply(TunnelIpv4Src.class).accept(new Ipv4SrcMatchFieldSerializer());
    injector.apply(UdpDst.class).accept(new UdpDstMatchFieldSerializer());
    injector.apply(UdpSrc.class).accept(new UdpSrcMatchFieldSerializer());
    injector.apply(VlanPcp.class).accept(new VlanPcpMatchFieldSerializer());
    injector.apply(VlanVid.class).accept(new VlanVidMatchFieldSerializer());
}
Also used : ArpSpa(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpSpa) UdpDstMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.UdpDstMatchFieldSerializer) PbbIsidMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.PbbIsidMatchFieldSerializer) IpProto(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.IpProto) Ipv6Src(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Src) Ipv6ExtHdrMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv6ExtHdrMatchFieldSerializer) ArpSha(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpSha) Icmpv6Type(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv6Type) SctpSrcMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.SctpSrcMatchFieldSerializer) Ipv4SrcMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv4SrcMatchFieldSerializer) Ipv6NdSll(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdSll) Icmpv6TypeMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Icmpv6TypeMatchFieldSerializer) SctpDst(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.SctpDst) Icmpv4CodeMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Icmpv4CodeMatchFieldSerializer) TunnelIdMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.TunnelIdMatchFieldSerializer) Consumer(java.util.function.Consumer) TcpFlagsMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.TcpFlagsMatchFieldSerializer) ArpShaMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.ArpShaMatchFieldSerializer) Icmpv4Type(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv4Type) TcpSrc(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TcpSrc) ArpThaMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.ArpThaMatchFieldSerializer) InPort(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.InPort) VlanVid(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.VlanVid) UdpDst(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.UdpDst) TunnelIpv4Dst(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TunnelIpv4Dst) InPhyPortMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.InPhyPortMatchFieldSerializer) TcpDstMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.TcpDstMatchFieldSerializer) Icmpv6CodeMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Icmpv6CodeMatchFieldSerializer) SetFieldMatch(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch) Ipv6NdSllMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv6NdSllMatchFieldSerializer) UdpSrcMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.UdpSrcMatchFieldSerializer) EthType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthType) EthTypeMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.EthTypeMatchFieldSerializer) EthSrcMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.EthSrcMatchFieldSerializer) IpEcnMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.IpEcnMatchFieldSerializer) Ipv6DstMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv6DstMatchFieldSerializer) TcpDst(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TcpDst) MplsLabelMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.MplsLabelMatchFieldSerializer) Ipv6NdTllMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv6NdTllMatchFieldSerializer) IpDscpMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.IpDscpMatchFieldSerializer) MplsTcMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.MplsTcMatchFieldSerializer) PbbIsid(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.PbbIsid) TunnelIpv4Src(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TunnelIpv4Src) Ipv4Src(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv4Src) UdpSrc(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.UdpSrc) ArpTpa(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpTpa) Metadata(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Metadata) ArpOp(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpOp) TunnelIpv4Src(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TunnelIpv4Src) Ipv6FlabelMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv6FlabelMatchFieldSerializer) ArpTha(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpTha) TunnelId(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TunnelId) VlanPcpMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.VlanPcpMatchFieldSerializer) MatchField(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MatchField) MplsBosMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.MplsBosMatchFieldSerializer) Ipv6Exthdr(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Exthdr) Ipv6NdTll(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdTll) TcpFlags(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TcpFlags) InPortMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.InPortMatchFieldSerializer) VlanVidMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.VlanVidMatchFieldSerializer) MplsBos(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MplsBos) MplsLabel(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MplsLabel) SctpDstMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.SctpDstMatchFieldSerializer) MplsTc(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MplsTc) EthDst(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthDst) EthDstMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.EthDstMatchFieldSerializer) Icmpv6Code(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv6Code) Ipv4Dst(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv4Dst) TunnelIpv4Dst(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TunnelIpv4Dst) Ipv6SrcMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv6SrcMatchFieldSerializer) Ipv6Dst(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Dst) Ipv6NdTarget(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdTarget) InPhyPort(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.InPhyPort) IpProtoMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.IpProtoMatchFieldSerializer) MetadataMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.MetadataMatchFieldSerializer) ArpTpaMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.ArpTpaMatchFieldSerializer) IpEcn(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.IpEcn) TcpSrcMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.TcpSrcMatchFieldSerializer) Icmpv4Code(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv4Code) SctpSrc(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.SctpSrc) Ipv6NdTargetMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv6NdTargetMatchFieldSerializer) Icmpv4TypeMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Icmpv4TypeMatchFieldSerializer) VlanPcp(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.VlanPcp) ArpOpMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.ArpOpMatchFieldSerializer) EthSrc(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthSrc) Ipv6Flabel(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Flabel) Ipv4DstMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv4DstMatchFieldSerializer) ArpSpaMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.ArpSpaMatchFieldSerializer) IpDscp(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.IpDscp)

Example 3 with MatchField

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField in project openflowplugin by opendaylight.

the class TableFeaturesResponseConvertor method setSetFieldTableFeatureProperty.

private static List<SetFieldMatch> setSetFieldTableFeatureProperty(final TableFeatureProperties properties, final boolean setHasMask) {
    List<SetFieldMatch> setFieldMatchList = new ArrayList<>();
    SetFieldMatchBuilder setFieldMatchBuilder = new SetFieldMatchBuilder();
    // This handles only OpenflowBasicClass oxm class.
    for (MatchEntry currMatch : properties.getAugmentation(OxmRelatedTableFeatureProperty.class).getMatchEntry()) {
        Class<? extends MatchField> ofMatchField = currMatch.getOxmMatchField();
        if (setHasMask) {
            setFieldMatchBuilder.setHasMask(currMatch.isHasMask());
        }
        setFieldMatchBuilder.setMatchType(OF_TO_SAL_TABLE_FEATURE_PROPERTIES.get(ofMatchField));
        setFieldMatchList.add(setFieldMatchBuilder.build());
    }
    return setFieldMatchList;
}
Also used : SetFieldMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatchBuilder) MatchEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry) OxmRelatedTableFeatureProperty(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmRelatedTableFeatureProperty) ArrayList(java.util.ArrayList) SetFieldMatch(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch)

Example 4 with MatchField

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField in project openflowplugin by opendaylight.

the class MatchResponseConvertorTest method toOfPort.

private static MatchEntry toOfPort(final Class<? extends MatchField> field, final Long portNumber) {
    MatchEntryBuilder builder = new MatchEntryBuilder();
    builder.setOxmClass(OpenflowBasicClass.class);
    builder.setHasMask(false);
    builder.setOxmMatchField(field);
    InPortCaseBuilder inPortCaseBuilder = new InPortCaseBuilder();
    InPortBuilder portBuilder = new InPortBuilder();
    portBuilder.setPortNumber(new PortNumber(portNumber));
    inPortCaseBuilder.setInPort(portBuilder.build());
    builder.setMatchEntryValue(inPortCaseBuilder.build());
    return builder.build();
}
Also used : MatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder) InPortCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.InPortCaseBuilder) InPortBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.in.port._case.InPortBuilder) PortNumber(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber)

Example 5 with MatchField

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField in project openflowplugin by opendaylight.

the class MatchUtil method createDefaultMatchEntryBuilder.

public static MatchEntryBuilder createDefaultMatchEntryBuilder(Class<? extends MatchField> matchField, Class<? extends OxmClassBase> oxmClass, MatchEntryValue matchEntryValue) {
    MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
    matchEntryBuilder.setHasMask(false);
    matchEntryBuilder.setOxmMatchField(matchField);
    matchEntryBuilder.setOxmClass(oxmClass);
    matchEntryBuilder.setMatchEntryValue(matchEntryValue);
    return matchEntryBuilder;
}
Also used : MatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder)

Aggregations

MatchEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry)4 MatchEntryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder)4 ArrayList (java.util.ArrayList)2 TunnelIpv4Dst (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TunnelIpv4Dst)2 TunnelIpv4Src (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TunnelIpv4Src)2 SetFieldMatch (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch)2 Consumer (java.util.function.Consumer)1 MatchEntrySerializerKey (org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey)1 MatchPath (org.opendaylight.openflowplugin.extension.api.path.MatchPath)1 ArpOpMatchFieldSerializer (org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.ArpOpMatchFieldSerializer)1 ArpShaMatchFieldSerializer (org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.ArpShaMatchFieldSerializer)1 ArpSpaMatchFieldSerializer (org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.ArpSpaMatchFieldSerializer)1 ArpThaMatchFieldSerializer (org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.ArpThaMatchFieldSerializer)1 ArpTpaMatchFieldSerializer (org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.ArpTpaMatchFieldSerializer)1 EthDstMatchFieldSerializer (org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.EthDstMatchFieldSerializer)1 EthSrcMatchFieldSerializer (org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.EthSrcMatchFieldSerializer)1 EthTypeMatchFieldSerializer (org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.EthTypeMatchFieldSerializer)1 Icmpv4CodeMatchFieldSerializer (org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Icmpv4CodeMatchFieldSerializer)1 Icmpv4TypeMatchFieldSerializer (org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Icmpv4TypeMatchFieldSerializer)1 Icmpv6CodeMatchFieldSerializer (org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Icmpv6CodeMatchFieldSerializer)1