xref: /csrg-svn/usr.bin/uucp/includes/uucp.h (revision 23681)
1*23681Sbloom /*	uucp.h	5.7	85/06/23	*/
213632Ssam 
318624Sralph #include <stdio.h>
413632Ssam 
513632Ssam /*
613632Ssam  * Determine local uucp name of this machine.
713632Ssam  * Define one of the following:
813632Ssam  *
913632Ssam  * For UCB 4.1A and later systems, you will have the gethostname(2) call.
1013632Ssam  * If this call exists, define GETHOSTNAME.
1113632Ssam  *
1213632Ssam  * For USG 3.0 and later systems, you will have the uname(2) call.
1313632Ssam  * If this call exists, define UNAME.
1413632Ssam  *
1513632Ssam  * Some systems have a line of the form '#define sysname "myuucpname",'
1613632Ssam  * in the file /usr/include/whoami.h, to identify their machine.
1713632Ssam  * If your site does that, define WHOAMI.
1813632Ssam  *
1913632Ssam  * If your site has <whoami.h>, but you do not want to read
2013632Ssam  * that file every time uucp runs, you can compile sysname into uucp.
2113632Ssam  * This is faster and more reliable, but binaries do not port.
2213632Ssam  * If you want to do that, define CCWHOAMI.
2313632Ssam  *
2413632Ssam  * Some systems put the local uucp name in a single-line file
2513632Ssam  * named /etc/uucpname or /local/uucpname.
2613632Ssam  * If your site does that, define UUNAME.
2713632Ssam  *
2813632Ssam  * Systems running 3Com's UNET will have the getmyhname() call.
2913632Ssam  * If you want to, define GETMYHNAME.
3013632Ssam  *
3117842Sralph  * You should also define MYNAME to be your uucp name.
3213632Ssam  *
3313632Ssam  * For each of the above that are defined, uucp checks them in order.
3413632Ssam  * It stops on the first method that returns a non null name.
3513632Ssam  * If everything fails, it uses "unknown" for the system name.
3613632Ssam  */
37*23681Sbloom #define	GETHOSTNAME	/**/
38*23681Sbloom /* #define UNAME	/**/
39*23681Sbloom /* #define WHOAMI	/**/
40*23681Sbloom /* #define CCWHOAMI	/**/
41*23681Sbloom /* #define UUNAME	/**/
42*23681Sbloom /* #define GETMYHNAME	/**/
4313632Ssam /* If the above fails ... */
44*23681Sbloom #define	MYNAME	"erehwon"
4513632Ssam 
4613632Ssam /*
4713632Ssam  * If you have it, include <sysexits.h> to use exit
4813632Ssam  * codes that will be understood by sendmail.
4913632Ssam  * Otherwise, define EX_NOHOST, EX_CANTCREAT, and EX_NOINPUT.
5013632Ssam  */
5113632Ssam #include <sysexits.h>
52*23681Sbloom /*#define EX_NOINPUT	66	/**/
53*23681Sbloom /*#define EX_NOHOST	68	/**/
54*23681Sbloom /*#define EX_CANTCREAT	73	/**/
5513632Ssam 
5613632Ssam /*
5713632Ssam  * Define the various kinds of connections to include.
5813632Ssam  * The complete list is in the condevs array in condevs.c
5913632Ssam  */
6017872Sralph #define DN11		/* standard dialer */
6117842Sralph /*#define DATAKIT	/* ATT's datakit */
6213632Ssam /*#define PNET		/* Purdue network */
6317872Sralph #define DF02		/* Dec's DF02/DF03 */
6418624Sralph #define DF112		/* Dec's DF112 */
6517872Sralph #define HAYES		/* Hayes' Smartmodem */
66*23681Sbloom #define VENTEL		/* Ventel Dialer */
6718624Sralph #define PENRIL		/* PENRIL Dialer */
6817872Sralph #define VADIC		/* Racal-Vadic 345x */
6917872Sralph #define VA212		/* Racal-Vadic 212 */
7017872Sralph #define VA811S		/* Racal-Vadic 811S dialer, 831 adaptor */
7117842Sralph #define VA820		/* Racal-Vadic 820 dialer, 831 adaptor */
7217872Sralph #define RVMACS		/* Racal-Vadic MACS  820 dialer, 831 adaptor */
7317872Sralph #define VMACS		/* Racal-Vadic MACS  811 dialer, 831 adaptor */
7417842Sralph /*#define UNETTCP	/* 3Com's UNET */
75*23681Sbloom #define BSDTCP		/* 4.2bsd or 2.9bsd TCP/IP */
7617842Sralph #define PAD		/* X.25 PAD */
7713632Ssam /*#define MICOM		/* micom mux port */
7817872Sralph #define NOVATION	/* Novation modem */
7913632Ssam 
8017842Sralph #if defined(UNETTCP) || defined(BSDTCP)
8117842Sralph #define TCPIP
8217842Sralph #endif
8317842Sralph 
8418624Sralph #if defined(VENTEL) || defined(NOVATION) || defined(DF112) || defined(PENRIL)
8513632Ssam /*
8613632Ssam  * We need a timer to write slowly to ventels.
8713632Ssam  * define INTERVALTIMER to use 4.2 bsd interval timer.
8813632Ssam  * define FASTTIMER if you have the nap() system call.
8913632Ssam  * define FTIME if you have the ftime() system call.
9013632Ssam  * define BUSYLOOP if you must do a busy loop.
9113632Ssam  * Look at uucpdelay() in condevs.c for details.
9213632Ssam  */
93*23681Sbloom #define	INTERVALTIMER
9418624Sralph #endif VENTEL || NOVATION || DF112 || PENRIL
9513632Ssam 
9613632Ssam /*
9713632Ssam  * If your site is using "ndir.h" to retrofit the Berkeley
9813632Ssam  * directory reading routines, define NDIR.
9913632Ssam  * You will probably also have to set LIBNDIR in Makefile.
10013632Ssam  * Otherwise, <dir.h> is assumed to have the Berkeley directory definitions.
10113632Ssam  */
102*23681Sbloom /*#define	NDIR	/**/
10313632Ssam 
10413632Ssam /*
105*23681Sbloom  * If yours is a BTL system III, IV, V or so-on site, define USG.
10613632Ssam  */
107*23681Sbloom /*#define	USG	/**/
10813632Ssam 
10917842Sralph /*
11017842Sralph  * If you are running 4.2bsd, define BSD4_2
11117842Sralph  */
112*23681Sbloom #define BSD4_2 	/**/
11317842Sralph 
11417842Sralph /*
115*23681Sbloom  * If you are running 2.9bsd, define BSD2_9
116*23681Sbloom  */
117*23681Sbloom /*#define BSD2_9 	/**/
118*23681Sbloom 
119*23681Sbloom /*
12017842Sralph  * If you are using /etc/inetd with 4.2bsd, define BSDINETD
12117842Sralph  */
122*23681Sbloom #define BSDINETD	/**/
12317842Sralph 
12417842Sralph /*#define VMSDTR	/* Turn on modem control on vms(works DTR) for
12517842Sralph 			   develcon and gandalf ports to gain access */
12618624Sralph /*
12718624Sralph  *	If you want to use the same modem for dialing in and out define
12818624Sralph  *	DIALINOUT to be the localtion of the acucntrl program
12918624Sralph  */
130*23681Sbloom /* #define DIALINOUT	"/usr/lib/uucp/acucntrl" /**/
13117842Sralph 
132*23681Sbloom /*
133*23681Sbloom  *	If you want all ACU lines to be DIALINOUT, define ALLACUINOUT
134*23681Sbloom  */
135*23681Sbloom /* #define ALLACUINOUT	/**/
13613632Ssam 
13713632Ssam /* define the value of WFMASK - for umask call - used for all uucp work files */
13813632Ssam #define WFMASK 0137
13913632Ssam 
14017842Sralph /* define UUSTAT if you need "uustat" command */
141*23681Sbloom /* #define UUSTAT	/**/
14217842Sralph 
143*23681Sbloom /* define UUSUB if you need "uusub" command */
14417842Sralph /* #define UUSUB /**/
14517842Sralph 
14613632Ssam /* define the value of LOGMASK - for LOGFILE, SYSLOG, ERRLOG */
147*23681Sbloom #define	LOGMASK		0133
14813632Ssam 
14913632Ssam /* All files are given at least the following at the final destination */
15013632Ssam /* It is also the default mode, so '666' is recommended */
15113632Ssam /* and 444 is minimal (minimally useful, maximally annoying) */
15213632Ssam #define	BASEMODE	0666
15313632Ssam 
15417842Sralph /*
15517842Sralph  * Define NOSTRANGERS if you don't want to accept transactions from
15617842Sralph  * sites that are not in your L.sys file (see cico.c)
15717842Sralph  */
158*23681Sbloom #define NOSTRANGERS	/**/
15917842Sralph /*
16017842Sralph  * Traditionally LCK (lock) files have been kept in /usr/spool/uucp.
16117842Sralph  * If you want that define LOCKDIR to be ".".
16217842Sralph  * If you want the locks kept in a subdirectory, define LOCKDIR as "LCK.".
16317842Sralph  * Good news about LCK. subdirectory: the directory can be mode 777 so
16417842Sralph  * unprivileged programs can share the uucp locking system,
16517842Sralph  * and the subdirectory keeps down clutter in the main directory.
16617842Sralph  * The BAD news: you have to change 'tip' and another programs that
16717842Sralph  * know where the LCK files are kept, and you have to change your /etc/rc
16817842Sralph  * if your rc cleans out the lock files (as it should).
16917842Sralph  */
170*23681Sbloom /*#define	LOCKDIR	"LCK."	/**/
171*23681Sbloom #define LOCKDIR	"." /**/
17213632Ssam 
17317842Sralph /*
17417842Sralph  * If you want uucp and uux to copy the data files by default,
17517842Sralph  * don't define DONTCOPY (This is the way older 4bsd uucps worked)
17617842Sralph  * If you want uucp and uux to use the original files instead of
17717842Sralph  * copies, define DONTCOPY (This is the way System III and V work)
17817842Sralph  */
179*23681Sbloom #define DONTCOPY	/**/
18017842Sralph 
18117842Sralph /*
18218624Sralph  * Very few (that I know of) systems use the sequence checking feature.
18317842Sralph  * If you are not going to use it (hint: you are not),
18417842Sralph  * do not define GNXSEQ.  This saves precious room on PDP11s.
18517842Sralph  */
186*23681Sbloom /*#define	GNXSEQ	/* comment this out to save space */
18717842Sralph 
18818624Sralph /*
18918624Sralph  * If you want the logfile stored in a file for each site instead
19018624Sralph  * of one file
19118624Sralph  * define LOGBYSITE as the directory to put the files in
19218624Sralph  */
193*23681Sbloom /*#define LOGBYSITE	"/usr/spool/uucp/LOG" /**/
19418624Sralph 
19513632Ssam #define XQTDIR		"/usr/spool/uucp/XTMP"
19613632Ssam #define SQFILE		"/usr/lib/uucp/SQFILE"
19713632Ssam #define SQTMP		"/usr/lib/uucp/SQTMP"
19813632Ssam #define SLCKTIME	5400	/* system/device timeout (LCK.. files) */
19913632Ssam #define SEQFILE		"/usr/lib/uucp/SEQF"
20013632Ssam #define SYSFILE		"/usr/lib/uucp/L.sys"
20113632Ssam #define DEVFILE		"/usr/lib/uucp/L-devices"
20213632Ssam #define DIALFILE	"/usr/lib/uucp/L-dialcodes"
20313632Ssam #define USERFILE	"/usr/lib/uucp/USERFILE"
20413632Ssam #define	CMDFILE		"/usr/lib/uucp/L.cmds"
20518624Sralph #define	ALIASFILE	"/usr/lib/uucp/L.aliases"
20613632Ssam 
20713632Ssam #define SPOOL		"/usr/spool/uucp"
20817842Sralph #define SQLOCK		"LCK.SQ"
20913632Ssam #define SYSLOG		"/usr/spool/uucp/SYSLOG"
21013632Ssam #define PUBDIR		"/usr/spool/uucppublic"
21113632Ssam 
21213632Ssam #define SEQLOCK		"LCK.SEQL"
21313632Ssam #define CMDPRE		'C'
21413632Ssam #define DATAPRE		'D'
21513632Ssam #define XQTPRE		'X'
21613632Ssam 
217*23681Sbloom #define LOGFILE		"/usr/spool/uucp/LOGFILE"
218*23681Sbloom #define ERRLOG		"/usr/spool/uucp/ERRLOG"
219*23681Sbloom #define CMDSDIR		"/usr/spool/uucp/C."
220*23681Sbloom #define DATADIR		"/usr/spool/uucp/D."
221*23681Sbloom #define XEQTDIR		"/usr/spool/uucp/X."
22213632Ssam 
22313632Ssam #define RMTDEBUG	"AUDIT"
22417842Sralph #define CORRUPT		"CORRUPT"
22513632Ssam #define SQTIME		60
22613632Ssam #define TRYCALLS	2	/* number of tries to dial call */
22713632Ssam 
22817842Sralph #define LLEN	50
22917842Sralph #define MAXRQST	250
23017842Sralph 
23113632Ssam #define DEBUG(l, f, s) if (Debug >= l) fprintf(stderr, f, s); else
23213632Ssam 
23317842Sralph #define ASSERT(e, s1, s2, i1) if (!(e)) {assert(s1, s2, i1);cleanup(FAIL);}else
23413632Ssam 
235*23681Sbloom #define SAME		0
236*23681Sbloom #define ANYREAD		0004
237*23681Sbloom #define ANYWRITE	02
238*23681Sbloom #define FAIL		-1
239*23681Sbloom #define SUCCESS		0
240*23681Sbloom #define CNULL		(char *) 0
241*23681Sbloom #define STBNULL		(struct sgttyb *) 0
242*23681Sbloom #define MASTER		1
243*23681Sbloom #define SLAVE		0
244*23681Sbloom #define MAXFULLNAME	255
245*23681Sbloom #define MAXMSGTIME	45
246*23681Sbloom #define NAMESIZE	255
247*23681Sbloom #define MAXBASENAME	14
248*23681Sbloom #define SYSNSIZE	(MAXBASENAME-1-1-1-4)
249*23681Sbloom #define EOTMSG		"\04\n\04\n"
250*23681Sbloom #define CALLBACK	1
251*23681Sbloom #define ONEDAY		86400L
25213632Ssam 
25313632Ssam 	/*  commands  */
25413632Ssam #define SHELL		"/bin/sh"
25517842Sralph #define MAIL		"/usr/lib/sendmail"
25613632Ssam #define UUCICO		"/usr/lib/uucp/uucico"
25713632Ssam #define UUXQT		"/usr/lib/uucp/uuxqt"
25813632Ssam #define UUCP		"uucp"
25913632Ssam 
26013632Ssam 	/*  call connect fail stuff  */
26113632Ssam #define CF_SYSTEM	-1
26213632Ssam #define CF_TIME		-2
26313632Ssam #define CF_LOCK		-3
26413632Ssam #define	CF_NODEV	-4
26513632Ssam #define CF_DIAL		-5
26613632Ssam #define CF_LOGIN	-6
26713632Ssam 
268*23681Sbloom #define F_NAME		0
269*23681Sbloom #define F_TIME		1
270*23681Sbloom #define F_LINE		2
271*23681Sbloom #define F_CLASS		3	/* an optional prefix and the speed */
272*23681Sbloom #define F_PHONE		4
273*23681Sbloom #define F_LOGIN		5
27413632Ssam 
275*23681Sbloom #define MAXPH		60	/* maximum length of a phone number */
27613632Ssam 
27713632Ssam 	/* This structure tells how to get to a device */
27813632Ssam struct condev {
27913632Ssam 	char *CU_meth;		/* method, such as 'ACU' or 'DIR' */
28013632Ssam 	char *CU_brand;		/* brand, such as 'Hayes' or 'Vadic' */
28113632Ssam 	int (*CU_gen)();	/* what to call to search for brands */
28213632Ssam 	int (*CU_open)();	/* what to call to open brand */
28313632Ssam 	int (*CU_clos)();	/* what to call to close brand */
28413632Ssam };
28513632Ssam 
28613632Ssam 	/* This structure tells about a device */
28713632Ssam struct Devices {
28817842Sralph #define	D_type		D_arg[0]
28917842Sralph #define	D_line		D_arg[1]
29017842Sralph #define	D_calldev	D_arg[2]
29117842Sralph #define	D_class		D_arg[3]
29217842Sralph #define	D_brand		D_arg[4]
29317842Sralph #define	D_CHAT		5
29417842Sralph 	int  D_numargs;
29517842Sralph 	int  D_speed;
29617842Sralph 	char *D_arg[20];
29717842Sralph 	char D_argbfr[100];
29813632Ssam };
29913632Ssam 
30013632Ssam 	/*  system status stuff  */
30113632Ssam #define SS_OK		0
30213632Ssam #define SS_NODEVICE	1
30313632Ssam #define SS_CALLBACK	2
30413632Ssam #define SS_INPROGRESS	3
305*23681Sbloom #define SS_FAIL		4
30613632Ssam #define SS_BADSEQ	5
30717842Sralph #define SS_WRONGTIME	6
30813632Ssam 
30913632Ssam 	/*  fail/retry parameters  */
310*23681Sbloom #define RETRYTIME	600
311*23681Sbloom #define MAXRECALLS	25
31213632Ssam 
31313632Ssam 	/*  stuff for command execution  */
31413632Ssam #define X_RQDFILE	'F'
31513632Ssam #define X_STDIN		'I'
31613632Ssam #define X_STDOUT	'O'
31713632Ssam #define X_CMD		'C'
31813632Ssam #define X_USER		'U'
31913632Ssam #define X_SENDFILE	'S'
32013632Ssam #define	X_NONOTI	'N'
32117842Sralph #define X_RETURNTO	'R'
32213632Ssam #define	X_NONZERO	'Z'
32313632Ssam #define X_LOCK		"LCK.XQT"
324*23681Sbloom #define X_LOCKTIME	3600L
32513632Ssam 
326*23681Sbloom #define WKDSIZE		100	/*  size of work dir name  */
32713632Ssam 
32818624Sralph #include <sys/types.h>
32918624Sralph #ifndef USG
33018624Sralph #include <sys/timeb.h>
33118624Sralph #else USG
33218624Sralph struct timeb
33318624Sralph {
33418624Sralph 	time_t	time;
33518624Sralph 	unsigned short millitm;
33618624Sralph 	short	timezone;
33718624Sralph 	short	dstflag;
33818624Sralph };
339*23681Sbloom #define rindex strrchr
340*23681Sbloom #define index strchr
34118624Sralph #endif USG
34218624Sralph 
34318624Sralph extern struct timeb Now;
34418624Sralph 
34513632Ssam extern int Ifn, Ofn;
34618624Sralph extern char *Rmtname;
34713632Ssam extern char User[];
34813632Ssam extern char Loginuser[];
34913632Ssam extern char *Spool;
35013632Ssam extern char Myname[];
35117842Sralph extern char Myfullname[];
35213632Ssam extern int Debug;
35313632Ssam extern int Bspeed;
35413632Ssam extern char Wrkdir[];
355*23681Sbloom extern time_t Retrytime;
35617842Sralph extern short Usrf;
35717842Sralph extern int IsTcpIp;
35813632Ssam extern char Progname[];
35913632Ssam extern int (*CU_end)();
36013632Ssam extern struct condev condevs[];
36117842Sralph extern int nologinflag;
36217842Sralph extern char NOLOGIN[];
36313632Ssam 
36417842Sralph extern	char DLocal[], DLocalX[], *subfile(), *subdir();
36513632Ssam 
36613632Ssam /* Commonly called routines which return non-int value */
36713632Ssam extern	char *ttyname(), *strcpy(), *strcat(), *index(), *rindex(),
36817842Sralph 		*fgets(), *calloc(), *malloc(), *fdig(), *ttyname(),
369*23681Sbloom 		*cfgets(), *getwd(), *strpbrk(), *strncpy();
37013632Ssam extern	long lseek();
37113992Sgray extern	FILE *rpopen();
372*23681Sbloom extern time_t time();
37317842Sralph 
37417842Sralph extern char _FAILED[], CANTOPEN[], DEVNULL[];
375*23681Sbloom 
376*23681Sbloom #ifdef lint
377*23681Sbloom /* This horrible gross kludge is the only way I know to
378*23681Sbloom  * convince lint that signal(SIGINT,SIG_IGN) is legal. It hates SIG_IGN.
379*23681Sbloom  */
380*23681Sbloom #ifdef SIG_IGN
381*23681Sbloom #undef SIG_IGN
382*23681Sbloom #endif /* SIG_IGN */
383*23681Sbloom #define SIG_IGN	main
384*23681Sbloom extern int main();
385*23681Sbloom #ifdef DEBUG
386*23681Sbloom #undef DEBUG
387*23681Sbloom #endif DEBUG
388*23681Sbloom #define DEBUG(a,b,c)
389*23681Sbloom #endif /* lint */
390