xref: /illumos-gate/usr/src/lib/libnsl/dial/uucp.h (revision ace1a5f1)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
23*61961e0fSrobinson /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
24*61961e0fSrobinson /*	  All Rights Reserved	*/
267c478bd9Sstevel@tonic-gate /*
27*61961e0fSrobinson  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
287c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
297c478bd9Sstevel@tonic-gate  */
317c478bd9Sstevel@tonic-gate #ifndef _UUCP_H
32*61961e0fSrobinson #define	_UUCP_H
34*61961e0fSrobinson #pragma ident	"%Z%%M%	%I%	%E% SMI"
367c478bd9Sstevel@tonic-gate #include <sys/types.h>
377c478bd9Sstevel@tonic-gate #include <unistd.h>
387c478bd9Sstevel@tonic-gate #include <stdlib.h>
397c478bd9Sstevel@tonic-gate #include <string.h>
40*61961e0fSrobinson #include <parms.h>
427c478bd9Sstevel@tonic-gate #include <stdio.h>
437c478bd9Sstevel@tonic-gate #include <ctype.h>
447c478bd9Sstevel@tonic-gate #include <setjmp.h>
457c478bd9Sstevel@tonic-gate #include <sys/param.h>
467c478bd9Sstevel@tonic-gate #include <termio.h>
477c478bd9Sstevel@tonic-gate #include <signal.h>
487c478bd9Sstevel@tonic-gate #include <fcntl.h>
497c478bd9Sstevel@tonic-gate #include <sys/stat.h>
507c478bd9Sstevel@tonic-gate #include <utime.h>
517c478bd9Sstevel@tonic-gate #include <dirent.h>
527c478bd9Sstevel@tonic-gate #include <time.h>
537c478bd9Sstevel@tonic-gate #include <sys/times.h>
547c478bd9Sstevel@tonic-gate #include <errno.h>
557c478bd9Sstevel@tonic-gate #include <sys/mkdev.h>
56*61961e0fSrobinson #include <strings.h>
57*61961e0fSrobinson #include <ulimit.h>
58*61961e0fSrobinson #include <sys/utsname.h>
59*61961e0fSrobinson #include <ustat.h>
61*61961e0fSrobinson #ifdef	__cplusplus
62*61961e0fSrobinson extern "C" {
63*61961e0fSrobinson #endif
657c478bd9Sstevel@tonic-gate /* what mode should user files be allowed to have upon creation? */
667c478bd9Sstevel@tonic-gate /* NOTE: This does not allow setuid or execute bits on transfer. */
67*61961e0fSrobinson #define	LEGALMODE (mode_t)0666
697c478bd9Sstevel@tonic-gate /* what mode should public files have upon creation? */
70*61961e0fSrobinson #define	PUB_FILEMODE (mode_t)0666
727c478bd9Sstevel@tonic-gate /* what mode should log files have upon creation? */
73*61961e0fSrobinson #define	LOGFILEMODE (mode_t)0644
757c478bd9Sstevel@tonic-gate /* what mode should C. files have upon creation? */
76*61961e0fSrobinson #define	CFILEMODE (mode_t)0644
787c478bd9Sstevel@tonic-gate /* what mode should D. files have upon creation? */
79*61961e0fSrobinson #define	DFILEMODE (mode_t)0600
817c478bd9Sstevel@tonic-gate /* define the value of PUBMASK, used for creating "public" directories */
82*61961e0fSrobinson #define	PUBMASK (mode_t)0000
847c478bd9Sstevel@tonic-gate /* what mode should public directories have upon creation? */
85*61961e0fSrobinson #define	PUB_DIRMODE (mode_t)0777
877c478bd9Sstevel@tonic-gate /* define the value of DIRMASK, used for creating "system" subdirectories */
88*61961e0fSrobinson #define	DIRMASK (mode_t)0022
90*61961e0fSrobinson #define	MAXSTART	300	/* how long to wait on startup */
927c478bd9Sstevel@tonic-gate /* define the last characters for ACU  (used for 801/212 dialers) */
93*61961e0fSrobinson #define	ACULAST "<"
95*61961e0fSrobinson /*
96*61961e0fSrobinson  * caution - the fillowing names are also in Makefile
97*61961e0fSrobinson  * any changes here have to also be made there
987c478bd9Sstevel@tonic-gate  *
997c478bd9Sstevel@tonic-gate  * it's a good idea to make directories .foo, since this ensures
1007c478bd9Sstevel@tonic-gate  * that they'll be ignored by processes that search subdirectories in SPOOL
1017c478bd9Sstevel@tonic-gate  *
102*61961e0fSrobinson  *	XQTDIR = /var/uucp/.Xqtdir
103*61961e0fSrobinson  *	CORRUPT = /var/uucp/.Corrupt
104*61961e0fSrobinson  *	LOGDIR = /var/uucp/.Log
105*61961e0fSrobinson  *	SEQDIR = /var/uucp/.Sequence
106*61961e0fSrobinson  *	STATDIR = /var/uucp/.Status
1077c478bd9Sstevel@tonic-gate  */
1097c478bd9Sstevel@tonic-gate /* where to put the STST. files? */
110*61961e0fSrobinson #define	STATDIR		(const char *)"/var/uucp/.Status"
1127c478bd9Sstevel@tonic-gate /* where should logfiles be kept? */
113*61961e0fSrobinson #define	LOGUUX		(const char *)"/var/uucp/.Log/uux"
114*61961e0fSrobinson #define	LOGUUXQT	(const char *)"/var/uucp/.Log/uuxqt"
115*61961e0fSrobinson #define	LOGUUCP		(const char *)"/var/uucp/.Log/uucp"
116*61961e0fSrobinson #define	LOGCICO		(const char *)"/var/uucp/.Log/uucico"
117*61961e0fSrobinson #define	CORRUPTDIR	(const char *)"/var/uucp/.Corrupt"
1197c478bd9Sstevel@tonic-gate /* some sites use /var/uucp/.XQTDIR here */
1207c478bd9Sstevel@tonic-gate /* use caution since things are linked into there */
121*61961e0fSrobinson #define	XQTDIR		(const char *)"/var/uucp/.Xqtdir"
1237c478bd9Sstevel@tonic-gate /* how much of a system name can we print in a [CX]. file? */
1247c478bd9Sstevel@tonic-gate /* MAXBASENAME - 1 (pre) - 1 ('.') - 1 (grade) - 4 (sequence number) */
125*61961e0fSrobinson #define	SYSNSIZE (MAXBASENAME - 7)
1277c478bd9Sstevel@tonic-gate #ifdef USRSPOOLLOCKS
128*61961e0fSrobinson #define	LOCKPRE		(const char *)"/var/spool/locks/LCK."
1297c478bd9Sstevel@tonic-gate #else
130*61961e0fSrobinson #define	LOCKPRE		(const char *)"/var/spool/uucp/LCK."
1317c478bd9Sstevel@tonic-gate #endif /* USRSPOOLLOCKS */
133*61961e0fSrobinson #define	SQFILE		(const char *)"/etc/uucp/SQFILE"
134*61961e0fSrobinson #define	SQTMP		(const char *)"/etc/uucp/SQTMP"
135*61961e0fSrobinson #define	SLCKTIME	5400	/* system/device timeout (LCK.. files) */
136*61961e0fSrobinson #define	DIALCODES	(const char *)"/etc/uucp/Dialcodes"
137*61961e0fSrobinson #define	PERMISSIONS	(const char *)"/etc/uucp/Permissions"
139*61961e0fSrobinson #define	SPOOL		(const char *)"/var/spool/uucp"
140*61961e0fSrobinson #define	SEQDIR		(const char *)"/var/uucp/.Sequence"
142*61961e0fSrobinson #define	X_LOCKTIME	3600
1437c478bd9Sstevel@tonic-gate #ifdef USRSPOOLLOCKS
144*61961e0fSrobinson #define	SEQLOCK		(const char *)"/var/spool/locks/LCK.SQ."
145*61961e0fSrobinson #define	SQLOCK		(const char *)"/var/spool/locks/LCK.SQ"
146*61961e0fSrobinson #define	X_LOCK		(const char *)"/var/spool/locks/LCK.X"
147*61961e0fSrobinson #define	S_LOCK		(const char *)"/var/spool/locks/LCK.S"
148*61961e0fSrobinson #define	L_LOCK		(const char *)"/var/spool/locks/LK"
149*61961e0fSrobinson #define	X_LOCKDIR	(const char *)"/var/spool/locks"
150*61961e0fSrobinson 						/* must be dir part of above */
1517c478bd9Sstevel@tonic-gate #else
152*61961e0fSrobinson #define	SEQLOCK		(const char *)"/var/spool/uucp/LCK.SQ."
153*61961e0fSrobinson #define	SQLOCK		(const char *)"/var/spool/uucp/LCK.SQ"
154*61961e0fSrobinson #define	X_LOCK		(const char *)"/var/spool/uucp/LCK.X"
155*61961e0fSrobinson #define	S_LOCK		(const char *)"/var/spool/uucp/LCK.S"
156*61961e0fSrobinson #define	L_LOCK		(const char *)"/var/spool/uucp/LK"
157*61961e0fSrobinson #define	X_LOCKDIR	(const char *)"/var/spool/uucp"
158*61961e0fSrobinson 						/* must be dir part of above */
1597c478bd9Sstevel@tonic-gate #endif /* USRSPOOLLOCKS */
160*61961e0fSrobinson #define	X_LOCKPRE	(const char *)"LCK.X"	/* must be last part of above */
162*61961e0fSrobinson #define	PUBDIR		(const char *)"/var/spool/uucppublic"
163*61961e0fSrobinson #define	ADMIN		(const char *)"/var/uucp/.Admin"
164*61961e0fSrobinson #define	ERRLOG		(const char *)"/var/uucp/.Admin/errors"
165*61961e0fSrobinson #define	SYSLOG		(const char *)"/var/uucp/.Admin/xferstats"
166*61961e0fSrobinson #define	RMTDEBUG	(const char *)"/var/uucp/.Admin/audit"
167*61961e0fSrobinson #define	CLEANUPLOGFILE	(const char *)"/var/uucp/.Admin/uucleanup"
168*61961e0fSrobinson #define	CMDLOG		(const char *)"/var/uucp/.Admin/command"
169*61961e0fSrobinson #define	PERFLOG		(const char *)"/var/uucp/.Admin/perflog"
170*61961e0fSrobinson #define	ACCOUNT		(const char *)"/var/uucp/.Admin/account"
171*61961e0fSrobinson #define	SECURITY	(const char *)"/var/uucp/.Admin/security"
1737c478bd9Sstevel@tonic-gate #define	WORKSPACE	(const char *)"/var/uucp/.Workspace"
175*61961e0fSrobinson #define	SQTIME		60
176*61961e0fSrobinson #define	TRYCALLS	2	/* number of tries to dial call */
177*61961e0fSrobinson #define	MINULIMIT	(1L<<11)	/* minimum reasonable ulimit */
1787c478bd9Sstevel@tonic-gate #define	MAX_LOCKTRY	5	/* number of attempts to lock device */
1807c478bd9Sstevel@tonic-gate /*
181*61961e0fSrobinson  * CDEBUG is for communication line debugging
182*61961e0fSrobinson  * DEBUG is for program debugging
1837c478bd9Sstevel@tonic-gate  * #define SMALL to compile without the DEBUG code
1847c478bd9Sstevel@tonic-gate  */
186*61961e0fSrobinson #define	CDEBUG(l, f, s)
187*61961e0fSrobinson #define	SMALL
1897c478bd9Sstevel@tonic-gate #ifndef SMALL
190*61961e0fSrobinson #define	DEBUG(l, f, s) if (Debug >= l) fprintf(stderr, f, s)
1917c478bd9Sstevel@tonic-gate #else
192*61961e0fSrobinson #define	DEBUG(l, f, s)
1937c478bd9Sstevel@tonic-gate #endif /* SMALL */
1957c478bd9Sstevel@tonic-gate /*
1967c478bd9Sstevel@tonic-gate  * VERBOSE is used by cu and ct to inform the user of progress
1977c478bd9Sstevel@tonic-gate  * In other programs, the Value of Verbose is always 0.
1987c478bd9Sstevel@tonic-gate  */
199*61961e0fSrobinson #define	VERBOSE(f, s) { if (Verbose > 0) (void) fprintf(stderr, f, s); }
201*61961e0fSrobinson #define	PREFIX(pre, str)	(strncmp((pre), (str), strlen(pre)) == SAME)
202*61961e0fSrobinson #define	BASENAME(str, c) ((Bnptr = strrchr((str), c)) ? (Bnptr + 1) : (str))
203*61961e0fSrobinson #define	EQUALS(a, b)		((a != CNULL) && (b != CNULL) && \
204*61961e0fSrobinson 					(strcmp((a), (b)) == SAME))
205*61961e0fSrobinson #define	EQUALSN(a, b, n)	((a != CNULL) && (b != CNULL) && \
206*61961e0fSrobinson 					(strncmp((a), (b), (n)) == SAME))
207*61961e0fSrobinson #define	LASTCHAR(s)	(s+strlen(s)-1)
209*61961e0fSrobinson #define	SAME 0
210*61961e0fSrobinson #define	ANYREAD 04
211*61961e0fSrobinson #define	ANYWRITE 02
212*61961e0fSrobinson #define	FAIL -1
213*61961e0fSrobinson #define	SUCCESS 0
214*61961e0fSrobinson #define	NULLCHAR	'\0'
215*61961e0fSrobinson #define	CNULL (char *)0
216*61961e0fSrobinson #define	STBNULL (struct sgttyb *)0
217*61961e0fSrobinson #define	MASTER 1
218*61961e0fSrobinson #define	SLAVE 0
219*61961e0fSrobinson #define	MAXBASENAME 14 /* should be DIRSIZ but that is now fs dependent */
220*61961e0fSrobinson #define	MAXFULLNAME BUFSIZ
221*61961e0fSrobinson #define	MAXNAMESIZE	64	/* /var/spool/uucp/<14 chars>/<14 chars>+slop */
222*61961e0fSrobinson #define	CONNECTTIME 30
223*61961e0fSrobinson #define	EXPECTTIME 45
224*61961e0fSrobinson #define	MSGTIME 60
225*61961e0fSrobinson #define	NAMESIZE MAXBASENAME+1
2267c478bd9Sstevel@tonic-gate #define	SIZEOFPID	10		/* maximum number of digits in a pid */
227*61961e0fSrobinson #define	EOTMSG "\004\n\004\n"
228*61961e0fSrobinson #define	CALLBACK 1
2307c478bd9Sstevel@tonic-gate /* manifests for sysfiles.c's sysaccess()	*/
2317c478bd9Sstevel@tonic-gate /* check file access for REAL user id */
2327c478bd9Sstevel@tonic-gate #define	ACCESS_SYSTEMS	1
2337c478bd9Sstevel@tonic-gate #define	ACCESS_DEVICES	2
2347c478bd9Sstevel@tonic-gate #define	ACCESS_DIALERS	3
2357c478bd9Sstevel@tonic-gate /* check file access for EFFECTIVE user id */
2367c478bd9Sstevel@tonic-gate #define	EACCESS_SYSTEMS	4
2377c478bd9Sstevel@tonic-gate #define	EACCESS_DEVICES	5
2387c478bd9Sstevel@tonic-gate #define	EACCESS_DIALERS	6
2407c478bd9Sstevel@tonic-gate /* manifest for chkpth flag */
241*61961e0fSrobinson #define	CK_READ		0
242*61961e0fSrobinson #define	CK_WRITE	1
2447c478bd9Sstevel@tonic-gate /*
2457c478bd9Sstevel@tonic-gate  * commands
2467c478bd9Sstevel@tonic-gate  */
247*61961e0fSrobinson #define	SHELL		(const char *)"/usr/bin/sh"
248*61961e0fSrobinson #define	MAIL		(const char *)"mail"
249*61961e0fSrobinson #define	UUCICO		(const char *)"/usr/lib/uucp/uucico"
250*61961e0fSrobinson #define	UUXQT		(const char *)"/usr/lib/uucp/uuxqt"
251*61961e0fSrobinson #define	UUX		(const char *)"/usr/bin/uux"
252*61961e0fSrobinson #define	UUCP		(const char *)"/usr/bin/uucp"
2557c478bd9Sstevel@tonic-gate /* system status stuff */
256*61961e0fSrobinson #define	SS_OK			0
257*61961e0fSrobinson #define	SS_NO_DEVICE		1
258*61961e0fSrobinson #define	SS_TIME_WRONG		2
259*61961e0fSrobinson #define	SS_INPROGRESS		3
260*61961e0fSrobinson #define	SS_CONVERSATION		4
261*61961e0fSrobinson #define	SS_SEQBAD		5
262*61961e0fSrobinson #define	SS_LOGIN_FAILED		6
263*61961e0fSrobinson #define	SS_DIAL_FAILED		7
264*61961e0fSrobinson #define	SS_BAD_LOG_MCH		8
265*61961e0fSrobinson #define	SS_LOCKED_DEVICE	9
266*61961e0fSrobinson #define	SS_ASSERT_ERROR		10
267*61961e0fSrobinson #define	SS_BADSYSTEM		11
268*61961e0fSrobinson #define	SS_CANT_ACCESS_DEVICE	12
269*61961e0fSrobinson #define	SS_DEVICE_FAILED	13	/* used for interface failure */
270*61961e0fSrobinson #define	SS_WRONG_MCH		14
271*61961e0fSrobinson #define	SS_CALLBACK		15
272*61961e0fSrobinson #define	SS_RLOCKED		16
273*61961e0fSrobinson #define	SS_RUNKNOWN		17
274*61961e0fSrobinson #define	SS_RLOGIN		18
275*61961e0fSrobinson #define	SS_UNKNOWN_RESPONSE	19
276*61961e0fSrobinson #define	SS_STARTUP		20
277*61961e0fSrobinson #define	SS_CHAT_FAILED		21
278*61961e0fSrobinson #define	SS_CALLBACK_LOOP	22
280*61961e0fSrobinson #define	MAXPH	60	/* maximum phone string size */
2817c478bd9Sstevel@tonic-gate #define	MAXC	BUFSIZ
2837c478bd9Sstevel@tonic-gate #define	TRUE	1
2847c478bd9Sstevel@tonic-gate #define	FALSE	0
285*61961e0fSrobinson #define	NAMEBUF	32
2877c478bd9Sstevel@tonic-gate /* The call structure is used by ct.c, cu.c, and dial.c.	*/
2897c478bd9Sstevel@tonic-gate struct call {
2907c478bd9Sstevel@tonic-gate 	char *speed;		/* transmission baud rate */
2917c478bd9Sstevel@tonic-gate 	char *line;		/* device name for outgoing line */
2927c478bd9Sstevel@tonic-gate 	char *telno;		/* ptr to tel-no digit string */
2937c478bd9Sstevel@tonic-gate 	char *type;		/* type of device to use for call. */
2947c478bd9Sstevel@tonic-gate };
2967c478bd9Sstevel@tonic-gate /* structure of an Systems file line */
297*61961e0fSrobinson #define	F_MAX	50	/* max number of fields in Systems file line */
298*61961e0fSrobinson #define	F_NAME 0
299*61961e0fSrobinson #define	F_TIME 1
300*61961e0fSrobinson #define	F_TYPE 2
301*61961e0fSrobinson #define	F_CLASS 3	/* an optional prefix and the speed */
302*61961e0fSrobinson #define	F_PHONE 4
303*61961e0fSrobinson #define	F_LOGIN 5
3057c478bd9Sstevel@tonic-gate /* structure of an Devices file line */
306*61961e0fSrobinson #define	D_TYPE 0
307*61961e0fSrobinson #define	D_LINE 1
308*61961e0fSrobinson #define	D_CALLDEV 2
309*61961e0fSrobinson #define	D_CLASS 3
310*61961e0fSrobinson #define	D_CALLER 4
311*61961e0fSrobinson #define	D_ARG 5
312*61961e0fSrobinson #define	D_MAX	50	/* max number of fields in Devices file line */
314*61961e0fSrobinson #define	D_ACU 1
315*61961e0fSrobinson #define	D_DIRECT 2
316*61961e0fSrobinson #define	D_PROT 4
318*61961e0fSrobinson #define	GRADES "/etc/uucp/Grades"
3207c478bd9Sstevel@tonic-gate #define	D_QUEUE	'Z'	/* default queue */
3227c478bd9Sstevel@tonic-gate /* past here, local changes are not recommended */
323*61961e0fSrobinson #define	CMDPRE		'C'
324*61961e0fSrobinson #define	DATAPRE		'D'
325*61961e0fSrobinson #define	XQTPRE		'X'
3277c478bd9Sstevel@tonic-gate /*
3287c478bd9Sstevel@tonic-gate  * stuff for command execution
3297c478bd9Sstevel@tonic-gate  */
330*61961e0fSrobinson #define	X_RQDFILE	'F'
331*61961e0fSrobinson #define	X_STDIN		'I'
332*61961e0fSrobinson #define	X_STDOUT	'O'
333*61961e0fSrobinson #define	X_STDERR	'E'
334*61961e0fSrobinson #define	X_CMD		'C'
335*61961e0fSrobinson #define	X_USER		'U'
336*61961e0fSrobinson #define	X_BRINGBACK	'B'
337*61961e0fSrobinson #define	X_MAILF		'M'
338*61961e0fSrobinson #define	X_RETADDR	'R'
339*61961e0fSrobinson #define	X_COMMENT	'#'
340*61961e0fSrobinson #define	X_NONZERO	'Z'
341*61961e0fSrobinson #define	X_SENDNOTHING	'N'
342*61961e0fSrobinson #define	X_SENDZERO	'n'
3457c478bd9Sstevel@tonic-gate /* This structure describes call routines */
3467c478bd9Sstevel@tonic-gate struct caller {
3477c478bd9Sstevel@tonic-gate 	const char	*CA_type;
3487c478bd9Sstevel@tonic-gate 	int		(*CA_caller)();
3497c478bd9Sstevel@tonic-gate };
3517c478bd9Sstevel@tonic-gate /* structure for a saved C file */
3537c478bd9Sstevel@tonic-gate struct cs_struct {
3547c478bd9Sstevel@tonic-gate 	char	file[NAMESIZE];
3557c478bd9Sstevel@tonic-gate 	char	sys[NAMESIZE+5];
3567c478bd9Sstevel@tonic-gate 	char	sgrade[NAMESIZE];
3577c478bd9Sstevel@tonic-gate 	char	grade;
3587c478bd9Sstevel@tonic-gate 	long	jsize;
3597c478bd9Sstevel@tonic-gate };
3617c478bd9Sstevel@tonic-gate /* This structure describes dialing routines */
3627c478bd9Sstevel@tonic-gate struct dialer {
3637c478bd9Sstevel@tonic-gate 	char	*DI_type;
3647c478bd9Sstevel@tonic-gate 	int	(*DI_dialer)();
3657c478bd9Sstevel@tonic-gate };
3677c478bd9Sstevel@tonic-gate struct nstat {
3687c478bd9Sstevel@tonic-gate 	pid_t	t_pid;		/* process id				*/
3697c478bd9Sstevel@tonic-gate 	time_t	t_start;	/* start time				*/
3707c478bd9Sstevel@tonic-gate 	time_t	t_scall;	/* start call to system			*/
3717c478bd9Sstevel@tonic-gate 	time_t	t_ecall;	/* end call to system			*/
3727c478bd9Sstevel@tonic-gate 	time_t	t_tacu;		/* acu time				*/
3737c478bd9Sstevel@tonic-gate 	time_t	t_tlog;		/* login time				*/
3747c478bd9Sstevel@tonic-gate 	time_t	t_sftp;		/* start file transfer protocol		*/
375*61961e0fSrobinson 	time_t	t_sxf;		/* start xfer				*/
376*61961e0fSrobinson 	time_t	t_exf;		/* end xfer				*/
3777c478bd9Sstevel@tonic-gate 	time_t	t_eftp;		/* end file transfer protocol		*/
3787c478bd9Sstevel@tonic-gate 	time_t	t_qtime;	/* time file queued			*/
3797c478bd9Sstevel@tonic-gate 	int	t_ndial;	/* # of dials				*/
3807c478bd9Sstevel@tonic-gate 	int	t_nlogs;	/* # of login trys			*/
3817c478bd9Sstevel@tonic-gate 	struct tms t_tbb;	/* start execution times		*/
3827c478bd9Sstevel@tonic-gate 	struct tms t_txfs;	/* xfer start times			*/
383*61961e0fSrobinson 	struct tms t_txfe;	/* xfer end times			*/
3847c478bd9Sstevel@tonic-gate 	struct tms t_tga;	/* garbage execution times		*/
3857c478bd9Sstevel@tonic-gate };
3877c478bd9Sstevel@tonic-gate /* This structure describes the values from Limits file */
3887c478bd9Sstevel@tonic-gate struct limits {
3897c478bd9Sstevel@tonic-gate 	int	totalmax;	/* overall limit */
3907c478bd9Sstevel@tonic-gate 	int	sitemax;	/* limit per site */
3917c478bd9Sstevel@tonic-gate 	char	mode[64];	/* uucico mode */
3927c478bd9Sstevel@tonic-gate };
3947c478bd9Sstevel@tonic-gate /* external declarations */
396*61961e0fSrobinson static ssize_t (*Read)(), (*Write)();
397*61961e0fSrobinson static int (*Ioctl)(int, int, ...);
398*61961e0fSrobinson static int Debug, Verbose;
399*61961e0fSrobinson static uid_t Uid, Euid;		/* user-id and effective-uid */
400*61961e0fSrobinson static mode_t Dev_mode;		/* save device mode here */
401*61961e0fSrobinson static long Retrytime;
402*61961e0fSrobinson static char Dc[];			/* line name			*/
403*61961e0fSrobinson static const char *Spool;
404*61961e0fSrobinson static const char *Pubdir;
405*61961e0fSrobinson static char Progname[];
406*61961e0fSrobinson static char *Bnptr;		/* used when BASENAME macro is expanded */
408*61961e0fSrobinson static int Uerror;		/* global error code */
409*61961e0fSrobinson static char *UerrorText[];	/* text for error code */
411*61961e0fSrobinson #define	UERRORTEXT		UerrorText[Uerror]
412*61961e0fSrobinson #define	UTEXT(x)		UerrorText[x]
4147c478bd9Sstevel@tonic-gate /* things get kind of tricky beyond this point -- please stay out */
4167c478bd9Sstevel@tonic-gate /* uucp functions and subroutine */
417*61961e0fSrobinson static void	(*genbrk)();
4187c478bd9Sstevel@tonic-gate extern int	iswrk(), gtwvec();			/* anlwrk.c */
4197c478bd9Sstevel@tonic-gate extern void	findgrade();				/* grades.c */
4207c478bd9Sstevel@tonic-gate extern void	chremdir(), mkremdir();			/* chremdir.c */
4217c478bd9Sstevel@tonic-gate extern void	toCorrupt();				/* cpmv.c  */
4227c478bd9Sstevel@tonic-gate extern int	xmv();					/* cpmv.c  */
424*61961e0fSrobinson static int	getargs();				/* getargs.c */
425*61961e0fSrobinson static void	bsfix();				/* getargs.c */
4267c478bd9Sstevel@tonic-gate extern char	*getprm();				/* getprm.c */
4287c478bd9Sstevel@tonic-gate extern char	*next_token();				/* permission.c */
4297c478bd9Sstevel@tonic-gate extern char	*nextarg();				/* permission.c */
4307c478bd9Sstevel@tonic-gate extern int	getuline();				/* permission.c */
432*61961e0fSrobinson static void	logent(const char *, const char *);	/* logent.c */
4337c478bd9Sstevel@tonic-gate extern void	commandlog();				/* logent.c */
4347c478bd9Sstevel@tonic-gate extern time_t	millitick();				/* logent.c */
4367c478bd9Sstevel@tonic-gate extern unsigned long	getfilesize();			/* statlog.c */
437*61961e0fSrobinson extern void		putfilesize();			/* statlog.c */
4397c478bd9Sstevel@tonic-gate extern int	logFind(), mchFind();			/* permission.c */
4407c478bd9Sstevel@tonic-gate extern int	chkperm(), chkpth();			/* permission.c */
4417c478bd9Sstevel@tonic-gate extern int	cmdOK(), switchRole();			/* permission.c */
4427c478bd9Sstevel@tonic-gate extern int	callBack(), requestOK();		/* permission.c */
4437c478bd9Sstevel@tonic-gate extern int	noSpool();				/* permission.c */
4447c478bd9Sstevel@tonic-gate extern void	myName();				/* permission.c */
4467c478bd9Sstevel@tonic-gate extern int	mkdirs();				/* expfile.c */
4477c478bd9Sstevel@tonic-gate extern int	scanlimit();				/* limits.c */
4487c478bd9Sstevel@tonic-gate extern void	systat();				/* systat.c */
449*61961e0fSrobinson static int	fd_mklock();				/* ulockf.c */
450*61961e0fSrobinson static int	mklock(), cklock();			/* ulockf.c */
451*61961e0fSrobinson static void	fd_rmlock(),  rmlock();	/* ulockf.c */
4527c478bd9Sstevel@tonic-gate extern char	*timeStamp();				/* utility.c */
453*61961e0fSrobinson static void	assert(const char *s1, const char *s2,
4547c478bd9Sstevel@tonic-gate 		    int i1, const char *s3, int i2);	/* utility.c */
4557c478bd9Sstevel@tonic-gate extern void	uucpname();				/* uucpname.c */
4567c478bd9Sstevel@tonic-gate extern int	versys();				/* versys.c */
4577c478bd9Sstevel@tonic-gate extern void	xuuxqt(), xuucico();			/* xqt.c */
458*61961e0fSrobinson static void	cleanup();				/* misc main.c */
460*61961e0fSrobinson #define	ASSERT(e, s1, s2, i1) if (!(e)) { \
461*61961e0fSrobinson 	assert(s1, s2, i1, __FILE__, __LINE__); \
462*61961e0fSrobinson 	cleanup(FAIL); \
4637c478bd9Sstevel@tonic-gate };
4657c478bd9Sstevel@tonic-gate /* messages */
466*61961e0fSrobinson static const char Ct_OPEN[];
467*61961e0fSrobinson static const char Ct_WRITE[];
468*61961e0fSrobinson static const char Ct_READ[];
469*61961e0fSrobinson static const char Ct_CREATE[];
470*61961e0fSrobinson static const char Ct_ALLOCATE[];
471*61961e0fSrobinson static const char Ct_LOCK[];
472*61961e0fSrobinson static const char Ct_STAT[];
473*61961e0fSrobinson static const char Ct_CHOWN[];
474*61961e0fSrobinson static const char Ct_CHMOD[];
475*61961e0fSrobinson static const char Ct_LINK[];
476*61961e0fSrobinson static const char Ct_CHDIR[];
477*61961e0fSrobinson static const char Ct_UNLINK[];
478*61961e0fSrobinson static const char Wr_ROLE[];
479*61961e0fSrobinson static const char Ct_CORRUPT[];
480*61961e0fSrobinson static const char Ct_FORK[];
481*61961e0fSrobinson static const char Ct_CLOSE[];
482*61961e0fSrobinson static const char Ct_BADOWN[];
483*61961e0fSrobinson static const char Fl_EXISTS[];
485*61961e0fSrobinson #ifdef	__cplusplus
486*61961e0fSrobinson }
4877c478bd9Sstevel@tonic-gate #endif
489*61961e0fSrobinson #endif /* _UUCP_H */