1 16 package org.apache.commons.net.telnet; 17 18 29 30 public class TelnetOption 31 { 32 33 public static final int MAX_OPTION_VALUE = 255; 34 35 public static int BINARY = 0; 36 37 public static int ECHO = 1; 38 39 public static int PREPARE_TO_RECONNECT = 2; 40 41 public static int SUPPRESS_GO_AHEAD = 3; 42 43 public static int APPROXIMATE_MESSAGE_SIZE = 4; 44 45 public static int STATUS = 5; 46 47 public static int TIMING_MARK = 6; 48 49 public static int REMOTE_CONTROLLED_TRANSMISSION = 7; 50 51 public static int NEGOTIATE_OUTPUT_LINE_WIDTH = 8; 52 53 public static int NEGOTIATE_OUTPUT_PAGE_SIZE = 9; 54 55 public static int NEGOTIATE_CARRIAGE_RETURN = 10; 56 57 public static int NEGOTIATE_HORIZONTAL_TAB_STOP = 11; 58 59 public static int NEGOTIATE_HORIZONTAL_TAB = 12; 60 61 public static int NEGOTIATE_FORMFEED = 13; 62 63 public static int NEGOTIATE_VERTICAL_TAB_STOP = 14; 64 65 public static int NEGOTIATE_VERTICAL_TAB = 15; 66 67 public static int NEGOTIATE_LINEFEED = 16; 68 69 public static int EXTENDED_ASCII = 17; 70 71 public static int FORCE_LOGOUT = 18; 72 73 public static int BYTE_MACRO = 19; 74 75 public static int DATA_ENTRY_TERMINAL = 20; 76 77 public static int SUPDUP = 21; 78 79 public static int SUPDUP_OUTPUT = 22; 80 81 public static int SEND_LOCATION = 23; 82 83 public static int TERMINAL_TYPE = 24; 84 85 public static int END_OF_RECORD = 25; 86 87 public static int TACACS_USER_IDENTIFICATION = 26; 88 89 public static int OUTPUT_MARKING = 27; 90 91 public static int TERMINAL_LOCATION_NUMBER = 28; 92 93 public static int REGIME_3270 = 29; 94 95 public static int X3_PAD = 30; 96 97 public static int WINDOW_SIZE = 31; 98 99 public static int TERMINAL_SPEED = 32; 100 101 public static int REMOTE_FLOW_CONTROL = 33; 102 103 public static int LINEMODE = 34; 104 105 public static int X_DISPLAY_LOCATION = 35; 106 107 public static int OLD_ENVIRONMENT_VARIABLES = 36; 108 109 public static int AUTHENTICATION = 37; 110 111 public static int ENCRYPTION = 38; 112 113 public static int NEW_ENVIRONMENT_VARIABLES = 39; 114 115 public static int EXTENDED_OPTIONS_LIST = 255; 116 117 private static int __FIRST_OPTION = BINARY; 118 private static int __LAST_OPTION = EXTENDED_OPTIONS_LIST; 119 120 private static final String __optionString[] = { 121 "BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME", "STATUS", 122 "TIMING MARK", "RCTE", "NAOL", "NAOP", "NAOCRD", "NAOHTS", "NAOHTD", 123 "NAOFFD", "NAOVTS", "NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", 124 "BYTE MACRO", "DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT", 125 "SEND LOCATION", "TERMINAL TYPE", "END OF RECORD", "TACACS UID", 126 "OUTPUT MARKING", "TTYLOC", "3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", 127 "LFLOW", "LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION", 128 "ENCRYPT", "NEW-ENVIRON", "TN3270E", "XAUTH", "CHARSET", "RSP", 129 "Com Port Control", "Suppress Local Echo", "Start TLS", 130 "KERMIT", "SEND-URL", "FORWARD_X", "", "", "", 131 "", "", "", "", "", "", "", "", "", "", 132 "", "", "", "", "", "", "", "", "", "", 133 "", "", "", "", "", "", "", "", "", "", 134 "", "", "", "", "", "", "", "", "", "", 135 "", "", "", "", "", "", "", "", "", "", 136 "", "", "", "", "", "", "", "", "", "", 137 "", "", "", "", "", "", "", "", "", "", 138 "", "", "", "", "", "", "", "", "", "", 139 "", "", "", "", "", "TELOPT PRAGMA LOGON", "TELOPT SSPI LOGON", 140 "TELOPT PRAGMA HEARTBEAT", "", "", "", "", 141 "", "", "", "", "", "", "", "", "", "", 142 "", "", "", "", "", "", "", "", "", "", 143 "", "", "", "", "", "", "", "", "", "", 144 "", "", "", "", "", "", "", "", "", "", 145 "", "", "", "", "", "", "", "", "", "", 146 "", "", "", "", "", "", "", "", "", "", 147 "", "", "", "", "", "", "", "", "", "", 148 "", "", "", "", "", "", "", "", "", "", 149 "", "", "", "", "", "", "", "", "", "", 150 "", "", "", "", "", "", "", "", "", "", 151 "", "", "", "", "", "", "", "", "", "", 152 "Extended-Options-List" 153 }; 154 155 156 163 public static final String getOption(int code) 164 { 165 if(__optionString[code].length() == 0) 166 { 167 return "UNASSIGNED"; 168 } 169 else 170 { 171 return __optionString[code]; 172 } 173 } 174 175 176 183 public static final boolean isValidOption(int code) 184 { 185 return (code <= __LAST_OPTION); 186 } 187 188 private TelnetOption() 190 { } 191 } 192 | Popular Tags |