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