1 /* 2 * Copyright (c) 1989 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 * 7 * @(#)ext.h 5.9 (Berkeley) 04/05/93 8 */ 9 10 /* 11 * Telnet server variable declarations 12 */ 13 extern char options[256]; 14 extern char do_dont_resp[256]; 15 extern char will_wont_resp[256]; 16 extern int linemode; /* linemode on/off */ 17 #ifdef LINEMODE 18 extern int uselinemode; /* what linemode to use (on/off) */ 19 extern int editmode; /* edit modes in use */ 20 extern int useeditmode; /* edit modes to use */ 21 extern int alwayslinemode; /* command line option */ 22 # ifdef KLUDGELINEMODE 23 extern int lmodetype; /* Client support for linemode */ 24 # endif /* KLUDGELINEMODE */ 25 #endif /* LINEMODE */ 26 extern int flowmode; /* current flow control state */ 27 extern int restartany; /* restart output on any character state */ 28 #ifdef DIAGNOSTICS 29 extern int diagnostic; /* telnet diagnostic capabilities */ 30 #endif /* DIAGNOSTICS */ 31 #ifdef BFTPDAEMON 32 extern int bftpd; /* behave as bftp daemon */ 33 #endif /* BFTPDAEMON */ 34 #if defined(SecurID) 35 extern int require_SecurID; 36 #endif 37 #if defined(AUTHENTICATION) 38 extern int auth_level; 39 #endif 40 41 extern slcfun slctab[NSLC + 1]; /* slc mapping table */ 42 43 char *terminaltype; 44 45 /* 46 * I/O data buffers, pointers, and counters. 47 */ 48 extern char ptyobuf[BUFSIZ+NETSLOP], *pfrontp, *pbackp; 49 50 extern char netibuf[BUFSIZ], *netip; 51 52 extern char netobuf[BUFSIZ+NETSLOP], *nfrontp, *nbackp; 53 extern char *neturg; /* one past last bye of urgent data */ 54 55 extern int pcc, ncc; 56 57 #if defined(CRAY2) && defined(UNICOS5) 58 extern int unpcc; /* characters left unprocessed by CRAY-2 terminal routine */ 59 extern char *unptyip; /* pointer to remaining characters in buffer */ 60 #endif 61 62 extern int pty, net; 63 extern char *line; 64 extern int SYNCHing; /* we are in TELNET SYNCH mode */ 65 66 #ifndef P 67 # ifdef __STDC__ 68 # define P(x) x 69 # else 70 # define P(x) () 71 # endif 72 #endif 73 74 extern void 75 _termstat P((void)), 76 add_slc P((int, int, int)), 77 check_slc P((void)), 78 change_slc P((int, int, int)), 79 cleanup P((int)), 80 clientstat P((int, int, int)), 81 copy_termbuf P((char *, int)), 82 deferslc P((void)), 83 defer_terminit P((void)), 84 do_opt_slc P((unsigned char *, int)), 85 doeof P((void)), 86 dooption P((int)), 87 dontoption P((int)), 88 edithost P((char *, char *)), 89 fatal P((int, char *)), 90 fatalperror P((int, char *)), 91 get_slc_defaults P((void)), 92 init_env P((void)), 93 init_termbuf P((void)), 94 interrupt P((void)), 95 localstat P((void)), 96 flowstat P((void)), 97 netclear P((void)), 98 netflush P((void)), 99 #ifdef DIAGNOSTICS 100 printoption P((char *, int)), 101 printdata P((char *, char *, int)), 102 printsub P((int, unsigned char *, int)), 103 #endif 104 ptyflush P((void)), 105 putchr P((int)), 106 putf P((char *, char *)), 107 recv_ayt P((void)), 108 send_do P((int, int)), 109 send_dont P((int, int)), 110 send_slc P((void)), 111 send_status P((void)), 112 send_will P((int, int)), 113 send_wont P((int, int)), 114 sendbrk P((void)), 115 sendsusp P((void)), 116 set_termbuf P((void)), 117 start_login P((char *, int, char *)), 118 start_slc P((int)), 119 #if defined(AUTHENTICATION) 120 start_slave P((char *)), 121 #else 122 start_slave P((char *, int, char *)), 123 #endif 124 suboption P((void)), 125 telrcv P((void)), 126 ttloop P((void)), 127 tty_binaryin P((int)), 128 tty_binaryout P((int)); 129 130 extern int 131 end_slc P((unsigned char **)), 132 getnpty P((void)), 133 getpty P((void)), 134 login_tty P((int)), 135 spcset P((int, cc_t *, cc_t **)), 136 stilloob P((int)), 137 terminit P((void)), 138 termstat P((void)), 139 tty_flowmode P((void)), 140 tty_restartany P((void)), 141 tty_isbinaryin P((void)), 142 tty_isbinaryout P((void)), 143 tty_iscrnl P((void)), 144 tty_isecho P((void)), 145 tty_isediting P((void)), 146 tty_islitecho P((void)), 147 tty_isnewmap P((void)), 148 tty_israw P((void)), 149 tty_issofttab P((void)), 150 tty_istrapsig P((void)), 151 tty_linemode P((void)); 152 153 extern void 154 tty_rspeed P((int)), 155 tty_setecho P((int)), 156 tty_setedit P((int)), 157 tty_setlinemode P((int)), 158 tty_setlitecho P((int)), 159 tty_setsig P((int)), 160 tty_setsofttab P((int)), 161 tty_tspeed P((int)), 162 willoption P((int)), 163 wontoption P((int)), 164 writenet P((unsigned char *, int)); 165 166 #if defined(ENCRYPTION) 167 extern void (*encrypt_output) P((unsigned char *, int)); 168 extern int (*decrypt_input) P((int)); 169 extern char *nclearto; 170 #endif 171 172 173 /* 174 * The following are some clocks used to decide how to interpret 175 * the relationship between various variables. 176 */ 177 178 extern struct { 179 int 180 system, /* what the current time is */ 181 echotoggle, /* last time user entered echo character */ 182 modenegotiated, /* last time operating mode negotiated */ 183 didnetreceive, /* last time we read data from network */ 184 ttypesubopt, /* ttype subopt is received */ 185 tspeedsubopt, /* tspeed subopt is received */ 186 environsubopt, /* environ subopt is received */ 187 xdisplocsubopt, /* xdisploc subopt is received */ 188 baseline, /* time started to do timed action */ 189 gotDM; /* when did we last see a data mark */ 190 } clocks; 191 192 193 #if defined(CRAY2) && defined(UNICOS5) 194 extern int needtermstat; 195 #endif 196 197 #ifndef DEFAULT_IM 198 # ifdef CRAY 199 # define DEFAULT_IM "\r\n\r\nCray UNICOS (%h) (%t)\r\n\r\r\n\r" 200 # else 201 # ifdef sun 202 # define DEFAULT_IM "\r\n\r\nSunOS UNIX (%h) (%t)\r\n\r\r\n\r" 203 # else 204 # ifdef ultrix 205 # define DEFAULT_IM "\r\n\r\nULTRIX (%h) (%t)\r\n\r\r\n\r" 206 # else 207 # define DEFAULT_IM "\r\n\r\n4.4 BSD UNIX (%h) (%t)\r\n\r\r\n\r" 208 # endif 209 # endif 210 # endif 211 #endif 212