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 */ 31 public enum ProtocolType implements EnumConverter<Byte> 32 { 33 /** Null */ 34 NULL(0), 35 36 /** Internet Conrol Message */ 37 ICMP(1), 38 39 /** Internet Group Management */ 40 IGMP(2), 41 42 /** Gateway-to-Gateway */ 43 GGP(3), 44 45 /** Stream */ 46 ST(5), 47 48 /** Transmission control */ 49 TCP(6), 50 51 /** UCL */ 52 UCL(7), 53 54 /** Exterior Gateway Protocol */ 55 EGP(8), 56 57 /** any private interior gateway */ 58 IGP(9), 59 60 /** BBN RCC Monitoring */ 61 BBN_RCC_MON(10), 62 63 /** Network Voice Protocol */ 64 NVP_II(11), 65 66 /** PUP */ 67 PUP(12), 68 69 /** ARGUS */ 70 ARGUS(13), 71 72 /** EMCON */ 73 EMCON(14), 74 75 /** Cross Net Debugger */ 76 XNET(15), 77 78 /** Chaos */ 79 CHAOS(16), 80 81 /** User Datagram */ 82 UDP(17), 83 84 /** Multiplexing */ 85 MUX(18), 86 87 /** DCN Measurement Subsystems */ 88 DCN_MEAS(19), 89 90 /** Host Monitoring */ 91 HMP(20), 92 93 /** Packet Radio Measurement */ 94 PRM(21), 95 96 /** XEROX NS IDP */ 97 XNS_IDP(22), 98 99 /** 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 }