1*26152Sbloom /* uucp.h 5.11 86/02/12 */ 213632Ssam 318624Sralph #include <stdio.h> 413632Ssam 513632Ssam /* 613632Ssam * Determine local uucp name of this machine. 713632Ssam * Define one of the following: 813632Ssam * 913632Ssam * For UCB 4.1A and later systems, you will have the gethostname(2) call. 1013632Ssam * If this call exists, define GETHOSTNAME. 1113632Ssam * 1213632Ssam * For USG 3.0 and later systems, you will have the uname(2) call. 1313632Ssam * If this call exists, define UNAME. 1413632Ssam * 1513632Ssam * Some systems have a line of the form '#define sysname "myuucpname",' 1613632Ssam * in the file /usr/include/whoami.h, to identify their machine. 1713632Ssam * If your site does that, define WHOAMI. 1813632Ssam * 1913632Ssam * If your site has <whoami.h>, but you do not want to read 2013632Ssam * that file every time uucp runs, you can compile sysname into uucp. 2113632Ssam * This is faster and more reliable, but binaries do not port. 2213632Ssam * If you want to do that, define CCWHOAMI. 2313632Ssam * 2413632Ssam * Some systems put the local uucp name in a single-line file 2513632Ssam * named /etc/uucpname or /local/uucpname. 2613632Ssam * If your site does that, define UUNAME. 2713632Ssam * 2813632Ssam * Systems running 3Com's UNET will have the getmyhname() call. 2913632Ssam * If you want to, define GETMYHNAME. 3013632Ssam * 3117842Sralph * You should also define MYNAME to be your uucp name. 3213632Ssam * 3313632Ssam * For each of the above that are defined, uucp checks them in order. 3413632Ssam * It stops on the first method that returns a non null name. 3513632Ssam * If everything fails, it uses "unknown" for the system name. 3613632Ssam */ 3723681Sbloom #define GETHOSTNAME /**/ 3823681Sbloom /* #define UNAME /**/ 3923681Sbloom /* #define WHOAMI /**/ 4023681Sbloom /* #define CCWHOAMI /**/ 4123681Sbloom /* #define UUNAME /**/ 4223681Sbloom /* #define GETMYHNAME /**/ 4313632Ssam /* If the above fails ... */ 4423681Sbloom #define MYNAME "erehwon" 4513632Ssam 4613632Ssam /* 4713632Ssam * If you have it, include <sysexits.h> to use exit 4813632Ssam * codes that will be understood by sendmail. 4913632Ssam * Otherwise, define EX_NOHOST, EX_CANTCREAT, and EX_NOINPUT. 5013632Ssam */ 5113632Ssam #include <sysexits.h> 5223681Sbloom /*#define EX_NOINPUT 66 /**/ 5323681Sbloom /*#define EX_NOHOST 68 /**/ 5423681Sbloom /*#define EX_CANTCREAT 73 /**/ 5513632Ssam 5613632Ssam /* 5713632Ssam * Define the various kinds of connections to include. 5813632Ssam * The complete list is in the condevs array in condevs.c 5913632Ssam */ 60*26152Sbloom #define ATT2224 /* AT&T 2224 */ 6125269Sbloom #define BSDTCP /* 4.2bsd or 2.9bsd TCP/IP */ 62*26152Sbloom #define CDS224 /* Concord Data Systems 2400 */ 6325269Sbloom /* #define DATAKIT /* ATT's datakit */ 6417872Sralph #define DF02 /* Dec's DF02/DF03 */ 6518624Sralph #define DF112 /* Dec's DF112 */ 6625269Sbloom #define DN11 /* "standard" DEC dialer */ 6717872Sralph #define HAYES /* Hayes' Smartmodem */ 68*26152Sbloom #define HAYES2400 /* Hayes' 2400 baud Smartmodem */ 6925269Sbloom /* #define MICOM /* Micom Mux port */ 7025269Sbloom #define NOVATION /* Novation modem */ 7125269Sbloom #define PAD /* X.25 PAD */ 7218624Sralph #define PENRIL /* PENRIL Dialer */ 7325269Sbloom /* #define PNET /* Purdue network */ 7425269Sbloom #define RVMACS /* Racal-Vadic MACS 820 dialer, 831 adaptor */ 7525269Sbloom /* #define SYTEK /* Sytek Local Area Net */ 7625269Sbloom /* #define UNETTCP /* 3Com's UNET */ 77*26152Sbloom #define USR2400 /* USRobotics Courier 2400 */ 7817872Sralph #define VA212 /* Racal-Vadic 212 */ 7917872Sralph #define VA811S /* Racal-Vadic 811S dialer, 831 adaptor */ 8017842Sralph #define VA820 /* Racal-Vadic 820 dialer, 831 adaptor */ 8125269Sbloom #define VADIC /* Racal-Vadic 345x */ 8225269Sbloom #define VENTEL /* Ventel Dialer */ 8317872Sralph #define VMACS /* Racal-Vadic MACS 811 dialer, 831 adaptor */ 8413632Ssam 85*26152Sbloom #if defined(USR2400) && !defined(HAYES) 86*26152Sbloom #define HAYES 87*26152Sbloom #endif USR2400 && !HAYES 88*26152Sbloom 8917842Sralph #if defined(UNETTCP) || defined(BSDTCP) 9017842Sralph #define TCPIP 9117842Sralph #endif 9217842Sralph 9313632Ssam /* 9425707Sbloom * We need a timer to write slowly to certain modems. 9525707Sbloom * and for generating breaks. 9625707Sbloom * 9723728Sbloom * define INTERVALTIMER to use 4.[23] bsd interval timer. 9813632Ssam * define FASTTIMER if you have the nap() system call. 9913632Ssam * define FTIME if you have the ftime() system call. 10013632Ssam * define BUSYLOOP if you must do a busy loop. 10113632Ssam * Look at uucpdelay() in condevs.c for details. 10213632Ssam */ 10323681Sbloom #define INTERVALTIMER 10425269Sbloom /*#define FASTTIMER /**/ 10525269Sbloom /*#define FTIME /**/ 10625269Sbloom /*#define BUSYLOOP /**/ 10713632Ssam 10813632Ssam /* 10913632Ssam * If your site is using "ndir.h" to retrofit the Berkeley 11013632Ssam * directory reading routines, define NDIR. 11113632Ssam * You will probably also have to set LIBNDIR in Makefile. 11213632Ssam * Otherwise, <dir.h> is assumed to have the Berkeley directory definitions. 11313632Ssam */ 11423681Sbloom /*#define NDIR /**/ 11513632Ssam 11613632Ssam /* 11723681Sbloom * If yours is a BTL system III, IV, V or so-on site, define USG. 11813632Ssam */ 11923681Sbloom /*#define USG /**/ 12013632Ssam 12117842Sralph /* 12223728Sbloom * If you are running 4.3bsd, define BSD4_3 and BSD4_2 12323728Sbloom * If you are just running 4.2bsd, define BSD4_2 124*26152Sbloom * If you are running the BRL version of 4.2BSD define BRL4_2, NOT BSD4_3 12517842Sralph */ 12623728Sbloom #define BSD4_3 /**/ 12723681Sbloom #define BSD4_2 /**/ 128*26152Sbloom /*#define BRL4_2 /**/ 12917842Sralph 130*26152Sbloom #if defined(BRL4_2) && !defined(BSD4_2) 131*26152Sbloom #define BSD4_2 132*26152Sbloom #undef BSD4_3 133*26152Sbloom #endif BRL4_2 134*26152Sbloom 13517842Sralph /* 13623681Sbloom * If you are running 2.9bsd, define BSD2_9 13723681Sbloom */ 13823681Sbloom /*#define BSD2_9 /**/ 13923681Sbloom 14023681Sbloom /* 14117842Sralph * If you are using /etc/inetd with 4.2bsd, define BSDINETD 14217842Sralph */ 14323681Sbloom #define BSDINETD /**/ 14417842Sralph 14523728Sbloom /* 146*26152Sbloom * If you are running 4.3bsd or BRL 4.2, you are running the inetd 14723728Sbloom */ 14823728Sbloom 149*26152Sbloom #if (defined(BSD4_3) || defined(BRL4_2)) && !defined(BSDINETD) 15023728Sbloom #define BSDINETD 151*26152Sbloom #endif (BSD4_3 ||BRL4_2) && !BSDINETD 15223728Sbloom 15317842Sralph /*#define VMSDTR /* Turn on modem control on vms(works DTR) for 15417842Sralph develcon and gandalf ports to gain access */ 15518624Sralph /* 15618624Sralph * If you want to use the same modem for dialing in and out define 15718624Sralph * DIALINOUT to be the localtion of the acucntrl program 15818624Sralph */ 15923681Sbloom /* #define DIALINOUT "/usr/lib/uucp/acucntrl" /**/ 16017842Sralph 16123681Sbloom /* 16223681Sbloom * If you want all ACU lines to be DIALINOUT, define ALLACUINOUT 16323681Sbloom */ 16423681Sbloom /* #define ALLACUINOUT /**/ 16513632Ssam 16613632Ssam /* define the value of WFMASK - for umask call - used for all uucp work files */ 16713632Ssam #define WFMASK 0137 16813632Ssam 16913632Ssam /* define the value of LOGMASK - for LOGFILE, SYSLOG, ERRLOG */ 17023681Sbloom #define LOGMASK 0133 17113632Ssam 17213632Ssam /* All files are given at least the following at the final destination */ 17313632Ssam /* It is also the default mode, so '666' is recommended */ 17413632Ssam /* and 444 is minimal (minimally useful, maximally annoying) */ 17513632Ssam #define BASEMODE 0666 17613632Ssam 17717842Sralph /* 17817842Sralph * Define NOSTRANGERS if you don't want to accept transactions from 17917842Sralph * sites that are not in your L.sys file (see cico.c) 18017842Sralph */ 18123681Sbloom #define NOSTRANGERS /**/ 182*26152Sbloom 18317842Sralph /* 18417842Sralph * Traditionally LCK (lock) files have been kept in /usr/spool/uucp. 18517842Sralph * If you want that define LOCKDIR to be ".". 18625269Sbloom * If you want the locks kept in a subdirectory, define LOCKDIR as "LCK". 18717842Sralph * Good news about LCK. subdirectory: the directory can be mode 777 so 18817842Sralph * unprivileged programs can share the uucp locking system, 18917842Sralph * and the subdirectory keeps down clutter in the main directory. 19017842Sralph * The BAD news: you have to change 'tip' and another programs that 19117842Sralph * know where the LCK files are kept, and you have to change your /etc/rc 19217842Sralph * if your rc cleans out the lock files (as it should). 19317842Sralph */ 19425269Sbloom /*#define LOCKDIR "LCK" /**/ 19523681Sbloom #define LOCKDIR "." /**/ 19613632Ssam 19725269Sbloom /* 19817842Sralph * If you want uucp and uux to copy the data files by default, 19917842Sralph * don't define DONTCOPY (This is the way older 4bsd uucps worked) 20017842Sralph * If you want uucp and uux to use the original files instead of 20117842Sralph * copies, define DONTCOPY (This is the way System III and V work) 20217842Sralph */ 20323681Sbloom #define DONTCOPY /**/ 20417842Sralph 20517842Sralph /* 20618624Sralph * Very few (that I know of) systems use the sequence checking feature. 20717842Sralph * If you are not going to use it (hint: you are not), 20817842Sralph * do not define GNXSEQ. This saves precious room on PDP11s. 20917842Sralph */ 21023681Sbloom /*#define GNXSEQ /* comment this out to save space */ 21117842Sralph 21218624Sralph /* 21318624Sralph * If you want the logfile stored in a file for each site instead 21418624Sralph * of one file 21518624Sralph * define LOGBYSITE as the directory to put the files in 21618624Sralph */ 21723681Sbloom /*#define LOGBYSITE "/usr/spool/uucp/LOG" /**/ 21818624Sralph 21913632Ssam #define XQTDIR "/usr/spool/uucp/XTMP" 22013632Ssam #define SQFILE "/usr/lib/uucp/SQFILE" 22113632Ssam #define SQTMP "/usr/lib/uucp/SQTMP" 22213632Ssam #define SLCKTIME 5400 /* system/device timeout (LCK.. files) */ 22313632Ssam #define SEQFILE "/usr/lib/uucp/SEQF" 22413632Ssam #define SYSFILE "/usr/lib/uucp/L.sys" 22513632Ssam #define DEVFILE "/usr/lib/uucp/L-devices" 22613632Ssam #define DIALFILE "/usr/lib/uucp/L-dialcodes" 22713632Ssam #define USERFILE "/usr/lib/uucp/USERFILE" 22813632Ssam #define CMDFILE "/usr/lib/uucp/L.cmds" 22918624Sralph #define ALIASFILE "/usr/lib/uucp/L.aliases" 23013632Ssam 23113632Ssam #define SPOOL "/usr/spool/uucp" 23213632Ssam #define SYSLOG "/usr/spool/uucp/SYSLOG" 23313632Ssam #define PUBDIR "/usr/spool/uucppublic" 23413632Ssam 235*26152Sbloom #define SQLOCK "SQ" 23625269Sbloom #define SEQLOCK "SEQL" 23713632Ssam #define CMDPRE 'C' 23813632Ssam #define DATAPRE 'D' 23913632Ssam #define XQTPRE 'X' 24013632Ssam 24123681Sbloom #define LOGFILE "/usr/spool/uucp/LOGFILE" 24223681Sbloom #define ERRLOG "/usr/spool/uucp/ERRLOG" 24323681Sbloom #define CMDSDIR "/usr/spool/uucp/C." 24423681Sbloom #define DATADIR "/usr/spool/uucp/D." 24523681Sbloom #define XEQTDIR "/usr/spool/uucp/X." 24613632Ssam 24713632Ssam #define RMTDEBUG "AUDIT" 24817842Sralph #define CORRUPT "CORRUPT" 24913632Ssam #define SQTIME 60 25013632Ssam #define TRYCALLS 2 /* number of tries to dial call */ 25113632Ssam 25217842Sralph #define LLEN 50 25317842Sralph #define MAXRQST 250 25417842Sralph 25513632Ssam #define DEBUG(l, f, s) if (Debug >= l) fprintf(stderr, f, s); else 25613632Ssam 25717842Sralph #define ASSERT(e, s1, s2, i1) if (!(e)) {assert(s1, s2, i1);cleanup(FAIL);}else 25813632Ssam 25925269Sbloom #define delock(dev) rmlock(dev) 26025269Sbloom #define mlock(dev) ulockf(dev, SLCKTIME) 26125269Sbloom 26223681Sbloom #define SAME 0 26323681Sbloom #define ANYREAD 0004 26423681Sbloom #define ANYWRITE 02 26523681Sbloom #define FAIL -1 26623681Sbloom #define SUCCESS 0 26723681Sbloom #define CNULL (char *) 0 26823681Sbloom #define STBNULL (struct sgttyb *) 0 26923681Sbloom #define MASTER 1 27023681Sbloom #define SLAVE 0 27123681Sbloom #define MAXFULLNAME 255 27223681Sbloom #define MAXMSGTIME 45 27323681Sbloom #define NAMESIZE 255 27423681Sbloom #define MAXBASENAME 14 27523681Sbloom #define SYSNSIZE (MAXBASENAME-1-1-1-4) 27623681Sbloom #define EOTMSG "\04\n\04\n" 27723681Sbloom #define CALLBACK 1 27823681Sbloom #define ONEDAY 86400L 27913632Ssam 28013632Ssam /* commands */ 28113632Ssam #define SHELL "/bin/sh" 28217842Sralph #define MAIL "/usr/lib/sendmail" 28313632Ssam #define UUCICO "/usr/lib/uucp/uucico" 28413632Ssam #define UUXQT "/usr/lib/uucp/uuxqt" 28513632Ssam #define UUCP "uucp" 28613632Ssam 28713632Ssam /* call connect fail stuff */ 28813632Ssam #define CF_SYSTEM -1 28913632Ssam #define CF_TIME -2 29013632Ssam #define CF_LOCK -3 29113632Ssam #define CF_NODEV -4 29213632Ssam #define CF_DIAL -5 29313632Ssam #define CF_LOGIN -6 29413632Ssam 29523681Sbloom #define F_NAME 0 29623681Sbloom #define F_TIME 1 29723681Sbloom #define F_LINE 2 29823681Sbloom #define F_CLASS 3 /* an optional prefix and the speed */ 29923681Sbloom #define F_PHONE 4 30023681Sbloom #define F_LOGIN 5 30113632Ssam 30223681Sbloom #define MAXPH 60 /* maximum length of a phone number */ 30313632Ssam 30413632Ssam /* This structure tells how to get to a device */ 30513632Ssam struct condev { 30613632Ssam char *CU_meth; /* method, such as 'ACU' or 'DIR' */ 30713632Ssam char *CU_brand; /* brand, such as 'Hayes' or 'Vadic' */ 30813632Ssam int (*CU_gen)(); /* what to call to search for brands */ 30913632Ssam int (*CU_open)(); /* what to call to open brand */ 31013632Ssam int (*CU_clos)(); /* what to call to close brand */ 31113632Ssam }; 31213632Ssam 31313632Ssam /* This structure tells about a device */ 31413632Ssam struct Devices { 31517842Sralph #define D_type D_arg[0] 31617842Sralph #define D_line D_arg[1] 31717842Sralph #define D_calldev D_arg[2] 31817842Sralph #define D_class D_arg[3] 31917842Sralph #define D_brand D_arg[4] 32017842Sralph #define D_CHAT 5 32117842Sralph int D_numargs; 32217842Sralph int D_speed; 32317842Sralph char *D_arg[20]; 32417842Sralph char D_argbfr[100]; 32513632Ssam }; 32613632Ssam 32713632Ssam /* system status stuff */ 32813632Ssam #define SS_OK 0 32913632Ssam #define SS_NODEVICE 1 33013632Ssam #define SS_CALLBACK 2 33113632Ssam #define SS_INPROGRESS 3 33223681Sbloom #define SS_FAIL 4 33313632Ssam #define SS_BADSEQ 5 33417842Sralph #define SS_WRONGTIME 6 33513632Ssam 33613632Ssam /* fail/retry parameters */ 33723681Sbloom #define RETRYTIME 600 33823681Sbloom #define MAXRECALLS 25 33913632Ssam 34013632Ssam /* stuff for command execution */ 34113632Ssam #define X_RQDFILE 'F' 34213632Ssam #define X_STDIN 'I' 34313632Ssam #define X_STDOUT 'O' 34413632Ssam #define X_CMD 'C' 34513632Ssam #define X_USER 'U' 34613632Ssam #define X_SENDFILE 'S' 34713632Ssam #define X_NONOTI 'N' 34817842Sralph #define X_RETURNTO 'R' 34913632Ssam #define X_NONZERO 'Z' 35025269Sbloom #define X_LOCK "XQT" 35123681Sbloom #define X_LOCKTIME 3600L 35213632Ssam 35323681Sbloom #define WKDSIZE 100 /* size of work dir name */ 35413632Ssam 35518624Sralph #include <sys/types.h> 35618624Sralph #ifndef USG 35718624Sralph #include <sys/timeb.h> 35818624Sralph #else USG 35918624Sralph struct timeb 36018624Sralph { 36118624Sralph time_t time; 36218624Sralph unsigned short millitm; 36318624Sralph short timezone; 36418624Sralph short dstflag; 36518624Sralph }; 36623681Sbloom #define rindex strrchr 36723681Sbloom #define index strchr 36818624Sralph #endif USG 36918624Sralph 37018624Sralph extern struct timeb Now; 37118624Sralph 37213632Ssam extern int Ifn, Ofn; 37318624Sralph extern char *Rmtname; 37413632Ssam extern char User[]; 37513632Ssam extern char Loginuser[]; 37613632Ssam extern char *Spool; 37713632Ssam extern char Myname[]; 37817842Sralph extern char Myfullname[]; 37913632Ssam extern int Debug; 38013632Ssam extern int Bspeed; 38113632Ssam extern char Wrkdir[]; 38223681Sbloom extern time_t Retrytime; 38317842Sralph extern short Usrf; 38417842Sralph extern int IsTcpIp; 38513632Ssam extern char Progname[]; 38613632Ssam extern int (*CU_end)(); 38713632Ssam extern struct condev condevs[]; 38817842Sralph extern char NOLOGIN[]; 38913632Ssam 39017842Sralph extern char DLocal[], DLocalX[], *subfile(), *subdir(); 39113632Ssam 39213632Ssam /* Commonly called routines which return non-int value */ 39313632Ssam extern char *ttyname(), *strcpy(), *strcat(), *index(), *rindex(), 39417842Sralph *fgets(), *calloc(), *malloc(), *fdig(), *ttyname(), 39523681Sbloom *cfgets(), *getwd(), *strpbrk(), *strncpy(); 39613632Ssam extern long lseek(); 39713992Sgray extern FILE *rpopen(); 39823681Sbloom extern time_t time(); 39917842Sralph 40017842Sralph extern char _FAILED[], CANTOPEN[], DEVNULL[]; 40123681Sbloom 40223681Sbloom #ifdef lint 40323681Sbloom /* This horrible gross kludge is the only way I know to 40423681Sbloom * convince lint that signal(SIGINT,SIG_IGN) is legal. It hates SIG_IGN. 40523681Sbloom */ 40623681Sbloom #ifdef SIG_IGN 40723681Sbloom #undef SIG_IGN 40823681Sbloom #endif /* SIG_IGN */ 40923681Sbloom #define SIG_IGN main 41023681Sbloom extern int main(); 41123681Sbloom #ifdef DEBUG 41223681Sbloom #undef DEBUG 41323681Sbloom #endif DEBUG 41423681Sbloom #define DEBUG(a,b,c) 41523681Sbloom #endif /* lint */ 416