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