1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * Copyright 1994-2002 Sun Microsystems, Inc. All rights reserved. 3*7c478bd9Sstevel@tonic-gate * Use is subject to license terms. 4*7c478bd9Sstevel@tonic-gate */ 5*7c478bd9Sstevel@tonic-gate 6*7c478bd9Sstevel@tonic-gate /* 7*7c478bd9Sstevel@tonic-gate * Copyright (c) 1988, 1990, 1993 8*7c478bd9Sstevel@tonic-gate * The Regents of the University of California. All rights reserved. 9*7c478bd9Sstevel@tonic-gate * 10*7c478bd9Sstevel@tonic-gate * Redistribution and use in source and binary forms, with or without 11*7c478bd9Sstevel@tonic-gate * modification, are permitted provided that the following conditions 12*7c478bd9Sstevel@tonic-gate * are met: 13*7c478bd9Sstevel@tonic-gate * 1. Redistributions of source code must retain the above copyright 14*7c478bd9Sstevel@tonic-gate * notice, this list of conditions and the following disclaimer. 15*7c478bd9Sstevel@tonic-gate * 2. Redistributions in binary form must reproduce the above copyright 16*7c478bd9Sstevel@tonic-gate * notice, this list of conditions and the following disclaimer in the 17*7c478bd9Sstevel@tonic-gate * documentation and/or other materials provided with the distribution. 18*7c478bd9Sstevel@tonic-gate * 3. All advertising materials mentioning features or use of this software 19*7c478bd9Sstevel@tonic-gate * must display the following acknowledgement: 20*7c478bd9Sstevel@tonic-gate * This product includes software developed by the University of 21*7c478bd9Sstevel@tonic-gate * California, Berkeley and its contributors. 22*7c478bd9Sstevel@tonic-gate * 4. Neither the name of the University nor the names of its contributors 23*7c478bd9Sstevel@tonic-gate * may be used to endorse or promote products derived from this software 24*7c478bd9Sstevel@tonic-gate * without specific prior written permission. 25*7c478bd9Sstevel@tonic-gate * 26*7c478bd9Sstevel@tonic-gate * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 27*7c478bd9Sstevel@tonic-gate * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 28*7c478bd9Sstevel@tonic-gate * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 29*7c478bd9Sstevel@tonic-gate * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 30*7c478bd9Sstevel@tonic-gate * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31*7c478bd9Sstevel@tonic-gate * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32*7c478bd9Sstevel@tonic-gate * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33*7c478bd9Sstevel@tonic-gate * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34*7c478bd9Sstevel@tonic-gate * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35*7c478bd9Sstevel@tonic-gate * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36*7c478bd9Sstevel@tonic-gate * SUCH DAMAGE. 37*7c478bd9Sstevel@tonic-gate * 38*7c478bd9Sstevel@tonic-gate * @(#)externs.h 8.1 (Berkeley) 6/6/93 39*7c478bd9Sstevel@tonic-gate */ 40*7c478bd9Sstevel@tonic-gate 41*7c478bd9Sstevel@tonic-gate #ifndef _EXTERNS_H 42*7c478bd9Sstevel@tonic-gate #define _EXTERNS_H 43*7c478bd9Sstevel@tonic-gate 44*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 45*7c478bd9Sstevel@tonic-gate 46*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 47*7c478bd9Sstevel@tonic-gate extern "C" { 48*7c478bd9Sstevel@tonic-gate #endif 49*7c478bd9Sstevel@tonic-gate 50*7c478bd9Sstevel@tonic-gate #include <libintl.h> 51*7c478bd9Sstevel@tonic-gate #include <stdio.h> 52*7c478bd9Sstevel@tonic-gate #include <setjmp.h> 53*7c478bd9Sstevel@tonic-gate #include <sys/filio.h> 54*7c478bd9Sstevel@tonic-gate #ifdef USE_TERMIO 55*7c478bd9Sstevel@tonic-gate #include <sys/termios.h> 56*7c478bd9Sstevel@tonic-gate #define termio termios 57*7c478bd9Sstevel@tonic-gate #endif 58*7c478bd9Sstevel@tonic-gate #if defined(NO_CC_T) || !defined(USE_TERMIO) 59*7c478bd9Sstevel@tonic-gate #if !defined(USE_TERMIO) 60*7c478bd9Sstevel@tonic-gate typedef char cc_t; 61*7c478bd9Sstevel@tonic-gate #else 62*7c478bd9Sstevel@tonic-gate typedef unsigned char cc_t; 63*7c478bd9Sstevel@tonic-gate #endif 64*7c478bd9Sstevel@tonic-gate #endif 65*7c478bd9Sstevel@tonic-gate 66*7c478bd9Sstevel@tonic-gate #include "auth.h" 67*7c478bd9Sstevel@tonic-gate #include "encrypt.h" 68*7c478bd9Sstevel@tonic-gate #include <profile/prof_int.h> 69*7c478bd9Sstevel@tonic-gate 70*7c478bd9Sstevel@tonic-gate extern profile_options_boolean config_file_options[]; 71*7c478bd9Sstevel@tonic-gate #define forwardable_flag_set config_file_options[0].found 72*7c478bd9Sstevel@tonic-gate #define forward_flag_set config_file_options[1].found 73*7c478bd9Sstevel@tonic-gate #define encrypt_flag_set config_file_options[2].found 74*7c478bd9Sstevel@tonic-gate #define autologin_set config_file_options[3].found 75*7c478bd9Sstevel@tonic-gate 76*7c478bd9Sstevel@tonic-gate #include <string.h> 77*7c478bd9Sstevel@tonic-gate 78*7c478bd9Sstevel@tonic-gate #ifndef _POSIX_VDISABLE 79*7c478bd9Sstevel@tonic-gate #include <sys/param.h> /* pick up VDISABLE definition, mayby */ 80*7c478bd9Sstevel@tonic-gate #ifdef VDISABLE 81*7c478bd9Sstevel@tonic-gate #define _POSIX_VDISABLE VDISABLE 82*7c478bd9Sstevel@tonic-gate #else 83*7c478bd9Sstevel@tonic-gate #define _POSIX_VDISABLE ((cc_t)'\377') 84*7c478bd9Sstevel@tonic-gate #endif 85*7c478bd9Sstevel@tonic-gate #endif 86*7c478bd9Sstevel@tonic-gate 87*7c478bd9Sstevel@tonic-gate #include <wait.h> 88*7c478bd9Sstevel@tonic-gate #include <stdlib.h> 89*7c478bd9Sstevel@tonic-gate #include <unistd.h> 90*7c478bd9Sstevel@tonic-gate 91*7c478bd9Sstevel@tonic-gate 92*7c478bd9Sstevel@tonic-gate #define SUBBUFSIZE 256 93*7c478bd9Sstevel@tonic-gate 94*7c478bd9Sstevel@tonic-gate extern int autologin; /* Autologin enabled */ 95*7c478bd9Sstevel@tonic-gate extern int skiprc; /* Don't process the ~/.telnetrc file */ 96*7c478bd9Sstevel@tonic-gate extern int eight; /* use eight bit mode (binary in and/or out */ 97*7c478bd9Sstevel@tonic-gate extern int flushout; /* flush output */ 98*7c478bd9Sstevel@tonic-gate extern int connected; /* Are we connected to the other side? */ 99*7c478bd9Sstevel@tonic-gate extern int globalmode; /* Mode tty should be in */ 100*7c478bd9Sstevel@tonic-gate extern int telnetport; /* Are we connected to the telnet port? */ 101*7c478bd9Sstevel@tonic-gate extern int localflow; /* Flow control handled locally */ 102*7c478bd9Sstevel@tonic-gate extern int restartany; /* If flow control, restart output on any character */ 103*7c478bd9Sstevel@tonic-gate extern int localchars; /* we recognize interrupt/quit */ 104*7c478bd9Sstevel@tonic-gate extern int donelclchars; /* the user has set "localchars" */ 105*7c478bd9Sstevel@tonic-gate extern int showoptions; 106*7c478bd9Sstevel@tonic-gate extern int net; /* Network file descriptor */ 107*7c478bd9Sstevel@tonic-gate extern int tout; /* Terminal output file descriptor */ 108*7c478bd9Sstevel@tonic-gate extern int crlf; /* Should '\r' be mapped to <CR><LF> (or <CR><NUL>)? */ 109*7c478bd9Sstevel@tonic-gate extern int autoflush; /* flush output when interrupting? */ 110*7c478bd9Sstevel@tonic-gate extern int autosynch; /* send interrupt characters with SYNCH? */ 111*7c478bd9Sstevel@tonic-gate extern int SYNCHing; /* Is the stream in telnet SYNCH mode? */ 112*7c478bd9Sstevel@tonic-gate extern int donebinarytoggle; /* the user has put us in binary */ 113*7c478bd9Sstevel@tonic-gate extern int dontlecho; /* do we suppress local echoing right now? */ 114*7c478bd9Sstevel@tonic-gate extern int crmod; 115*7c478bd9Sstevel@tonic-gate extern int netdata; /* Print out network data flow */ 116*7c478bd9Sstevel@tonic-gate extern int prettydump; /* Print "netdata" output in user readable format */ 117*7c478bd9Sstevel@tonic-gate extern int termdata; /* Print out terminal data flow */ 118*7c478bd9Sstevel@tonic-gate extern int eof_pending; /* Received EOF in line mode, need to send IAC-xEOF */ 119*7c478bd9Sstevel@tonic-gate extern int debug; /* Debug level */ 120*7c478bd9Sstevel@tonic-gate 121*7c478bd9Sstevel@tonic-gate 122*7c478bd9Sstevel@tonic-gate extern int krb5auth_flag; 123*7c478bd9Sstevel@tonic-gate extern char *RemoteHostName; 124*7c478bd9Sstevel@tonic-gate extern char *UserNameRequested; 125*7c478bd9Sstevel@tonic-gate extern int forwardable_flag; 126*7c478bd9Sstevel@tonic-gate extern int forward_flag; 127*7c478bd9Sstevel@tonic-gate extern boolean_t wantencryption; /* User has requested encryption */ 128*7c478bd9Sstevel@tonic-gate extern int encrypt_flag; /* for reading config file for Krb5 */ 129*7c478bd9Sstevel@tonic-gate 130*7c478bd9Sstevel@tonic-gate extern boolean_t Ambiguous(void *); 131*7c478bd9Sstevel@tonic-gate extern boolean_t intr_happened; /* for interrupt handling */ 132*7c478bd9Sstevel@tonic-gate extern boolean_t intr_waiting; 133*7c478bd9Sstevel@tonic-gate 134*7c478bd9Sstevel@tonic-gate extern cc_t escape; /* Escape to command mode */ 135*7c478bd9Sstevel@tonic-gate extern cc_t rlogin; /* Rlogin mode escape character */ 136*7c478bd9Sstevel@tonic-gate extern boolean_t escape_valid; 137*7c478bd9Sstevel@tonic-gate #ifdef KLUDGELINEMODE 138*7c478bd9Sstevel@tonic-gate extern cc_t echoc; /* Toggle local echoing */ 139*7c478bd9Sstevel@tonic-gate #endif 140*7c478bd9Sstevel@tonic-gate 141*7c478bd9Sstevel@tonic-gate extern char *prompt; /* Prompt for command. */ 142*7c478bd9Sstevel@tonic-gate 143*7c478bd9Sstevel@tonic-gate extern char doopt[]; 144*7c478bd9Sstevel@tonic-gate extern char dont[]; 145*7c478bd9Sstevel@tonic-gate extern char will[]; 146*7c478bd9Sstevel@tonic-gate extern char wont[]; 147*7c478bd9Sstevel@tonic-gate extern char options[]; /* All the little options */ 148*7c478bd9Sstevel@tonic-gate extern char *hostname; /* Who are we connected to? */ 149*7c478bd9Sstevel@tonic-gate extern void (*encrypt_output) (unsigned char *, int); 150*7c478bd9Sstevel@tonic-gate extern int (*decrypt_input) (int); 151*7c478bd9Sstevel@tonic-gate 152*7c478bd9Sstevel@tonic-gate /* 153*7c478bd9Sstevel@tonic-gate * We keep track of each side of the option negotiation. 154*7c478bd9Sstevel@tonic-gate */ 155*7c478bd9Sstevel@tonic-gate 156*7c478bd9Sstevel@tonic-gate #define MY_STATE_WILL 0x01 157*7c478bd9Sstevel@tonic-gate #define MY_WANT_STATE_WILL 0x02 158*7c478bd9Sstevel@tonic-gate #define MY_STATE_DO 0x04 159*7c478bd9Sstevel@tonic-gate #define MY_WANT_STATE_DO 0x08 160*7c478bd9Sstevel@tonic-gate 161*7c478bd9Sstevel@tonic-gate /* 162*7c478bd9Sstevel@tonic-gate * Macros to check the current state of things 163*7c478bd9Sstevel@tonic-gate */ 164*7c478bd9Sstevel@tonic-gate 165*7c478bd9Sstevel@tonic-gate #define my_state_is_do(opt) (options[opt]&MY_STATE_DO) 166*7c478bd9Sstevel@tonic-gate #define my_state_is_will(opt) (options[opt]&MY_STATE_WILL) 167*7c478bd9Sstevel@tonic-gate #define my_want_state_is_do(opt) (options[opt]&MY_WANT_STATE_DO) 168*7c478bd9Sstevel@tonic-gate #define my_want_state_is_will(opt) (options[opt]&MY_WANT_STATE_WILL) 169*7c478bd9Sstevel@tonic-gate 170*7c478bd9Sstevel@tonic-gate #define my_state_is_dont(opt) (!my_state_is_do(opt)) 171*7c478bd9Sstevel@tonic-gate #define my_state_is_wont(opt) (!my_state_is_will(opt)) 172*7c478bd9Sstevel@tonic-gate #define my_want_state_is_dont(opt) (!my_want_state_is_do(opt)) 173*7c478bd9Sstevel@tonic-gate #define my_want_state_is_wont(opt) (!my_want_state_is_will(opt)) 174*7c478bd9Sstevel@tonic-gate 175*7c478bd9Sstevel@tonic-gate #define set_my_state_do(opt) {options[opt] |= MY_STATE_DO; } 176*7c478bd9Sstevel@tonic-gate #define set_my_state_will(opt) {options[opt] |= MY_STATE_WILL; } 177*7c478bd9Sstevel@tonic-gate #define set_my_want_state_do(opt) {options[opt] |= MY_WANT_STATE_DO; } 178*7c478bd9Sstevel@tonic-gate #define set_my_want_state_will(opt) {options[opt] |= MY_WANT_STATE_WILL; } 179*7c478bd9Sstevel@tonic-gate 180*7c478bd9Sstevel@tonic-gate #define set_my_state_dont(opt) {options[opt] &= ~MY_STATE_DO; } 181*7c478bd9Sstevel@tonic-gate #define set_my_state_wont(opt) {options[opt] &= ~MY_STATE_WILL; } 182*7c478bd9Sstevel@tonic-gate #define set_my_want_state_dont(opt) {options[opt] &= ~MY_WANT_STATE_DO; } 183*7c478bd9Sstevel@tonic-gate #define set_my_want_state_wont(opt) {options[opt] &= ~MY_WANT_STATE_WILL; } 184*7c478bd9Sstevel@tonic-gate 185*7c478bd9Sstevel@tonic-gate /* 186*7c478bd9Sstevel@tonic-gate * Make everything symetrical 187*7c478bd9Sstevel@tonic-gate */ 188*7c478bd9Sstevel@tonic-gate 189*7c478bd9Sstevel@tonic-gate #define HIS_STATE_WILL MY_STATE_DO 190*7c478bd9Sstevel@tonic-gate #define HIS_WANT_STATE_WILL MY_WANT_STATE_DO 191*7c478bd9Sstevel@tonic-gate #define HIS_STATE_DO MY_STATE_WILL 192*7c478bd9Sstevel@tonic-gate #define HIS_WANT_STATE_DO MY_WANT_STATE_WILL 193*7c478bd9Sstevel@tonic-gate 194*7c478bd9Sstevel@tonic-gate #define his_state_is_do my_state_is_will 195*7c478bd9Sstevel@tonic-gate #define his_state_is_will my_state_is_do 196*7c478bd9Sstevel@tonic-gate #define his_want_state_is_do my_want_state_is_will 197*7c478bd9Sstevel@tonic-gate #define his_want_state_is_will my_want_state_is_do 198*7c478bd9Sstevel@tonic-gate 199*7c478bd9Sstevel@tonic-gate #define his_state_is_dont my_state_is_wont 200*7c478bd9Sstevel@tonic-gate #define his_state_is_wont my_state_is_dont 201*7c478bd9Sstevel@tonic-gate #define his_want_state_is_dont my_want_state_is_wont 202*7c478bd9Sstevel@tonic-gate #define his_want_state_is_wont my_want_state_is_dont 203*7c478bd9Sstevel@tonic-gate 204*7c478bd9Sstevel@tonic-gate #define set_his_state_do set_my_state_will 205*7c478bd9Sstevel@tonic-gate #define set_his_state_will set_my_state_do 206*7c478bd9Sstevel@tonic-gate #define set_his_want_state_do set_my_want_state_will 207*7c478bd9Sstevel@tonic-gate #define set_his_want_state_will set_my_want_state_do 208*7c478bd9Sstevel@tonic-gate 209*7c478bd9Sstevel@tonic-gate #define set_his_state_dont set_my_state_wont 210*7c478bd9Sstevel@tonic-gate #define set_his_state_wont set_my_state_dont 211*7c478bd9Sstevel@tonic-gate #define set_his_want_state_dont set_my_want_state_wont 212*7c478bd9Sstevel@tonic-gate #define set_his_want_state_wont set_my_want_state_dont 213*7c478bd9Sstevel@tonic-gate 214*7c478bd9Sstevel@tonic-gate 215*7c478bd9Sstevel@tonic-gate extern FILE *NetTrace; /* Where debugging output goes */ 216*7c478bd9Sstevel@tonic-gate /* Name of file where debugging output goes */ 217*7c478bd9Sstevel@tonic-gate extern unsigned char NetTraceFile[]; 218*7c478bd9Sstevel@tonic-gate extern void SetNetTrace(char *); /* Function to change where debugging goes */ 219*7c478bd9Sstevel@tonic-gate 220*7c478bd9Sstevel@tonic-gate extern jmp_buf peerdied; 221*7c478bd9Sstevel@tonic-gate extern jmp_buf toplevel; /* For error conditions. */ 222*7c478bd9Sstevel@tonic-gate 223*7c478bd9Sstevel@tonic-gate extern char *AllocStringBuffer(char **, unsigned int *, unsigned int); 224*7c478bd9Sstevel@tonic-gate extern void ExitString(char *, int); 225*7c478bd9Sstevel@tonic-gate extern void Exit(int); 226*7c478bd9Sstevel@tonic-gate extern void command(int, char *, int); 227*7c478bd9Sstevel@tonic-gate extern void Dump(int, unsigned char *, int); 228*7c478bd9Sstevel@tonic-gate extern char *GetAndAppendString(char **, unsigned int *, char *, FILE *); 229*7c478bd9Sstevel@tonic-gate extern char *GetString(char **, unsigned int *, FILE *); 230*7c478bd9Sstevel@tonic-gate extern void init_network(void); 231*7c478bd9Sstevel@tonic-gate extern void init_terminal(void); 232*7c478bd9Sstevel@tonic-gate extern void init_sys(void); 233*7c478bd9Sstevel@tonic-gate extern void optionstatus(void); 234*7c478bd9Sstevel@tonic-gate extern void printoption(char *, int, int); 235*7c478bd9Sstevel@tonic-gate extern void printsub(int, unsigned char *, int); 236*7c478bd9Sstevel@tonic-gate extern void sendnaws(void); 237*7c478bd9Sstevel@tonic-gate extern void setconnmode(int); 238*7c478bd9Sstevel@tonic-gate extern void setcommandmode(void); 239*7c478bd9Sstevel@tonic-gate extern void setneturg(void); 240*7c478bd9Sstevel@tonic-gate extern void sys_telnet_init(void); 241*7c478bd9Sstevel@tonic-gate extern void telnet(char *); 242*7c478bd9Sstevel@tonic-gate extern void tel_enter_binary(int); 243*7c478bd9Sstevel@tonic-gate extern void tel_leave_binary(int); 244*7c478bd9Sstevel@tonic-gate extern void TerminalDefaultChars(void); 245*7c478bd9Sstevel@tonic-gate extern void TerminalFlushOutput(void); 246*7c478bd9Sstevel@tonic-gate extern void TerminalNewMode(int); 247*7c478bd9Sstevel@tonic-gate extern void TerminalSaveState(void); 248*7c478bd9Sstevel@tonic-gate extern void TerminalSpeeds(int *, int *); 249*7c478bd9Sstevel@tonic-gate extern void upcase(char *); 250*7c478bd9Sstevel@tonic-gate 251*7c478bd9Sstevel@tonic-gate extern void xmitEL(void); 252*7c478bd9Sstevel@tonic-gate extern void xmitEC(void); 253*7c478bd9Sstevel@tonic-gate extern void intp(void); 254*7c478bd9Sstevel@tonic-gate extern void sendabort(void); 255*7c478bd9Sstevel@tonic-gate extern void sendsusp(void); 256*7c478bd9Sstevel@tonic-gate extern void set_escape_char(char *); 257*7c478bd9Sstevel@tonic-gate extern void fatal_tty_error(char *); 258*7c478bd9Sstevel@tonic-gate 259*7c478bd9Sstevel@tonic-gate extern void send_do(int, int); 260*7c478bd9Sstevel@tonic-gate extern void send_dont(int, int); 261*7c478bd9Sstevel@tonic-gate extern void send_will(int, int); 262*7c478bd9Sstevel@tonic-gate extern void send_wont(int, int); 263*7c478bd9Sstevel@tonic-gate 264*7c478bd9Sstevel@tonic-gate extern void lm_mode(unsigned char *, int, int); 265*7c478bd9Sstevel@tonic-gate 266*7c478bd9Sstevel@tonic-gate extern void slcstate(void); 267*7c478bd9Sstevel@tonic-gate extern void slc_mode_export(void); 268*7c478bd9Sstevel@tonic-gate extern void slc_mode_import(int); 269*7c478bd9Sstevel@tonic-gate extern void slc_check(void); 270*7c478bd9Sstevel@tonic-gate 271*7c478bd9Sstevel@tonic-gate extern void env_opt_start_info(void); 272*7c478bd9Sstevel@tonic-gate extern void env_opt_add(unsigned char *); 273*7c478bd9Sstevel@tonic-gate extern void env_opt_end(int); 274*7c478bd9Sstevel@tonic-gate 275*7c478bd9Sstevel@tonic-gate extern char **genget(char *, char **, int); 276*7c478bd9Sstevel@tonic-gate extern unsigned char *env_default(int, int); 277*7c478bd9Sstevel@tonic-gate extern unsigned char *env_getvalue(unsigned char *); 278*7c478bd9Sstevel@tonic-gate 279*7c478bd9Sstevel@tonic-gate extern int env_init(void); 280*7c478bd9Sstevel@tonic-gate extern int get_status(void); 281*7c478bd9Sstevel@tonic-gate extern int init_telnet(void); 282*7c478bd9Sstevel@tonic-gate extern int isprefix(register char *, register char *); 283*7c478bd9Sstevel@tonic-gate extern int netflush(void); 284*7c478bd9Sstevel@tonic-gate extern int opt_welldefined(char *); 285*7c478bd9Sstevel@tonic-gate extern int process_rings(int, int, int, int, int, int); 286*7c478bd9Sstevel@tonic-gate extern int quit(void); 287*7c478bd9Sstevel@tonic-gate extern int rlogin_susp(void); 288*7c478bd9Sstevel@tonic-gate extern int Scheduler(int); 289*7c478bd9Sstevel@tonic-gate extern int SetSockOpt(int, int, int, int); 290*7c478bd9Sstevel@tonic-gate extern int stilloob(void); 291*7c478bd9Sstevel@tonic-gate extern int telrcv(void); 292*7c478bd9Sstevel@tonic-gate extern int TerminalWindowSize(unsigned short *, unsigned short *); 293*7c478bd9Sstevel@tonic-gate extern int TerminalWrite(char *, int); 294*7c478bd9Sstevel@tonic-gate extern int TerminalSpecialChars(int); 295*7c478bd9Sstevel@tonic-gate extern int tn(int, char **); 296*7c478bd9Sstevel@tonic-gate extern int tninit(void); 297*7c478bd9Sstevel@tonic-gate extern int ttyflush(int); 298*7c478bd9Sstevel@tonic-gate extern int getconnmode(void); 299*7c478bd9Sstevel@tonic-gate extern int xmitAO(void); 300*7c478bd9Sstevel@tonic-gate extern int sendbrk(void); 301*7c478bd9Sstevel@tonic-gate extern int dosynch(void); 302*7c478bd9Sstevel@tonic-gate 303*7c478bd9Sstevel@tonic-gate extern cc_t *tcval(int); 304*7c478bd9Sstevel@tonic-gate 305*7c478bd9Sstevel@tonic-gate extern void auth_encrypt_init(char *, char *, char *); 306*7c478bd9Sstevel@tonic-gate extern void auth_encrypt_user(char *); 307*7c478bd9Sstevel@tonic-gate extern int net_write(unsigned char *, int len); 308*7c478bd9Sstevel@tonic-gate extern void net_encrypt(void); 309*7c478bd9Sstevel@tonic-gate extern void telnet_spin(void); 310*7c478bd9Sstevel@tonic-gate extern void printd(unsigned char *, int); 311*7c478bd9Sstevel@tonic-gate 312*7c478bd9Sstevel@tonic-gate #ifndef USE_TERMIO 313*7c478bd9Sstevel@tonic-gate 314*7c478bd9Sstevel@tonic-gate extern struct tchars ntc; 315*7c478bd9Sstevel@tonic-gate extern struct ltchars nltc; 316*7c478bd9Sstevel@tonic-gate extern struct sgttyb nttyb; 317*7c478bd9Sstevel@tonic-gate 318*7c478bd9Sstevel@tonic-gate #define termEofChar ntc.t_eofc 319*7c478bd9Sstevel@tonic-gate #define termEraseChar nttyb.sg_erase 320*7c478bd9Sstevel@tonic-gate #define termFlushChar nltc.t_flushc 321*7c478bd9Sstevel@tonic-gate #define termIntChar ntc.t_intrc 322*7c478bd9Sstevel@tonic-gate #define termKillChar nttyb.sg_kill 323*7c478bd9Sstevel@tonic-gate #define termLiteralNextChar nltc.t_lnextc 324*7c478bd9Sstevel@tonic-gate #define termQuitChar ntc.t_quitc 325*7c478bd9Sstevel@tonic-gate #define termSuspChar nltc.t_suspc 326*7c478bd9Sstevel@tonic-gate #define termRprntChar nltc.t_rprntc 327*7c478bd9Sstevel@tonic-gate #define termWerasChar nltc.t_werasc 328*7c478bd9Sstevel@tonic-gate #define termStartChar ntc.t_startc 329*7c478bd9Sstevel@tonic-gate #define termStopChar ntc.t_stopc 330*7c478bd9Sstevel@tonic-gate #define termForw1Char ntc.t_brkc 331*7c478bd9Sstevel@tonic-gate extern cc_t termForw2Char; 332*7c478bd9Sstevel@tonic-gate extern cc_t termAytChar; 333*7c478bd9Sstevel@tonic-gate 334*7c478bd9Sstevel@tonic-gate #define termEofCharp (cc_t *)&ntc.t_eofc 335*7c478bd9Sstevel@tonic-gate #define termEraseCharp (cc_t *)&nttyb.sg_erase 336*7c478bd9Sstevel@tonic-gate #define termFlushCharp (cc_t *)&nltc.t_flushc 337*7c478bd9Sstevel@tonic-gate #define termIntCharp (cc_t *)&ntc.t_intrc 338*7c478bd9Sstevel@tonic-gate #define termKillCharp (cc_t *)&nttyb.sg_kill 339*7c478bd9Sstevel@tonic-gate #define termLiteralNextCharp (cc_t *)&nltc.t_lnextc 340*7c478bd9Sstevel@tonic-gate #define termQuitCharp (cc_t *)&ntc.t_quitc 341*7c478bd9Sstevel@tonic-gate #define termSuspCharp (cc_t *)&nltc.t_suspc 342*7c478bd9Sstevel@tonic-gate #define termRprntCharp (cc_t *)&nltc.t_rprntc 343*7c478bd9Sstevel@tonic-gate #define termWerasCharp (cc_t *)&nltc.t_werasc 344*7c478bd9Sstevel@tonic-gate #define termStartCharp (cc_t *)&ntc.t_startc 345*7c478bd9Sstevel@tonic-gate #define termStopCharp (cc_t *)&ntc.t_stopc 346*7c478bd9Sstevel@tonic-gate #define termForw1Charp (cc_t *)&ntc.t_brkc 347*7c478bd9Sstevel@tonic-gate #define termForw2Charp (cc_t *)&termForw2Char 348*7c478bd9Sstevel@tonic-gate #define termAytCharp (cc_t *)&termAytChar 349*7c478bd9Sstevel@tonic-gate 350*7c478bd9Sstevel@tonic-gate #else 351*7c478bd9Sstevel@tonic-gate 352*7c478bd9Sstevel@tonic-gate extern struct termio new_tc; 353*7c478bd9Sstevel@tonic-gate 354*7c478bd9Sstevel@tonic-gate #define termEofChar new_tc.c_cc[VEOF] 355*7c478bd9Sstevel@tonic-gate #define termEraseChar new_tc.c_cc[VERASE] 356*7c478bd9Sstevel@tonic-gate #define termIntChar new_tc.c_cc[VINTR] 357*7c478bd9Sstevel@tonic-gate #define termKillChar new_tc.c_cc[VKILL] 358*7c478bd9Sstevel@tonic-gate #define termQuitChar new_tc.c_cc[VQUIT] 359*7c478bd9Sstevel@tonic-gate 360*7c478bd9Sstevel@tonic-gate #define termSuspChar new_tc.c_cc[VSUSP] 361*7c478bd9Sstevel@tonic-gate #define termFlushChar new_tc.c_cc[VDISCARD] 362*7c478bd9Sstevel@tonic-gate #define termWerasChar new_tc.c_cc[VWERASE] 363*7c478bd9Sstevel@tonic-gate #define termRprntChar new_tc.c_cc[VREPRINT] 364*7c478bd9Sstevel@tonic-gate #define termLiteralNextChar new_tc.c_cc[VLNEXT] 365*7c478bd9Sstevel@tonic-gate #define termStartChar new_tc.c_cc[VSTART] 366*7c478bd9Sstevel@tonic-gate #define termStopChar new_tc.c_cc[VSTOP] 367*7c478bd9Sstevel@tonic-gate #define termForw1Char new_tc.c_cc[VEOL] 368*7c478bd9Sstevel@tonic-gate #define termForw2Char new_tc.c_cc[VEOL] 369*7c478bd9Sstevel@tonic-gate extern cc_t termAytChar; 370*7c478bd9Sstevel@tonic-gate 371*7c478bd9Sstevel@tonic-gate #define termEofCharp &termEofChar 372*7c478bd9Sstevel@tonic-gate #define termEraseCharp &termEraseChar 373*7c478bd9Sstevel@tonic-gate #define termIntCharp &termIntChar 374*7c478bd9Sstevel@tonic-gate #define termKillCharp &termKillChar 375*7c478bd9Sstevel@tonic-gate #define termQuitCharp &termQuitChar 376*7c478bd9Sstevel@tonic-gate #define termSuspCharp &termSuspChar 377*7c478bd9Sstevel@tonic-gate #define termFlushCharp &termFlushChar 378*7c478bd9Sstevel@tonic-gate #define termWerasCharp &termWerasChar 379*7c478bd9Sstevel@tonic-gate #define termRprntCharp &termRprntChar 380*7c478bd9Sstevel@tonic-gate #define termLiteralNextCharp &termLiteralNextChar 381*7c478bd9Sstevel@tonic-gate #define termStartCharp &termStartChar 382*7c478bd9Sstevel@tonic-gate #define termStopCharp &termStopChar 383*7c478bd9Sstevel@tonic-gate #define termForw1Charp &termForw1Char 384*7c478bd9Sstevel@tonic-gate #define termForw2Charp &termForw2Char 385*7c478bd9Sstevel@tonic-gate #define termAytCharp &termAytChar 386*7c478bd9Sstevel@tonic-gate #endif 387*7c478bd9Sstevel@tonic-gate 388*7c478bd9Sstevel@tonic-gate 389*7c478bd9Sstevel@tonic-gate /* Ring buffer structures which are shared */ 390*7c478bd9Sstevel@tonic-gate 391*7c478bd9Sstevel@tonic-gate #include "ring.h" 392*7c478bd9Sstevel@tonic-gate 393*7c478bd9Sstevel@tonic-gate extern Ring netoring; 394*7c478bd9Sstevel@tonic-gate extern Ring netiring; 395*7c478bd9Sstevel@tonic-gate extern Ring ttyoring; 396*7c478bd9Sstevel@tonic-gate extern Ring ttyiring; 397*7c478bd9Sstevel@tonic-gate 398*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 399*7c478bd9Sstevel@tonic-gate } 400*7c478bd9Sstevel@tonic-gate #endif 401*7c478bd9Sstevel@tonic-gate 402*7c478bd9Sstevel@tonic-gate #endif /* _EXTERNS_H */ 403