xref: /original-bsd/usr.bin/uucp/includes/uucp.h (revision abfc216a)
1 /*	@(#)uucp.h	5.18	03/05/91	*/
2 
3 #include <stdio.h>
4 
5 /*
6  * Determine local uucp name of this machine.
7  * Define one of the following:
8  *
9  * For UCB 4.1A and later systems, you will have the gethostname(2) call.
10  * If this call exists, define GETHOSTNAME.
11  *
12  * For USG 3.0 and later systems, you will have the uname(2) call.
13  * If this call exists, define UNAME.
14  *
15  * Some systems have a line of the form '#define sysname "myuucpname",'
16  * in the file /usr/include/whoami.h, to identify their machine.
17  * If your site does that, define WHOAMI.
18  *
19  * If your site has <whoami.h>, but you do not want to read
20  * that file every time uucp runs, you can compile sysname into uucp.
21  * This is faster and more reliable, but binaries do not port.
22  * If you want to do that, define CCWHOAMI.
23  *
24  * Some systems put the local uucp name in a single-line file
25  * named /etc/uucpname or /local/uucpname.
26  * If your site does that, define UUNAME.
27  *
28  * You should also define MYNAME to be your uucp name.
29  *
30  * For each of the above that are defined, uucp checks them in order.
31  * It stops on the first method that returns a non null name.
32  * If everything fails, it uses "unknown" for the system name.
33  */
34 #define	GETHOSTNAME	/**/
35 /* #define UNAME	/**/
36 /* #define WHOAMI	/**/
37 /* #define CCWHOAMI	/**/
38 /* #define UUNAME	/**/
39 /* If the above fails ... */
40 #define	MYNAME	"erehwon"
41 
42 /*
43  * Define the various kinds of connections to include.
44  * The complete list is in the condevs array in condevs.c
45  */
46 #define ATT2224		/* AT&T 2224 */
47 #define BSDTCP		/* 4.2bsd TCP/IP */
48 #define CDS224		/* Concord Data Systems 2400 */
49 /* #define DATAKIT	/* ATT's datakit */
50 #define DF02		/* Dec's DF02/DF03 */
51 #define DF112		/* Dec's DF112 */
52 #define DN11		/* "standard" DEC dialer */
53 #define HAYES		/* Hayes' Smartmodem */
54 #define HAYES2400	/* Hayes' 2400 baud Smartmodem */
55 /* #define MICOM	/* Micom Mux port */
56 #define NOVATION	/* Novation modem */
57 #define PAD		/* X.25 PAD */
58 #define PENRIL		/* PENRIL Dialer */
59 /* #define PNET		/* Purdue network */
60 #define RVMACS		/* Racal-Vadic MACS  820 dialer, 831 adaptor */
61 /* #define SYTEK	/* Sytek Local Area Net */
62 /* #define UNETTCP	/* 3Com's UNET */
63 #define USR2400		/* USRobotics Courier 2400 */
64 #define VA212		/* Racal-Vadic 212 */
65 #define VA811S		/* Racal-Vadic 811S dialer, 831 adaptor */
66 #define VA820		/* Racal-Vadic 820 dialer, 831 adaptor */
67 #define VADIC		/* Racal-Vadic 345x */
68 #define VENTEL		/* Ventel Dialer */
69 #define VMACS		/* Racal-Vadic MACS  811 dialer, 831 adaptor */
70 
71 #if defined(USR2400) && !defined(HAYES)
72 #define HAYES
73 #endif USR2400 && !HAYES
74 
75 #if defined(UNETTCP) || defined(BSDTCP)
76 #define TCPIP
77 #endif
78 
79 /*
80  * We need a timer to write slowly to certain modems.
81  * and for generating breaks.
82  *
83  * define INTERVALTIMER to use 4.[23] bsd interval timer.
84  * define FASTTIMER if you have the nap() system call.
85  * define FTIME if you have the ftime() system call.
86  * define BUSYLOOP if you must do a busy loop.
87  * Look at uucpdelay() in condevs.c for details.
88  */
89 #define	INTERVALTIMER
90 /*#define FASTTIMER /**/
91 /*#define FTIME /**/
92 /*#define BUSYLOOP /**/
93 
94 /*
95  * If your site is using "ndir.h" to retrofit the Berkeley
96  * directory reading routines, define NDIR.
97  * You will probably also have to set LIBNDIR in Makefile.
98  * Otherwise, <dir.h> is assumed to have the Berkeley directory definitions.
99  */
100 /*#define	NDIR	/**/
101 
102 /*
103  * If yours is a BTL system III, IV, V or so-on site, define USG.
104  */
105 /*#define	USG	/**/
106 
107 /*
108  * If you are running 4.3bsd, define BSD4_3 and BSD4_2
109  * If you are just running 4.2bsd, define BSD4_2
110  * If you are running the BRL version of 4.2BSD define BRL4_2, NOT BSD4_3
111  */
112 #ifndef BSD4_3
113 #define BSD4_3 	/**/
114 #endif
115 #ifndef BSD4_2
116 #define BSD4_2 	/**/
117 #endif
118 /*#define BRL4_2 /**/
119 
120 #if defined(BRL4_2) && !defined(BSD4_2)
121 #define BSD4_2
122 #undef BSD4_3
123 #endif BRL4_2
124 
125 /*
126  * If you are using /etc/inetd with 4.2bsd, define BSDINETD
127  */
128 #define BSDINETD	/**/
129 
130 /*
131  * If you are running 4.3bsd or BRL 4.2, you are running the inetd
132  */
133 
134 #if (defined(BSD4_3) || defined(BRL4_2)) && !defined(BSDINETD)
135 #define BSDINETD
136 #endif (BSD4_3 ||BRL4_2) && !BSDINETD
137 
138 /*#define VMSDTR	/* Turn on modem control on vms(works DTR) for
139 			   develcon and gandalf ports to gain access */
140 /*
141  *	If you want to use the same modem for dialing in and out define
142  *	DIALINOUT to be the localtion of the acucntrl program
143  */
144 /* #define DIALINOUT	"/usr/lib/uucp/acucntrl" /**/
145 
146 /*
147  *	If you want all ACU lines to be DIALINOUT, define ALLACUINOUT
148  */
149 /* #define ALLACUINOUT	/**/
150 
151 /* define the value of WFMASK - for umask call - used for all uucp work files */
152 #define WFMASK 0137
153 
154 /* define the value of LOGMASK - for LOGFILE, SYSLOG, ERRLOG */
155 #define	LOGMASK		0133
156 
157 /* All files are given at least the following at the final destination */
158 /* It is also the default mode, so '666' is recommended */
159 /* and 444 is minimal (minimally useful, maximally annoying) */
160 #define	BASEMODE	0666
161 
162 /*
163  * Define NOSTRANGERS if you don't want to accept transactions from
164  * sites that are not in your L.sys file (see cico.c)
165  */
166 #define NOSTRANGERS	/**/
167 
168 /*
169  * Traditionally LCK (lock) files have been kept in /var/spool/uucp.
170  * If you want that define LOCKDIR to be ".".
171  * If you want the locks kept in a subdirectory, define LOCKDIR as "LCK".
172  * Good news about LCK. subdirectory: the directory can be mode 777 so
173  * unprivileged programs can share the uucp locking system,
174  * and the subdirectory keeps down clutter in the main directory.
175  * The BAD news: you have to change 'tip' and another programs that
176  * know where the LCK files are kept, and you have to change your /etc/rc
177  * if your rc cleans out the lock files (as it should).
178  */
179 /* #define	LOCKDIR	"LCK"	/**/
180 #define LOCKDIR	"." /**/
181 
182 /*
183  * If you want uucp and uux to copy the data files by default,
184  * don't define DONTCOPY (This is the way older 4bsd uucps worked)
185  * If you want uucp and uux to use the original files instead of
186  * copies, define DONTCOPY (This is the way System III and V work)
187  */
188 #define DONTCOPY	/**/
189 
190 /*
191  * Very few (that I know of) systems use the sequence checking feature.
192  * If you are not going to use it (hint: you are not),
193  * do not define GNXSEQ.  This saves precious room on PDP11s.
194  */
195 /*#define	GNXSEQ	/* comment this out to save space */
196 
197 /*
198  * If you want the logfile stored in a file for each site instead
199  * of one file
200  * define LOGBYSITE as the directory to put the files in
201  */
202 /* #define LOGBYSITE	"/var/spool/uucp/LOG" /**/
203 
204 /*
205  * define USE_SYSLOG if you want error messages to use SYSLOG instead
206  * of being written to /var/spool/log/ERRLOG
207  */
208 #define USE_SYSLOG	/**/
209 
210 /*
211  * If you are doing rebilling and need connect accounting,
212  * define DO_CONNECT_ACCOUNTING to be the accounting file name
213  */
214 /*#define DO_CONNECT_ACCOUNTING	"/var/spool/uucp/CONNECT"	/**/
215 
216 #define XQTDIR		"/var/spool/uucp/XTMP"
217 #define SQFILE		"/usr/lib/uucp/SQFILE"
218 #define SQTMP		"/usr/lib/uucp/SQTMP"
219 #define SLCKTIME	5400	/* system/device timeout (LCK.. files) */
220 #define SEQFILE		"/usr/lib/uucp/SEQF"
221 #define SYSFILE		"/usr/lib/uucp/L.sys"
222 #define DEVFILE		"/usr/lib/uucp/L-devices"
223 #define DIALFILE	"/usr/lib/uucp/L-dialcodes"
224 #define USERFILE	"/usr/lib/uucp/USERFILE"
225 #define	CMDFILE		"/usr/lib/uucp/L.cmds"
226 #define	ALIASFILE	"/usr/lib/uucp/L.aliases"
227 
228 #define SPOOL		"/var/spool/uucp"
229 #define SYSLOG		"/var/spool/uucp/SYSLOG"
230 #define PUBDIR		"/var/spool/uucppublic"
231 
232 #define SQLOCK		"SQ"
233 #define SEQLOCK		"SEQL"
234 #define CMDPRE		'C'
235 #define DATAPRE		'D'
236 #define XQTPRE		'X'
237 
238 #define LOGFILE		"/var/spool/uucp/LOGFILE"
239 #define ERRLOG		"/var/spool/uucp/ERRLOG"
240 #define CMDSDIR		"/var/spool/uucp/C."
241 #define DATADIR		"/var/spool/uucp/D."
242 #define XEQTDIR		"/var/spool/uucp/X."
243 
244 #define RMTDEBUG	"AUDIT"
245 #define CORRUPT		"CORRUPT"
246 #define SQTIME		60
247 #define TRYCALLS	2	/* number of tries to dial call */
248 
249 #define LLEN	150
250 #define MAXRQST	250
251 
252 #define DEBUG(l, f, s) if (Debug >= l) fprintf(stderr, f, s); else
253 
254 #define delock(dev)	rmlock(dev)
255 #define mlock(dev)	ulockf(dev, SLCKTIME)
256 
257 #define SAME		0
258 #define ANYREAD		0004
259 #define ANYWRITE	02
260 #define FAIL		-1
261 #define SUCCESS		0
262 #define CNULL		(char *) 0
263 #define STBNULL		(struct sgttyb *) 0
264 #define MASTER		1
265 #define SLAVE		0
266 #define MAXFULLNAME	255
267 #define MAXMSGTIME	45
268 #define NAMESIZE	255
269 #define MAXBASENAME	14
270 #define SYSNSIZE	(MAXBASENAME-1-1-1-4)
271 #define EOTMSG		"\04\n\04\n"
272 #define CALLBACK	1
273 #define ONEDAY		86400L
274 
275 	/*  commands  */
276 #define SHELL		"/bin/sh"
277 #define MAIL		"/usr/lib/sendmail"
278 #define UUCICO		"/usr/lib/uucp/uucico"
279 #define UUXQT		"/usr/lib/uucp/uuxqt"
280 #define UUCP		"uucp"
281 
282 	/*  call connect fail stuff  */
283 #define CF_SYSTEM	-1
284 #define CF_TIME		-2
285 #define CF_LOCK		-3
286 #define	CF_NODEV	-4
287 #define CF_DIAL		-5
288 #define CF_LOGIN	-6
289 
290 #define F_NAME		0
291 #define F_TIME		1
292 #define F_LINE		2
293 #define F_CLASS		3	/* an optional prefix and the speed */
294 #define F_PHONE		4
295 #define F_LOGIN		5
296 
297 #define MAXPH		60	/* maximum length of a phone number */
298 
299 	/* This structure tells how to get to a device */
300 struct condev {
301 	char *CU_meth;		/* method, such as 'ACU' or 'DIR' */
302 	char *CU_brand;		/* brand, such as 'Hayes' or 'Vadic' */
303 	int (*CU_gen)();	/* what to call to search for brands */
304 	int (*CU_open)();	/* what to call to open brand */
305 	int (*CU_clos)();	/* what to call to close brand */
306 };
307 
308 	/* This structure tells about a device */
309 struct Devices {
310 #define	D_type		D_arg[0]
311 #define	D_line		D_arg[1]
312 #define	D_calldev	D_arg[2]
313 #define	D_class		D_arg[3]
314 #define	D_brand		D_arg[4]
315 #define	D_CHAT		5
316 	int  D_numargs;
317 	int  D_speed;
318 	char *D_arg[20];
319 	char D_argbfr[100];
320 };
321 
322 	/*  system status stuff  */
323 #define SS_OK		0
324 #define SS_NODEVICE	1
325 #define SS_CALLBACK	2
326 #define SS_INPROGRESS	3
327 #define SS_FAIL		4
328 #define SS_BADSEQ	5
329 #define SS_WRONGTIME	6
330 
331 	/*  fail/retry parameters  */
332 #define RETRYTIME	600
333 #define MAXRECALLS	25
334 
335 	/*  stuff for command execution  */
336 #define X_RQDFILE	'F'
337 #define X_STDIN		'I'
338 #define X_STDOUT	'O'
339 #define X_CMD		'C'
340 #define X_USER		'U'
341 #define X_SENDFILE	'S'
342 #define	X_NONOTI	'N'
343 #define X_RETURNTO	'R'
344 #define	X_NONZERO	'Z'
345 #define X_LOCK		"XQT"
346 #define X_LOCKTIME	3600L
347 
348 #define WKDSIZE		100	/*  size of work dir name  */
349 
350 #include <sys/types.h>
351 #ifndef USG
352 #include <sys/timeb.h>
353 #else USG
354 struct timeb
355 {
356 	time_t	time;
357 	unsigned short millitm;
358 	short	timezone;
359 	short	dstflag;
360 };
361 #define rindex strrchr
362 #define index strchr
363 #endif USG
364 
365 #ifdef BSD4_2
366 #include <syslog.h>
367 #endif /* BSD4_2 */
368 
369 extern struct timeb Now;
370 
371 extern int Ifn, Ofn;
372 extern char *Rmtname;
373 extern char User[];
374 extern char Loginuser[];
375 extern char *Spool;
376 extern char Myname[];
377 extern char Myfullname[];
378 extern int Debug;
379 extern int Bspeed;
380 extern char Wrkdir[];
381 extern time_t Retrytime;
382 extern short Usrf;
383 extern int IsTcpIp;
384 extern char Progname[];
385 extern int (*CU_end)();
386 extern struct condev condevs[];
387 extern char NOLOGIN[];
388 
389 extern	char DLocal[], DLocalX[], *subfile(), *subdir();
390 
391 /* Commonly called routines which return non-int value */
392 extern	char *ttyname(), *strcpy(), *strcat(), *index(), *rindex(),
393 		*fgets(), *calloc(), *malloc(), *fdig(), *ttyname(),
394 		*cfgets(), *getwd(), *strpbrk(), *strncpy();
395 extern	long lseek();
396 extern time_t time();
397 
398 extern char _FAILED[], CANTOPEN[], DEVNULL[];
399 
400 #ifdef lint
401 /* This horrible gross kludge is the only way I know to
402  * convince lint that signal(SIGINT,SIG_IGN) is legal. It hates SIG_IGN.
403  */
404 #ifdef SIG_IGN
405 #undef SIG_IGN
406 #endif /* SIG_IGN */
407 #define SIG_IGN	main
408 extern int main();
409 #ifdef DEBUG
410 #undef DEBUG
411 #endif DEBUG
412 #define DEBUG(a,b,c)
413 #endif /* lint */
414