1 16 package org.apache.commons.net.telnet; 17 18 25 26 public final class TelnetCommand 27 { 28 29 public static final int MAX_COMMAND_VALUE = 255; 30 31 32 public static final int IAC = 255; 33 34 35 public static final int DONT = 254; 36 37 38 public static final int DO = 253; 39 40 41 public static final int WONT = 252; 42 43 44 public static final int WILL = 251; 45 46 47 public static final int SB = 250; 48 49 50 public static final int GA = 249; 51 52 53 public static final int EL = 248; 54 55 56 public static final int EC = 247; 57 58 59 public static final int AYT = 246; 60 61 62 public static final int AO = 245; 63 64 65 public static final int IP = 244; 66 67 68 public static final int BREAK = 243; 69 70 71 public static final int DM = 242; 72 73 74 public static final int NOP = 241; 75 76 77 public static final int SE = 240; 78 79 80 public static final int EOR = 239; 81 82 83 public static final int ABORT = 238; 84 85 86 public static final int SUSP = 237; 87 88 89 public static final int EOF = 236; 90 91 92 public static final int SYNCH = 242; 93 94 95 private static final String __commandString[] = { 96 "IAC", "DONT", "DO", "WONT", "WILL", "SB", "GA", "EL", "EC", "AYT", 97 "AO", "IP", "BRK", "DMARK", "NOP", "SE", "EOR", "ABORT", "SUSP", "EOF" 98 }; 99 100 private static final int __FIRST_COMMAND = IAC; 101 private static final int __LAST_COMMAND = EOF; 102 103 110 public static final String getCommand(int code) 111 { 112 return __commandString[__FIRST_COMMAND - code]; 113 } 114 115 122 public static final boolean isValidCommand(int code) 123 { 124 return (code <= __FIRST_COMMAND && code >= __LAST_COMMAND); 125 } 126 127 private TelnetCommand() 129 { } 130 } 131 | Popular Tags |