X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflow-protocol-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Fprotocol%2Fimpl%2Fdeserialization%2FMatchEntryDeserializerInitializer.java;h=dc1bae06345ef3bd8b4f5a4ee33f57565f8877cc;hb=c1db8b191643be117b28bb82a3a6371d4b23d6e9;hp=fe15b917411739602a6f17940f9d65726a7e1a12;hpb=26aeaa7e2754b2cf4f6ad63055ab3ce34f68c961;p=openflowjava.git diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/MatchEntryDeserializerInitializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/MatchEntryDeserializerInitializer.java index fe15b917..dc1bae06 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/MatchEntryDeserializerInitializer.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/MatchEntryDeserializerInitializer.java @@ -1,123 +1,120 @@ -/* - * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.openflowjava.protocol.impl.deserialization; - -import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.NxmTcpFlagDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.NxmTunnelIpv4DstDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.NxmTunnelIpv4SrcDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmArpOpDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmArpShaDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmArpSpaDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmArpThaDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmArpTpaDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmEthDstDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmEthSrcDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmEthTypeDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIcmpv4CodeDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIcmpv4TypeDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIcmpv6CodeDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIcmpv6TypeDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmInPhyPortDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmInPortDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpDscpDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpEcnDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpProtoDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv4DstDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv4SrcDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6DstDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6ExtHdrDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6FlabelDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6NdSllDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6NdTargetDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6NdTllDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6SrcDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmMetadataDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmMplsBosDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmMplsLabelDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmMplsTcDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmPbbIsidDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmSctpDstDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmSctpSrcDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmTcpDstDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmTcpSrcDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmTunnelIdDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmUdpDstDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmUdpSrcDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmVlanPcpDeserializer; -import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmVlanVidDeserializer; -import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants; -import org.opendaylight.openflowjava.protocol.impl.util.MatchEntryDeserializerRegistryHelper; -import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants; - -/** - * @author michal.polkorab - * - */ -public class MatchEntryDeserializerInitializer { - - /** - * Registers match entry deserializers - * @param registry registry to be filled with deserializers - */ - public static void registerMatchEntryDeserializers(DeserializerRegistry registry) { - // register OpenflowBasicClass match entry deserializers - MatchEntryDeserializerRegistryHelper helper = - new MatchEntryDeserializerRegistryHelper(EncodeConstants.OF13_VERSION_ID, - OxmMatchConstants.OPENFLOW_BASIC_CLASS, registry); - helper.register(OxmMatchConstants.IN_PORT, new OxmInPortDeserializer()); - helper.register(OxmMatchConstants.IN_PHY_PORT, new OxmInPhyPortDeserializer()); - helper.register(OxmMatchConstants.METADATA, new OxmMetadataDeserializer()); - helper.register(OxmMatchConstants.ETH_DST, new OxmEthDstDeserializer()); - helper.register(OxmMatchConstants.ETH_SRC, new OxmEthSrcDeserializer()); - helper.register(OxmMatchConstants.ETH_TYPE, new OxmEthTypeDeserializer()); - helper.register(OxmMatchConstants.VLAN_VID, new OxmVlanVidDeserializer()); - helper.register(OxmMatchConstants.VLAN_PCP, new OxmVlanPcpDeserializer()); - helper.register(OxmMatchConstants.IP_DSCP, new OxmIpDscpDeserializer()); - helper.register(OxmMatchConstants.IP_ECN, new OxmIpEcnDeserializer()); - helper.register(OxmMatchConstants.IP_PROTO, new OxmIpProtoDeserializer()); - helper.register(OxmMatchConstants.IPV4_SRC, new OxmIpv4SrcDeserializer()); - helper.register(OxmMatchConstants.IPV4_DST, new OxmIpv4DstDeserializer()); - helper.register(OxmMatchConstants.TCP_SRC, new OxmTcpSrcDeserializer()); - helper.register(OxmMatchConstants.TCP_DST, new OxmTcpDstDeserializer()); - helper.register(OxmMatchConstants.UDP_SRC, new OxmUdpSrcDeserializer()); - helper.register(OxmMatchConstants.UDP_DST, new OxmUdpDstDeserializer()); - helper.register(OxmMatchConstants.SCTP_SRC, new OxmSctpSrcDeserializer()); - helper.register(OxmMatchConstants.SCTP_DST, new OxmSctpDstDeserializer()); - helper.register(OxmMatchConstants.ICMPV4_TYPE, new OxmIcmpv4TypeDeserializer()); - helper.register(OxmMatchConstants.ICMPV4_CODE, new OxmIcmpv4CodeDeserializer()); - helper.register(OxmMatchConstants.ARP_OP, new OxmArpOpDeserializer()); - helper.register(OxmMatchConstants.ARP_SPA, new OxmArpSpaDeserializer()); - helper.register(OxmMatchConstants.ARP_TPA, new OxmArpTpaDeserializer()); - helper.register(OxmMatchConstants.ARP_SHA, new OxmArpShaDeserializer()); - helper.register(OxmMatchConstants.ARP_THA, new OxmArpThaDeserializer()); - helper.register(OxmMatchConstants.IPV6_SRC, new OxmIpv6SrcDeserializer()); - helper.register(OxmMatchConstants.IPV6_DST, new OxmIpv6DstDeserializer()); - helper.register(OxmMatchConstants.IPV6_FLABEL, new OxmIpv6FlabelDeserializer()); - helper.register(OxmMatchConstants.ICMPV6_TYPE, new OxmIcmpv6TypeDeserializer()); - helper.register(OxmMatchConstants.ICMPV6_CODE, new OxmIcmpv6CodeDeserializer()); - helper.register(OxmMatchConstants.IPV6_ND_TARGET, new OxmIpv6NdTargetDeserializer()); - helper.register(OxmMatchConstants.IPV6_ND_SLL, new OxmIpv6NdSllDeserializer()); - helper.register(OxmMatchConstants.IPV6_ND_TLL, new OxmIpv6NdTllDeserializer()); - helper.register(OxmMatchConstants.MPLS_LABEL, new OxmMplsLabelDeserializer()); - helper.register(OxmMatchConstants.MPLS_TC, new OxmMplsTcDeserializer()); - helper.register(OxmMatchConstants.MPLS_BOS, new OxmMplsBosDeserializer()); - helper.register(OxmMatchConstants.PBB_ISID, new OxmPbbIsidDeserializer()); - helper.register(OxmMatchConstants.TUNNEL_ID, new OxmTunnelIdDeserializer()); - helper.register(OxmMatchConstants.IPV6_EXTHDR, new OxmIpv6ExtHdrDeserializer()); - - // Register NXM1Class match entry deserializers - MatchEntryDeserializerRegistryHelper nxm1helper = - new MatchEntryDeserializerRegistryHelper(EncodeConstants.OF13_VERSION_ID, - OxmMatchConstants.NXM_1_CLASS, registry); - nxm1helper.register(OxmMatchConstants.NXM_NX_TUN_IPV4_SRC, new NxmTunnelIpv4SrcDeserializer()); - nxm1helper.register(OxmMatchConstants.NXM_NX_TUN_IPV4_DST, new NxmTunnelIpv4DstDeserializer()); - nxm1helper.register(OxmMatchConstants.NXM_NX_TCP_FLAG, new NxmTcpFlagDeserializer()); - - } -} +/* + * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.openflowjava.protocol.impl.deserialization; + +import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmArpOpDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmArpShaDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmArpSpaDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmArpThaDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmArpTpaDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmEthDstDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmEthSrcDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmEthTypeDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIcmpv4CodeDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIcmpv4TypeDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIcmpv6CodeDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIcmpv6TypeDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmInPhyPortDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmInPortDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpDscpDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpEcnDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpProtoDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv4DstDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv4SrcDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6DstDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6ExtHdrDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6FlabelDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6NdSllDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6NdTargetDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6NdTllDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6SrcDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmMetadataDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmMplsBosDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmMplsLabelDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmMplsTcDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmPbbIsidDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmSctpDstDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmSctpSrcDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmTcpDstDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmTcpSrcDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmTunnelIdDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmUdpDstDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmUdpSrcDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmVlanPcpDeserializer; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmVlanVidDeserializer; +import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants; +import org.opendaylight.openflowjava.protocol.impl.deserialization.match.ext.OnfOxmTcpFlagsDeserializer; +import org.opendaylight.openflowjava.protocol.impl.util.MatchEntryDeserializerRegistryHelper; +import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants; + +/** + * @author michal.polkorab + * + */ +public final class MatchEntryDeserializerInitializer { + + private MatchEntryDeserializerInitializer() { + throw new UnsupportedOperationException("Utility class shouldn't be instantiated"); + } + + /** + * Registers match entry deserializers + * @param registry registry to be filled with deserializers + */ + public static void registerMatchEntryDeserializers(DeserializerRegistry registry) { + // register OpenflowBasicClass match entry deserializers + MatchEntryDeserializerRegistryHelper helper = + new MatchEntryDeserializerRegistryHelper(EncodeConstants.OF13_VERSION_ID, + OxmMatchConstants.OPENFLOW_BASIC_CLASS, registry); + helper.register(OxmMatchConstants.IN_PORT, new OxmInPortDeserializer()); + helper.register(OxmMatchConstants.IN_PHY_PORT, new OxmInPhyPortDeserializer()); + helper.register(OxmMatchConstants.METADATA, new OxmMetadataDeserializer()); + helper.register(OxmMatchConstants.ETH_DST, new OxmEthDstDeserializer()); + helper.register(OxmMatchConstants.ETH_SRC, new OxmEthSrcDeserializer()); + helper.register(OxmMatchConstants.ETH_TYPE, new OxmEthTypeDeserializer()); + helper.register(OxmMatchConstants.VLAN_VID, new OxmVlanVidDeserializer()); + helper.register(OxmMatchConstants.VLAN_PCP, new OxmVlanPcpDeserializer()); + helper.register(OxmMatchConstants.IP_DSCP, new OxmIpDscpDeserializer()); + helper.register(OxmMatchConstants.IP_ECN, new OxmIpEcnDeserializer()); + helper.register(OxmMatchConstants.IP_PROTO, new OxmIpProtoDeserializer()); + helper.register(OxmMatchConstants.IPV4_SRC, new OxmIpv4SrcDeserializer()); + helper.register(OxmMatchConstants.IPV4_DST, new OxmIpv4DstDeserializer()); + helper.register(OxmMatchConstants.TCP_SRC, new OxmTcpSrcDeserializer()); + helper.register(OxmMatchConstants.TCP_DST, new OxmTcpDstDeserializer()); + helper.register(OxmMatchConstants.UDP_SRC, new OxmUdpSrcDeserializer()); + helper.register(OxmMatchConstants.UDP_DST, new OxmUdpDstDeserializer()); + helper.register(OxmMatchConstants.SCTP_SRC, new OxmSctpSrcDeserializer()); + helper.register(OxmMatchConstants.SCTP_DST, new OxmSctpDstDeserializer()); + helper.register(OxmMatchConstants.ICMPV4_TYPE, new OxmIcmpv4TypeDeserializer()); + helper.register(OxmMatchConstants.ICMPV4_CODE, new OxmIcmpv4CodeDeserializer()); + helper.register(OxmMatchConstants.ARP_OP, new OxmArpOpDeserializer()); + helper.register(OxmMatchConstants.ARP_SPA, new OxmArpSpaDeserializer()); + helper.register(OxmMatchConstants.ARP_TPA, new OxmArpTpaDeserializer()); + helper.register(OxmMatchConstants.ARP_SHA, new OxmArpShaDeserializer()); + helper.register(OxmMatchConstants.ARP_THA, new OxmArpThaDeserializer()); + helper.register(OxmMatchConstants.IPV6_SRC, new OxmIpv6SrcDeserializer()); + helper.register(OxmMatchConstants.IPV6_DST, new OxmIpv6DstDeserializer()); + helper.register(OxmMatchConstants.IPV6_FLABEL, new OxmIpv6FlabelDeserializer()); + helper.register(OxmMatchConstants.ICMPV6_TYPE, new OxmIcmpv6TypeDeserializer()); + helper.register(OxmMatchConstants.ICMPV6_CODE, new OxmIcmpv6CodeDeserializer()); + helper.register(OxmMatchConstants.IPV6_ND_TARGET, new OxmIpv6NdTargetDeserializer()); + helper.register(OxmMatchConstants.IPV6_ND_SLL, new OxmIpv6NdSllDeserializer()); + helper.register(OxmMatchConstants.IPV6_ND_TLL, new OxmIpv6NdTllDeserializer()); + helper.register(OxmMatchConstants.MPLS_LABEL, new OxmMplsLabelDeserializer()); + helper.register(OxmMatchConstants.MPLS_TC, new OxmMplsTcDeserializer()); + helper.register(OxmMatchConstants.MPLS_BOS, new OxmMplsBosDeserializer()); + helper.register(OxmMatchConstants.PBB_ISID, new OxmPbbIsidDeserializer()); + helper.register(OxmMatchConstants.TUNNEL_ID, new OxmTunnelIdDeserializer()); + helper.register(OxmMatchConstants.IPV6_EXTHDR, new OxmIpv6ExtHdrDeserializer()); + + // Register approved openflow match entry deserializers + helper.registerExperimenter(OxmMatchConstants.ONFOXM_ET_TCP_FLAGS, OxmMatchConstants.ONFOXM_ET_TCP_FLAGS_EXP_ID, + new OnfOxmTcpFlagsDeserializer()); + } +}