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