Home | History | Annotate | Line # | Download | only in telnetd
ext.h revision 1.10
      1 /*	$NetBSD: ext.h,v 1.10 2000/01/13 13:11:31 ad Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 1989, 1993
      5  *	The Regents of the University of California.  All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  * 1. Redistributions of source code must retain the above copyright
     11  *    notice, this list of conditions and the following disclaimer.
     12  * 2. Redistributions in binary form must reproduce the above copyright
     13  *    notice, this list of conditions and the following disclaimer in the
     14  *    documentation and/or other materials provided with the distribution.
     15  * 3. All advertising materials mentioning features or use of this software
     16  *    must display the following acknowledgement:
     17  *	This product includes software developed by the University of
     18  *	California, Berkeley and its contributors.
     19  * 4. Neither the name of the University nor the names of its contributors
     20  *    may be used to endorse or promote products derived from this software
     21  *    without specific prior written permission.
     22  *
     23  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     27  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     29  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     32  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     33  * SUCH DAMAGE.
     34  *
     35  *	from: @(#)ext.h	8.2 (Berkeley) 12/15/93
     36  */
     37 
     38 /*
     39  * Telnet server variable declarations
     40  */
     41 extern char	options[256];
     42 extern char	do_dont_resp[256];
     43 extern char	will_wont_resp[256];
     44 extern int	linemode;	/* linemode on/off */
     45 #ifdef	LINEMODE
     46 extern int	uselinemode;	/* what linemode to use (on/off) */
     47 extern int	editmode;	/* edit modes in use */
     48 extern int	useeditmode;	/* edit modes to use */
     49 extern int	alwayslinemode;	/* command line option */
     50 # ifdef	KLUDGELINEMODE
     51 extern int	lmodetype;	/* Client support for linemode */
     52 # endif	/* KLUDGELINEMODE */
     53 #endif	/* LINEMODE */
     54 extern int	flowmode;	/* current flow control state */
     55 extern int	restartany;	/* restart output on any character state */
     56 #ifdef DIAGNOSTICS
     57 extern int	diagnostic;	/* telnet diagnostic capabilities */
     58 #endif /* DIAGNOSTICS */
     59 #ifdef BFTPDAEMON
     60 extern int	bftpd;		/* behave as bftp daemon */
     61 #endif /* BFTPDAEMON */
     62 #if	defined(SECURELOGIN)
     63 extern int	require_secure_login;
     64 #endif
     65 #if	defined(AUTHENTICATION)
     66 extern int	auth_level;
     67 #endif
     68 
     69 extern slcfun	slctab[NSLC + 1];	/* slc mapping table */
     70 
     71 char	*terminaltype;
     72 
     73 /*
     74  * I/O data buffers, pointers, and counters.
     75  */
     76 extern char	ptyobuf[BUFSIZ+NETSLOP], *pfrontp, *pbackp;
     77 
     78 extern char	netibuf[BUFSIZ], *netip;
     79 
     80 extern char	netobuf[BUFSIZ+NETSLOP], *nfrontp, *nbackp;
     81 extern char	*neturg;		/* one past last bye of urgent data */
     82 
     83 extern int	pcc, ncc;
     84 
     85 #if defined(CRAY2) && defined(UNICOS5)
     86 extern int unpcc;  /* characters left unprocessed by CRAY-2 terminal routine */
     87 extern char *unptyip;  /* pointer to remaining characters in buffer */
     88 #endif
     89 
     90 extern int	pty, net;
     91 extern char	*line;
     92 extern int	SYNCHing;		/* we are in TELNET SYNCH mode */
     93 
     94 #include <sys/cdefs.h>
     95 #define P __P
     96 
     97 extern void
     98 	_termstat P((void)),
     99 	add_slc P((int, int, int)),
    100 	check_slc P((void)),
    101 	change_slc P((int, int, int)),
    102 	cleanup P((int)),
    103 	clientstat P((int, int, int)),
    104 	copy_termbuf P((char *, int)),
    105 	deferslc P((void)),
    106 	defer_terminit P((void)),
    107 	do_opt_slc P((unsigned char *, int)),
    108 	doeof P((void)),
    109 	dooption P((int)),
    110 	dontoption P((int)),
    111 	edithost P((char *, char *)),
    112 	fatal P((int, char *)),
    113 	fatalperror P((int, char *)),
    114 	get_slc_defaults P((void)),
    115 	init_env P((void)),
    116 	init_termbuf P((void)),
    117 	interrupt P((void)),
    118 	localstat P((void)),
    119 	flowstat P((void)),
    120 	netclear P((void)),
    121 	netflush P((void)),
    122 #ifdef DIAGNOSTICS
    123 	printoption P((char *, int)),
    124 	printdata P((char *, char *, int)),
    125 	printsub P((int, unsigned char *, int)),
    126 #endif
    127 	ptyflush P((void)),
    128 	putchr P((int)),
    129 	recv_ayt P((void)),
    130 	send_do P((int, int)),
    131 	send_dont P((int, int)),
    132 	send_slc P((void)),
    133 	send_status P((void)),
    134 	send_will P((int, int)),
    135 	send_wont P((int, int)),
    136 	sendbrk P((void)),
    137 	sendsusp P((void)),
    138 	set_termbuf P((void)),
    139 	start_login P((char *, int, char *)),
    140 	start_slc P((int)),
    141 	startslave P((char *, int, char *)),
    142 	suboption P((void)),
    143 	telrcv P((void)),
    144 	ttloop P((void)),
    145 	tty_binaryin P((int)),
    146 	tty_binaryout P((int));
    147 
    148 extern char *
    149 	putf P((char *, char *));
    150 
    151 extern int
    152 	end_slc P((unsigned char **)),
    153 	getnpty P((void)),
    154 #ifndef convex
    155 	getpty P((int *)),
    156 #endif
    157 	login_tty P((int)),
    158 	spcset P((int, cc_t *, cc_t **)),
    159 	stilloob P((int)),
    160 	terminit P((void)),
    161 	termstat P((void)),
    162 	tty_flowmode P((void)),
    163 	tty_restartany P((void)),
    164 	tty_isbinaryin P((void)),
    165 	tty_isbinaryout P((void)),
    166 	tty_iscrnl P((void)),
    167 	tty_isecho P((void)),
    168 	tty_isediting P((void)),
    169 	tty_islitecho P((void)),
    170 	tty_isnewmap P((void)),
    171 	tty_israw P((void)),
    172 	tty_issofttab P((void)),
    173 	tty_istrapsig P((void)),
    174 	tty_linemode P((void));
    175 
    176 extern void
    177 	tty_rspeed P((int)),
    178 	tty_setecho P((int)),
    179 	tty_setedit P((int)),
    180 	tty_setlinemode P((int)),
    181 	tty_setlitecho P((int)),
    182 	tty_setsig P((int)),
    183 	tty_setsofttab P((int)),
    184 	tty_tspeed P((int)),
    185 	willoption P((int)),
    186 	wontoption P((int)),
    187 	writenet P((unsigned char *, int));
    188 
    189 
    190 
    191 /*
    192  * The following are some clocks used to decide how to interpret
    193  * the relationship between various variables.
    194  */
    195 
    196 extern struct {
    197     int
    198 	system,			/* what the current time is */
    199 	echotoggle,		/* last time user entered echo character */
    200 	modenegotiated,		/* last time operating mode negotiated */
    201 	didnetreceive,		/* last time we read data from network */
    202 	ttypesubopt,		/* ttype subopt is received */
    203 	tspeedsubopt,		/* tspeed subopt is received */
    204 	environsubopt,		/* environ subopt is received */
    205 	oenvironsubopt,		/* old environ subopt is received */
    206 	xdisplocsubopt,		/* xdisploc subopt is received */
    207 	baseline,		/* time started to do timed action */
    208 	gotDM;			/* when did we last see a data mark */
    209 } clocks;
    210 
    211 
    212 #if	defined(CRAY2) && defined(UNICOS5)
    213 extern int	needtermstat;
    214 #endif
    215 
    216 #ifndef	DEFAULT_IM
    217 # ifdef CRAY
    218 #  define DEFAULT_IM	"\r\n\r\nCray UNICOS (%h) (%t)\r\n\r\r\n\r"
    219 # else
    220 #  ifdef sun
    221 #   define DEFAULT_IM	"\r\n\r\nSunOS UNIX (%h) (%t)\r\n\r\r\n\r"
    222 #  else
    223 #   ifdef ultrix
    224 #    define DEFAULT_IM	"\r\n\r\nULTRIX (%h) (%t)\r\n\r\r\n\r"
    225 #   else
    226 #    define DEFAULT_IM	"\r\n\r\n4.4 BSD UNIX (%h) (%t)\r\n\r\r\n\r"
    227 #   endif
    228 #  endif
    229 # endif
    230 #endif
    231