129088Smarkm/*
229088Smarkm * Copyright (c) 1988, 1990, 1993
329088Smarkm *	The Regents of the University of California.  All rights reserved.
429088Smarkm *
529088Smarkm * Redistribution and use in source and binary forms, with or without
629088Smarkm * modification, are permitted provided that the following conditions
729088Smarkm * are met:
829088Smarkm * 1. Redistributions of source code must retain the above copyright
929088Smarkm *    notice, this list of conditions and the following disclaimer.
1029088Smarkm * 2. Redistributions in binary form must reproduce the above copyright
1129088Smarkm *    notice, this list of conditions and the following disclaimer in the
1229088Smarkm *    documentation and/or other materials provided with the distribution.
1329088Smarkm * 3. All advertising materials mentioning features or use of this software
1429088Smarkm *    must display the following acknowledgement:
1529088Smarkm *	This product includes software developed by the University of
1629088Smarkm *	California, Berkeley and its contributors.
1729088Smarkm * 4. Neither the name of the University nor the names of its contributors
1829088Smarkm *    may be used to endorse or promote products derived from this software
1929088Smarkm *    without specific prior written permission.
2029088Smarkm *
2129088Smarkm * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2229088Smarkm * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2329088Smarkm * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2429088Smarkm * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2529088Smarkm * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2629088Smarkm * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2729088Smarkm * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2829088Smarkm * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2929088Smarkm * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3029088Smarkm * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3129088Smarkm * SUCH DAMAGE.
3229088Smarkm *
3329088Smarkm *	@(#)externs.h	8.3 (Berkeley) 5/30/95
3456668Sshin *	$FreeBSD$
3529088Smarkm */
3629088Smarkm
3729088Smarkm#ifndef	BSD
3829088Smarkm# define BSD 43
3929088Smarkm#endif
4029088Smarkm
4129088Smarkm/*
4272083Sasmodai * ucb stdio.h defines BSD as something weird
4329088Smarkm */
4429088Smarkm#if defined(sun) && defined(__svr4__)
4529088Smarkm#define BSD 43
4629088Smarkm#endif
4729088Smarkm
4829088Smarkm#ifndef	USE_TERMIO
4929088Smarkm# if BSD > 43 || defined(SYSV_TERMIO)
5029088Smarkm#  define USE_TERMIO
5129088Smarkm# endif
5229088Smarkm#endif
5329088Smarkm
5429088Smarkm#include <stdio.h>
5529088Smarkm#include <setjmp.h>
5629088Smarkm#include <sys/ioctl.h>
5787139Smarkm#include <errno.h>
5829088Smarkm#ifdef	USE_TERMIO
5929088Smarkm# ifndef	VINTR
60199874Sed#  include <termios.h>
6129088Smarkm# endif
6287139Smarkm# define termio termios
6329088Smarkm#endif
6429088Smarkm#if defined(NO_CC_T) || !defined(USE_TERMIO)
6529088Smarkm# if !defined(USE_TERMIO)
6629088Smarkmtypedef char cc_t;
6729088Smarkm# else
6829088Smarkmtypedef unsigned char cc_t;
6929088Smarkm# endif
7029088Smarkm#endif
7129088Smarkm
7229088Smarkm#include <string.h>
7329088Smarkm
7456668Sshin#if defined(IPSEC)
75171135Sgnn#include <netipsec/ipsec.h>
7656668Sshin#if defined(IPSEC_POLICY_IPSEC)
7756668Sshinextern char *ipsec_policy_in;
7856668Sshinextern char *ipsec_policy_out;
7956668Sshin#endif
8056668Sshin#endif
8156668Sshin
8229088Smarkm#ifndef	_POSIX_VDISABLE
8329088Smarkm# ifdef sun
8429088Smarkm#  include <sys/param.h>	/* pick up VDISABLE definition, mayby */
8529088Smarkm# endif
8629088Smarkm# ifdef VDISABLE
8729088Smarkm#  define _POSIX_VDISABLE VDISABLE
8829088Smarkm# else
8929088Smarkm#  define _POSIX_VDISABLE ((cc_t)'\377')
9029088Smarkm# endif
9129088Smarkm#endif
9229088Smarkm
9329088Smarkm#define	SUBBUFSIZE	256
9429088Smarkm
9529088Smarkm#if	!defined(P)
9629088Smarkm# ifdef	__STDC__
9729088Smarkm#  define	P(x)	x
9829088Smarkm# else
9929088Smarkm#  define	P(x)	()
10029088Smarkm# endif
10129088Smarkm#endif
10229088Smarkm
10329088Smarkmextern int
10429088Smarkm    autologin,		/* Autologin enabled */
10529088Smarkm    skiprc,		/* Don't process the ~/.telnetrc file */
10629088Smarkm    eight,		/* use eight bit mode (binary in and/or out */
10756668Sshin    family,		/* address family of peer */
10829088Smarkm    flushout,		/* flush output */
10929088Smarkm    connected,		/* Are we connected to the other side? */
11029088Smarkm    globalmode,		/* Mode tty should be in */
11129088Smarkm    telnetport,		/* Are we connected to the telnet port? */
11229088Smarkm    localflow,		/* Flow control handled locally */
11329088Smarkm    restartany,		/* If flow control, restart output on any character */
11429088Smarkm    localchars,		/* we recognize interrupt/quit */
11529088Smarkm    donelclchars,	/* the user has set "localchars" */
11629088Smarkm    showoptions,
11729088Smarkm    net,		/* Network file descriptor */
11829088Smarkm    tin,		/* Terminal input file descriptor */
11929088Smarkm    tout,		/* Terminal output file descriptor */
12029088Smarkm    crlf,		/* Should '\r' be mapped to <CR><LF> (or <CR><NUL>)? */
12129088Smarkm    autoflush,		/* flush output when interrupting? */
12229088Smarkm    autosynch,		/* send interrupt characters with SYNCH? */
12329088Smarkm    SYNCHing,		/* Is the stream in telnet SYNCH mode? */
12429088Smarkm    donebinarytoggle,	/* the user has put us in binary */
12529088Smarkm    dontlecho,		/* do we suppress local echoing right now? */
12629088Smarkm    crmod,
12729088Smarkm    netdata,		/* Print out network data flow */
12829088Smarkm    prettydump,		/* Print "netdata" output in user readable format */
12929088Smarkm    termdata,		/* Print out terminal data flow */
130114911Smarkm    telnet_debug,	/* Debug level */
13147973Sru    doaddrlookup,	/* do a reverse lookup? */
13229181Smarkm    clienteof;		/* Client received EOF */
13329088Smarkm
13429088Smarkmextern cc_t escape;	/* Escape to command mode */
13529088Smarkmextern cc_t rlogin;	/* Rlogin mode escape character */
13629088Smarkm#ifdef	KLUDGELINEMODE
13729088Smarkmextern cc_t echoc;	/* Toggle local echoing */
13829088Smarkm#endif
13929088Smarkm
14029088Smarkmextern char
14129088Smarkm    *prompt;		/* Prompt for command. */
14229088Smarkm
14329088Smarkmextern char
14429088Smarkm    doopt[],
14529088Smarkm    dont[],
14629088Smarkm    will[],
14729088Smarkm    wont[],
14829088Smarkm    options[],		/* All the little options */
14929088Smarkm    *hostname;		/* Who are we connected to? */
15029088Smarkm#ifdef	ENCRYPTION
15187155Smarkmextern void (*encrypt_output)(unsigned char *, int);
15287155Smarkmextern int (*decrypt_input)(int);
15329088Smarkm#endif	/* ENCRYPTION */
15429088Smarkm
15529088Smarkm/*
15629088Smarkm * We keep track of each side of the option negotiation.
15729088Smarkm */
15829088Smarkm
15929088Smarkm#define	MY_STATE_WILL		0x01
16029088Smarkm#define	MY_WANT_STATE_WILL	0x02
16129088Smarkm#define	MY_STATE_DO		0x04
16229088Smarkm#define	MY_WANT_STATE_DO	0x08
16329088Smarkm
16429088Smarkm/*
16529088Smarkm * Macros to check the current state of things
16629088Smarkm */
16729088Smarkm
16829088Smarkm#define	my_state_is_do(opt)		(options[opt]&MY_STATE_DO)
16929088Smarkm#define	my_state_is_will(opt)		(options[opt]&MY_STATE_WILL)
17029088Smarkm#define my_want_state_is_do(opt)	(options[opt]&MY_WANT_STATE_DO)
17129088Smarkm#define my_want_state_is_will(opt)	(options[opt]&MY_WANT_STATE_WILL)
17229088Smarkm
17329088Smarkm#define	my_state_is_dont(opt)		(!my_state_is_do(opt))
17429088Smarkm#define	my_state_is_wont(opt)		(!my_state_is_will(opt))
17529088Smarkm#define my_want_state_is_dont(opt)	(!my_want_state_is_do(opt))
17629088Smarkm#define my_want_state_is_wont(opt)	(!my_want_state_is_will(opt))
17729088Smarkm
17829088Smarkm#define	set_my_state_do(opt)		{options[opt] |= MY_STATE_DO;}
17929088Smarkm#define	set_my_state_will(opt)		{options[opt] |= MY_STATE_WILL;}
18029088Smarkm#define	set_my_want_state_do(opt)	{options[opt] |= MY_WANT_STATE_DO;}
18129088Smarkm#define	set_my_want_state_will(opt)	{options[opt] |= MY_WANT_STATE_WILL;}
18229088Smarkm
18329088Smarkm#define	set_my_state_dont(opt)		{options[opt] &= ~MY_STATE_DO;}
18429088Smarkm#define	set_my_state_wont(opt)		{options[opt] &= ~MY_STATE_WILL;}
18529088Smarkm#define	set_my_want_state_dont(opt)	{options[opt] &= ~MY_WANT_STATE_DO;}
18629088Smarkm#define	set_my_want_state_wont(opt)	{options[opt] &= ~MY_WANT_STATE_WILL;}
18729088Smarkm
18829088Smarkm/*
18929088Smarkm * Make everything symetrical
19029088Smarkm */
19129088Smarkm
19229088Smarkm#define	HIS_STATE_WILL			MY_STATE_DO
19329088Smarkm#define	HIS_WANT_STATE_WILL		MY_WANT_STATE_DO
19429088Smarkm#define HIS_STATE_DO			MY_STATE_WILL
19529088Smarkm#define HIS_WANT_STATE_DO		MY_WANT_STATE_WILL
19629088Smarkm
19729088Smarkm#define	his_state_is_do			my_state_is_will
19829088Smarkm#define	his_state_is_will		my_state_is_do
19929088Smarkm#define his_want_state_is_do		my_want_state_is_will
20029088Smarkm#define his_want_state_is_will		my_want_state_is_do
20129088Smarkm
20229088Smarkm#define	his_state_is_dont		my_state_is_wont
20329088Smarkm#define	his_state_is_wont		my_state_is_dont
20429088Smarkm#define his_want_state_is_dont		my_want_state_is_wont
20529088Smarkm#define his_want_state_is_wont		my_want_state_is_dont
20629088Smarkm
20729088Smarkm#define	set_his_state_do		set_my_state_will
20829088Smarkm#define	set_his_state_will		set_my_state_do
20929088Smarkm#define	set_his_want_state_do		set_my_want_state_will
21029088Smarkm#define	set_his_want_state_will		set_my_want_state_do
21129088Smarkm
21229088Smarkm#define	set_his_state_dont		set_my_state_wont
21329088Smarkm#define	set_his_state_wont		set_my_state_dont
21429088Smarkm#define	set_his_want_state_dont		set_my_want_state_wont
21529088Smarkm#define	set_his_want_state_wont		set_my_want_state_dont
21629088Smarkm
21787139Smarkm#if	defined(USE_TERMIO)
21887139Smarkm#define	SIG_FUNC_RET	void
21987139Smarkm#else
22087139Smarkm#define	SIG_FUNC_RET	int
22187139Smarkm#endif
22229088Smarkm
22387139Smarkm#ifdef	SIGINFO
22487139Smarkmextern SIG_FUNC_RET
22587155Smarkm    ayt_status(void);
22687139Smarkm#endif
22787139Smarkm
22829088Smarkmextern FILE
22929088Smarkm    *NetTrace;		/* Where debugging output goes */
23029088Smarkmextern unsigned char
23129088Smarkm    NetTraceFile[];	/* Name of file where debugging output goes */
23229088Smarkmextern void
23387155Smarkm    SetNetTrace(char *);	/* Function to change where debugging goes */
234275508Sngieextern unsigned char
235275508Sngie    ComPortBaudRate[];	/* Baud rate of the remote end */
236275508Sngieextern void
237275508Sngie    DoBaudRate(char *);	/* Function to set the baud rate of the remote end */
23829088Smarkm
23929088Smarkmextern jmp_buf
24029088Smarkm    toplevel;		/* For error conditions. */
24129088Smarkm
24229088Smarkmextern void
24387155Smarkm    command(int, const char *, int),
24487155Smarkm    Dump(char, unsigned char *, int),
24587155Smarkm    env_init(void),
24687155Smarkm    Exit(int),
24787155Smarkm    ExitString(const char *, int),
24887155Smarkm    init_network(void),
24987155Smarkm    init_sys(void),
25087155Smarkm    init_telnet(void),
25187155Smarkm    init_terminal(void),
25287155Smarkm    intp(void),
25387155Smarkm    optionstatus(void),
25487155Smarkm    printoption(const char *, int, int),
25587155Smarkm    printsub(char, unsigned char *, int),
25687155Smarkm    quit(void),
25787155Smarkm    sendabort(void),
25887155Smarkm    sendbrk(void),
25987155Smarkm    sendeof(void),
26087155Smarkm    sendsusp(void),
26187155Smarkm    sendnaws(void),
26287155Smarkm    sendayt(void),
26387155Smarkm    setconnmode(int),
26487155Smarkm    setcommandmode(void),
26587155Smarkm    set_escape_char(char *s),
26687155Smarkm    setneturg(void),
26787155Smarkm    sys_telnet_init(void),
26887155Smarkm    telnet(char *),
26987155Smarkm    tel_enter_binary(int),
27087155Smarkm    tel_leave_binary(int),
27187155Smarkm    TerminalFlushOutput(void),
27287155Smarkm    TerminalNewMode(int),
27387155Smarkm    TerminalRestoreState(void),
27487155Smarkm    TerminalSaveState(void),
27587155Smarkm    TerminalDefaultChars(void),
27687155Smarkm    TerminalSpeeds(long *, long *),
27787155Smarkm    tninit(void),
27887155Smarkm    upcase(char *),
27987155Smarkm    willoption(int),
28087155Smarkm    wontoption(int);
28129088Smarkm
28229088Smarkmextern void
28387155Smarkm    send_do(int, int),
28487155Smarkm    send_dont(int, int),
28587155Smarkm    send_will(int, int),
28687155Smarkm    send_wont(int, int);
28729088Smarkm
28829088Smarkmextern void
28987155Smarkm    lm_will(unsigned char *, int),
29087155Smarkm    lm_wont(unsigned char *, int),
29187155Smarkm    lm_do(unsigned char *, int),
29287155Smarkm    lm_dont(unsigned char *, int),
29387155Smarkm    lm_mode(unsigned char *, int, int);
29429088Smarkm
29529088Smarkmextern void
29687155Smarkm    slc_init(void),
29787155Smarkm    slcstate(void),
29887155Smarkm    slc_mode_export(void),
29987155Smarkm    slc_mode_import(int),
30087155Smarkm    slc_import(int),
30187155Smarkm    slc_export(void),
30287155Smarkm    slc(unsigned char *, int),
30387155Smarkm    slc_check(void),
30487155Smarkm    slc_start_reply(void),
30587155Smarkm    slc_add_reply(unsigned char, unsigned char, cc_t),
30687155Smarkm    slc_end_reply(void);
30729088Smarkmextern int
30887155Smarkm    getconnmode(void),
30987155Smarkm    opt_welldefined(const char *),
31087155Smarkm    NetClose(int),
31187155Smarkm    netflush(void),
31287155Smarkm    process_rings(int, int, int, int, int, int),
31387155Smarkm    rlogin_susp(void),
31487155Smarkm    SetSockOpt(int, int, int, int),
31587155Smarkm    slc_update(void),
31687155Smarkm    stilloob(void),
31787155Smarkm    telrcv(void),
31887155Smarkm    TerminalRead(char *, int),
31987155Smarkm    TerminalWrite(char *, int),
32087155Smarkm    TerminalAutoFlush(void),
32187155Smarkm    TerminalWindowSize(long *, long *),
32287155Smarkm    TerminalSpecialChars(int),
32387155Smarkm    tn(int, char **),
32487155Smarkm    ttyflush(int);
32529088Smarkm
32629088Smarkmextern void
32787155Smarkm    env_opt(unsigned char *, int),
32887155Smarkm    env_opt_start(void),
32987155Smarkm    env_opt_start_info(void),
33087155Smarkm    env_opt_add(unsigned char *),
33187155Smarkm    env_opt_end(int);
33229088Smarkm
33329088Smarkmextern unsigned char
33487155Smarkm    *env_default(int, int),
33587155Smarkm    *env_getvalue(const unsigned char *);
33629088Smarkm
33729088Smarkmextern int
33887155Smarkm    get_status(char *),
33987155Smarkm    dosynch(char *);
34029088Smarkm
34129088Smarkmextern cc_t
34287155Smarkm    *tcval(int);
34329088Smarkm
34429088Smarkm#ifndef	USE_TERMIO
34529088Smarkm
34629088Smarkmextern struct	tchars ntc;
34729088Smarkmextern struct	ltchars nltc;
34829088Smarkmextern struct	sgttyb nttyb;
34929088Smarkm
35029088Smarkm# define termEofChar		ntc.t_eofc
35129088Smarkm# define termEraseChar		nttyb.sg_erase
35229088Smarkm# define termFlushChar		nltc.t_flushc
35329088Smarkm# define termIntChar		ntc.t_intrc
35429088Smarkm# define termKillChar		nttyb.sg_kill
35529088Smarkm# define termLiteralNextChar	nltc.t_lnextc
35629088Smarkm# define termQuitChar		ntc.t_quitc
35729088Smarkm# define termSuspChar		nltc.t_suspc
35829088Smarkm# define termRprntChar		nltc.t_rprntc
35929088Smarkm# define termWerasChar		nltc.t_werasc
36029088Smarkm# define termStartChar		ntc.t_startc
36129088Smarkm# define termStopChar		ntc.t_stopc
36229088Smarkm# define termForw1Char		ntc.t_brkc
36329088Smarkmextern cc_t termForw2Char;
36429088Smarkmextern cc_t termAytChar;
36529088Smarkm
36629088Smarkm# define termEofCharp		(cc_t *)&ntc.t_eofc
36729088Smarkm# define termEraseCharp		(cc_t *)&nttyb.sg_erase
36829088Smarkm# define termFlushCharp		(cc_t *)&nltc.t_flushc
36929088Smarkm# define termIntCharp		(cc_t *)&ntc.t_intrc
37029088Smarkm# define termKillCharp		(cc_t *)&nttyb.sg_kill
37129088Smarkm# define termLiteralNextCharp	(cc_t *)&nltc.t_lnextc
37229088Smarkm# define termQuitCharp		(cc_t *)&ntc.t_quitc
37329088Smarkm# define termSuspCharp		(cc_t *)&nltc.t_suspc
37429088Smarkm# define termRprntCharp		(cc_t *)&nltc.t_rprntc
37529088Smarkm# define termWerasCharp		(cc_t *)&nltc.t_werasc
37629088Smarkm# define termStartCharp		(cc_t *)&ntc.t_startc
37729088Smarkm# define termStopCharp		(cc_t *)&ntc.t_stopc
37829088Smarkm# define termForw1Charp		(cc_t *)&ntc.t_brkc
37929088Smarkm# define termForw2Charp		(cc_t *)&termForw2Char
38029088Smarkm# define termAytCharp		(cc_t *)&termAytChar
38129088Smarkm
38229088Smarkm# else
38329088Smarkm
38429088Smarkmextern struct	termio new_tc;
38529088Smarkm
38629088Smarkm# define termEofChar		new_tc.c_cc[VEOF]
38729088Smarkm# define termEraseChar		new_tc.c_cc[VERASE]
38829088Smarkm# define termIntChar		new_tc.c_cc[VINTR]
38929088Smarkm# define termKillChar		new_tc.c_cc[VKILL]
39029088Smarkm# define termQuitChar		new_tc.c_cc[VQUIT]
39129088Smarkm
39229088Smarkm# ifndef	VSUSP
39329088Smarkmextern cc_t termSuspChar;
39429088Smarkm# else
39529088Smarkm#  define termSuspChar		new_tc.c_cc[VSUSP]
39629088Smarkm# endif
39729088Smarkm# if	defined(VFLUSHO) && !defined(VDISCARD)
39829088Smarkm#  define VDISCARD VFLUSHO
39929088Smarkm# endif
40029088Smarkm# ifndef	VDISCARD
40129088Smarkmextern cc_t termFlushChar;
40229088Smarkm# else
40329088Smarkm#  define termFlushChar		new_tc.c_cc[VDISCARD]
40429088Smarkm# endif
40529088Smarkm# ifndef VWERASE
40629088Smarkmextern cc_t termWerasChar;
40729088Smarkm# else
40829088Smarkm#  define termWerasChar		new_tc.c_cc[VWERASE]
40929088Smarkm# endif
41029088Smarkm# ifndef	VREPRINT
41129088Smarkmextern cc_t termRprntChar;
41229088Smarkm# else
41329088Smarkm#  define termRprntChar		new_tc.c_cc[VREPRINT]
41429088Smarkm# endif
41529088Smarkm# ifndef	VLNEXT
41629088Smarkmextern cc_t termLiteralNextChar;
41729088Smarkm# else
41829088Smarkm#  define termLiteralNextChar	new_tc.c_cc[VLNEXT]
41929088Smarkm# endif
42029088Smarkm# ifndef	VSTART
42129088Smarkmextern cc_t termStartChar;
42229088Smarkm# else
42329088Smarkm#  define termStartChar		new_tc.c_cc[VSTART]
42429088Smarkm# endif
42529088Smarkm# ifndef	VSTOP
42629088Smarkmextern cc_t termStopChar;
42729088Smarkm# else
42829088Smarkm#  define termStopChar		new_tc.c_cc[VSTOP]
42929088Smarkm# endif
43029088Smarkm# ifndef	VEOL
43129088Smarkmextern cc_t termForw1Char;
43229088Smarkm# else
43329088Smarkm#  define termForw1Char		new_tc.c_cc[VEOL]
43429088Smarkm# endif
43529088Smarkm# ifndef	VEOL2
43629088Smarkmextern cc_t termForw2Char;
43729088Smarkm# else
43829088Smarkm#  define termForw2Char		new_tc.c_cc[VEOL]
43929088Smarkm# endif
44029088Smarkm# ifndef	VSTATUS
44129088Smarkmextern cc_t termAytChar;
44229088Smarkm#else
44329088Smarkm#  define termAytChar		new_tc.c_cc[VSTATUS]
44429088Smarkm#endif
44529088Smarkm
44682497Smarkm# if defined(__STDC__)
44729088Smarkm#  define termEofCharp		&termEofChar
44829088Smarkm#  define termEraseCharp	&termEraseChar
44929088Smarkm#  define termIntCharp		&termIntChar
45029088Smarkm#  define termKillCharp		&termKillChar
45129088Smarkm#  define termQuitCharp		&termQuitChar
45229088Smarkm#  define termSuspCharp		&termSuspChar
45329088Smarkm#  define termFlushCharp	&termFlushChar
45429088Smarkm#  define termWerasCharp	&termWerasChar
45529088Smarkm#  define termRprntCharp	&termRprntChar
45629088Smarkm#  define termLiteralNextCharp	&termLiteralNextChar
45729088Smarkm#  define termStartCharp	&termStartChar
45829088Smarkm#  define termStopCharp		&termStopChar
45929088Smarkm#  define termForw1Charp	&termForw1Char
46029088Smarkm#  define termForw2Charp	&termForw2Char
46129088Smarkm#  define termAytCharp		&termAytChar
46229088Smarkm# else
46329088Smarkm	/* Work around a compiler bug */
46429088Smarkm#  define termEofCharp		0
46529088Smarkm#  define termEraseCharp	0
46629088Smarkm#  define termIntCharp		0
46729088Smarkm#  define termKillCharp		0
46829088Smarkm#  define termQuitCharp		0
46929088Smarkm#  define termSuspCharp		0
47029088Smarkm#  define termFlushCharp	0
47129088Smarkm#  define termWerasCharp	0
47229088Smarkm#  define termRprntCharp	0
47329088Smarkm#  define termLiteralNextCharp	0
47429088Smarkm#  define termStartCharp	0
47529088Smarkm#  define termStopCharp		0
47629088Smarkm#  define termForw1Charp	0
47729088Smarkm#  define termForw2Charp	0
47829088Smarkm#  define termAytCharp		0
47929088Smarkm# endif
48029088Smarkm#endif
48129088Smarkm
482275508Sngietypedef struct {
483275508Sngie    int
484275508Sngie	system,			/* what the current time is */
485275508Sngie	echotoggle,		/* last time user entered echo character */
486275508Sngie	modenegotiated,		/* last time operating mode negotiated */
487275508Sngie	didnetreceive,		/* last time we read data from network */
488275508Sngie	gotDM;			/* when did we last see a data mark */
489275508Sngie} Clocks;
49029088Smarkm
491275508Sngieextern Clocks clocks;
492275508Sngie
49329088Smarkm/* Ring buffer structures which are shared */
49429088Smarkm
49529088Smarkmextern Ring
49629088Smarkm    netoring,
49729088Smarkm    netiring,
49829088Smarkm    ttyoring,
49929088Smarkm    ttyiring;
50029088Smarkm
50129088Smarkmextern void
50287155Smarkm    xmitAO(void),
50387155Smarkm    xmitEC(void),
50487155Smarkm    xmitEL(void);
505