2 * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.openflowjava.protocol.impl.deserialization;
10 import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;
11 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmArpOpDeserializer;
12 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmArpShaDeserializer;
13 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmArpSpaDeserializer;
14 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmArpThaDeserializer;
15 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmArpTpaDeserializer;
16 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmEthDstDeserializer;
17 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmEthSrcDeserializer;
18 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmEthTypeDeserializer;
19 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIcmpv4CodeDeserializer;
20 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIcmpv4TypeDeserializer;
21 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIcmpv6CodeDeserializer;
22 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIcmpv6TypeDeserializer;
23 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmInPhyPortDeserializer;
24 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmInPortDeserializer;
25 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpDscpDeserializer;
26 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpEcnDeserializer;
27 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpProtoDeserializer;
28 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv4DstDeserializer;
29 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv4SrcDeserializer;
30 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6DstDeserializer;
31 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6ExtHdrDeserializer;
32 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6FlabelDeserializer;
33 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6NdSllDeserializer;
34 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6NdTargetDeserializer;
35 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6NdTllDeserializer;
36 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6SrcDeserializer;
37 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmMetadataDeserializer;
38 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmMplsBosDeserializer;
39 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmMplsLabelDeserializer;
40 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmMplsTcDeserializer;
41 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmPbbIsidDeserializer;
42 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmSctpDstDeserializer;
43 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmSctpSrcDeserializer;
44 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmTcpDstDeserializer;
45 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmTcpSrcDeserializer;
46 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmTunnelIdDeserializer;
47 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmUdpDstDeserializer;
48 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmUdpSrcDeserializer;
49 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmVlanPcpDeserializer;
50 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmVlanVidDeserializer;
51 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
52 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.ext.OnfOxmTcpFlagsDeserializer;
53 import org.opendaylight.openflowjava.protocol.impl.util.MatchEntryDeserializerRegistryHelper;
54 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
57 * @author michal.polkorab
60 public final class MatchEntryDeserializerInitializer {
62 private MatchEntryDeserializerInitializer() {
63 throw new UnsupportedOperationException("Utility class shouldn't be instantiated");
67 * Registers match entry deserializers
68 * @param registry registry to be filled with deserializers
70 public static void registerMatchEntryDeserializers(DeserializerRegistry registry) {
71 // register OpenflowBasicClass match entry deserializers
72 MatchEntryDeserializerRegistryHelper helper =
73 new MatchEntryDeserializerRegistryHelper(EncodeConstants.OF13_VERSION_ID,
74 OxmMatchConstants.OPENFLOW_BASIC_CLASS, registry);
75 helper.register(OxmMatchConstants.IN_PORT, new OxmInPortDeserializer());
76 helper.register(OxmMatchConstants.IN_PHY_PORT, new OxmInPhyPortDeserializer());
77 helper.register(OxmMatchConstants.METADATA, new OxmMetadataDeserializer());
78 helper.register(OxmMatchConstants.ETH_DST, new OxmEthDstDeserializer());
79 helper.register(OxmMatchConstants.ETH_SRC, new OxmEthSrcDeserializer());
80 helper.register(OxmMatchConstants.ETH_TYPE, new OxmEthTypeDeserializer());
81 helper.register(OxmMatchConstants.VLAN_VID, new OxmVlanVidDeserializer());
82 helper.register(OxmMatchConstants.VLAN_PCP, new OxmVlanPcpDeserializer());
83 helper.register(OxmMatchConstants.IP_DSCP, new OxmIpDscpDeserializer());
84 helper.register(OxmMatchConstants.IP_ECN, new OxmIpEcnDeserializer());
85 helper.register(OxmMatchConstants.IP_PROTO, new OxmIpProtoDeserializer());
86 helper.register(OxmMatchConstants.IPV4_SRC, new OxmIpv4SrcDeserializer());
87 helper.register(OxmMatchConstants.IPV4_DST, new OxmIpv4DstDeserializer());
88 helper.register(OxmMatchConstants.TCP_SRC, new OxmTcpSrcDeserializer());
89 helper.register(OxmMatchConstants.TCP_DST, new OxmTcpDstDeserializer());
90 helper.register(OxmMatchConstants.UDP_SRC, new OxmUdpSrcDeserializer());
91 helper.register(OxmMatchConstants.UDP_DST, new OxmUdpDstDeserializer());
92 helper.register(OxmMatchConstants.SCTP_SRC, new OxmSctpSrcDeserializer());
93 helper.register(OxmMatchConstants.SCTP_DST, new OxmSctpDstDeserializer());
94 helper.register(OxmMatchConstants.ICMPV4_TYPE, new OxmIcmpv4TypeDeserializer());
95 helper.register(OxmMatchConstants.ICMPV4_CODE, new OxmIcmpv4CodeDeserializer());
96 helper.register(OxmMatchConstants.ARP_OP, new OxmArpOpDeserializer());
97 helper.register(OxmMatchConstants.ARP_SPA, new OxmArpSpaDeserializer());
98 helper.register(OxmMatchConstants.ARP_TPA, new OxmArpTpaDeserializer());
99 helper.register(OxmMatchConstants.ARP_SHA, new OxmArpShaDeserializer());
100 helper.register(OxmMatchConstants.ARP_THA, new OxmArpThaDeserializer());
101 helper.register(OxmMatchConstants.IPV6_SRC, new OxmIpv6SrcDeserializer());
102 helper.register(OxmMatchConstants.IPV6_DST, new OxmIpv6DstDeserializer());
103 helper.register(OxmMatchConstants.IPV6_FLABEL, new OxmIpv6FlabelDeserializer());
104 helper.register(OxmMatchConstants.ICMPV6_TYPE, new OxmIcmpv6TypeDeserializer());
105 helper.register(OxmMatchConstants.ICMPV6_CODE, new OxmIcmpv6CodeDeserializer());
106 helper.register(OxmMatchConstants.IPV6_ND_TARGET, new OxmIpv6NdTargetDeserializer());
107 helper.register(OxmMatchConstants.IPV6_ND_SLL, new OxmIpv6NdSllDeserializer());
108 helper.register(OxmMatchConstants.IPV6_ND_TLL, new OxmIpv6NdTllDeserializer());
109 helper.register(OxmMatchConstants.MPLS_LABEL, new OxmMplsLabelDeserializer());
110 helper.register(OxmMatchConstants.MPLS_TC, new OxmMplsTcDeserializer());
111 helper.register(OxmMatchConstants.MPLS_BOS, new OxmMplsBosDeserializer());
112 helper.register(OxmMatchConstants.PBB_ISID, new OxmPbbIsidDeserializer());
113 helper.register(OxmMatchConstants.TUNNEL_ID, new OxmTunnelIdDeserializer());
114 helper.register(OxmMatchConstants.IPV6_EXTHDR, new OxmIpv6ExtHdrDeserializer());
116 // Register approved openflow match entry deserializers
117 helper.registerExperimenter(OxmMatchConstants.ONFOXM_ET_TCP_FLAGS, OxmMatchConstants.ONFOXM_ET_TCP_FLAGS_EXP_ID,
118 new OnfOxmTcpFlagsDeserializer());