Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: fusl/include/arpa/telnet.h

Issue 1714623002: [fusl] clang-format fusl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: headers too Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #ifndef _ARPA_TELNET_H 1 #ifndef _ARPA_TELNET_H
2 #define»_ARPA_TELNET_H 2 #define _ARPA_TELNET_H
3 3
4 #define»IAC» 255 4 #define IAC 255
5 #define»DONT» 254 5 #define DONT 254
6 #define»DO» 253 6 #define DO 253
7 #define»WONT» 252 7 #define WONT 252
8 #define»WILL» 251 8 #define WILL 251
9 #define»SB» 250 9 #define SB 250
10 #define»GA» 249 10 #define GA 249
11 #define»EL» 248 11 #define EL 248
12 #define»EC» 247 12 #define EC 247
13 #define»AYT» 246 13 #define AYT 246
14 #define»AO» 245 14 #define AO 245
15 #define»IP» 244 15 #define IP 244
16 #define»BREAK» 243 16 #define BREAK 243
17 #define»DM» 242 17 #define DM 242
18 #define»NOP» 241 18 #define NOP 241
19 #define»SE» 240 19 #define SE 240
20 #define EOR 239 20 #define EOR 239
21 #define»ABORT» 238 21 #define ABORT 238
22 #define»SUSP» 237 22 #define SUSP 237
23 #define»xEOF» 236 23 #define xEOF 236
24 24
25 #define SYNCH» 242 25 #define SYNCH 242
26 26
27 #define telcmds ((char [][6]){ "EOF", "SUSP", "ABORT", "EOR", "SE", "NOP", "DMAR K", "BRK", "IP", "AO", "AYT", "EC", "EL", "GA", "SB", "WILL", "WONT", "DO", "DON T", "IAC", 0 }) 27 #define telcmds \
28 28 ((char[][6]){"EOF", "SUSP", "ABORT", "EOR", "SE", "NOP", "DMARK", \
29 #define»TELCMD_FIRST» xEOF 29 "BRK", "IP", "AO", "AYT", "EC", "EL", "GA", \
30 #define»TELCMD_LAST» IAC 30 "SB", "WILL", "WONT", "DO", "DONT", "IAC", 0})
31 #define»TELCMD_OK(x)» ((unsigned int)(x) <= TELCMD_LAST && \ 31
32 » » » (unsigned int)(x) >= TELCMD_FIRST) 32 #define TELCMD_FIRST xEOF
33 #define»TELCMD(x)» telcmds[(x)-TELCMD_FIRST] 33 #define TELCMD_LAST IAC
34 34 #define TELCMD_OK(x) \
35 #define TELOPT_BINARY» 0 35 ((unsigned int)(x) <= TELCMD_LAST && (unsigned int)(x) >= TELCMD_FIRST)
36 #define TELOPT_ECHO» 1 36 #define TELCMD(x) telcmds[(x)-TELCMD_FIRST]
37 #define»TELOPT_RCP» 2 37
38 #define»TELOPT_SGA» 3 38 #define TELOPT_BINARY 0
39 #define»TELOPT_NAMS» 4 39 #define TELOPT_ECHO 1
40 #define»TELOPT_STATUS» 5 40 #define TELOPT_RCP 2
41 #define»TELOPT_TM» 6 41 #define TELOPT_SGA 3
42 #define»TELOPT_RCTE» 7 42 #define TELOPT_NAMS 4
43 #define TELOPT_NAOL » 8 43 #define TELOPT_STATUS 5
44 #define TELOPT_NAOP » 9 44 #define TELOPT_TM 6
45 #define TELOPT_NAOCRD» 10 45 #define TELOPT_RCTE 7
46 #define TELOPT_NAOHTS» 11 46 #define TELOPT_NAOL 8
47 #define TELOPT_NAOHTD» 12 47 #define TELOPT_NAOP 9
48 #define TELOPT_NAOFFD» 13 48 #define TELOPT_NAOCRD 10
49 #define TELOPT_NAOVTS» 14 49 #define TELOPT_NAOHTS 11
50 #define TELOPT_NAOVTD» 15 50 #define TELOPT_NAOHTD 12
51 #define TELOPT_NAOLFD» 16 51 #define TELOPT_NAOFFD 13
52 #define TELOPT_XASCII» 17 52 #define TELOPT_NAOVTS 14
53 #define»TELOPT_LOGOUT» 18 53 #define TELOPT_NAOVTD 15
54 #define»TELOPT_BM» 19 54 #define TELOPT_NAOLFD 16
55 #define»TELOPT_DET» 20 55 #define TELOPT_XASCII 17
56 #define»TELOPT_SUPDUP» 21 56 #define TELOPT_LOGOUT 18
57 #define»TELOPT_SUPDUPOUTPUT 22 57 #define TELOPT_BM 19
58 #define»TELOPT_SNDLOC» 23 58 #define TELOPT_DET 20
59 #define»TELOPT_TTYPE» 24 59 #define TELOPT_SUPDUP 21
60 #define»TELOPT_EOR» 25 60 #define TELOPT_SUPDUPOUTPUT 22
61 #define»TELOPT_TUID» 26 61 #define TELOPT_SNDLOC 23
62 #define»TELOPT_OUTMRK» 27 62 #define TELOPT_TTYPE 24
63 #define»TELOPT_TTYLOC» 28 63 #define TELOPT_EOR 25
64 #define»TELOPT_3270REGIME 29 64 #define TELOPT_TUID 26
65 #define»TELOPT_X3PAD» 30 65 #define TELOPT_OUTMRK 27
66 #define»TELOPT_NAWS» 31 66 #define TELOPT_TTYLOC 28
67 #define»TELOPT_TSPEED» 32 67 #define TELOPT_3270REGIME 29
68 #define»TELOPT_LFLOW» 33 68 #define TELOPT_X3PAD 30
69 #define TELOPT_LINEMODE»34 69 #define TELOPT_NAWS 31
70 #define TELOPT_XDISPLOC»35 70 #define TELOPT_TSPEED 32
71 #define TELOPT_LFLOW 33
72 #define TELOPT_LINEMODE 34
73 #define TELOPT_XDISPLOC 35
71 #define TELOPT_OLD_ENVIRON 36 74 #define TELOPT_OLD_ENVIRON 36
72 #define»TELOPT_AUTHENTICATION 37/* Authenticate */ 75 #define TELOPT_AUTHENTICATION 37 /* Authenticate */
73 #define»TELOPT_ENCRYPT» 38 76 #define TELOPT_ENCRYPT 38
74 #define TELOPT_NEW_ENVIRON 39 77 #define TELOPT_NEW_ENVIRON 39
75 #define»TELOPT_EXOPL» 255 78 #define TELOPT_EXOPL 255
76 79
77 80 #define NTELOPTS (1 + TELOPT_NEW_ENVIRON)
78 #define»NTELOPTS» (1+TELOPT_NEW_ENVIRON)
79 #ifdef TELOPTS 81 #ifdef TELOPTS
80 char *telopts[NTELOPTS+1] = { 82 char* telopts[NTELOPTS + 1] = {
81 » "BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME", 83 "BINARY",
82 » "STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP", 84 "ECHO",
83 » "NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS", 85 "RCP",
84 » "NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO", 86 "SUPPRESS GO AHEAD",
85 » "DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT", 87 "NAME",
86 » "SEND LOCATION", "TERMINAL TYPE", "END OF RECORD", 88 "STATUS",
87 » "TACACS UID", "OUTPUT MARKING", "TTYLOC", 89 "TIMING MARK",
88 » "3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW", 90 "RCTE",
89 » "LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION", 91 "NAOL",
90 » "ENCRYPT", "NEW-ENVIRON", 92 "NAOP",
91 » 0, 93 "NAOCRD",
92 }; 94 "NAOHTS",
93 #define»TELOPT_FIRST» TELOPT_BINARY 95 "NAOHTD",
94 #define»TELOPT_LAST» TELOPT_NEW_ENVIRON 96 "NAOFFD",
95 #define»TELOPT_OK(x)» ((unsigned int)(x) <= TELOPT_LAST) 97 "NAOVTS",
96 #define»TELOPT(x)» telopts[(x)-TELOPT_FIRST] 98 "NAOVTD",
97 #endif 99 "NAOLFD",
98 100 "EXTEND ASCII",
99 #define»TELQUAL_IS» 0 101 "LOGOUT",
100 #define»TELQUAL_SEND» 1 102 "BYTE MACRO",
101 #define»TELQUAL_INFO» 2 103 "DATA ENTRY TERMINAL",
102 #define»TELQUAL_REPLY» 2 104 "SUPDUP",
103 #define»TELQUAL_NAME» 3 105 "SUPDUP OUTPUT",
104 106 "SEND LOCATION",
105 #define»LFLOW_OFF» » 0 107 "TERMINAL TYPE",
106 #define»LFLOW_ON» » 1 108 "END OF RECORD",
107 #define»LFLOW_RESTART_ANY» 2 109 "TACACS UID",
108 #define»LFLOW_RESTART_XON» 3 110 "OUTPUT MARKING",
109 111 "TTYLOC",
110 112 "3270 REGIME",
111 #define»LM_MODE»» 1 113 "X.3 PAD",
112 #define»LM_FORWARDMASK» 2 114 "NAWS",
113 #define»LM_SLC» » 3 115 "TSPEED",
114 116 "LFLOW",
115 #define»MODE_EDIT» 0x01 117 "LINEMODE",
116 #define»MODE_TRAPSIG» 0x02 118 "XDISPLOC",
117 #define»MODE_ACK» 0x04 119 "OLD-ENVIRON",
118 #define MODE_SOFT_TAB» 0x08 120 "AUTHENTICATION",
119 #define MODE_LIT_ECHO» 0x10 121 "ENCRYPT",
120 122 "NEW-ENVIRON",
121 #define»MODE_MASK» 0x1f 123 0,
122 124 };
123 #define MODE_FLOW» » 0x0100 125 #define TELOPT_FIRST TELOPT_BINARY
124 #define MODE_ECHO» » 0x0200 126 #define TELOPT_LAST TELOPT_NEW_ENVIRON
125 #define MODE_INBIN» » 0x0400 127 #define TELOPT_OK(x) ((unsigned int)(x) <= TELOPT_LAST)
126 #define MODE_OUTBIN» » 0x0800 128 #define TELOPT(x) telopts[(x)-TELOPT_FIRST]
127 #define MODE_FORCE» » 0x1000 129 #endif
128 130
129 #define»SLC_SYNCH» 1 131 #define TELQUAL_IS 0
130 #define»SLC_BRK»» 2 132 #define TELQUAL_SEND 1
131 #define»SLC_IP» » 3 133 #define TELQUAL_INFO 2
132 #define»SLC_AO» » 4 134 #define TELQUAL_REPLY 2
133 #define»SLC_AYT»» 5 135 #define TELQUAL_NAME 3
134 #define»SLC_EOR»» 6 136
135 #define»SLC_ABORT» 7 137 #define LFLOW_OFF 0
136 #define»SLC_EOF»» 8 138 #define LFLOW_ON 1
137 #define»SLC_SUSP» 9 139 #define LFLOW_RESTART_ANY 2
138 #define»SLC_EC» » 10 140 #define LFLOW_RESTART_XON 3
139 #define»SLC_EL» » 11 141
140 #define»SLC_EW» » 12 142 #define LM_MODE 1
141 #define»SLC_RP» » 13 143 #define LM_FORWARDMASK 2
142 #define»SLC_LNEXT» 14 144 #define LM_SLC 3
143 #define»SLC_XON»» 15 145
144 #define»SLC_XOFF» 16 146 #define MODE_EDIT 0x01
145 #define»SLC_FORW1» 17 147 #define MODE_TRAPSIG 0x02
146 #define»SLC_FORW2» 18 148 #define MODE_ACK 0x04
147 149 #define MODE_SOFT_TAB 0x08
148 #define»NSLC» » 18 150 #define MODE_LIT_ECHO 0x10
149 151
150 #define»SLC_NAMELIST» "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \ 152 #define MODE_MASK 0x1f
151 » » » "ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", \ 153
152 » » » "LNEXT", "XON", "XOFF", "FORW1", "FORW2", 0, 154 #define MODE_FLOW 0x0100
153 #ifdef» SLC_NAMES 155 #define MODE_ECHO 0x0200
154 char *slc_names[] = { 156 #define MODE_INBIN 0x0400
155 » SLC_NAMELIST 157 #define MODE_OUTBIN 0x0800
156 }; 158 #define MODE_FORCE 0x1000
159
160 #define SLC_SYNCH 1
161 #define SLC_BRK 2
162 #define SLC_IP 3
163 #define SLC_AO 4
164 #define SLC_AYT 5
165 #define SLC_EOR 6
166 #define SLC_ABORT 7
167 #define SLC_EOF 8
168 #define SLC_SUSP 9
169 #define SLC_EC 10
170 #define SLC_EL 11
171 #define SLC_EW 12
172 #define SLC_RP 13
173 #define SLC_LNEXT 14
174 #define SLC_XON 15
175 #define SLC_XOFF 16
176 #define SLC_FORW1 17
177 #define SLC_FORW2 18
178
179 #define NSLC 18
180
181 #define SLC_NAMELIST \
182 "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", "ABORT", "EOF", "SUSP", "EC", \
183 "EL", "EW", "RP", "LNEXT", "XON", "XOFF", "FORW1", "FORW2", 0,
184 #ifdef SLC_NAMES
185 char* slc_names[] = {SLC_NAMELIST};
157 #else 186 #else
158 extern char *slc_names[]; 187 extern char* slc_names[];
159 #define»SLC_NAMES SLC_NAMELIST 188 #define SLC_NAMES SLC_NAMELIST
160 #endif 189 #endif
161 190
162 #define»SLC_NAME_OK(x)» ((unsigned int)(x) <= NSLC) 191 #define SLC_NAME_OK(x) ((unsigned int)(x) <= NSLC)
163 #define SLC_NAME(x)» slc_names[x] 192 #define SLC_NAME(x) slc_names[x]
164 193
165 #define»SLC_NOSUPPORT» 0 194 #define SLC_NOSUPPORT 0
166 #define»SLC_CANTCHANGE» 1 195 #define SLC_CANTCHANGE 1
167 #define»SLC_VARIABLE» 2 196 #define SLC_VARIABLE 2
168 #define»SLC_DEFAULT» 3 197 #define SLC_DEFAULT 3
169 #define»SLC_LEVELBITS» 0x03 198 #define SLC_LEVELBITS 0x03
170 199
171 #define»SLC_FUNC» 0 200 #define SLC_FUNC 0
172 #define»SLC_FLAGS» 1 201 #define SLC_FLAGS 1
173 #define»SLC_VALUE» 2 202 #define SLC_VALUE 2
174 203
175 #define»SLC_ACK»» 0x80 204 #define SLC_ACK 0x80
176 #define»SLC_FLUSHIN» 0x40 205 #define SLC_FLUSHIN 0x40
177 #define»SLC_FLUSHOUT» 0x20 206 #define SLC_FLUSHOUT 0x20
178 207
179 #define»OLD_ENV_VAR» 1 208 #define OLD_ENV_VAR 1
180 #define»OLD_ENV_VALUE» 0 209 #define OLD_ENV_VALUE 0
181 #define»NEW_ENV_VAR» 0 210 #define NEW_ENV_VAR 0
182 #define»NEW_ENV_VALUE» 1 211 #define NEW_ENV_VALUE 1
183 #define»ENV_ESC»» 2 212 #define ENV_ESC 2
184 #define ENV_USERVAR» 3 213 #define ENV_USERVAR 3
185 214
186 #define»AUTH_WHO_CLIENT»» 0 215 #define AUTH_WHO_CLIENT 0
187 #define»AUTH_WHO_SERVER»» 1 216 #define AUTH_WHO_SERVER 1
188 #define»AUTH_WHO_MASK» » 1 217 #define AUTH_WHO_MASK 1
189 218
190 #define»AUTH_HOW_ONE_WAY» 0 219 #define AUTH_HOW_ONE_WAY 0
191 #define»AUTH_HOW_MUTUAL»» 2 220 #define AUTH_HOW_MUTUAL 2
192 #define»AUTH_HOW_MASK» » 2 221 #define AUTH_HOW_MASK 2
193 222
194 #define»AUTHTYPE_NULL» » 0 223 #define AUTHTYPE_NULL 0
195 #define»AUTHTYPE_KERBEROS_V4» 1 224 #define AUTHTYPE_KERBEROS_V4 1
196 #define»AUTHTYPE_KERBEROS_V5» 2 225 #define AUTHTYPE_KERBEROS_V5 2
197 #define»AUTHTYPE_SPX» » 3 226 #define AUTHTYPE_SPX 3
198 #define»AUTHTYPE_MINK» » 4 227 #define AUTHTYPE_MINK 4
199 #define»AUTHTYPE_CNT» » 5 228 #define AUTHTYPE_CNT 5
200 229
201 #define»AUTHTYPE_TEST» » 99 230 #define AUTHTYPE_TEST 99
202 231
203 #ifdef» AUTH_NAMES 232 #ifdef AUTH_NAMES
204 char *authtype_names[] = { 233 char* authtype_names[] = {
205 » "NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK", 0, 234 "NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK", 0,
206 }; 235 };
207 #else 236 #else
208 extern char *authtype_names[]; 237 extern char* authtype_names[];
209 #endif 238 #endif
210 239
211 #define»AUTHTYPE_NAME_OK(x)» ((unsigned int)(x) < AUTHTYPE_CNT) 240 #define AUTHTYPE_NAME_OK(x) ((unsigned int)(x) < AUTHTYPE_CNT)
212 #define»AUTHTYPE_NAME(x)» authtype_names[x] 241 #define AUTHTYPE_NAME(x) authtype_names[x]
213 242
214 #define»ENCRYPT_IS» » 0 243 #define ENCRYPT_IS 0
215 #define»ENCRYPT_SUPPORT»» 1 244 #define ENCRYPT_SUPPORT 1
216 #define»ENCRYPT_REPLY» » 2 245 #define ENCRYPT_REPLY 2
217 #define»ENCRYPT_START» » 3 246 #define ENCRYPT_START 3
218 #define»ENCRYPT_END» » 4 247 #define ENCRYPT_END 4
219 #define»ENCRYPT_REQSTART» 5 248 #define ENCRYPT_REQSTART 5
220 #define»ENCRYPT_REQEND» » 6 249 #define ENCRYPT_REQEND 6
221 #define»ENCRYPT_ENC_KEYID» 7 250 #define ENCRYPT_ENC_KEYID 7
222 #define»ENCRYPT_DEC_KEYID» 8 251 #define ENCRYPT_DEC_KEYID 8
223 #define»ENCRYPT_CNT» » 9 252 #define ENCRYPT_CNT 9
224 253
225 #define»ENCTYPE_ANY» » 0 254 #define ENCTYPE_ANY 0
226 #define»ENCTYPE_DES_CFB64» 1 255 #define ENCTYPE_DES_CFB64 1
227 #define»ENCTYPE_DES_OFB64» 2 256 #define ENCTYPE_DES_OFB64 2
228 #define»ENCTYPE_CNT» » 3 257 #define ENCTYPE_CNT 3
229 258
230 #ifdef» ENCRYPT_NAMES 259 #ifdef ENCRYPT_NAMES
231 char *encrypt_names[] = { 260 char* encrypt_names[] = {
232 » "IS", "SUPPORT", "REPLY", "START", "END", 261 "IS", "SUPPORT", "REPLY", "START", "END", "REQUEST-START",
233 » "REQUEST-START", "REQUEST-END", "ENC-KEYID", "DEC-KEYID", 262 "REQUEST-END", "ENC-KEYID", "DEC-KEYID", 0,
234 » 0, 263 };
235 }; 264 char* enctype_names[] = {
236 char *enctype_names[] = { 265 "ANY", "DES_CFB64", "DES_OFB64", 0,
237 » "ANY", "DES_CFB64", "DES_OFB64", 0,
238 }; 266 };
239 #else 267 #else
240 extern char *encrypt_names[]; 268 extern char* encrypt_names[];
241 extern char *enctype_names[]; 269 extern char* enctype_names[];
242 #endif 270 #endif
243 271
244 272 #define ENCRYPT_NAME_OK(x) ((unsigned int)(x) < ENCRYPT_CNT)
245 #define»ENCRYPT_NAME_OK(x)» ((unsigned int)(x) < ENCRYPT_CNT) 273 #define ENCRYPT_NAME(x) encrypt_names[x]
246 #define»ENCRYPT_NAME(x)»» encrypt_names[x] 274
247 275 #define ENCTYPE_NAME_OK(x) ((unsigned int)(x) < ENCTYPE_CNT)
248 #define»ENCTYPE_NAME_OK(x)» ((unsigned int)(x) < ENCTYPE_CNT) 276 #define ENCTYPE_NAME(x) enctype_names[x]
249 #define»ENCTYPE_NAME(x)»» enctype_names[x] 277
250 278 #endif
251 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698