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