Fix miscellaneous compiler warnings. Thanks to Jacob Nevins
[u/mdw/putty] / telnet.c
CommitLineData
374330e2 1#include <windows.h>
2#include <stdio.h>
3#include <stdlib.h>
374330e2 4
5#include "putty.h"
6
7#ifndef FALSE
8#define FALSE 0
9#endif
10#ifndef TRUE
11#define TRUE 1
12#endif
13
8df7a775 14static Socket s = NULL;
374330e2 15
16#define IAC 255 /* interpret as command: */
17#define DONT 254 /* you are not to use option */
18#define DO 253 /* please, you use option */
19#define WONT 252 /* I won't use option */
20#define WILL 251 /* I will use option */
21#define SB 250 /* interpret as subnegotiation */
22#define SE 240 /* end sub negotiation */
23
24#define GA 249 /* you may reverse the line */
25#define EL 248 /* erase the current line */
26#define EC 247 /* erase the current character */
27#define AYT 246 /* are you there */
28#define AO 245 /* abort output--but let prog finish */
29#define IP 244 /* interrupt process--permanently */
30#define BREAK 243 /* break */
31#define DM 242 /* data mark--for connect. cleaning */
32#define NOP 241 /* nop */
33#define EOR 239 /* end of record (transparent mode) */
34#define ABORT 238 /* Abort process */
35#define SUSP 237 /* Suspend process */
36#define xEOF 236 /* End of file: EOF is already used... */
37
38#define TELOPT_BINARY 0 /* 8-bit data path */
39#define TELOPT_ECHO 1 /* echo */
40#define TELOPT_RCP 2 /* prepare to reconnect */
41#define TELOPT_SGA 3 /* suppress go ahead */
42#define TELOPT_NAMS 4 /* approximate message size */
43#define TELOPT_STATUS 5 /* give status */
44#define TELOPT_TM 6 /* timing mark */
45#define TELOPT_RCTE 7 /* remote controlled transmission and echo */
46#define TELOPT_NAOL 8 /* negotiate about output line width */
47#define TELOPT_NAOP 9 /* negotiate about output page size */
48#define TELOPT_NAOCRD 10 /* negotiate about CR disposition */
49#define TELOPT_NAOHTS 11 /* negotiate about horizontal tabstops */
50#define TELOPT_NAOHTD 12 /* negotiate about horizontal tab disposition */
51#define TELOPT_NAOFFD 13 /* negotiate about formfeed disposition */
52#define TELOPT_NAOVTS 14 /* negotiate about vertical tab stops */
53#define TELOPT_NAOVTD 15 /* negotiate about vertical tab disposition */
54#define TELOPT_NAOLFD 16 /* negotiate about output LF disposition */
55#define TELOPT_XASCII 17 /* extended ascic character set */
56#define TELOPT_LOGOUT 18 /* force logout */
57#define TELOPT_BM 19 /* byte macro */
58#define TELOPT_DET 20 /* data entry terminal */
59#define TELOPT_SUPDUP 21 /* supdup protocol */
60#define TELOPT_SUPDUPOUTPUT 22 /* supdup output */
61#define TELOPT_SNDLOC 23 /* send location */
62#define TELOPT_TTYPE 24 /* terminal type */
63#define TELOPT_EOR 25 /* end or record */
64#define TELOPT_TUID 26 /* TACACS user identification */
65#define TELOPT_OUTMRK 27 /* output marking */
66#define TELOPT_TTYLOC 28 /* terminal location number */
67#define TELOPT_3270REGIME 29 /* 3270 regime */
68#define TELOPT_X3PAD 30 /* X.3 PAD */
69#define TELOPT_NAWS 31 /* window size */
70#define TELOPT_TSPEED 32 /* terminal speed */
71#define TELOPT_LFLOW 33 /* remote flow control */
72#define TELOPT_LINEMODE 34 /* Linemode option */
73#define TELOPT_XDISPLOC 35 /* X Display Location */
74#define TELOPT_OLD_ENVIRON 36 /* Old - Environment variables */
75#define TELOPT_AUTHENTICATION 37/* Authenticate */
76#define TELOPT_ENCRYPT 38 /* Encryption option */
77#define TELOPT_NEW_ENVIRON 39 /* New - Environment variables */
78#define TELOPT_EXOPL 255 /* extended-options-list */
79
80#define TELQUAL_IS 0 /* option is... */
81#define TELQUAL_SEND 1 /* send option */
82#define TELQUAL_INFO 2 /* ENVIRON: informational version of IS */
83#define BSD_VAR 1
84#define BSD_VALUE 0
85#define RFC_VAR 0
86#define RFC_VALUE 1
87
88#define CR 13
89#define LF 10
90#define NUL 0
91
92#define iswritable(x) ( (x) != IAC && (x) != CR )
93
94static char *telopt(int opt) {
95#define i(x) if (opt == TELOPT_ ## x) return #x;
96 i(BINARY); i(ECHO); i(RCP); i(SGA); i(NAMS); i(STATUS); i(TM); i(RCTE);
97 i(NAOL); i(NAOP); i(NAOCRD); i(NAOHTS); i(NAOHTD); i(NAOFFD); i(NAOVTS);
98 i(NAOVTD); i(NAOLFD); i(XASCII); i(LOGOUT); i(BM); i(DET); i(SUPDUP);
99 i(SUPDUPOUTPUT); i(SNDLOC); i(TTYPE); i(EOR); i(TUID); i(OUTMRK);
100 i(TTYLOC); i(X3PAD); i(NAWS); i(TSPEED); i(LFLOW); i(LINEMODE);
101 i(XDISPLOC); i(OLD_ENVIRON); i(AUTHENTICATION); i(ENCRYPT);
102 i(NEW_ENVIRON); i(EXOPL);
103#undef i
104 return "<unknown>";
105}
106
107static void telnet_size(void);
108
109struct Opt {
110 int send; /* what we initially send */
111 int nsend; /* -ve send if requested to stop it */
112 int ack, nak; /* +ve and -ve acknowledgements */
113 int option; /* the option code */
114 enum {
115 REQUESTED, ACTIVE, INACTIVE, REALLY_INACTIVE
116 } state;
117};
118
119static struct Opt o_naws = {WILL, WONT, DO, DONT, TELOPT_NAWS, REQUESTED};
120static struct Opt o_tspeed = {WILL, WONT, DO, DONT, TELOPT_TSPEED, REQUESTED};
121static struct Opt o_ttype = {WILL, WONT, DO, DONT, TELOPT_TTYPE, REQUESTED};
122static struct Opt o_oenv = {WILL, WONT, DO, DONT, TELOPT_OLD_ENVIRON,
123 INACTIVE};
124static struct Opt o_nenv = {WILL, WONT, DO, DONT, TELOPT_NEW_ENVIRON,
125 REQUESTED};
126static struct Opt o_echo = {DO, DONT, WILL, WONT, TELOPT_ECHO, REQUESTED};
127static struct Opt o_we_sga = {WILL, WONT, DO, DONT, TELOPT_SGA, REQUESTED};
128static struct Opt o_they_sga = {DO, DONT, WILL, WONT, TELOPT_SGA, REQUESTED};
129
130static struct Opt *opts[] = {
131 &o_naws, &o_tspeed, &o_ttype, &o_oenv, &o_nenv, &o_echo,
132 &o_we_sga, &o_they_sga, NULL
133};
134
374330e2 135static int in_synch;
374330e2 136static int sb_opt, sb_len;
137static char *sb_buf = NULL;
138static int sb_size = 0;
139#define SB_DELTA 1024
140
fe50e814 141static void c_write1(int c) {
142 char cc = (char)c;
143 from_backend(0, &cc, 1);
144}
145
374330e2 146static void log_option (char *sender, int cmd, int option) {
147 char buf[50];
148 sprintf(buf, "%s:\t%s %s", sender,
149 (cmd == WILL ? "WILL" : cmd == WONT ? "WONT" :
150 cmd == DO ? "DO" : cmd == DONT ? "DONT" : "<??>"),
151 telopt(option));
c5e9c988 152 logevent(buf);
374330e2 153}
154
155static void send_opt (int cmd, int option) {
156 unsigned char b[3];
157
158 b[0] = IAC; b[1] = cmd; b[2] = option;
8df7a775 159 sk_write(s, b, 3);
374330e2 160 log_option("client", cmd, option);
161}
162
163static void deactivate_option (struct Opt *o) {
164 if (o->state == REQUESTED || o->state == ACTIVE)
165 send_opt (o->nsend, o->option);
166 o->state = REALLY_INACTIVE;
167}
168
169static void activate_option (struct Opt *o) {
170 if (o->send == WILL && o->option == TELOPT_NAWS)
171 telnet_size();
172 if (o->send == WILL &&
173 (o->option == TELOPT_NEW_ENVIRON ||
174 o->option == TELOPT_OLD_ENVIRON)) {
175 /*
176 * We may only have one kind of ENVIRON going at a time.
177 * This is a hack, but who cares.
178 */
179 deactivate_option (o->option==TELOPT_NEW_ENVIRON ? &o_oenv : &o_nenv);
180 }
2f938b83 181 if (o->option == TELOPT_ECHO && cfg.ldisc_term)
684d367c 182 ldisc = &ldisc_simple;
374330e2 183}
184
185static void refused_option (struct Opt *o) {
186 if (o->send == WILL && o->option == TELOPT_NEW_ENVIRON &&
187 o_oenv.state == INACTIVE) {
188 send_opt (WILL, TELOPT_OLD_ENVIRON);
189 o_oenv.state = REQUESTED;
190 }
2f938b83 191 if (o->option == TELOPT_ECHO && cfg.ldisc_term)
684d367c 192 ldisc = &ldisc_term;
374330e2 193}
194
195static void proc_rec_opt (int cmd, int option) {
196 struct Opt **o;
197
198 log_option ("server", cmd, option);
199 for (o = opts; *o; o++) {
200 if ((*o)->option == option && (*o)->ack == cmd) {
201 switch ((*o)->state) {
202 case REQUESTED:
203 (*o)->state = ACTIVE;
204 activate_option (*o);
205 break;
206 case ACTIVE:
207 break;
208 case INACTIVE:
209 (*o)->state = ACTIVE;
210 send_opt ((*o)->send, option);
211 activate_option (*o);
212 break;
213 case REALLY_INACTIVE:
214 send_opt ((*o)->nsend, option);
215 break;
216 }
217 return;
218 } else if ((*o)->option == option && (*o)->nak == cmd) {
219 switch ((*o)->state) {
220 case REQUESTED:
221 (*o)->state = INACTIVE;
222 refused_option (*o);
223 break;
224 case ACTIVE:
225 (*o)->state = INACTIVE;
226 send_opt ((*o)->nsend, option);
227 break;
228 case INACTIVE:
229 case REALLY_INACTIVE:
230 break;
231 }
232 return;
233 }
234 }
235 /*
236 * If we reach here, the option was one we weren't prepared to
237 * cope with. So send a negative ack.
238 */
239 send_opt ((cmd == WILL ? DONT : WONT), option);
240}
241
242static void process_subneg (void) {
243 unsigned char b[2048], *p, *q;
244 int var, value, n;
245 char *e;
246
247 switch (sb_opt) {
248 case TELOPT_TSPEED:
249 if (sb_len == 1 && sb_buf[0] == TELQUAL_SEND) {
250 char logbuf[sizeof(cfg.termspeed)+80];
251 b[0] = IAC; b[1] = SB; b[2] = TELOPT_TSPEED;
252 b[3] = TELQUAL_IS;
253 strcpy(b+4, cfg.termspeed);
254 n = 4 + strlen(cfg.termspeed);
255 b[n] = IAC; b[n+1] = SE;
8df7a775 256 sk_write(s, b, n+2);
c5e9c988 257 logevent("server:\tSB TSPEED SEND");
374330e2 258 sprintf(logbuf, "client:\tSB TSPEED IS %s", cfg.termspeed);
c5e9c988 259 logevent (logbuf);
374330e2 260 } else
c5e9c988 261 logevent ("server:\tSB TSPEED <something weird>");
374330e2 262 break;
263 case TELOPT_TTYPE:
264 if (sb_len == 1 && sb_buf[0] == TELQUAL_SEND) {
265 char logbuf[sizeof(cfg.termtype)+80];
266 b[0] = IAC; b[1] = SB; b[2] = TELOPT_TTYPE;
267 b[3] = TELQUAL_IS;
268 for (n = 0; cfg.termtype[n]; n++)
269 b[n+4] = (cfg.termtype[n] >= 'a' && cfg.termtype[n] <= 'z' ?
270 cfg.termtype[n] + 'A'-'a' : cfg.termtype[n]);
271 b[n+4] = IAC; b[n+5] = SE;
8df7a775 272 sk_write(s, b, n+6);
374330e2 273 b[n+4] = 0;
c5e9c988 274 logevent("server:\tSB TTYPE SEND");
374330e2 275 sprintf(logbuf, "client:\tSB TTYPE IS %s", b+4);
c5e9c988 276 logevent(logbuf);
374330e2 277 } else
c5e9c988 278 logevent("server:\tSB TTYPE <something weird>\r\n");
374330e2 279 break;
280 case TELOPT_OLD_ENVIRON:
281 case TELOPT_NEW_ENVIRON:
282 p = sb_buf;
283 q = p + sb_len;
284 if (p < q && *p == TELQUAL_SEND) {
285 char logbuf[50];
286 p++;
287 sprintf (logbuf, "server:\tSB %s SEND", telopt(sb_opt));
c5e9c988 288 logevent (logbuf);
374330e2 289 if (sb_opt == TELOPT_OLD_ENVIRON) {
290 if (cfg.rfc_environ) {
291 value = RFC_VALUE;
292 var = RFC_VAR;
293 } else {
294 value = BSD_VALUE;
295 var = BSD_VAR;
296 }
297 /*
298 * Try to guess the sense of VAR and VALUE.
299 */
300 while (p < q) {
301 if (*p == RFC_VAR) {
302 value = RFC_VALUE;
303 var = RFC_VAR;
304 } else if (*p == BSD_VAR) {
305 value = BSD_VALUE;
306 var = BSD_VAR;
307 }
308 p++;
309 }
310 } else {
311 /*
312 * With NEW_ENVIRON, the sense of VAR and VALUE
313 * isn't in doubt.
314 */
315 value = RFC_VALUE;
316 var = RFC_VAR;
317 }
318 b[0] = IAC; b[1] = SB; b[2] = sb_opt;
319 b[3] = TELQUAL_IS;
320 n = 4;
37508af4 321 e = cfg.environmt;
374330e2 322 while (*e) {
323 b[n++] = var;
324 while (*e && *e != '\t') b[n++] = *e++;
325 if (*e == '\t') e++;
326 b[n++] = value;
327 while (*e) b[n++] = *e++;
328 e++;
329 }
330 if (*cfg.username) {
331 b[n++] = var; b[n++] = 'U'; b[n++] = 'S';
332 b[n++] = 'E'; b[n++] = 'R'; b[n++] = value;
333 e = cfg.username;
334 while (*e) b[n++] = *e++;
335 }
336 b[n++] = IAC; b[n++] = SE;
8df7a775 337 sk_write(s, b, n);
374330e2 338 sprintf(logbuf, "client:\tSB %s IS %s", telopt(sb_opt),
339 n==6 ? "<nothing>" : "<stuff>");
c5e9c988 340 logevent (logbuf);
374330e2 341 }
342 break;
343 }
344}
345
346static enum {
347 TOPLEVEL, SEENIAC, SEENWILL, SEENWONT, SEENDO, SEENDONT,
348 SEENSB, SUBNEGOT, SUBNEG_IAC, SEENCR
349} telnet_state = TOPLEVEL;
350
351static void do_telnet_read (char *buf, int len) {
374330e2 352
353 while (len--) {
354 int c = (unsigned char) *buf++;
355
356 switch (telnet_state) {
357 case TOPLEVEL:
358 case SEENCR:
359 if (c == NUL && telnet_state == SEENCR)
360 telnet_state = TOPLEVEL;
361 else if (c == IAC)
362 telnet_state = SEENIAC;
363 else {
374330e2 364 if (!in_synch)
c9def1b8 365 c_write1(c);
2f938b83 366
367#if 1
368 /* I can't get the F***ing winsock to insert the urgent IAC
369 * into the right position! Even with SO_OOBINLINE it gives
370 * it to recv too soon. And of course the DM byte (that
371 * arrives in the same packet!) appears several K later!!
372 *
373 * Oh well, we do get the DM in the right place so I'll
374 * just stop hiding on the next 0xf2 and hope for the best.
375 */
376 else if (c == DM) in_synch = 0;
377#endif
374330e2 378 if (c == CR)
379 telnet_state = SEENCR;
380 else
381 telnet_state = TOPLEVEL;
382 }
383 break;
384 case SEENIAC:
385 if (c == DO) telnet_state = SEENDO;
386 else if (c == DONT) telnet_state = SEENDONT;
387 else if (c == WILL) telnet_state = SEENWILL;
388 else if (c == WONT) telnet_state = SEENWONT;
389 else if (c == SB) telnet_state = SEENSB;
2f938b83 390 else if (c == DM) {
391 in_synch = 0;
392 telnet_state = TOPLEVEL;
393 }
300d41b0 394 else {
ded38628 395 /* ignore everything else; print it if it's IAC */
396 if (c == IAC) {
c9def1b8 397 c_write1(c);
ded38628 398 }
300d41b0 399 telnet_state = TOPLEVEL;
400 }
374330e2 401 break;
402 case SEENWILL:
403 proc_rec_opt (WILL, c);
404 telnet_state = TOPLEVEL;
405 break;
406 case SEENWONT:
407 proc_rec_opt (WONT, c);
408 telnet_state = TOPLEVEL;
409 break;
410 case SEENDO:
411 proc_rec_opt (DO, c);
412 telnet_state = TOPLEVEL;
413 break;
414 case SEENDONT:
415 proc_rec_opt (DONT, c);
416 telnet_state = TOPLEVEL;
417 break;
418 case SEENSB:
419 sb_opt = c;
420 sb_len = 0;
421 telnet_state = SUBNEGOT;
422 break;
423 case SUBNEGOT:
424 if (c == IAC)
425 telnet_state = SUBNEG_IAC;
426 else {
427 subneg_addchar:
428 if (sb_len >= sb_size) {
429 char *newbuf;
430 sb_size += SB_DELTA;
431 newbuf = (sb_buf ?
c9def1b8 432 srealloc(sb_buf, sb_size) :
433 smalloc(sb_size));
374330e2 434 if (newbuf)
435 sb_buf = newbuf;
436 else
437 sb_size -= SB_DELTA;
438 }
439 if (sb_len < sb_size)
440 sb_buf[sb_len++] = c;
441 telnet_state = SUBNEGOT;/* in case we came here by goto */
442 }
443 break;
444 case SUBNEG_IAC:
445 if (c != SE)
446 goto subneg_addchar; /* yes, it's a hack, I know, but... */
447 else {
448 process_subneg();
449 telnet_state = TOPLEVEL;
450 }
451 break;
452 }
453 }
454}
455
8df7a775 456static int telnet_receive(Socket s, int urgent, char *data, int len) {
457 if (!len) {
458 /* Connection has closed. */
459 sk_close(s);
460 s = NULL;
461 return 0;
462 }
463 do_telnet_read (data, len);
464 return 1;
465}
466
374330e2 467/*
8df7a775 468 * Called to set up the Telnet connection.
374330e2 469 *
470 * Returns an error message, or NULL on success.
471 *
472 * Also places the canonical host name into `realhost'.
473 */
8df7a775 474static char *telnet_init (char *host, int port, char **realhost) {
475 SockAddr addr;
476 char *err;
374330e2 477
478 /*
479 * Try to find host.
480 */
8df7a775 481 addr = sk_namelookup(host, realhost);
482 if ( (err = sk_addr_error(addr)) )
483 return err;
374330e2 484
485 if (port < 0)
486 port = 23; /* default telnet port */
487
488 /*
489 * Open socket.
490 */
8df7a775 491 s = sk_new(addr, port, telnet_receive);
492 if ( (err = sk_socket_error(s)) )
493 return err;
374330e2 494
8df7a775 495 sk_addr_free(addr);
374330e2 496
497 /*
498 * Initialise option states.
499 */
eb5e1db9 500 if( cfg.ldisc_term )
501 {
502 struct Opt **o;
503
504 for (o = opts; *o; o++)
505 if ((*o)->state == REQUESTED)
506 (*o)->state = INACTIVE;
507 }
508 else
374330e2 509 {
510 struct Opt **o;
511
512 for (o = opts; *o; o++)
513 if ((*o)->state == REQUESTED)
514 send_opt ((*o)->send, (*o)->option);
515 }
516
374330e2 517 /*
518 * Set up SYNCH state.
519 */
520 in_synch = FALSE;
6f34e365 521
522 /*
523 * We have no pre-session phase.
524 */
525 begin_session();
526
374330e2 527 return NULL;
528}
529
530/*
374330e2 531 * Called to send data down the Telnet connection.
532 */
533static void telnet_send (char *buf, int len) {
534 char *p;
535 static unsigned char iac[2] = { IAC, IAC };
536 static unsigned char cr[2] = { CR, NUL };
eb5e1db9 537 static unsigned char nl[2] = { CR, LF };
374330e2 538
8df7a775 539 if (s == NULL)
374330e2 540 return;
541
542 p = buf;
2f938b83 543 while (p < buf+len) {
374330e2 544 char *q = p;
545
546 while (iswritable((unsigned char)*p) && p < buf+len) p++;
8df7a775 547 sk_write(s, q, p-q);
374330e2 548
549 while (p < buf+len && !iswritable((unsigned char)*p)) {
8df7a775 550 sk_write(s, (unsigned char)*p == IAC ? iac : nl, 2);
374330e2 551 p++;
552 }
553 }
554}
555
556/*
557 * Called to set the size of the window from Telnet's POV.
558 */
559static void telnet_size(void) {
560 unsigned char b[16];
561 char logbuf[50];
562
8df7a775 563 if (s == NULL || o_naws.state != ACTIVE)
374330e2 564 return;
565 b[0] = IAC; b[1] = SB; b[2] = TELOPT_NAWS;
566 b[3] = cols >> 8; b[4] = cols & 0xFF;
567 b[5] = rows >> 8; b[6] = rows & 0xFF;
568 b[7] = IAC; b[8] = SE;
8df7a775 569 sk_write(s, b, 9);
374330e2 570 sprintf(logbuf, "client:\tSB NAWS %d,%d",
571 ((unsigned char)b[3] << 8) + (unsigned char)b[4],
572 ((unsigned char)b[5] << 8) + (unsigned char)b[6]);
c5e9c988 573 logevent (logbuf);
374330e2 574}
575
576/*
577 * Send Telnet special codes.
578 */
579static void telnet_special (Telnet_Special code) {
580 unsigned char b[2];
581
8df7a775 582 if (s == NULL)
374330e2 583 return;
584
585 b[0] = IAC;
586 switch (code) {
8df7a775 587 case TS_AYT: b[1] = AYT; sk_write(s, b, 2); break;
588 case TS_BRK: b[1] = BREAK; sk_write(s, b, 2); break;
589 case TS_EC: b[1] = EC; sk_write(s, b, 2); break;
590 case TS_EL: b[1] = EL; sk_write(s, b, 2); break;
591 case TS_GA: b[1] = GA; sk_write(s, b, 2); break;
592 case TS_NOP: b[1] = NOP; sk_write(s, b, 2); break;
593 case TS_ABORT: b[1] = ABORT; sk_write(s, b, 2); break;
594 case TS_AO: b[1] = AO; sk_write(s, b, 2); break;
595 case TS_IP: b[1] = IP; sk_write(s, b, 2); break;
596 case TS_SUSP: b[1] = SUSP; sk_write(s, b, 2); break;
597 case TS_EOR: b[1] = EOR; sk_write(s, b, 2); break;
598 case TS_EOF: b[1] = xEOF; sk_write(s, b, 2); break;
374330e2 599 case TS_SYNCH:
8df7a775 600 b[1] = DM;
601 sk_write (s, b, 1);
602 sk_write_oob (s, b+1, 1);
603 break;
684d367c 604 case TS_RECHO:
605 if (o_echo.state == INACTIVE || o_echo.state == REALLY_INACTIVE) {
606 o_echo.state = REQUESTED;
607 send_opt (o_echo.send, o_echo.option);
608 }
609 break;
610 case TS_LECHO:
611 if (o_echo.state == ACTIVE) {
612 o_echo.state = REQUESTED;
613 send_opt (o_echo.nsend, o_echo.option);
614 }
374330e2 615 break;
ec55b220 616 case TS_PING:
617 if (o_they_sga.state == ACTIVE) {
618 b[1] = NOP;
8df7a775 619 sk_write(s, b, 2);
ec55b220 620 }
621 break;
374330e2 622 }
623}
624
8df7a775 625static Socket telnet_socket(void) { return s; }
8ccc75b0 626
627static int telnet_sendok(void) { return 1; }
4017be6d 628
374330e2 629Backend telnet_backend = {
630 telnet_init,
374330e2 631 telnet_send,
632 telnet_size,
4017be6d 633 telnet_special,
8ccc75b0 634 telnet_socket,
97db3be4 635 telnet_sendok,
636 23
374330e2 637};