001/*
002 *  Licensed to the Apache Software Foundation (ASF) under one
003 *  or more contributor license agreements.  See the NOTICE file
004 *  distributed with this work for additional information
005 *  regarding copyright ownership.  The ASF licenses this file
006 *  to you under the Apache License, Version 2.0 (the
007 *  "License"); you may not use this file except in compliance
008 *  with the License.  You may obtain a copy of the License at
009 *  
010 *    http://www.apache.org/licenses/LICENSE-2.0
011 *  
012 *  Unless required by applicable law or agreed to in writing,
013 *  software distributed under the License is distributed on an
014 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 *  KIND, either express or implied.  See the License for the
016 *  specific language governing permissions and limitations
017 *  under the License. 
018 *  
019 */
020
021package org.apache.directory.server.dns.messages;
022
023
024import org.apache.directory.server.dns.util.EnumConverter;
025import org.apache.directory.server.dns.util.ReverseEnumMap;
026
027
028/**
029 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
030 */
031public enum ProtocolType implements EnumConverter<Byte>
032{
033    /** Null */
034    NULL(0),
035
036    /** Internet Conrol Message */
037    ICMP(1),
038
039    /** Internet Group Management */
040    IGMP(2),
041
042    /** Gateway-to-Gateway */
043    GGP(3),
044
045    /** Stream */
046    ST(5),
047
048    /** Transmission control */
049    TCP(6),
050
051    /** UCL */
052    UCL(7),
053
054    /** Exterior Gateway Protocol */
055    EGP(8),
056
057    /** any private interior gateway */
058    IGP(9),
059
060    /** BBN RCC Monitoring */
061    BBN_RCC_MON(10),
062
063    /** Network Voice Protocol */
064    NVP_II(11),
065
066    /** PUP */
067    PUP(12),
068
069    /** ARGUS */
070    ARGUS(13),
071
072    /** EMCON */
073    EMCON(14),
074
075    /** Cross Net Debugger */
076    XNET(15),
077
078    /** Chaos */
079    CHAOS(16),
080
081    /** User Datagram */
082    UDP(17),
083
084    /** Multiplexing */
085    MUX(18),
086
087    /** DCN Measurement Subsystems */
088    DCN_MEAS(19),
089
090    /** Host Monitoring */
091    HMP(20),
092
093    /** Packet Radio Measurement */
094    PRM(21),
095
096    /** XEROX NS IDP */
097    XNS_IDP(22),
098
099    /** Trunk-1 */
100    TRUNK_1(23),
101
102    /** Trunk-2 */
103    TRUNK_2(24),
104
105    /** Leaf-1 */
106    LEAF_1(25),
107
108    /** Leaf-2 */
109    LEAF_2(26),
110
111    /** Reliable Data Protocol */
112    RDP(27),
113
114    /** Internet Reliable Transaction */
115    IRTP(28),
116
117    /** ISO Transport Protocol Class 4 */
118    ISO_TP4(29),
119
120    /** Bulk Data Transfer Protocol */
121    NETBLT(30),
122
123    /** MFE Network Services Protocol */
124    MFE_NSP(31),
125
126    /** MERIT Internodal Protocol */
127    MERIT_INP(32),
128
129    /** Sequential Exchange Protocol */
130    SEP(33),
131
132    /** CFTP */
133    CFTP(62),
134
135    /** SATNET and Backroom EXPAK */
136    SAT_EXPAK(64),
137
138    /** MIT Subnet Support */
139    MIT_SUBNET(65),
140
141    /** MIT Remote Virtual Disk Protocol */
142    RVD(66),
143
144    /** Internet Pluribus Packet Core */
145    IPPC(67),
146
147    /** SATNET Monitoring */
148    SAT_MON(69),
149
150    /** Internet Packet Core Utility */
151    IPCV(71),
152
153    /** Backroom SETNET Monitoring */
154    BR_SAT_MON(76),
155
156    /** WIDEBAND Monitoring */
157    WB_MON(78),
158
159    /** WIDEBAND EXPAK */
160    WB_EXPAK(79);
161
162    private static ReverseEnumMap<Byte, ProtocolType> map = new ReverseEnumMap<>( ProtocolType.class );
163
164    private final byte value;
165
166
167    ProtocolType( int value )
168    {
169        this.value = ( byte ) value;
170    }
171
172
173    public Byte convert()
174    {
175        return this.value;
176    }
177
178
179    /**
180     * Converts an ordinal value into a {@link ProtocolType}.
181     *
182     * @param value
183     * @return The {@link ProtocolType}.
184     */
185    public static ProtocolType convert( byte value )
186    {
187        return map.get( value );
188    }
189}