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