xref: /original-bsd/usr.bin/uucp/includes/uucp.h (revision 7e7b101a)
1 /*	uucp.h	5.6	85/04/10	*/
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  * Systems running 3Com's UNET will have the getmyhname() call.
29  * If you want to, define GETMYHNAME.
30  *
31  * You should also define MYNAME to be your uucp name.
32  *
33  * For each of the above that are defined, uucp checks them in order.
34  * It stops on the first method that returns a non null name.
35  * If everything fails, it uses "unknown" for the system name.
36  */
37 #define	GETHOSTNAME
38 /*#define CCWHOAMI	*/
39 /* If the above fails ... */
40 #define	MYNAME	"erewhon"
41 
42 /*
43  * If you have it, include <sysexits.h> to use exit
44  * codes that will be understood by sendmail.
45  * Otherwise, define EX_NOHOST, EX_CANTCREAT, and EX_NOINPUT.
46  */
47 #include <sysexits.h>
48 /*#define EX_NOINPUT	66*/
49 /*#define EX_NOHOST	68*/
50 /*#define EX_CANTCREAT	73*/
51 
52 /*
53  * Define the various kinds of connections to include.
54  * The complete list is in the condevs array in condevs.c
55  */
56 #define DN11		/* standard dialer */
57 /*#define DATAKIT	/* ATT's datakit */
58 /*#define PNET		/* Purdue network */
59 #define DF02		/* Dec's DF02/DF03 */
60 #define DF112		/* Dec's DF112 */
61 #define HAYES		/* Hayes' Smartmodem */
62 #define VENTEL		/* ventel dialer */
63 #define PENRIL		/* PENRIL Dialer */
64 #define VADIC		/* Racal-Vadic 345x */
65 #define VA212		/* Racal-Vadic 212 */
66 #define VA811S		/* Racal-Vadic 811S dialer, 831 adaptor */
67 #define VA820		/* Racal-Vadic 820 dialer, 831 adaptor */
68 #define RVMACS		/* Racal-Vadic MACS  820 dialer, 831 adaptor */
69 #define VMACS		/* Racal-Vadic MACS  811 dialer, 831 adaptor */
70 /*#define UNETTCP	/* 3Com's UNET */
71 #define BSDTCP		/* 4.2bsd TCP/IP */
72 #define PAD		/* X.25 PAD */
73 /*#define MICOM		/* micom mux port */
74 #define NOVATION	/* Novation modem */
75 
76 #if defined(UNETTCP) || defined(BSDTCP)
77 #define TCPIP
78 #endif
79 
80 #if defined(VENTEL) || defined(NOVATION) || defined(DF112) || defined(PENRIL)
81 /*
82  * We need a timer to write slowly to ventels.
83  * define INTERVALTIMER to use 4.2 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	FTIME
90 #endif VENTEL || NOVATION || DF112 || PENRIL
91 
92 /*
93  * If your site is using "ndir.h" to retrofit the Berkeley
94  * directory reading routines, define NDIR.
95  * You will probably also have to set LIBNDIR in Makefile.
96  * Otherwise, <dir.h> is assumed to have the Berkeley directory definitions.
97  */
98 /*#define	NDIR	*/
99 
100 /*
101  * If yours is a BTL system III, IV, or so-on site, define USG.
102  */
103 /*#define	USG	*/
104 
105 /*
106  * If you are running 4.2bsd, define BSD4_2
107  */
108 #define BSD4_2
109 
110 /*
111  * If you are using /etc/inetd with 4.2bsd, define BSDINETD
112  */
113 #define BSDINETD
114 
115 /*#define VMSDTR	/* Turn on modem control on vms(works DTR) for
116 			   develcon and gandalf ports to gain access */
117 /*
118  *	If you want to use the same modem for dialing in and out define
119  *	DIALINOUT to be the localtion of the acucntrl program
120  */
121 /* #define DIALINOUT	"/usr/lib/uucp/acucntrl" */
122 
123 /* define the last characters for ACU */
124 #define ACULAST "-<"
125 
126 /* define the value of WFMASK - for umask call - used for all uucp work files */
127 #define WFMASK 0137
128 
129 /* define UUSTAT if you need "uustat" command */
130 /* #define UUSTAT	*/
131 
132 /*	define UUSUB if you need "uusub" command */
133 /* #define UUSUB /**/
134 
135 /* define the value of LOGMASK - for LOGFILE, SYSLOG, ERRLOG */
136 #define	LOGMASK	0133
137 
138 /* All files are given at least the following at the final destination */
139 /* It is also the default mode, so '666' is recommended */
140 /* and 444 is minimal (minimally useful, maximally annoying) */
141 #define	BASEMODE	0666
142 
143 /*
144  * Define NOSTRANGERS if you don't want to accept transactions from
145  * sites that are not in your L.sys file (see cico.c)
146  */
147 #define NOSTRANGERS
148 /*
149  * Traditionally LCK (lock) files have been kept in /usr/spool/uucp.
150  * If you want that define LOCKDIR to be ".".
151  * If you want the locks kept in a subdirectory, define LOCKDIR as "LCK.".
152  * Good news about LCK. subdirectory: the directory can be mode 777 so
153  * unprivileged programs can share the uucp locking system,
154  * and the subdirectory keeps down clutter in the main directory.
155  * The BAD news: you have to change 'tip' and another programs that
156  * know where the LCK files are kept, and you have to change your /etc/rc
157  * if your rc cleans out the lock files (as it should).
158  */
159 /*#define	LOCKDIR	"LCK" */
160 #define	LOCKDIR	"."
161 
162 /*
163  * If you want uucp and uux to copy the data files by default,
164  * don't define DONTCOPY (This is the way older 4bsd uucps worked)
165  * If you want uucp and uux to use the original files instead of
166  * copies, define DONTCOPY (This is the way System III and V work)
167  */
168 #define DONTCOPY
169 
170 /*
171  * Very few (that I know of) systems use the sequence checking feature.
172  * If you are not going to use it (hint: you are not),
173  * do not define GNXSEQ.  This saves precious room on PDP11s.
174  */
175 /*#define	GNXSEQ/* comment this out to save space */
176 
177 /*
178  * If you want the logfile stored in a file for each site instead
179  * of one file
180  * define LOGBYSITE as the directory to put the files in
181  */
182 /*#define LOGBYSITE	"/usr/spool/uucp/LOG"	*/
183 
184 #define XQTDIR		"/usr/spool/uucp/XTMP"
185 #define SQFILE		"/usr/lib/uucp/SQFILE"
186 #define SQTMP		"/usr/lib/uucp/SQTMP"
187 #define SLCKTIME	5400	/* system/device timeout (LCK.. files) */
188 #define SEQFILE		"/usr/lib/uucp/SEQF"
189 #define SYSFILE		"/usr/lib/uucp/L.sys"
190 #define DEVFILE		"/usr/lib/uucp/L-devices"
191 #define DIALFILE	"/usr/lib/uucp/L-dialcodes"
192 #define USERFILE	"/usr/lib/uucp/USERFILE"
193 #define	CMDFILE		"/usr/lib/uucp/L.cmds"
194 #define	ALIASFILE	"/usr/lib/uucp/L.aliases"
195 
196 #define SPOOL		"/usr/spool/uucp"
197 #define SQLOCK		"LCK.SQ"
198 #define SYSLOG		"/usr/spool/uucp/SYSLOG"
199 #define PUBDIR		"/usr/spool/uucppublic"
200 
201 #define SEQLOCK		"LCK.SEQL"
202 #define CMDPRE		'C'
203 #define DATAPRE		'D'
204 #define XQTPRE		'X'
205 
206 #define LOGFILE	"/usr/spool/uucp/LOGFILE"
207 #define ERRLOG	"/usr/spool/uucp/ERRLOG"
208 #define CMDSDIR	"/usr/spool/uucp/C."
209 #define DATADIR	"/usr/spool/uucp/D."
210 #define XEQTDIR	"/usr/spool/uucp/X."
211 
212 #define RMTDEBUG	"AUDIT"
213 #define CORRUPT		"CORRUPT"
214 #define SQTIME		60
215 #define TRYCALLS	2	/* number of tries to dial call */
216 
217 #define LLEN	50
218 #define MAXRQST	250
219 
220 #define DEBUG(l, f, s) if (Debug >= l) fprintf(stderr, f, s); else
221 
222 #define ASSERT(e, s1, s2, i1) if (!(e)) {assert(s1, s2, i1);cleanup(FAIL);}else
223 
224 #define SAME 0
225 #define ANYREAD 0004
226 #define ANYWRITE 02
227 #define FAIL -1
228 #define SUCCESS 0
229 #define CNULL (char *) 0
230 #define STBNULL (struct sgttyb *) 0
231 #define MASTER 1
232 #define SLAVE 0
233 #define MAXFULLNAME 255
234 #define MAXMSGTIME 45
235 #define NAMESIZE 255
236 #define EOTMSG "\04\n\04\n"
237 #define CALLBACK 1
238 #define ONEDAY	86400L
239 
240 	/*  commands  */
241 #define SHELL		"/bin/sh"
242 #define MAIL		"/usr/lib/sendmail"
243 #define UUCICO		"/usr/lib/uucp/uucico"
244 #define UUXQT		"/usr/lib/uucp/uuxqt"
245 #define UUCP		"uucp"
246 
247 	/*  call connect fail stuff  */
248 #define CF_SYSTEM	-1
249 #define CF_TIME		-2
250 #define CF_LOCK		-3
251 #define	CF_NODEV	-4
252 #define CF_DIAL		-5
253 #define CF_LOGIN	-6
254 
255 #define F_NAME 0
256 #define F_TIME 1
257 #define F_LINE 2
258 #define F_CLASS 3	/* an optional prefix and the speed */
259 #define F_PHONE 4
260 #define F_LOGIN 5
261 
262 #define MAXPH	60	/* maximum length of a phone number */
263 
264 	/* This structure tells how to get to a device */
265 struct condev {
266 	char *CU_meth;		/* method, such as 'ACU' or 'DIR' */
267 	char *CU_brand;		/* brand, such as 'Hayes' or 'Vadic' */
268 	int (*CU_gen)();	/* what to call to search for brands */
269 	int (*CU_open)();	/* what to call to open brand */
270 	int (*CU_clos)();	/* what to call to close brand */
271 };
272 
273 	/* This structure tells about a device */
274 struct Devices {
275 #define	D_type		D_arg[0]
276 #define	D_line		D_arg[1]
277 #define	D_calldev	D_arg[2]
278 #define	D_class		D_arg[3]
279 #define	D_brand		D_arg[4]
280 #define	D_CHAT		5
281 	int  D_numargs;
282 	int  D_speed;
283 	char *D_arg[20];
284 	char D_argbfr[100];
285 };
286 
287 	/*  system status stuff  */
288 #define SS_OK		0
289 #define SS_FAIL		4
290 #define SS_NODEVICE	1
291 #define SS_CALLBACK	2
292 #define SS_INPROGRESS	3
293 #define SS_BADSEQ	5
294 #define SS_WRONGTIME	6
295 
296 	/*  fail/retry parameters  */
297 #define RETRYTIME 600
298 #define MAXRECALLS 20
299 
300 	/*  stuff for command execution  */
301 #define X_RQDFILE	'F'
302 #define X_STDIN		'I'
303 #define X_STDOUT	'O'
304 #define X_CMD		'C'
305 #define X_USER		'U'
306 #define X_SENDFILE	'S'
307 #define	X_NONOTI	'N'
308 #define X_RETURNTO	'R'
309 #define	X_NONZERO	'Z'
310 #define X_LOCK		"LCK.XQT"
311 #define X_LOCKTIME	3600
312 
313 #define WKDSIZE 100	/*  size of work dir name  */
314 
315 #include <sys/types.h>
316 #ifndef USG
317 #include <sys/timeb.h>
318 #else USG
319 struct timeb
320 {
321 	time_t	time;
322 	unsigned short millitm;
323 	short	timezone;
324 	short	dstflag;
325 };
326 #endif USG
327 
328 extern struct timeb Now;
329 
330 extern int Ifn, Ofn;
331 extern char *Rmtname;
332 extern char User[];
333 extern char Loginuser[];
334 extern char *Spool;
335 extern char Myname[];
336 extern char Myfullname[];
337 extern int Debug;
338 extern int Bspeed;
339 extern char Wrkdir[];
340 extern long Retrytime;
341 extern short Usrf;
342 extern int IsTcpIp;
343 extern char Progname[];
344 extern int (*CU_end)();
345 extern struct condev condevs[];
346 extern int nologinflag;
347 extern char NOLOGIN[];
348 
349 extern	char DLocal[], DLocalX[], *subfile(), *subdir();
350 
351 /* Commonly called routines which return non-int value */
352 extern	char *ttyname(), *strcpy(), *strcat(), *index(), *rindex(),
353 		*fgets(), *calloc(), *malloc(), *fdig(), *ttyname(),
354 		*cfgets();
355 extern	long lseek();
356 extern	FILE *rpopen();
357 
358 extern char _FAILED[], CANTOPEN[], DEVNULL[];
359