Archive-Name: uutraf
Submitted-By: (Greg A. Woods) woods@robohack.UUCP
Environment: UUCP on any UNIX


		UUTRAF - UUCP Traffic Analysis and Reporting

OVERVIEW

Uutraf is a program that analyzes the output of uucico log files, and
produces a summary of activity.  It works with both old style UUCP and
AT&T's BNU or HoneyDanBer UUCP.  It requires no special privileges to
execute.  It makes no shell calls.

[ The old-style SYSLOG parsing code for systems other than ULTRIX 4.2
may not work so well just now.... --woods ]

Uutraf is similar to, but more extensive than, the "uusub" utility
that was supplied with AT&T UNIX System V's running the old-style UUCP.

Note that while HDB-UUCP does record a user-name for each transfer,
this user name may be either a local name, or a remote name, and it is
impossible to tell which without knowing which system the request was
originally submitted from (which is only possible by matching up the
PID to the uucico logs, and then tracing back through the uucp and uux
logs for the given system in an attempt to match the job to a request).
As a result, uutraf does not attempt to report statistics by user.


TO COMPILE


Copy the file "externhdr.shar" into the directory where you keep
source for local header files (eg.: ../head), and unshar it.  Then
copy the enclosed header files into your local include directory.

Sysdefs.h in particularly, and libc.h to a lesser extent, may require
modification to suit your local system's compiler environment.
(Please send any changes to the authors, thanks!)

[These header files are used for several projects and are maintained
separately on one of the author's machines.  He recommends you should
update your local include directory should you run across any newer
version(s).  Future patches will also be kept separate for these
files, and may even appear separately from packages that use them.]

[[Also note that if you do not install these header files, along with
dlst.h, in a local include directory, and if you have a non-standard
pre-processor (cpp), you'll likely have to set INCDIR to '.' in the
Makefile and copy dlst.h into the uutraf source directory.]]

Go back to where you unpacked the uutraf shar file.

Copy the file "dlst.shar" into a new sub-directory wherever you keep
the sources for your local libraries (eg.: ../lib/dlst), unshar it and
read the enclosed file "README", then build and install as per the
instructions in the README.  You'll need libdlst.a and dlst.h in
appropriate local places to compile and link uutraf itself.

Go back to where you unpacked the uutraf shar file.

If your system needs strtok(3c) and/or getopt(3c), unshar the file
"externsrc.shar" in the current directory.  [You may wish to use
either the strtok.c from this shar, or the pdstrtok.c included in the
master shar.  Make your decision and rename as appropriate.]

Copy "Makefile-dist" to "Makefile" and edit: SYSTYPE, OPTIM, CFLAGS,
LDFLAGS, LIBS, BIN, and MAN.


NOTES & HINTS:

	- AT&T 3b1 (or UNIX PC, or 7300) are truly just SYSVR2.

	- Some SysVr4's may need both SYSVR4 & _POSIX_SOURCE, though
	  Solaris 2.0 seems to need only SYSVR4 in pure ANSI mode.

	- Beta SysVr4's may need USE_STDLIB too (non-ANSI C compiler,
	  eg. NEC EWS/UP 4800's running UX 4.0 at least up to release
	  5.1, which also needs DUMB_VOID).

	- AIX v3.x users should use _POSIX_SOURCE, and must compile
	  *outside* of the BSD compatibility environment, as that
	  defines _BSD, and makes a real mess of the system include
	  files.

	- SunOS 4.1.2 with acc doesn't like _POSIX_SOURCE either, and
	  also seems to have trouble with __STDC__.  Solaris 2.0
	  [sparc] is happy with just -DSYSVR4.

	- If you're not SYSVR3, you'll need to remove the "-lc_s" (and
	  probably the "-lmalloc" too) from the definition of LIBS, and
	  may want to add in your own systems shared library option,
	  if necessary.

	- SCO UNIX needs SYSVR3 & _POSIX_SOURCE, even though I don't
	  see how it can claim 1003.1 conformance....

	- Modern version of Pyramid OSx (i.e. the old Dual Universe
	  OS) works best if compiled in the "att" universe with
	  -D_POSIX_SOURCE -ZPOSIX -Xt (POSIX & ANSI-C with
	  compatibility).  You'll also have to change the
	  '-L$(LIBDIR)' option in $(LDFLAGS) to '-Wl,-L$(LIBDIR)' to
	  find the right local libraries (i.e.  path to libdlst.a).
	  Also check code surrounded by "#ifdef pyr", especially if
	  you run UUCP over TCP/IP.

	- Older versions of Pyramid OSx may work in the "ucb" universe
	  if compiled with -DBSD, though there may be problems with
	  the typedefs in <sysdefs.h>.  Also check code surrounded by
	  "#ifdef pyr", especially if you run UUCP over TCP/IP.

	- Older systems may need BSDOBJS uncommented.

	- Most versions of the UNIX PCC compiler will need DUMB_VOID.

	- DEBUG, OPTIM, & SDB should be set for defaults, and then
	  modified on the command line for debugging, etc.

Finally, copy "defs.h-dist" to "defs.h" and edit to suit.

We assume "pyr" will be defined on Pyramid OSx machines (you may need
to fix this for DC/OSx, as that one has HDB-UUCP, as it may cause
clashes, since the ifdef'ed code was meant to support Pyramid's weird
idea of identifying TCP transfers in the SYSLOG file).  This code
compiles on both OSx and DC/OSx, but has only been run on a valid data
file on DC/OSx.

We assume either "ultrix" or "__ultrix__" will be defined on ULTRIX
machines.  This code has not actually been compiled on ULTRIX, but the
SYSLOG parsing does work for ULTRIX 4.2 UUCP logs.

If you don't have HoneyDanBer-UUCP, and you're not running ULTRIX 4.2,
you may have to fix some of the parsing in uutraf.c:procfile() to
handle your system's /{usr,var}/spool/uucp/SYSLOG format.  (Please
send changes back to the authors.)

Note:  It seems Taylor-UUCP doesn't have any useful statistics
available yet. 

Once you've tailored Makefile and defs.h, just type "make", and it
should produce an executable called 'uutraf'.

Test!  (Just running it should display current summary.)  If you have
trouble try 'make DEBUG=-DDEBUG SDB=-g OPTIM=' and experiment with
your debugger.

If it runs okay, type "make install clobber".


MANUALS & DOCUMENTATION

The file "uutraf.1" contains the [nt]roff source for a manual page.

If you do not have nroff, I would suggest you track down Henry
Spencer's "awf" from an archive near you.  (It is a minimal nroff
clone written in awk.)  On the other hand, you can easily read the
manual source too!


#ident	"@(#)uutraf:README	1.1.2.7	92/11/08 16:26:00 (woods)"
--
Greg Hackney
Southwestern Bell Telephone Co.
hack@texbell.swbt.com	# no longer valid....
Dallas, Texas

Greg A. Woods
Elegant Communications Inc.
woods@Elegant.COM, woods@robohack.UUCP
Toronto, Ontario

