1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 * 19 */ 20 21 package org.apache.directory.server.dns.messages; 22 23 24 import org.apache.directory.server.dns.util.EnumConverter; 25 import org.apache.directory.server.dns.util.ReverseEnumMap; 26 27 28 /** 29 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 30 * @version $Rev: 547524 $, $Date: 2007-06-15 06:42:26 +0200 (Fr, 15 Jun 2007) $ 31 */ 32 public enum ProtocolType implements EnumConverter<Byte> 33 { 34 /** Null */ 35 NULL(0), 36 37 /** Internet Conrol Message */ 38 ICMP(1), 39 40 /** Internet Group Management */ 41 IGMP(2), 42 43 /** Gateway-to-Gateway */ 44 GGP(3), 45 46 /** Stream */ 47 ST(5), 48 49 /** Transmission control */ 50 TCP(6), 51 52 /** UCL */ 53 UCL(7), 54 55 /** Exterior Gateway Protocol */ 56 EGP(8), 57 58 /** any private interior gateway */ 59 IGP(9), 60 61 /** BBN RCC Monitoring */ 62 BBN_RCC_MON(10), 63 64 /** Network Voice Protocol */ 65 NVP_II(11), 66 67 /** PUP */ 68 PUP(12), 69 70 /** ARGUS */ 71 ARGUS(13), 72 73 /** EMCON */ 74 EMCON(14), 75 76 /** Cross Net Debugger */ 77 XNET(15), 78 79 /** Chaos */ 80 CHAOS(16), 81 82 /** User Datagram */ 83 UDP(17), 84 85 /** Multiplexing */ 86 MUX(18), 87 88 /** DCN Measurement Subsystems */ 89 DCN_MEAS(19), 90 91 /** Host Monitoring */ 92 HMP(20), 93 94 /** Packet Radio Measurement */ 95 PRM(21), 96 97 /** XEROX NS IDP */ 98 XNS_IDP(22), 99 100 /** Trunk-1 */ 101 TRUNK_1(23), 102 103 /** Trunk-2 */ 104 TRUNK_2(24), 105 106 /** Leaf-1 */ 107 LEAF_1(25), 108 109 /** Leaf-2 */ 110 LEAF_2(26), 111 112 /** Reliable Data Protocol */ 113 RDP(27), 114 115 /** Internet Reliable Transaction */ 116 IRTP(28), 117 118 /** ISO Transport Protocol Class 4 */ 119 ISO_TP4(29), 120 121 /** Bulk Data Transfer Protocol */ 122 NETBLT(30), 123 124 /** MFE Network Services Protocol */ 125 MFE_NSP(31), 126 127 /** MERIT Internodal Protocol */ 128 MERIT_INP(32), 129 130 /** Sequential Exchange Protocol */ 131 SEP(33), 132 133 /** CFTP */ 134 CFTP(62), 135 136 /** SATNET and Backroom EXPAK */ 137 SAT_EXPAK(64), 138 139 /** MIT Subnet Support */ 140 MIT_SUBNET(65), 141 142 /** MIT Remote Virtual Disk Protocol */ 143 RVD(66), 144 145 /** Internet Pluribus Packet Core */ 146 IPPC(67), 147 148 /** SATNET Monitoring */ 149 SAT_MON(69), 150 151 /** Internet Packet Core Utility */ 152 IPCV(71), 153 154 /** Backroom SETNET Monitoring */ 155 BR_SAT_MON(76), 156 157 /** WIDEBAND Monitoring */ 158 WB_MON(78), 159 160 /** WIDEBAND EXPAK */ 161 WB_EXPAK(79); 162 163 private static ReverseEnumMap<Byte, ProtocolType> map = new ReverseEnumMap<Byte, ProtocolType>( ProtocolType.class ); 164 165 private final byte value; 166 167 168 private ProtocolType( int value ) 169 { 170 this.value = ( byte ) value; 171 } 172 173 174 public Byte convert() 175 { 176 return this.value; 177 } 178 179 180 /** 181 * Converts an ordinal value into a {@link ProtocolType}. 182 * 183 * @param value 184 * @return The {@link ProtocolType}. 185 */ 186 public static ProtocolType convert( byte value ) 187 { 188 return map.get( value ); 189 } 190 }