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