xref: /csrg-svn/usr.bin/uucp/vms/uucp.h (revision 62413)
1*48677Sbostic /*	$Header: uucp.h,v 1.14 84/10/12 20:42:00 rick Exp $ */
2*48677Sbostic /*	from: uucp.h	5.2	83/07/19	*/
3*48677Sbostic 
4*48677Sbostic #include "stdio.h"
5*48677Sbostic 
6*48677Sbostic /*
7*48677Sbostic  * Determine local uucp name of this machine.
8*48677Sbostic  * Define one of the following:
9*48677Sbostic  *
10*48677Sbostic  * For UCB 4.1A and later systems, you will have the gethostname(2) call.
11*48677Sbostic  * If this call exists, define GETHOSTNAME.
12*48677Sbostic  *
13*48677Sbostic  * For USG 3.0 and later systems, you will have the uname(2) call.
14*48677Sbostic  * If this call exists, define UNAME.
15*48677Sbostic  *
16*48677Sbostic  * Some systems have a line of the form '#define sysname "myuucpname",'
17*48677Sbostic  * in the file /usr/include/whoami.h, to identify their machine.
18*48677Sbostic  * If your site does that, define WHOAMI.
19*48677Sbostic  *
20*48677Sbostic  * If your site has <whoami.h>, but you do not want to read
21*48677Sbostic  * that file every time uucp runs, you can compile sysname into uucp.
22*48677Sbostic  * This is faster and more reliable, but binaries do not port.
23*48677Sbostic  * If you want to do that, define CCWHOAMI.
24*48677Sbostic  *
25*48677Sbostic  * Some systems put the local uucp name in a single-line file
26*48677Sbostic  * named /etc/uucpname or /local/uucpname.
27*48677Sbostic  * If your site does that, define UUNAME.
28*48677Sbostic  *
29*48677Sbostic  * Systems running 3Com's UNET will have the getmyhname() call.
30*48677Sbostic  * If you want to, define GETMYHNAME.
31*48677Sbostic  *
32*48677Sbostic  * You should also define MYNANE to be your uucp name.
33*48677Sbostic  *
34*48677Sbostic  * For each of the above that are defined, uucp checks them in order.
35*48677Sbostic  * It stops on the first method that returns a non null name.
36*48677Sbostic  * If everything fails, it uses "unknown" for the system name.
37*48677Sbostic  */
38*48677Sbostic #define	GETHOSTNAME
39*48677Sbostic /*#define CCWHOAMI	*/
40*48677Sbostic /* If the above fails ... */
41*48677Sbostic #define	MYNAME	"erewhon"
42*48677Sbostic 
43*48677Sbostic /*
44*48677Sbostic  * If you have it, include <sysexits.h> to use exit
45*48677Sbostic  * codes that will be understood by sendmail.
46*48677Sbostic  * Otherwise, define EX_NOHOST, EX_CANTCREAT, and EX_NOINPUT.
47*48677Sbostic  */
48*48677Sbostic #include <sysexits.h>
49*48677Sbostic /*#define EX_NOHOST	101*/
50*48677Sbostic /*#define EX_CANTCREAT	1*/
51*48677Sbostic /*#define EX_NOINPUT	2*/
52*48677Sbostic 
53*48677Sbostic /*
54*48677Sbostic  * Define the various kinds of connections to include.
55*48677Sbostic  * The complete list is in the condevs array in condevs.c
56*48677Sbostic  */
57*48677Sbostic /*#define DN11		/* standard dialer */
58*48677Sbostic /*#define DATAKIT	/* ATT's datakit */
59*48677Sbostic /*#define PNET		/* Purdue network */
60*48677Sbostic /*#define DF02		/* Dec's DF02/DF03 */
61*48677Sbostic /*#define HAYES		/* Hayes' Smartmodem */
62*48677Sbostic /*#define VENTEL	/* ventel dialer */
63*48677Sbostic /*#define VADIC		/* Racal-Vadic 3450 */
64*48677Sbostic /*#define RVMACS	/* Racal-Vadic MACS 831 */
65*48677Sbostic /*#define RVADIC	/* Racal-Vadic 831 */
66*48677Sbostic /*#define UNETTCP	/* 3Com's UNET */
67*48677Sbostic #define BSDTCP		/* 4.2bsd TCP/IP */
68*48677Sbostic /*#define PAD		/* X.25 PAD */
69*48677Sbostic /*#define MICOM		/* micom mux port */
70*48677Sbostic /*#define NOVATION	/* Novation modem */
71*48677Sbostic 
72*48677Sbostic #if defined(UNETTCP) || defined(BSDTCP)
73*48677Sbostic #define TCPIP
74*48677Sbostic #endif
75*48677Sbostic 
76*48677Sbostic #ifdef	VENTEL
77*48677Sbostic /*
78*48677Sbostic  * We need a timer to write slowly to ventels.
79*48677Sbostic  * define INTERVALTIMER to use 4.2 bsd interval timer.
80*48677Sbostic  * define FASTTIMER if you have the nap() system call.
81*48677Sbostic  * define FTIME if you have the ftime() system call.
82*48677Sbostic  * define BUSYLOOP if you must do a busy loop.
83*48677Sbostic  * Look at uucpdelay() in condevs.c for details.
84*48677Sbostic  */
85*48677Sbostic #define	FTIME
86*48677Sbostic #endif
87*48677Sbostic 
88*48677Sbostic /*
89*48677Sbostic  * If your site is using "ndir.h" to retrofit the Berkeley
90*48677Sbostic  * directory reading routines, define NDIR.
91*48677Sbostic  * You will probably also have to set LIBNDIR in Makefile.
92*48677Sbostic  * Otherwise, <dir.h> is assumed to have the Berkeley directory definitions.
93*48677Sbostic  */
94*48677Sbostic #define	NDIR
95*48677Sbostic 
96*48677Sbostic /*
97*48677Sbostic  * If yours is a BTL system III, IV, or so-on site, define SYSIII.
98*48677Sbostic  */
99*48677Sbostic /*#define	SYSIII	*/
100*48677Sbostic 
101*48677Sbostic /*
102*48677Sbostic  * If you are running 4.2bsd, define BSD4_2
103*48677Sbostic  */
104*48677Sbostic /*#define BSD4_2 */
105*48677Sbostic 
106*48677Sbostic /* for a EUNICE system, define VMS */
107*48677Sbostic #define	VMS
108*48677Sbostic 
109*48677Sbostic /*
110*48677Sbostic  * If you are using /etc/inetd with 4.2bsd, define BSDINETD
111*48677Sbostic  */
112*48677Sbostic /*#define BSDINETD*/
113*48677Sbostic 
114*48677Sbostic #define VMSDTR	/* Turn on modem control on vms(works DTR) for
115*48677Sbostic 			   develcon and gandalf ports to gain access */
116*48677Sbostic 
117*48677Sbostic /* define the last characters for ACU */
118*48677Sbostic #define ACULAST "-<"
119*48677Sbostic 
120*48677Sbostic /* define the value of WFMASK - for umask call - used for all uucp work files */
121*48677Sbostic #define WFMASK 0111
122*48677Sbostic 
123*48677Sbostic /* define UUSTAT if you need "uustat" command */
124*48677Sbostic /* #define UUSTAT	*/
125*48677Sbostic 
126*48677Sbostic /*	define UUSUB if you need "uusub" command */
127*48677Sbostic /* #define UUSUB */
128*48677Sbostic 
129*48677Sbostic /* define the value of LOGMASK - for LOGFILE, SYSLOG, ERRLOG */
130*48677Sbostic #define	LOGMASK	0111
131*48677Sbostic 
132*48677Sbostic /* All files are given at least the following at the final destination */
133*48677Sbostic /* It is also the default mode, so '666' is recommended */
134*48677Sbostic /* and 444 is minimal (minimally useful, maximally annoying) */
135*48677Sbostic #define	BASEMODE	0666
136*48677Sbostic 
137*48677Sbostic /*
138*48677Sbostic  * Define NOSTRANGERS if you don't want to accept transactions from
139*48677Sbostic  * sites that are not in your L.sys file (see cico.c)
140*48677Sbostic  */
141*48677Sbostic /* #define NOSTRANGERS */
142*48677Sbostic 
143*48677Sbostic #define XQTDIR		"/usr/spool/uucp/XTMP"
144*48677Sbostic #define SQFILE		"/usr/lib/uucp/SQFILE"
145*48677Sbostic #define SQTMP		"/usr/lib/uucp/SQTMP"
146*48677Sbostic #define SLCKTIME	5400	/* system/device timeout (LCK.. files) */
147*48677Sbostic #define SEQFILE		"/usr/lib/uucp/SEQF"
148*48677Sbostic #define SYSFILE		"/usr/lib/uucp/L.sys"
149*48677Sbostic #define DEVFILE		"/usr/lib/uucp/L-devices"
150*48677Sbostic #define DIALFILE	"/usr/lib/uucp/L-dialcodes"
151*48677Sbostic #define USERFILE	"/usr/lib/uucp/USERFILE"
152*48677Sbostic #define	CMDFILE		"/usr/lib/uucp/L.cmds"
153*48677Sbostic 
154*48677Sbostic #define SPOOL		"/usr/spool/uucp"
155*48677Sbostic #define SQLOCK		"/usr/spool/uucp/LCK.SQ"
156*48677Sbostic #define SYSLOG		"/usr/spool/uucp/SYSLOG"
157*48677Sbostic #define PUBDIR		"/usr/spool/uucppublic"
158*48677Sbostic #define	CMDSDIR		"/usr/spool/uucp/C."
159*48677Sbostic #define	DATADIR		"/usr/spool/uucp/D."
160*48677Sbostic #define	XEQTDIR		"/usr/spool/uucp/X."
161*48677Sbostic 
162*48677Sbostic #define SEQLOCK		"LCK.SEQL"
163*48677Sbostic #define CMDPRE		'C'
164*48677Sbostic #define DATAPRE		'D'
165*48677Sbostic #define XQTPRE		'X'
166*48677Sbostic 
167*48677Sbostic #define LOGFILE	"/usr/spool/uucp/LOGFILE"
168*48677Sbostic #define ERRLOG	"/usr/spool/uucp/ERRLOG"
169*48677Sbostic 
170*48677Sbostic #define RMTDEBUG	"AUDIT"
171*48677Sbostic #define CORRUPT		"CORRUPT"
172*48677Sbostic #define SQTIME		60
173*48677Sbostic #define TRYCALLS	2	/* number of tries to dial call */
174*48677Sbostic 
175*48677Sbostic #define LLEN	50
176*48677Sbostic #define MAXRQST	250
177*48677Sbostic 
178*48677Sbostic #define DEBUG(l, f, s) if (Debug >= l) fprintf(stderr, f, s); else
179*48677Sbostic 
180*48677Sbostic #define ASSERT(e, s1, s2, i1) if (!(e)) {assert(s1, s2, i1);cleanup(FAIL);}else
181*48677Sbostic 
182*48677Sbostic #define SAME 0
183*48677Sbostic #define ANYREAD 0444
184*48677Sbostic #define ANYWRITE 02
185*48677Sbostic #define FAIL -1
186*48677Sbostic #define SUCCESS 0
187*48677Sbostic #define CNULL (char *) 0
188*48677Sbostic #define STBNULL (struct sgttyb *) 0
189*48677Sbostic #define MASTER 1
190*48677Sbostic #define SLAVE 0
191*48677Sbostic #define MAXFULLNAME 256
192*48677Sbostic #define MAXMSGTIME 45
193*48677Sbostic #define NAMESIZE 256
194*48677Sbostic #define EOTMSG "\04\n\04\n"
195*48677Sbostic #define CALLBACK 1
196*48677Sbostic 
197*48677Sbostic 	/*  commands  */
198*48677Sbostic #define SHELL		"/bin/sh"
199*48677Sbostic #define MAIL		"mail"
200*48677Sbostic #define UUCICO		"/usr/lib/uucp/uucico"
201*48677Sbostic #define UUXQT		"/usr/lib/uucp/uuxqt"
202*48677Sbostic #define UUCP		"uucp"
203*48677Sbostic #define	STARTUUCP	"/usr/lib/uucp/startuucp"
204*48677Sbostic 
205*48677Sbostic 	/*  call connect fail stuff  */
206*48677Sbostic #define CF_SYSTEM	-1
207*48677Sbostic #define CF_TIME		-2
208*48677Sbostic #define CF_LOCK		-3
209*48677Sbostic #define	CF_NODEV	-4
210*48677Sbostic #define CF_DIAL		-5
211*48677Sbostic #define CF_LOGIN	-6
212*48677Sbostic 
213*48677Sbostic #define F_NAME 0
214*48677Sbostic #define F_TIME 1
215*48677Sbostic #define F_LINE 2
216*48677Sbostic #define F_CLASS 3	/* an optional prefix and the speed */
217*48677Sbostic #define F_PHONE 4
218*48677Sbostic #define F_LOGIN 5
219*48677Sbostic 
220*48677Sbostic #define MAXPH	60	/* maximum length of a phone number */
221*48677Sbostic 
222*48677Sbostic 	/* This structure tells how to get to a device */
223*48677Sbostic struct condev {
224*48677Sbostic 	char *CU_meth;		/* method, such as 'ACU' or 'DIR' */
225*48677Sbostic 	char *CU_brand;		/* brand, such as 'Hayes' or 'Vadic' */
226*48677Sbostic 	int (*CU_gen)();	/* what to call to search for brands */
227*48677Sbostic 	int (*CU_open)();	/* what to call to open brand */
228*48677Sbostic 	int (*CU_clos)();	/* what to call to close brand */
229*48677Sbostic };
230*48677Sbostic 
231*48677Sbostic 	/* This structure tells about a device */
232*48677Sbostic struct Devices {
233*48677Sbostic 	char D_type[20];
234*48677Sbostic 	char D_line[20];
235*48677Sbostic 	char D_calldev[20];
236*48677Sbostic 	char D_class[20];
237*48677Sbostic 	int D_speed;
238*48677Sbostic 	char D_brand[20];	/* brand name, as 'Hayes' or 'Vadic' */
239*48677Sbostic };
240*48677Sbostic 
241*48677Sbostic 	/*  system status stuff  */
242*48677Sbostic #define SS_OK		0
243*48677Sbostic #define SS_FAIL		4
244*48677Sbostic #define SS_NODEVICE	1
245*48677Sbostic #define SS_CALLBACK	2
246*48677Sbostic #define SS_INPROGRESS	3
247*48677Sbostic #define SS_BADSEQ	5
248*48677Sbostic 
249*48677Sbostic 	/*  fail/retry parameters  */
250*48677Sbostic #define RETRYTIME 600
251*48677Sbostic #define MAXRECALLS 20
252*48677Sbostic 
253*48677Sbostic 	/*  stuff for command execution  */
254*48677Sbostic #define X_RQDFILE	'F'
255*48677Sbostic #define X_STDIN		'I'
256*48677Sbostic #define X_STDOUT	'O'
257*48677Sbostic #define X_CMD		'C'
258*48677Sbostic #define X_USER		'U'
259*48677Sbostic #define X_SENDFILE	'S'
260*48677Sbostic #define	X_NONOTI	'N'
261*48677Sbostic #define X_RETURNTO	'R'
262*48677Sbostic #define	X_NONZERO	'Z'
263*48677Sbostic #define X_LOCK		"LCK.XQT"
264*48677Sbostic #define X_LOCKTIME	3600
265*48677Sbostic 
266*48677Sbostic #define WKDSIZE 100	/*  size of work dir name  */
267*48677Sbostic 
268*48677Sbostic extern int Ifn, Ofn;
269*48677Sbostic extern char Rmtname[];
270*48677Sbostic extern char User[];
271*48677Sbostic extern char Loginuser[];
272*48677Sbostic extern char *Spool;
273*48677Sbostic extern char Myname[];
274*48677Sbostic extern char Myfullname[];
275*48677Sbostic extern int Debug;
276*48677Sbostic extern int Bspeed;
277*48677Sbostic extern char Wrkdir[];
278*48677Sbostic extern long Retrytime;
279*48677Sbostic extern short Usrf;
280*48677Sbostic extern int IsTcpIp;
281*48677Sbostic extern char Progname[];
282*48677Sbostic extern int (*CU_end)();
283*48677Sbostic extern struct condev condevs[];
284*48677Sbostic 
285*48677Sbostic extern	char DLocal[], DLocalX[], *subfile(), *subdir();
286*48677Sbostic 
287*48677Sbostic /* Commonly called routines which return non-int value */
288*48677Sbostic extern	char *ttyname(), *strcpy(), *strcat(), *index(), *rindex(),
289*48677Sbostic 		*fgets(), *calloc(), *malloc(),
290*48677Sbostic 		*cfgets();
291*48677Sbostic extern	long lseek();
292*48677Sbostic extern	FILE *rpopen();
293