# define THEKEY "hellotherekids"
get all the machine dependencies, standard I/O, and the
configuration definitions (LOCAL machine, etc.)
# define min(a,b) (a > b ? b : a)
# define getremote(S) (remtable[(S)-'a'])
/* adjustable parameters, may differ per machine */
# define INITFILE "/usr/net/initfile"
# define SAMPL 3600 /* 1 hour = 3600 */
# define BIGSAMPL 64800L /* 18 hours = 64800L */
/* adjustable parameters, must be same on all machines */
/* MAXFILE is the file size limit. If changed on one machine
but not the others, files bigger than the common minimum will
be flushed with no guarantee of err msgs. Thus if one link
is to be of a different limit than the others, make sure the users
# define MAXFILELARGE 500000L
/* the version of the protocol the network speaks */
/* the time constant added to all time stamps sent around the net */
# define TIMEBASE 282098011L
/* the number of mail forwarding hops allowed before looping is detected */
/* non-adjustable constants */
/* PARMLIST = max size of variable length parm list used in protocol */
/* FNS = max length of file name string */
/* NS = length of UNIX user name*/
/* flags for packet type (pcode) */
/* flags for mach type */
/* codes for cflag, powers of two, max (8 bits - 'a'), others may be added */
/* F_QUIET means send back only error messages and output of programs,
don't send back confimation with no data */
/* F_NONOTIFY means don't send back anything, ever,
even if there are errors (used for responses, etc.) */
at this point bring in the locally-dependent definitions.
this way the above parms may be altered.
/* structure declarations */
/* the chksum is only on a per-perpacket level,
There should be a checksum on the entire file as well.
long shorttime
, longtime
, elaptot
, waittime
, waittot
; /* in secs */
long outime
, ostime
; /* in 60ths sec */
long nbytesent
,nbytercv
, bytetot
; /* in bytes */
int nretrans
, nabnormal
, nloop
;
int ncksum
,npacksent
,npackrcv
;
int nnetcp
,nnetlpr
,nsmail
,nnetmail
,nresp
,nnet
;
int npass
, nsend
, nsendfail
;
char *calloc(), *crypt(), *ctime(), *getenv(), *longname();
char *SnFromUid(), *comptime(), *getpass(), *handlesp(), *SnCurrent();
FILE *mopen(), *fdopen();
struct passwd
*getpwnam(), *getpwuid(), *PwdCurrent(), *getpwent();
struct packet
*getpacket();
extern char *sys_errlist
[];
char remote
, local
; /* must be global, remote is not initialized*/
char netcmd
[],senddir
[], resfile
[], Bsh
[];
char machtype
[], remtable
[];
/* used to pass around info about user */
int muid
; /* combines uid and gid for FUID */
int mgid
; /* unused for FUID */
char force
; /* if true, always prompt for login and pass */
char nonotify
; /* if true, don't send anything back */
char nowrite
; /* if true, mail rather than write to user */
char quiet
; /* if true, only send a response back if rc !=0
or if there is stdout or stderr */
char sTtyname
[20]; /* tty user is on,full name e.g. /dev/tty0 */
char sCmdAct
[BUFSIZ
]; /* the actual command the net will exec */
char sCmdVirt
[BUFSIZ
]; /* the command the user thinks he is getting */
long lTtytime
; /* the time recorded for tty login in utmp */