1 /* @(#)uucp.h 5.17 06/29/90 */ 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 #define BSD4_3 /**/ 113 #define BSD4_2 /**/ 114 /*#define BRL4_2 /**/ 115 116 #if defined(BRL4_2) && !defined(BSD4_2) 117 #define BSD4_2 118 #undef BSD4_3 119 #endif BRL4_2 120 121 /* 122 * If you are using /etc/inetd with 4.2bsd, define BSDINETD 123 */ 124 #define BSDINETD /**/ 125 126 /* 127 * If you are running 4.3bsd or BRL 4.2, you are running the inetd 128 */ 129 130 #if (defined(BSD4_3) || defined(BRL4_2)) && !defined(BSDINETD) 131 #define BSDINETD 132 #endif (BSD4_3 ||BRL4_2) && !BSDINETD 133 134 /*#define VMSDTR /* Turn on modem control on vms(works DTR) for 135 develcon and gandalf ports to gain access */ 136 /* 137 * If you want to use the same modem for dialing in and out define 138 * DIALINOUT to be the localtion of the acucntrl program 139 */ 140 /* #define DIALINOUT "/usr/lib/uucp/acucntrl" /**/ 141 142 /* 143 * If you want all ACU lines to be DIALINOUT, define ALLACUINOUT 144 */ 145 /* #define ALLACUINOUT /**/ 146 147 /* define the value of WFMASK - for umask call - used for all uucp work files */ 148 #define WFMASK 0137 149 150 /* define the value of LOGMASK - for LOGFILE, SYSLOG, ERRLOG */ 151 #define LOGMASK 0133 152 153 /* All files are given at least the following at the final destination */ 154 /* It is also the default mode, so '666' is recommended */ 155 /* and 444 is minimal (minimally useful, maximally annoying) */ 156 #define BASEMODE 0666 157 158 /* 159 * Define NOSTRANGERS if you don't want to accept transactions from 160 * sites that are not in your L.sys file (see cico.c) 161 */ 162 #define NOSTRANGERS /**/ 163 164 /* 165 * Traditionally LCK (lock) files have been kept in /var/spool/uucp. 166 * If you want that define LOCKDIR to be ".". 167 * If you want the locks kept in a subdirectory, define LOCKDIR as "LCK". 168 * Good news about LCK. subdirectory: the directory can be mode 777 so 169 * unprivileged programs can share the uucp locking system, 170 * and the subdirectory keeps down clutter in the main directory. 171 * The BAD news: you have to change 'tip' and another programs that 172 * know where the LCK files are kept, and you have to change your /etc/rc 173 * if your rc cleans out the lock files (as it should). 174 */ 175 /* #define LOCKDIR "LCK" /**/ 176 #define LOCKDIR "." /**/ 177 178 /* 179 * If you want uucp and uux to copy the data files by default, 180 * don't define DONTCOPY (This is the way older 4bsd uucps worked) 181 * If you want uucp and uux to use the original files instead of 182 * copies, define DONTCOPY (This is the way System III and V work) 183 */ 184 #define DONTCOPY /**/ 185 186 /* 187 * Very few (that I know of) systems use the sequence checking feature. 188 * If you are not going to use it (hint: you are not), 189 * do not define GNXSEQ. This saves precious room on PDP11s. 190 */ 191 /*#define GNXSEQ /* comment this out to save space */ 192 193 /* 194 * If you want the logfile stored in a file for each site instead 195 * of one file 196 * define LOGBYSITE as the directory to put the files in 197 */ 198 /* #define LOGBYSITE "/var/spool/uucp/LOG" /**/ 199 200 /* 201 * define USE_SYSLOG if you want error messages to use SYSLOG instead 202 * of being written to /var/spool/log/ERRLOG 203 */ 204 #define USE_SYSLOG /**/ 205 206 /* 207 * If you are doing rebilling and need connect accounting, 208 * define DO_CONNECT_ACCOUNTING to be the accounting file name 209 */ 210 /*#define DO_CONNECT_ACCOUNTING "/var/spool/uucp/CONNECT" /**/ 211 212 #define XQTDIR "/var/spool/uucp/XTMP" 213 #define SQFILE "/usr/lib/uucp/SQFILE" 214 #define SQTMP "/usr/lib/uucp/SQTMP" 215 #define SLCKTIME 5400 /* system/device timeout (LCK.. files) */ 216 #define SEQFILE "/usr/lib/uucp/SEQF" 217 #define SYSFILE "/usr/lib/uucp/L.sys" 218 #define DEVFILE "/usr/lib/uucp/L-devices" 219 #define DIALFILE "/usr/lib/uucp/L-dialcodes" 220 #define USERFILE "/usr/lib/uucp/USERFILE" 221 #define CMDFILE "/usr/lib/uucp/L.cmds" 222 #define ALIASFILE "/usr/lib/uucp/L.aliases" 223 224 #define SPOOL "/var/spool/uucp" 225 #define SYSLOG "/var/spool/uucp/SYSLOG" 226 #define PUBDIR "/var/spool/uucppublic" 227 228 #define SQLOCK "SQ" 229 #define SEQLOCK "SEQL" 230 #define CMDPRE 'C' 231 #define DATAPRE 'D' 232 #define XQTPRE 'X' 233 234 #define LOGFILE "/var/spool/uucp/LOGFILE" 235 #define ERRLOG "/var/spool/uucp/ERRLOG" 236 #define CMDSDIR "/var/spool/uucp/C." 237 #define DATADIR "/var/spool/uucp/D." 238 #define XEQTDIR "/var/spool/uucp/X." 239 240 #define RMTDEBUG "AUDIT" 241 #define CORRUPT "CORRUPT" 242 #define SQTIME 60 243 #define TRYCALLS 2 /* number of tries to dial call */ 244 245 #define LLEN 150 246 #define MAXRQST 250 247 248 #define DEBUG(l, f, s) if (Debug >= l) fprintf(stderr, f, s); else 249 250 #define delock(dev) rmlock(dev) 251 #define mlock(dev) ulockf(dev, SLCKTIME) 252 253 #define SAME 0 254 #define ANYREAD 0004 255 #define ANYWRITE 02 256 #define FAIL -1 257 #define SUCCESS 0 258 #define CNULL (char *) 0 259 #define STBNULL (struct sgttyb *) 0 260 #define MASTER 1 261 #define SLAVE 0 262 #define MAXFULLNAME 255 263 #define MAXMSGTIME 45 264 #define NAMESIZE 255 265 #define MAXBASENAME 14 266 #define SYSNSIZE (MAXBASENAME-1-1-1-4) 267 #define EOTMSG "\04\n\04\n" 268 #define CALLBACK 1 269 #define ONEDAY 86400L 270 271 /* commands */ 272 #define SHELL "/bin/sh" 273 #define MAIL "/usr/lib/sendmail" 274 #define UUCICO "/usr/lib/uucp/uucico" 275 #define UUXQT "/usr/lib/uucp/uuxqt" 276 #define UUCP "uucp" 277 278 /* call connect fail stuff */ 279 #define CF_SYSTEM -1 280 #define CF_TIME -2 281 #define CF_LOCK -3 282 #define CF_NODEV -4 283 #define CF_DIAL -5 284 #define CF_LOGIN -6 285 286 #define F_NAME 0 287 #define F_TIME 1 288 #define F_LINE 2 289 #define F_CLASS 3 /* an optional prefix and the speed */ 290 #define F_PHONE 4 291 #define F_LOGIN 5 292 293 #define MAXPH 60 /* maximum length of a phone number */ 294 295 /* This structure tells how to get to a device */ 296 struct condev { 297 char *CU_meth; /* method, such as 'ACU' or 'DIR' */ 298 char *CU_brand; /* brand, such as 'Hayes' or 'Vadic' */ 299 int (*CU_gen)(); /* what to call to search for brands */ 300 int (*CU_open)(); /* what to call to open brand */ 301 int (*CU_clos)(); /* what to call to close brand */ 302 }; 303 304 /* This structure tells about a device */ 305 struct Devices { 306 #define D_type D_arg[0] 307 #define D_line D_arg[1] 308 #define D_calldev D_arg[2] 309 #define D_class D_arg[3] 310 #define D_brand D_arg[4] 311 #define D_CHAT 5 312 int D_numargs; 313 int D_speed; 314 char *D_arg[20]; 315 char D_argbfr[100]; 316 }; 317 318 /* system status stuff */ 319 #define SS_OK 0 320 #define SS_NODEVICE 1 321 #define SS_CALLBACK 2 322 #define SS_INPROGRESS 3 323 #define SS_FAIL 4 324 #define SS_BADSEQ 5 325 #define SS_WRONGTIME 6 326 327 /* fail/retry parameters */ 328 #define RETRYTIME 600 329 #define MAXRECALLS 25 330 331 /* stuff for command execution */ 332 #define X_RQDFILE 'F' 333 #define X_STDIN 'I' 334 #define X_STDOUT 'O' 335 #define X_CMD 'C' 336 #define X_USER 'U' 337 #define X_SENDFILE 'S' 338 #define X_NONOTI 'N' 339 #define X_RETURNTO 'R' 340 #define X_NONZERO 'Z' 341 #define X_LOCK "XQT" 342 #define X_LOCKTIME 3600L 343 344 #define WKDSIZE 100 /* size of work dir name */ 345 346 #include <sys/types.h> 347 #ifndef USG 348 #include <sys/timeb.h> 349 #else USG 350 struct timeb 351 { 352 time_t time; 353 unsigned short millitm; 354 short timezone; 355 short dstflag; 356 }; 357 #define rindex strrchr 358 #define index strchr 359 #endif USG 360 361 #ifdef BSD4_2 362 #include <syslog.h> 363 #endif /* BSD4_2 */ 364 365 extern struct timeb Now; 366 367 extern int Ifn, Ofn; 368 extern char *Rmtname; 369 extern char User[]; 370 extern char Loginuser[]; 371 extern char *Spool; 372 extern char Myname[]; 373 extern char Myfullname[]; 374 extern int Debug; 375 extern int Bspeed; 376 extern char Wrkdir[]; 377 extern time_t Retrytime; 378 extern short Usrf; 379 extern int IsTcpIp; 380 extern char Progname[]; 381 extern int (*CU_end)(); 382 extern struct condev condevs[]; 383 extern char NOLOGIN[]; 384 385 extern char DLocal[], DLocalX[], *subfile(), *subdir(); 386 387 /* Commonly called routines which return non-int value */ 388 extern char *ttyname(), *strcpy(), *strcat(), *index(), *rindex(), 389 *fgets(), *calloc(), *malloc(), *fdig(), *ttyname(), 390 *cfgets(), *getwd(), *strpbrk(), *strncpy(); 391 extern long lseek(); 392 extern time_t time(); 393 394 extern char _FAILED[], CANTOPEN[], DEVNULL[]; 395 396 #ifdef lint 397 /* This horrible gross kludge is the only way I know to 398 * convince lint that signal(SIGINT,SIG_IGN) is legal. It hates SIG_IGN. 399 */ 400 #ifdef SIG_IGN 401 #undef SIG_IGN 402 #endif /* SIG_IGN */ 403 #define SIG_IGN main 404 extern int main(); 405 #ifdef DEBUG 406 #undef DEBUG 407 #endif DEBUG 408 #define DEBUG(a,b,c) 409 #endif /* lint */ 410