1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.apache.commons.net.telnet; |
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
public class TelnetOption |
31 |
|
{ |
32 |
|
|
33 |
|
public static final int MAX_OPTION_VALUE = 255; |
34 |
|
|
35 |
5 |
public static int BINARY = 0; |
36 |
|
|
37 |
5 |
public static int ECHO = 1; |
38 |
|
|
39 |
5 |
public static int PREPARE_TO_RECONNECT = 2; |
40 |
|
|
41 |
5 |
public static int SUPPRESS_GO_AHEAD = 3; |
42 |
|
|
43 |
5 |
public static int APPROXIMATE_MESSAGE_SIZE = 4; |
44 |
|
|
45 |
5 |
public static int STATUS = 5; |
46 |
|
|
47 |
5 |
public static int TIMING_MARK = 6; |
48 |
|
|
49 |
5 |
public static int REMOTE_CONTROLLED_TRANSMISSION = 7; |
50 |
|
|
51 |
5 |
public static int NEGOTIATE_OUTPUT_LINE_WIDTH = 8; |
52 |
|
|
53 |
5 |
public static int NEGOTIATE_OUTPUT_PAGE_SIZE = 9; |
54 |
|
|
55 |
5 |
public static int NEGOTIATE_CARRIAGE_RETURN = 10; |
56 |
|
|
57 |
5 |
public static int NEGOTIATE_HORIZONTAL_TAB_STOP = 11; |
58 |
|
|
59 |
5 |
public static int NEGOTIATE_HORIZONTAL_TAB = 12; |
60 |
|
|
61 |
5 |
public static int NEGOTIATE_FORMFEED = 13; |
62 |
|
|
63 |
5 |
public static int NEGOTIATE_VERTICAL_TAB_STOP = 14; |
64 |
|
|
65 |
5 |
public static int NEGOTIATE_VERTICAL_TAB = 15; |
66 |
|
|
67 |
5 |
public static int NEGOTIATE_LINEFEED = 16; |
68 |
|
|
69 |
5 |
public static int EXTENDED_ASCII = 17; |
70 |
|
|
71 |
5 |
public static int FORCE_LOGOUT = 18; |
72 |
|
|
73 |
5 |
public static int BYTE_MACRO = 19; |
74 |
|
|
75 |
5 |
public static int DATA_ENTRY_TERMINAL = 20; |
76 |
|
|
77 |
5 |
public static int SUPDUP = 21; |
78 |
|
|
79 |
5 |
public static int SUPDUP_OUTPUT = 22; |
80 |
|
|
81 |
5 |
public static int SEND_LOCATION = 23; |
82 |
|
|
83 |
5 |
public static int TERMINAL_TYPE = 24; |
84 |
|
|
85 |
5 |
public static int END_OF_RECORD = 25; |
86 |
|
|
87 |
5 |
public static int TACACS_USER_IDENTIFICATION = 26; |
88 |
|
|
89 |
5 |
public static int OUTPUT_MARKING = 27; |
90 |
|
|
91 |
5 |
public static int TERMINAL_LOCATION_NUMBER = 28; |
92 |
|
|
93 |
5 |
public static int REGIME_3270 = 29; |
94 |
|
|
95 |
5 |
public static int X3_PAD = 30; |
96 |
|
|
97 |
5 |
public static int WINDOW_SIZE = 31; |
98 |
|
|
99 |
5 |
public static int TERMINAL_SPEED = 32; |
100 |
|
|
101 |
5 |
public static int REMOTE_FLOW_CONTROL = 33; |
102 |
|
|
103 |
5 |
public static int LINEMODE = 34; |
104 |
|
|
105 |
5 |
public static int X_DISPLAY_LOCATION = 35; |
106 |
|
|
107 |
5 |
public static int OLD_ENVIRONMENT_VARIABLES = 36; |
108 |
|
|
109 |
5 |
public static int AUTHENTICATION = 37; |
110 |
|
|
111 |
5 |
public static int ENCRYPTION = 38; |
112 |
|
|
113 |
5 |
public static int NEW_ENVIRONMENT_VARIABLES = 39; |
114 |
|
|
115 |
5 |
public static int EXTENDED_OPTIONS_LIST = 255; |
116 |
|
|
117 |
5 |
private static int __FIRST_OPTION = BINARY; |
118 |
5 |
private static int __LAST_OPTION = EXTENDED_OPTIONS_LIST; |
119 |
|
|
120 |
5 |
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 |
|
|
157 |
|
|
158 |
|
|
159 |
|
|
160 |
|
|
161 |
|
|
162 |
|
|
163 |
|
public static final String getOption(int code) |
164 |
|
{ |
165 |
3 |
if(__optionString[code].length() == 0) |
166 |
|
{ |
167 |
1 |
return "UNASSIGNED"; |
168 |
|
} |
169 |
|
else |
170 |
|
{ |
171 |
2 |
return __optionString[code]; |
172 |
|
} |
173 |
|
} |
174 |
|
|
175 |
|
|
176 |
|
|
177 |
|
|
178 |
|
|
179 |
|
|
180 |
|
|
181 |
|
|
182 |
|
|
183 |
|
public static final boolean isValidOption(int code) |
184 |
|
{ |
185 |
33 |
return (code <= __LAST_OPTION); |
186 |
|
} |
187 |
|
|
188 |
|
|
189 |
|
private TelnetOption() |
190 |
0 |
{ } |
191 |
|
} |