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