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.api.util.EncodeConstants;
12 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
13 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmArpOpDeserializer;
14 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmArpShaDeserializer;
15 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmArpSpaDeserializer;
16 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmArpThaDeserializer;
17 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmArpTpaDeserializer;
18 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmEthDstDeserializer;
19 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmEthSrcDeserializer;
20 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmEthTypeDeserializer;
21 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIcmpv4CodeDeserializer;
22 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIcmpv4TypeDeserializer;
23 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIcmpv6CodeDeserializer;
24 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIcmpv6TypeDeserializer;
25 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmInPhyPortDeserializer;
26 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmInPortDeserializer;
27 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpDscpDeserializer;
28 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpEcnDeserializer;
29 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpProtoDeserializer;
30 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv4DstDeserializer;
31 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv4SrcDeserializer;
32 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6DstDeserializer;
33 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6ExtHdrDeserializer;
34 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6FlabelDeserializer;
35 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6NdSllDeserializer;
36 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6NdTargetDeserializer;
37 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6NdTllDeserializer;
38 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmIpv6SrcDeserializer;
39 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmMetadataDeserializer;
40 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmMplsBosDeserializer;
41 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmMplsLabelDeserializer;
42 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmMplsTcDeserializer;
43 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmPacketTypeDeserializer;
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.impl.deserialization.match.ext.OnfOxmTcpFlagsDeserializer;
55 import org.opendaylight.openflowjava.protocol.impl.util.MatchEntryDeserializerRegistryHelper;
58 * Util class for init registration of match entry deserializers.
59 * @author michal.polkorab
61 public final class MatchEntryDeserializerInitializer {
63 private MatchEntryDeserializerInitializer() {
64 throw new UnsupportedOperationException("Utility class shouldn't be instantiated");
68 * Registers match entry deserializers.
69 * @param registry registry to be filled with deserializers
71 public static void registerMatchEntryDeserializers(final DeserializerRegistry registry) {
72 // register OpenflowBasicClass match entry deserializers
73 MatchEntryDeserializerRegistryHelper helper =
74 new MatchEntryDeserializerRegistryHelper(EncodeConstants.OF_VERSION_1_3,
75 OxmMatchConstants.OPENFLOW_BASIC_CLASS, registry);
76 helper.register(OxmMatchConstants.IN_PORT, new OxmInPortDeserializer());
77 helper.register(OxmMatchConstants.IN_PHY_PORT, new OxmInPhyPortDeserializer());
78 helper.register(OxmMatchConstants.METADATA, new OxmMetadataDeserializer());
79 helper.register(OxmMatchConstants.PACKET_TYPE, new OxmPacketTypeDeserializer());
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());
118 // Register approved openflow match entry deserializers
119 helper.registerExperimenter(EncodeConstants.ONFOXM_ET_TCP_FLAGS, EncodeConstants.ONF_EXPERIMENTER_ID,
120 new OnfOxmTcpFlagsDeserializer());