1 /* ckctel.h -- Symbol and macro definitions for C-Kermit telnet support */
4 Authors: Jeffrey E Altman <jaltman@secure-endpoints.com>,
5 Secure Endpoints Inc., New York City
6 Frank da Cruz <fdc@columbia.edu>
7 Columbia University Academic Information Systems, New York City.
9 Copyright (C) 1985, 2009,
10 Trustees of Columbia University in the City of New York.
11 All rights reserved. See the C-Kermit COPYING.TXT file or the
12 copyright text in the ckcmai.c module for disclaimer and permissions.
15 . This file should be used in place of "arpa/telnet.h"
16 . Only one source file should include #defines for
17 TELCMDS, TELOPTS, TELOPT_STATES, SLC_NAMES, and AUTH_NAMES.
24 Definitions for the TELNET protocol.
25 can't rely on library header files for any of them.
28 /* In some compilers these are prone to sign extension */
30 #ifndef IAC /* First the telnet commands */
91 #define LAST_TN_CMD 236
93 #define TN_SAK 200 /* IBM Secure Attention Key */
94 #endif /* LAST_TN_CMD */
95 #define SYNCH 242 /* for telfunc calls */
98 /* Hex notation seems to suppress the sugn extension effect */
101 #ifndef IAC /* First the telnet commands */
105 #define DONT 0xfe /* 254 */
108 #define DO 0xfd /* 253 */
111 #define WONT 0xfc /* 252 */
114 #define WILL 0xfb /* 251 */
117 #define SB 0xfa /* 250 */
120 #define TN_GA 0xf9 /* 249 */
123 #define TN_EL 0xf8 /* 248 */
126 #define TN_EC 0xf7 /* 247 */
129 #define TN_AYT 0xf6 /* 246 */
132 #define TN_AO 0xf5 /* 245 */
135 #define TN_IP 0xf4 /* 244 */
138 #define BREAK 0xf3 /* 243 */
141 #define TN_DM 0xf2 /* 242 */
144 #define TN_NOP 0xf1 /* 241 */
147 #define SE 0xf0 /* 240 */
150 #define TN_EOR 0xef /* 239 */
153 #define TN_ABORT 0xee /* 238 */
154 #endif /* TN_ABORT */
156 #define TN_SUSP 0xed /* 237 */
159 #define TN_EOF 0xec /* 236 */
162 #define LAST_TN_CMD 0xec /* 236 */
164 #define TN_SAK 0xc8 /* 200 - IBM Secure Attention Key */
165 #endif /* LAST_TN_CMD */
166 #define SYNCH 0xf2 /* 242 - for telfunc calls */
172 "EOF", "SUSP", "ABORT", "EOR",
173 "SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC",
174 "EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC", 0
177 extern char *telcmds[];
180 #define TELCMD_FIRST TN_EOF
181 #define TELCMD_LAST IAC
182 #define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && \
183 (unsigned int)(x) >= TELCMD_FIRST || \
184 (unsigned int)(x) == TN_SAK)
185 #define TELCMD(x) (TELCMD_OK(x)? ((x) == TN_SAK?"SAK": \
186 telcmds[(x)-TELCMD_FIRST]):"UNKNOWN")
188 /* Then the options */
189 /* NB: the following platforms have TELOPT_AUTHENTICATION defined as */
190 /* 45 instead of 37. */
191 #ifdef TELOPT_AUTHENTICATION
193 #undef TELOPT_AUTHENTICATION
196 #undef TELOPT_AUTHENTICATION
199 #undef TELOPT_AUTHENTICATION
201 #endif /* TELOPT_AUTHENTICATION */
204 #ifndef TELOPT_BINARY
205 #define TELOPT_BINARY 0 /* 8-bit data path (RFC 856)*/
208 #define TELOPT_ECHO 1 /* echo (RFC 857)*/
211 #define TELOPT_RCP 2 /* prepare to reconnect (NIC 50005)*/
214 #define TELOPT_SGA 3 /* suppress go ahead (RFC 858) */
217 #define TELOPT_NAMS 4 /* approximate message size (ETHERNET) */
219 #ifndef TELOPT_STATUS
220 #define TELOPT_STATUS 5 /* give status (RFC 859) */
223 #define TELOPT_TM 6 /* timing mark (RFC 860) */
226 #define TELOPT_RCTE 7 /* remote controlled transmission and echo */
227 #endif /* (RFC 726) */
229 #define TELOPT_NAOL 8 /* negotiate about output line width */
230 #endif /* (NIC 50005) */
232 #define TELOPT_NAOP 9 /* negotiate about output page size */
233 #endif /* (NIC 50005) */
234 #ifndef TELOPT_NAOCRD
235 #define TELOPT_NAOCRD 10 /* negotiate about CR disposition (RFC 652) */
236 #endif /* [Historic] */
237 #ifndef TELOPT_NAOHTS
238 #define TELOPT_NAOHTS 11 /* negotiate about horizontal tabstops */
239 #endif /* (RFC 653) [Historic] */
240 #ifndef TELOPT_NAOHTD
241 #define TELOPT_NAOHTD 12 /* negotiate about horiz tab disposition */
242 #endif /* (RFC 654) [Historic] */
243 #ifndef TELOPT_NAOFFD
244 #define TELOPT_NAOFFD 13 /* negotiate about formfeed disposition */
245 #endif /* (RFC 655) [Historic] */
246 #ifndef TELOPT_NAOVTS
247 #define TELOPT_NAOVTS 14 /* negotiate about vertical tab stops */
248 #endif /* (RFC 656) [Historic] */
249 #ifndef TELOPT_NAOVTD
250 #define TELOPT_NAOVTD 15 /* negotiate about vertical tab disposition */
251 #endif /* (RFC 657) [Historic] */
252 #ifndef TELOPT_NAOLFD
253 #define TELOPT_NAOLFD 16 /* negotiate about output LF disposition */
254 #endif /* (RFC 658) [Historic] */
255 #ifndef TELOPT_XASCII
256 #define TELOPT_XASCII 17 /* extended ascii character set */
257 #endif /* (RFC 698) */
258 #ifndef TELOPT_LOGOUT
259 #define TELOPT_LOGOUT 18 /* force logout (RFC 727) */
262 #define TELOPT_BM 19 /* byte macro (RFC 735) */
265 #define TELOPT_DET 20 /* data entry terminal (RFC 1043, 732) */
267 #ifndef TELOPT_SUPDUP
268 #define TELOPT_SUPDUP 21 /* supdup protocol (RFC 736, 734) */
270 #ifndef TELOPT_SUPDUPOUTPUT
271 #define TELOPT_SUPDUPOUTPUT 22 /* supdup output (RFC 749) */
273 #ifndef TELOPT_SNDLOC
274 #define TELOPT_SNDLOC 23 /* send location (RFC 779) */
277 #define TELOPT_TTYPE 24 /* terminal type (RFC 1091) */
280 #define TELOPT_EOR 25 /* end of record (RFC 885) */
283 #define TELOPT_TUID 26 /* TACACS user identification (RFC 927) */
285 #ifndef TELOPT_OUTMRK
286 #define TELOPT_OUTMRK 27 /* output marking (RFC 933) */
288 #ifndef TELOPT_TTYLOC
289 #define TELOPT_TTYLOC 28 /* terminal location number (RFC 946) */
291 #ifndef TELOPT_3270REGIME
292 #define TELOPT_3270REGIME 29 /* 3270 regime (RFC 1041) */
295 #define TELOPT_X3PAD 30 /* X.3 PAD (RFC 1053) */
298 #define TELOPT_NAWS 31 /* window size (RFC 1073) */
300 #ifndef TELOPT_TSPEED
301 #define TELOPT_TSPEED 32 /* terminal speed (RFC 1079) */
304 #define TELOPT_LFLOW 33 /* remote flow control (RFC 1372) */
306 #ifndef TELOPT_LINEMODE
307 #define TELOPT_LINEMODE 34 /* Linemode option (RFC 1184) */
309 #ifndef TELOPT_XDISPLOC
310 #define TELOPT_XDISPLOC 35 /* X Display Location (RFC 1096) */
312 #ifndef TELOPT_OLD_ENVIRON
313 #define TELOPT_OLD_ENVIRON 36 /* Old - Environment variables (RFC 1408) */
315 #ifndef TELOPT_AUTHENTICATION
316 #define TELOPT_AUTHENTICATION 37/* Authenticate (RFC 2941) */
318 #ifndef TELOPT_ENCRYPTION
319 #define TELOPT_ENCRYPTION 38 /* Encryption option (RFC 2946) */
321 #ifndef TELOPT_NEWENVIRON
322 #define TELOPT_NEWENVIRON 39 /* New - Environment variables (RFC 1572) */
325 #define TELOPT_3270E 40 /* 3270 Extended (RFC 1647) */
328 #define TELOPT_XAUTH 41 /* ??? (Earhart) */
330 #ifndef TELOPT_CHARSET
331 #define TELOPT_CHARSET 42 /* Character-set (RFC 2066) */
334 #define TELOPT_RSP 43 /* Remote Serial Port (Barnes) */
336 #ifndef TELOPT_COMPORT
337 #define TELOPT_COMPORT 44 /* Com Port Control (RFC 2217) */
340 #define TELOPT_SLE 45 /* Suppress Local Echo (Atmar) - [rejected] */
342 #ifndef TELOPT_START_TLS
343 #define TELOPT_START_TLS 46 /* Telnet over Transport Layer Security */
345 #ifndef TELOPT_KERMIT
346 #define TELOPT_KERMIT 47 /* Kermit (RFC 2840) */
348 #ifndef TELOPT_SEND_URL
349 #define TELOPT_SEND_URL 48 /* Send URL */
352 #ifndef TELOPT_FORWARD_X
353 #define TELOPT_FORWARD_X 49 /* X Windows Forwarding (Altman) */
354 #endif /* TELOPT_FORWARD_X */
356 #ifndef TELOPT_STDERR
357 #define TELOPT_STDERR 50 /* Redirected Stderr (Altman) */
358 #endif /* TELOPT_STDERR */
360 #ifndef TELOPT_PRAGMA_LOGON
361 #define TELOPT_PRAGMA_LOGON 138 /* Encrypted Logon option (PragmaSys) */
363 #ifndef TELOPT_SSPI_LOGON
364 #define TELOPT_SSPI_LOGON 139 /* MS SSPI Logon option (PragmaSys) */
366 #ifndef TELOPT_PRAGMA_HEARTBEAT
367 /* Server Send Heartbeat option (PragmaSys) */
368 #define TELOPT_PRAGMA_HEARTBEAT 140
371 #define TELOPT_IBM_SAK 200 /* IBM Secure Attention Key */
374 IBM Secure Attention Key (SAK) Option
376 In addition to terminal negotiation, the telnet command allows
377 negotiation for the Secure Attention Key (SAK)
378 option. This option, when supported, provides the local user with
379 a secure communication path to the remote
380 host for tasks such as changing user IDs or passwords. If the remote
381 host supports the SAK function, a trusted
382 shell is opened on the remote host when the telnet send sak
383 subcommand is issued. The SAK function can
384 also be assigned to a single key available in telnet input mode,
385 using the set sak subcommand.
389 Sends the TELNET SAK (Secure Attention Key) sequence, which causes
390 the remote system to invoke the trusted shell. If the SAK is not
391 supported, then an error message is displayed that reads:
392 Remote side does not support SAK.
396 #define TELOPT_EXOPL 255 /* Extended-options-list (RFC 861) */
401 #endif /* NTELOPTS */
402 /* The Telnet Option space is no longer being allocated by ICANN as a */
403 /* continuous list. In other words it is becoming sparse. But we do */
404 /* not want to have to allocate memory for a long list of strings and */
405 /* structs which will never be used. Therefore, the NTELOPTS define */
406 /* can no longer be equal to TELOPT_LAST+1. In fact, the notion of */
407 /* TELOPT_FIRST and TELOPT_LAST no longer make sense. */
410 #define TELOPT_FIRST TELOPT_BINARY
411 #define TELOPT_LAST TELOPT_IBM_SAK
414 The following macros speed us up at runtime but are too complex
415 for some preprocessors / compilers; if your compiler bombs on ckctel.c
416 with "Instruction table overflow" or somesuch, rebuild with -DNOTOMACROS.
421 #endif /* TELOPT_MACRO */
422 #endif /* NOTOMACROS */
425 #define TELOPT_INDEX(x) (((x)>=0 && (x)<= TELOPT_STDERR)?(x):\
426 ((x)>=TELOPT_PRAGMA_LOGON && (x)<=TELOPT_PRAGMA_HEARTBEAT)?(x)-87: \
427 ((x) == TELOPT_IBM_SAK)?(x)-146: NTELOPTS)
429 #define TELOPT_OK(x) (((x) >= TELOPT_BINARY && (x) <= TELOPT_STDERR) ||\
430 ((x) >= TELOPT_PRAGMA_LOGON && (x) <= TELOPT_PRAGMA_HEARTBEAT) ||\
431 ((x) == TELOPT_IBM_SAK))
432 #define TELOPT(x) (TELOPT_OK(x)?telopts[TELOPT_INDEX(x)]:"UNKNOWN")
433 #else /* TELOPT_MACRO */
434 _PROTOTYP(int telopt_index,(int));
435 _PROTOTYP(int telopt_ok,(int));
436 _PROTOTYP(CHAR * telopt, (int));
438 #define TELOPT_INDEX(x) telopt_index(x)
439 #define TELOPT_OK(x) telopt_ok(x)
440 #define TELOPT(x) telopt(x)
441 #endif /* TELOPT_MACRO */
444 char *telopts[NTELOPTS+2] = {
445 /* 0 */ "BINARY", "ECHO", "RCP", "SUPPRESS-GO-AHEAD",
446 /* 4 */ "NAME", "STATUS", "TIMING-MARK", "RCTE",
447 /* 8 */ "NAOL", "NAOP", "NAOCRD", "NAOHTS",
448 /* 12 */ "NAOHTD", "NAOFFD", "NAOVTS", "NAOVTD",
449 /* 16 */ "NAOLFD", "EXTEND-ASCII", "LOGOUT", "BYTE-MACRO",
450 /* 20 */ "DATA-ENTRY-TERMINAL", "SUPDUP", "SUPDUP-OUTPUT", "SEND-LOCATION",
451 /* 24 */ "TERMINAL-TYPE", "END-OF-RECORD", "TACACS-UID", "OUTPUT-MARKING",
452 /* 28 */ "TTYLOC", "3270-REGIME", "X.3-PAD", "NAWS",
453 /* 32 */ "TSPEED", "LFLOW", "LINEMODE", "XDISPLOC",
454 /* 36 */ "OLD-ENVIRON", "AUTHENTICATION", "ENCRYPTION", "NEW-ENVIRONMENT",
455 /* 40 */ "TN3270E","xauth","CHARSET", "remote-serial-port",
456 /* 44 */ "COM-PORT-CONTROL","suppress-local-echo","START-TLS","KERMIT",
457 /* 48 */ "send-url","FORWARD-X","stderr",
458 /* 138 */ "pragma-logon", "sspi-logon", "pragma-heartbeat",
464 extern char * telopts[];
467 /* TELNET Newline Mode */
469 #define TNL_CR 0 /* CR sends bare carriage return */
470 #define TNL_CRNUL 1 /* CR and NUL */
471 #define TNL_CRLF 2 /* CR and LF */
472 #define TNL_LF 3 /* LF instead of CR */
474 /* TELNET Negotiation Mode */
476 #define TN_NG_RF 0 /* Negotiation REFUSED */
477 #define TN_NG_AC 1 /* Negotiation ACCEPTED */
478 #define TN_NG_RQ 2 /* Negotiation REQUESTED */
479 #define TN_NG_MU 3 /* Negotiation REQUIRED (must) */
482 /* Systems where we know we can define TELNET NAWS automatically. */
484 #ifndef CK_NAWS /* In other words, if both */
485 #ifdef CK_TTGWSIZ /* TNCODE and TTGWSIZ are defined */
486 #define CK_NAWS /* then we can do NAWS. */
487 #endif /* CK_TTGWSIZ */
492 #define MAXFWDX 64 /* Num of X windows to be fwd'd */
494 #endif /* CK_FORWARD_X */
496 /* Telnet State structures and definitions */
497 struct _telopt_state {
498 unsigned char def_server_me_mode; /* Default Negotiation Mode */
499 unsigned char def_server_u_mode; /* Default Negotiation Mode */
500 unsigned char def_client_me_mode; /* Default Negotiation Mode */
501 unsigned char def_client_u_mode; /* Default Negotiation Mode */
502 unsigned char me_mode; /* Telnet Negotiation Mode */
503 unsigned char u_mode; /* Telnet Negotiation Mode */
504 unsigned char me; /* Am I ? */
505 unsigned char u; /* Are you? */
506 unsigned char unanswered_will; /* Sent Will, Waiting for DO/DONT */
507 unsigned char unanswered_do; /* Send DO, Waiting for WILL/WONT */
508 unsigned char unanswered_wont; /* Sent WONT, Waiting for DONT */
509 unsigned char unanswered_dont; /* Sent DONT, Waiting for WONT */
510 unsigned char unanswered_sb; /* Sent SB, Waiting for SB (server) */
513 struct _telopt_kermit { /* Kermit Option States */
514 unsigned char me_start; /* I have a Server active */
515 unsigned char me_req_start; /* Sent Req-Start, Waiting for response */
516 unsigned char me_req_stop; /* Sent Req-Stop, Waiting for response */
517 unsigned char u_start; /* You have a Server active */
518 unsigned char sop; /* Have we received the SOP char? */
520 #endif /* IKS_OPTION */
522 struct _telopt_encrypt { /* Encryption Option States */
523 unsigned char need_to_send;
524 unsigned char stop; /* Is encryption stopped? */
526 #endif /* CK_ENCRYPTION */
528 struct _telopt_naws { /* NAWS Option Information */
529 unsigned char need_to_send;
530 int x; /* Last Width */
531 int y; /* Last Height */
535 struct _telopt_start_tls { /* Start TLS Option */
536 unsigned char u_follows; /* u ready for TLS negotiation */
537 unsigned char me_follows; /* me ready for TLS negotiation */
538 unsigned char auth_request; /* Rcvd WILL AUTH before WONT START_TLS */
541 struct _telopt_term { /* Terminal Type */
542 unsigned char need_to_send;
543 unsigned char type[41]; /* Last terminal type */
545 #ifdef CK_ENVIRONMENT
546 struct _telopt_new_env {
547 unsigned char need_to_send;
552 struct _telopt_xdisp {
553 unsigned char need_to_send;
555 #endif /* CK_XDISPLOC */
556 #endif /* CK_ENVIRONMENT */
558 struct _telopt_sndloc {
559 unsigned char need_to_send;
561 #endif /* CK_SNDLOC */
563 struct _telopt_fwd_x {
564 unsigned char need_to_send;
569 unsigned char need_to_send_xauth;
570 unsigned char suspend;
576 #endif /* CK_FORWARD_X */
578 struct _telopt_comport {
579 unsigned char need_to_send;
580 unsigned char wait_for_sb;
581 unsigned char wait_for_ms;
583 #endif /* TN_COMPORT */
584 /* additional options such as New Environment or Send Location */
587 typedef struct _telopt_state telopt_state, *p_telopt_state;
589 /* telopt_states[] is the array of structs which the state of each telnet */
590 /* option is stored. We allocate one more than we need in case we are */
591 /* sent telnet options that we do not recognize. If by some chance the */
592 /* TELOPT_OK() check is skipped, TELOPT_INDEX() will force the option to */
593 /* use the extra cell. */
596 telopt_state telopt_states[NTELOPTS+1];
597 #else /* TELOPT_STATES */
598 extern telopt_state telopt_states[];
599 #endif /* TELOPT_STATES */
601 #define TELOPT_ME(x) (telopt_states[TELOPT_INDEX(x)].me)
602 #define TELOPT_U(x) (telopt_states[TELOPT_INDEX(x)].u)
603 #define TELOPT_ME_MODE(x) \
604 (telopt_states[TELOPT_INDEX(x)].me_mode)
605 #define TELOPT_U_MODE(x) \
606 (telopt_states[TELOPT_INDEX(x)].u_mode)
607 #define TELOPT_UNANSWERED_WILL(x) \
608 (telopt_states[TELOPT_INDEX(x)].unanswered_will)
609 #define TELOPT_UNANSWERED_DO(x) \
610 (telopt_states[TELOPT_INDEX(x)].unanswered_do)
611 #define TELOPT_UNANSWERED_WONT(x) \
612 (telopt_states[TELOPT_INDEX(x)].unanswered_wont)
613 #define TELOPT_UNANSWERED_DONT(x) \
614 (telopt_states[TELOPT_INDEX(x)].unanswered_dont)
615 #define TELOPT_UNANSWERED_SB(x) \
616 (telopt_states[TELOPT_INDEX(x)].unanswered_sb)
617 #define TELOPT_SB(x) \
618 (telopt_states[TELOPT_INDEX(x)].sb)
619 #define TELOPT_DEF_S_ME_MODE(x) \
620 (telopt_states[TELOPT_INDEX(x)].def_server_me_mode)
621 #define TELOPT_DEF_S_U_MODE(x) \
622 (telopt_states[TELOPT_INDEX(x)].def_server_u_mode)
623 #define TELOPT_DEF_C_ME_MODE(x) \
624 (telopt_states[TELOPT_INDEX(x)].def_client_me_mode)
625 #define TELOPT_DEF_C_U_MODE(x) \
626 (telopt_states[TELOPT_INDEX(x)].def_client_u_mode)
629 char * telopt_modes[4] = {
630 "REFUSED", "ACCEPTED", "REQUESTED", "REQUIRED"
632 #else /* TELOPT_MODES */
633 extern char * telopt_modes[];
634 #endif /* TELOPT_MODES */
637 #define TELOPT_MODE_OK(x) ((unsigned int)(x) <= TN_NG_MU)
638 #define TELOPT_MODE(x) (TELOPT_MODE_OK(x)?telopt_modes[(x)-TN_NG_RF]:"UNKNOWN")
639 #else /* TELOPT_MACRO */
640 _PROTOTYP(int telopt_mode_ok,(int));
641 _PROTOTYP(CHAR * telopt_mode,(int));
643 #define TELOPT_MODE_OK(x) telopt_mode_ok(x)
644 #define TELOPT_MODE(x) telopt_mode(x)
645 #endif /* TELOPT_MACRO */
647 /* Sub-option qualifiers */
648 #define TELQUAL_IS 0 /* option is... */
649 #define TELQUAL_SEND 1 /* send option */
650 #define TELQUAL_INFO 2 /* ENVIRON: informational version of IS */
651 #define TELQUAL_REPLY 2 /* AUTHENTICATION: client version of IS */
652 #define TELQUAL_NAME 3 /* AUTHENTICATION: client version of IS */
654 #define TEL_ENV_VAR 0
655 #define TEL_ENV_VALUE 1
656 #define TEL_ENV_ESC 2
657 #define TEL_ENV_USERVAR 3
659 #define LFLOW_OFF 0 /* Disable remote flow control */
660 #define LFLOW_ON 1 /* Enable remote flow control */
661 #define LFLOW_RESTART_ANY 2 /* Restart output on any char */
662 #define LFLOW_RESTART_XON 3 /* Restart output only on XON */
665 * LINEMODE suboptions
669 #define LM_FORWARDMASK 2
672 #define MODE_EDIT 0x01
673 #define MODE_TRAPSIG 0x02
674 #define MODE_ACK 0x04
675 #define MODE_SOFT_TAB 0x08
676 #define MODE_LIT_ECHO 0x10
678 #define MODE_MASK 0x1f
680 /* Not part of protocol, but needed to simplify things... */
681 #define MODE_FLOW 0x0100
682 #define MODE_ECHO 0x0200
683 #define MODE_INBIN 0x0400
684 #define MODE_OUTBIN 0x0800
685 #define MODE_FORCE 0x1000
721 * For backwards compatability, we define SLC_NAMES to be the
722 * list of names if SLC_NAMES is not defined.
724 #define SLC_NAMELIST "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \
725 "ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", \
726 "LNEXT", "XON", "XOFF", "FORW1", "FORW2", \
727 "MCL", "MCR", "MCWL", "MCWR", "MCBOL", "MCEOL", \
728 "INSRT", "OVER", "ECR", "EWR", "EBOL", "EEOL", 0
730 char *slc_names[] = {
734 extern char *slc_names[];
735 #define SLC_NAMES SLC_NAMELIST
738 #define SLC_NAME_OK(x) ((unsigned int)(x) <= NSLC)
739 #define SLC_NAME(x) (SLC_NAME_OK(x)?slc_names[x]:"UNKNOWN")
741 #define SLC_NOSUPPORT 0
742 #define SLC_CANTCHANGE 1
743 #define SLC_VARIABLE 2
744 #define SLC_DEFAULT 3
745 #define SLC_LEVELBITS 0x03
752 #define SLC_FLUSHIN 0x40
753 #define SLC_FLUSHOUT 0x20
755 #define OLD_ENV_VAR 1
756 #define OLD_ENV_VALUE 0
757 #define NEW_ENV_VAR 0
758 #define NEW_ENV_VALUE 1
760 #define ENV_USERVAR 3
762 #define FWDX_SCREEN 0
766 #define FWDX_OPTIONS 4
767 #define FWDX_OPT_DATA 5
771 #define FWDX_OPT_NONE 0
772 #define FWDX_OPT_XAUTH 1
775 * AUTHENTICATION suboptions
779 * Who is authenticating who ...
781 #define AUTH_CLIENT_TO_SERVER 0 /* Client authenticating server */
782 #define AUTH_SERVER_TO_CLIENT 1 /* Server authenticating client */
783 #define AUTH_WHO_MASK 1
786 * amount of authentication done
788 #define AUTH_HOW_ONE_WAY 0
789 #define AUTH_HOW_MUTUAL 2
790 #define AUTH_HOW_MASK 2
793 * should we be encrypting?
795 #define AUTH_ENCRYPT_OFF 0
796 #define AUTH_ENCRYPT_USING_TELOPT 4
797 #define AUTH_ENCRYPT_AFTER_EXCHANGE 16
798 #define AUTH_ENCRYPT_START_TLS 20
799 #define AUTH_ENCRYPT_MASK 20
802 * will we be forwarding?
803 * if we want to activate the use of this flag then
804 * #define USE_INI_CRED_FWD
806 #define INI_CRED_FWD_OFF 0
807 #define INI_CRED_FWD_ON 8
808 #define INI_CRED_FWD_MASK 8
809 #define USE_INI_CRED_FWD
811 #define AUTHTYPE_NULL 0
812 #define AUTHTYPE_KERBEROS_V4 1
813 #define AUTHTYPE_KERBEROS_V5 2
814 #define AUTHTYPE_SPX 3
815 #define AUTHTYPE_MINK 4
816 #define AUTHTYPE_SRP 5
817 #define AUTHTYPE_RSA 6
818 #define AUTHTYPE_SSL 7
819 #define AUTHTYPE_LOKI 10
820 #define AUTHTYPE_SSA 11
821 #define AUTHTYPE_KEA_SJ 12
822 #define AUTHTYPE_KEA_INTEG 13
823 #define AUTHTYPE_DSS 14
824 #define AUTHTYPE_NTLM 15
825 #define AUTHTYPE_GSSAPI_KRB5 16 /* Not allocated by IANA */
828 #endif /* AUTHTYPE_CNT */
829 #define AUTHTYPE_CNT 17
832 * AUTHTYPEs Last updated 21 March 1999
833 * from http://www.isi.edu/in-notes/iana/assignments/telnet-options
836 #define AUTHTYPE_AUTO 99
839 char *authtype_names[] = {
840 "NULL", /* RFC 2941 */
841 "KERBEROS_V4", /* RFC 2941 / 1411 */
842 "KERBEROS_V5", /* RFC 2941 */
843 "SPX", /* RFC 2941 (not Internet Standard) */
844 "MINK", /* RFC 2941 (not Internet Standard) */
845 "SRP", /* RFC 2944 */
846 "RSA", /* RFC 2941 (not Internet Standard) */
847 "SSL", /* RFC 2941 (not Internet Standard) */
848 "IANA_8", /* not assigned by IANA */
849 "IANA_9", /* not assigned by IANA */
850 "LOKI", /* RFC 2941 (not Internet Standard) */
852 "KEA_SJ", /* RFC 2951 */
853 "KEA_SJ_INTEG", /* RFC 2951 */
854 "DSS", /* RFC 2943 */
855 "NTLM", /* Kahn <louisk@microsoft.com> */
856 "GSSAPI-KRB5", /* experimental - altman */
859 char * authmode_names[] = {
860 "CLIENT_TO_SERVER|ONE_WAY",
861 "SERVER_TO_CLIENT|ONE_WAY",
862 "CLIENT_TO_SERVER|MUTUAL",
863 "SERVER_TO_CLIENT|MUTUAL",
864 "CLIENT_TO_SERVER|ONE_WAY|ENCRYPT_USING_TELOPT",
865 "SERVER_TO_CLIENT|ONE_WAY|ENCRYPT_USING_TELOPT",
866 "CLIENT_TO_SERVER|MUTUAL|ENCRYPT_USING_TELOPT",
867 "SERVER_TO_CLIENT|MUTUAL|ENCRYPT_USING_TELOPT",
868 "CLIENT_TO_SERVER|ONE_WAY|CRED_FWD",
869 "SERVER_TO_CLIENT|ONE_WAY|CRED_FWD",
870 "CLIENT_TO_SERVER|MUTUAL|CRED_FWD",
871 "SERVER_TO_CLIENT|MUTUAL|CRED_FWD",
872 "CLIENT_TO_SERVER|ONE_WAY|ENCRYPT_USING_TELOPT|CRED_FWD",
873 "SERVER_TO_CLIENT|ONE_WAY|ENCRYPT_USING_TELOPT|CRED_FWD",
874 "CLIENT_TO_SERVER|MUTUAL|ENCRYPT_USING_TELOPT|CRED_FWD",
875 "SERVER_TO_CLIENT|MUTUAL|ENCRYPT_USING_TELOPT|CRED_FWD",
876 "CLIENT_TO_SERVER|ONE_WAY|ENCRYPT_AFTER_EXCHANGE",
877 "SERVER_TO_CLIENT|ONE_WAY|ENCRYPT_AFTER_EXCHANGE",
878 "CLIENT_TO_SERVER|MUTUAL|ENCRYPT_AFTER_EXCHANGE",
879 "SERVER_TO_CLIENT|MUTUAL|ENCRYPT_AFTER_EXCHANGE",
880 "CLIENT_TO_SERVER|ONE_WAY|ENCRYPT_START_TLS",
881 "SERVER_TO_CLIENT|ONE_WAY|ENCRYPT_START_TLS",
882 "CLIENT_TO_SERVER|MUTUAL|ENCRYPT_START_TLS",
883 "SERVER_TO_CLIENT|MUTUAL|ENCRYPT_START_TLS",
884 "CLIENT_TO_SERVER|ONE_WAY|ENCRYPT_AFTER_EXCHANGE|CRED_FWD",
885 "SERVER_TO_CLIENT|ONE_WAY|ENCRYPT_AFTER_EXCHANGE|CRED_FWD",
886 "CLIENT_TO_SERVER|MUTUAL|ENCRYPT_AFTER_EXCHANGE|CRED_FWD",
887 "SERVER_TO_CLIENT|MUTUAL|ENCRYPT_AFTER_EXCHANGE|CRED_FWD",
888 "CLIENT_TO_SERVER|ONE_WAY|ENCRYPT_START_TLS|CRED_FWD",
889 "SERVER_TO_CLIENT|ONE_WAY|ENCRYPT_START_TLS|CRED_FWD",
890 "CLIENT_TO_SERVER|MUTUAL|ENCRYPT_START_TLS|CRED_FWD",
891 "SERVER_TO_CLIENT|MUTUAL|ENCRYPT_START_TLS|CRED_FWD",
895 extern char *authtype_names[];
896 extern char *authmode_names[];
898 #define AUTHMODE_CNT 32
900 #define AUTHTYPE_NAME_OK(x) ((unsigned int)(x) < AUTHTYPE_CNT)
901 #define AUTHTYPE_NAME(x) (AUTHTYPE_NAME_OK(x)?authtype_names[x]:"UNKNOWN")
903 #define AUTHMODE_NAME_OK(x) ((unsigned int)(x) < AUTHMODE_CNT)
904 #define AUTHMODE_NAME(x) (AUTHMODE_NAME_OK(x)?authmode_names[x]:"UNKNOWN")
906 /* Kerberos Authentication Message Identifiers */
907 #define KRB_AUTH 0 /* Authentication data follows */
908 #define KRB_REJECT 1 /* Rejected (reason might follow) */
909 #define KRB_ACCEPT 2 /* Accepted */
910 #define KRB4_CHALLENGE 3
911 #define KRB4_RESPONSE 4
912 #define KRB5_RESPONSE 3 /* Response for mutual auth. */
913 #define KRB5_FORWARD 4 /* Forwarded credentials follow */
914 #define KRB5_FORWARD_ACCEPT 5 /* Forwarded credentials accepted */
915 #define KRB5_FORWARD_REJECT 6 /* Forwarded credentials rejected */
916 #define KRB5_TLS_VERIFY 7 /* TLS Finished Msg verifier */
918 /* GSSAPI-KRB5 Authentication Message Identifiers */
919 #define GSS_AUTH_DATA 0 /* Authentication data follows */
920 #define GSS_REJECT 1 /* Rejected (reason might follow) */
921 #define GSS_ACCEPT 2 /* Accepted (username might follow) */
922 #define GSS_CONTINUE 3
924 /* Secure Remote Password Authentication Message Identifiers */
925 #define SRP_AUTH 0 /* Authentication data follows */
926 #define SRP_REJECT 1 /* Rejected (reason might follow) */
927 #define SRP_ACCEPT 2 /* Accepted */
928 #define SRP_CHALLENGE 3
929 #define SRP_RESPONSE 4
930 #define SRP_EXP 8 /* */
931 #define SRP_PARAMS 9 /* */
933 /* Telnet Auth using KEA and SKIPJACK */
935 #define KEA_CERTA_RA 1
936 #define KEA_CERTB_RB_IVB_NONCEB 2
937 #define KEA_IVA_RESPONSEB_NONCEA 3
938 #define KEA_RESPONSEA 4
940 /* Tim Hudson's SSL Authentication Message Identifiers */
945 /* Microsoft NTLM Authentication Message Identifiers */
947 #define NTLM_CHALLENGE 1
948 #define NTLM_RESPONSE 2
949 #define NTLM_ACCEPT 3
950 #define NTLM_REJECT 4
952 /* Generic Constants */
953 #define AUTH_SUCCESS 0
954 #define AUTH_FAILURE 255
957 * ENCRYPTion suboptions
959 #define ENCRYPT_IS 0 /* I pick encryption type ... */
960 #define ENCRYPT_SUPPORT 1 /* I support encryption types ... */
961 #define ENCRYPT_REPLY 2 /* Initial setup response */
962 #define ENCRYPT_START 3 /* Am starting to send encrypted */
963 #define ENCRYPT_END 4 /* Am ending encrypted */
964 #define ENCRYPT_REQSTART 5 /* Request you start encrypting */
965 #define ENCRYPT_REQEND 6 /* Request you send encrypting */
966 #define ENCRYPT_ENC_KEYID 7
967 #define ENCRYPT_DEC_KEYID 8
968 #define ENCRYPT_CNT 9
970 #define ENCTYPE_ANY 0
971 #define ENCTYPE_DES_CFB64 1
972 #define ENCTYPE_DES_OFB64 2
973 #define ENCTYPE_DES3_CFB64 3
974 #define ENCTYPE_DES3_OFB64 4
975 #define ENCTYPE_CAST5_40_CFB64 8
976 #define ENCTYPE_CAST5_40_OFB64 9
977 #define ENCTYPE_CAST128_CFB64 10
978 #define ENCTYPE_CAST128_OFB64 11
982 #define ENCTYPE_CNT 12
985 char *encrypt_names[] = {
986 "IS", "SUPPORT", "REPLY", "START", "END",
987 "REQUEST-START", "REQUEST-END", "ENC-KEYID", "DEC-KEYID",
990 char *enctype_names[] = {
992 "DES_CFB64", /* RFC 2952 */
993 "DES_OFB64", /* RFC 2953 */
994 "DES3_CFB64", /* RFC 2947 */
995 "DES3_OFB64", /* RFC 2948 */
999 "CAST5_40_CFB64", /* RFC 2950 */
1000 "CAST5_40_OFB64", /* RFC 2949 */
1001 "CAST128_CFB64", /* RFC 2950*/
1002 "CAST128_OFB64", /* RFC 2949 */
1006 extern char *encrypt_names[];
1007 extern char *enctype_names[];
1010 #define ENCRYPT_NAME_OK(x) ((unsigned int)(x) < ENCRYPT_CNT)
1011 #define ENCRYPT_NAME(x) (ENCRYPT_NAME_OK(x)?encrypt_names[x]:"UNKNOWN")
1013 #define ENCTYPE_NAME_OK(x) ((unsigned int)(x) < ENCTYPE_CNT)
1014 #define ENCTYPE_NAME(x) (ENCTYPE_NAME_OK(x)?enctype_names[x]:"UNKNOWN")
1016 /* For setting the state of validUser */
1018 #define AUTH_REJECT 0 /* Rejected */
1019 #define AUTH_UNKNOWN 1 /* We don't know who he is, but he's okay */
1020 #define AUTH_OTHER 2 /* We know him, but not his name */
1021 #define AUTH_USER 3 /* We know he name */
1022 #define AUTH_VALID 4 /* We know him, and he needs no password */
1024 /* Kermit Option Subnegotiations */
1026 #define KERMIT_START 0
1027 #define KERMIT_STOP 1
1028 #define KERMIT_REQ_START 2
1029 #define KERMIT_REQ_STOP 3
1030 #define KERMIT_SOP 4
1031 #define KERMIT_RESP_START 8
1032 #define KERMIT_RESP_STOP 9
1034 /* For SET TELNET AUTH HOW */
1035 #define TN_AUTH_HOW_ANY 0
1036 #define TN_AUTH_HOW_ONE_WAY 1
1037 #define TN_AUTH_HOW_MUTUAL 2
1039 /* For SET TELNET AUTH ENCRYPT */
1040 #define TN_AUTH_ENC_ANY 0
1041 #define TN_AUTH_ENC_NONE 1
1042 #define TN_AUTH_ENC_TELOPT 2
1043 #define TN_AUTH_ENC_EXCH 3 /* not used in Kermit */
1044 #define TN_AUTH_ENC_TLS 4
1046 /* Telnet protocol functions defined in C-Kermit */
1048 _PROTOTYP( int tn_ini, (void) ); /* Telnet protocol support */
1049 _PROTOTYP( int tn_reset, (void));
1050 _PROTOTYP( int tn_set_modes, (void));
1051 _PROTOTYP( int tn_sopt, (int, int) );
1052 _PROTOTYP( int tn_doop, (CHAR, int, int (*)(int) ) );
1053 _PROTOTYP( int tn_sttyp, (void) );
1054 _PROTOTYP( int tn_snenv, (CHAR *, int) ) ;
1055 _PROTOTYP( int tn_rnenv, (CHAR *, int) ) ;
1056 _PROTOTYP( int tn_wait, (char *) ) ;
1057 _PROTOTYP( int tn_push, (void) ) ;
1058 _PROTOTYP( int tnsndbrk, (void) );
1059 _PROTOTYP( VOID tn_debug, (char *));
1060 _PROTOTYP( int tn_hex, (CHAR *, int, CHAR *, int));
1061 _PROTOTYP( unsigned char * tn_get_display, (void));
1063 _PROTOTYP( int tn_siks, (int) );
1064 _PROTOTYP( int iks_wait, (int, int) );
1065 #endif /* IKS_OPTION */
1067 _PROTOTYP( int tn_snaws, (void) );
1068 #endif /* CK_NAWS */
1070 _PROTOTYP( int tn_sxdisploc, (void) );
1071 #endif /* CK_XDISPLOC */
1073 _PROTOTYP( int tn_sndloc, (void) );
1074 #endif /* CK_SNDLOC */
1077 typedef struct xauth {
1078 unsigned short family;
1079 unsigned short address_length;
1081 unsigned short number_length;
1083 unsigned short name_length;
1085 unsigned short data_length;
1092 #define FamilyInternet 0
1093 #define FamilyDECnet 1
1094 #define FamilyChaos 2
1096 # define FamilyLocal (256) /* not part of X standard (i.e. X.h) */
1097 # define FamilyWild (65535)
1098 # define FamilyNetname (254) /* not part of X standard */
1099 # define FamilyKrb5Principal (253) /* Kerberos 5 principal name */
1100 # define FamilyLocalHost (252) /* for local non-net authentication */
1101 char *XauFileName();
1104 FILE* /* auth_file */
1108 FILE* /* auth_file */,
1112 Xauth *XauGetAuthByName(
1113 const char* /* display_name */
1116 Xauth *XauGetAuthByAddr(
1117 unsigned int /* family */,
1118 unsigned int /* address_length */,
1119 const char* /* address */,
1120 unsigned int /* number_length */,
1121 const char* /* number */,
1122 unsigned int /* name_length */,
1123 const char* /* name */
1126 void XauDisposeAuth(
1131 _PROTOTYP( int fwdx_create_listen_socket,(int));
1132 _PROTOTYP( int fwdx_open_client_channel,(int));
1133 _PROTOTYP( int fwdx_open_server_channel,(VOID));
1134 _PROTOTYP( int fwdx_close_channel,(int));
1135 _PROTOTYP( int fwdx_write_data_to_channel,(int, char *,int));
1136 _PROTOTYP( int fwdx_send_data_from_channel,(int, char *,int));
1137 _PROTOTYP( int fwdx_close_all,(VOID));
1138 _PROTOTYP( int fwdx_tn_sb,(unsigned char *, int));
1139 _PROTOTYP( int tn_sndfwdx, (void));
1140 _PROTOTYP( int fwdx_send_close,(int));
1141 _PROTOTYP( int fwdx_send_open,(int));
1142 _PROTOTYP( int fwdx_client_reply_options,(char *, int));
1143 _PROTOTYP( int fwdx_send_options,(VOID));
1144 _PROTOTYP( VOID fwdx_check_sockets,(fd_set *));
1145 _PROTOTYP( int fwdx_init_fd_set,(fd_set *));
1146 _PROTOTYP( int fwdx_authorize_channel, (int, unsigned char *, int));
1147 _PROTOTYP( int fwdx_create_fake_xauth, (char *, int, int));
1148 _PROTOTYP( int fwdx_send_xauth_to_xserver, (int, unsigned char *, int len));
1149 _PROTOTYP( int fwdx_server_avail, (VOID));
1150 _PROTOTYP( int fwdx_parse_displayname, (char *, int *, char **, int *, int *, char **));
1153 _PROTOTYP( VOID fwdx_thread,(VOID *));
1155 #endif /* CK_FORWARD_X */
1158 #define TNC_C2S_SIGNATURE 0
1159 #define TNC_C2S_SET_BAUDRATE 1
1160 #define TNC_C2S_SET_DATASIZE 2
1161 #define TNC_C2S_SET_PARITY 3
1162 #define TNC_C2S_SET_STOPSIZE 4
1163 #define TNC_C2S_SET_CONTROL 5
1164 #define TNC_C2S_NOTIFY_LINESTATE 6
1165 #define TNC_C2S_NOTIFY_MODEMSTATE 7
1166 #define TNC_C2S_FLOW_SUSPEND 8
1167 #define TNC_C2S_FLOW_RESUME 9
1168 #define TNC_C2S_SET_LS_MASK 10
1169 #define TNC_C2S_SET_MS_MASK 11
1170 #define TNC_C2S_PURGE 12
1171 #define TNC_S2C_SIGNATURE 100
1172 #define TNC_S2C_SET_BAUDRATE 101
1173 #define TNC_S2C_SET_DATASIZE 102
1174 #define TNC_S2C_SET_PARITY 103
1175 #define TNC_S2C_SET_STOPSIZE 104
1176 #define TNC_S2C_SET_CONTROL 105
1177 #define TNC_S2C_SEND_LS 106
1178 #define TNC_S2C_SEND_MS 107
1179 #define TNC_S2C_FLOW_SUSPEND 108
1180 #define TNC_S2C_FLOW_RESUME 109
1181 #define TNC_S2C_SET_LS_MASK 110
1182 #define TNC_S2C_SET_MS_MASK 111
1183 #define TNC_S2C_PURGE 112
1185 /* The COMPORT values are not defined in RFC 2217 */
1186 #define TNC_BPS_REQUEST 0
1187 #define TNC_BPS_300 3
1188 #define TNC_BPS_600 4
1189 #define TNC_BPS_1200 5
1190 #define TNC_BPS_2400 6
1191 #define TNC_BPS_4800 7
1192 #define TNC_BPS_9600 8
1193 #define TNC_BPS_14400 9
1194 #define TNC_BPS_19200 10
1195 #define TNC_BPS_28800 11
1196 #define TNC_BPS_38400 12
1197 #define TNC_BPS_57600 13
1198 #define TNC_BPS_115200 14
1199 #define TNC_BPS_230400 15
1200 #define TNC_BPS_460800 16
1202 #define TNC_DS_REQUEST 0
1208 #define TNC_PAR_REQUEST 0
1209 #define TNC_PAR_NONE 1
1210 #define TNC_PAR_ODD 2
1211 #define TNC_PAR_EVEN 3
1212 #define TNC_PAR_MARK 4
1213 #define TNC_PAR_SPACE 5
1215 #define TNC_SB_REQUEST 0
1217 #define TNC_SB_1_5 3
1220 #define TNC_CTL_OFLOW_REQUEST 0
1221 #define TNC_CTL_OFLOW_NONE 1
1222 #define TNC_CTL_OFLOW_XON_XOFF 2
1223 #define TNC_CTL_OFLOW_RTS_CTS 3
1224 #define TNC_CTL_OFLOW_DCD 17
1225 #define TNC_CTL_OFLOW_DSR 19
1227 #define TNC_CTL_BREAK_REQUEST 4
1228 #define TNC_CTL_BREAK_ON 5
1229 #define TNC_CTL_BREAK_OFF 6
1231 #define TNC_CTL_DTR_REQUEST 7
1232 #define TNC_CTL_DTR_ON 8
1233 #define TNC_CTL_DTR_OFF 9
1235 #define TNC_CTL_RTS_REQUEST 10
1236 #define TNC_CTL_RTS_ON 11
1237 #define TNC_CTL_RTS_OFF 12
1239 #define TNC_CTL_IFLOW_REQUEST 13
1240 #define TNC_CTL_IFLOW_NONE 14
1241 #define TNC_CTL_IFLOW_XON_XOFF 15
1242 #define TNC_CTL_IFLOW_RTS_CTS 16
1243 #define TNC_CTL_IFLOW_DTR 18
1245 #define TNC_MS_DATA_READY 1
1246 #define TNC_MS_OVERRUN_ERROR 2
1247 #define TNC_MS_PARITY_ERROR 4
1248 #define TNC_MS_FRAME_ERROR 8
1249 #define TNC_MS_BREAK_ERROR 16
1250 #define TNC_MS_HR_EMPTY 32
1251 #define TNC_MS_SR_EMPTY 64
1252 #define TNC_MS_TIMEOUT_ERROR 128
1254 #define TNC_MS_CTS_DELTA 1
1255 #define TNC_MS_DSR_DELTA 2
1256 #define TNC_MS_EDGE_RING 4
1257 #define TNC_MS_RLSD_DELTA 8
1258 #define TNC_MS_CTS_SIG 16
1259 #define TNC_MS_DSR_SIG 32
1260 #define TNC_MS_RI_SIG 64
1261 #define TNC_MS_RLSD_SIG 128
1263 #define TNC_PURGE_RECEIVE 1
1264 #define TNC_PURGE_TRANSMIT 2
1265 #define TNC_PURGE_BOTH 3
1268 char *tnc_names[] = {
1269 "SIGNATURE", "SET-BAUDRATE", "SET-DATARATE", "SET-PARITY", "SET-STOPSIZE",
1270 "SET-CONTROL", "NOTIFY-LINESTATE", "NOTIFY-MODEMSTATE",
1271 "FLOWCONTROL-SUSPEND", "FLOWCONTROL-RESUME", "SET-LINESTATE-MASK",
1272 "SET-MODEMSTATE-MASK", "PURGE-DATA",
1276 extern char *tnc_names[];
1279 #define TNC_NAME_OK(x) ((x) >= 0 && (x) <= 12 || (x) >= 100 && (x) <= 112)
1280 #define TNC_NAME(x) \
1281 (TNC_NAME_OK(x)?tnc_names[(x)>=100?(x)-100:(x)]:"UNKNOWN")
1283 _PROTOTYP(int tnc_init,(void));
1284 _PROTOTYP(int tnc_wait,(CHAR *, int));
1285 _PROTOTYP(int tnc_tn_sb,(CHAR *,int));
1286 _PROTOTYP(CONST char * tnc_get_signature, (void));
1287 _PROTOTYP(int tnc_send_signature, (char *));
1288 _PROTOTYP(int tnc_set_baud,(long));
1289 _PROTOTYP(int tnc_get_baud,(void));
1290 _PROTOTYP(int tnc_set_datasize,(int));
1291 _PROTOTYP(int tnc_get_datasize,(void));
1292 _PROTOTYP(int tnc_set_parity,(int));
1293 _PROTOTYP(int tnc_get_parity,(void));
1294 _PROTOTYP(int tnc_set_stopsize,(int));
1295 _PROTOTYP(int tnc_get_stopsize,(void));
1296 _PROTOTYP(int tnc_set_oflow,(int));
1297 _PROTOTYP(int tnc_get_oflow,(void));
1298 _PROTOTYP(int tnc_set_iflow,(int));
1299 _PROTOTYP(int tnc_get_iflow,(void));
1300 _PROTOTYP(int tnc_set_break_state,(int));
1301 _PROTOTYP(int tnc_get_break_state,(void));
1302 _PROTOTYP(int tnc_set_dtr_state,(int));
1303 _PROTOTYP(int tnc_get_dtr_state,(void));
1304 _PROTOTYP(int tnc_set_rts_state,(int));
1305 _PROTOTYP(int tnc_get_rts_state,(void));
1306 _PROTOTYP(int tnc_set_ls_mask,(int));
1307 _PROTOTYP(int tnc_get_ls_mask,(void));
1308 _PROTOTYP(int tnc_get_ls,(void));
1309 _PROTOTYP(int tnc_set_ms_mask,(int));
1310 _PROTOTYP(int tnc_get_ms_mask,(void));
1311 _PROTOTYP(int tnc_get_ms,(void));
1312 _PROTOTYP(int tnc_send_purge_data,(int));
1313 _PROTOTYP(int tnc_flow_suspended,(void));
1314 _PROTOTYP(int tnc_suspend_flow,(void));
1315 _PROTOTYP(int tnc_resume_flow,(void));
1317 /* The following methods are to be called by ck?tio.c routines */
1318 _PROTOTYP(int tnsetflow,(int));
1319 _PROTOTYP(int tnsettings,(int,int));
1320 _PROTOTYP(int tngmdm,(void));
1321 _PROTOTYP(int tnsndb,(long));
1322 _PROTOTYP(int istncomport,(void));
1323 _PROTOTYP(int tn_sndcomport,(void));
1324 #endif /* TN_COMPORT */
1326 #ifndef CKCTEL_C /* These are declared in ckctel.c */
1327 extern int tn_init; /* Telnet protocol initialized flag */
1328 extern char *tn_term; /* Terminal type override */
1329 extern int sstelnet; /* Server side telnet? */
1330 extern int tn_deb; /* Telnet option debugging flag */
1331 extern int tn_auth_krb5_des_bug; /* Telnet BUG */
1332 #endif /* CKCTEL_C */
1334 #define TN_MSG_LEN 12292
1336 #endif /* CKCTEL_H */