The following are diffs to the 4.2 distribution of uucp and tip to make them
able to use the same lines for both dialin in and dialing out.  A program to
do the line-turnaround (acucntrl) is included.  This dialin-dialout mechanism
runs under a vanilla 4.2 BSD kernel.  Similar changes to uucp and tip ran here
when we were running 4.1 BSD. The Vax specificity is in the auxiliary program
acucntrl which enables/disables modem control by poking into /dev/kmem to
change flags in the tty drivers.  Similar things could be done for the tty
drivers of other machines (ideally the kernel would provide an ioctl() to
achieve this function).

This is the third revision of this posting. There were problems in the 
interaction between the diffs and patch.  The diffs are "edited" diffs
because there were many other changes made here to both programs.  Making
edited diffs work for patch involves extremely tedious and error-prone editing
of line numbers.  This time the diffs have been verified to work with patch when
applied to source directly off a 4.2 BSD distribution tape (vintage Nov. 1983).
The patched sources have then been verified to compile correctly.

The version of acucntrl included here is also the latest version of that
program.

We started to use uucp after the dialin lines had been in place for a while.
It would have been very unpopular here to remove one of lines from public use
to let uucp dial out.  The first version of these changes ran here early in
1983.

Having this ability is a very useful way to make full use of your modems. For
one thing, I can smile when a neighoring site complains that their one dialer
is tied up from news backed up to one of their neighbors which has been down
for a while and has just come back up. For another thing some of our neighbors
seem to be reachable better by some modems than by others.  For example, I can
only reach rocky2 with a Racal Vadic.  I have been able to only reach akgua,
burl, and sjuvax with a Hayes.  With our 2400 baud modem I don't have to buy
two 2400 baud modems to have two-way 2400 baud capability.

The key to this is a program is provided in the file acucntrl.c .  This should
be installed suid to root in the file /usr/local/lib/acucntrl . A set of diffs
for tip and uucp are also provided.

uucp notes:
The 3rd field of the L-devices file should contain "inout"  for all devices
intended for dialin/out use.  Devices without the "inout" specification will
be used like before: for dialout only. Changes are included to only disable
dialins on the line once per dialing session (rather than enabling it and
disabling it whenever another site is called).  Also included is the fix to
the nasty TIOCSPGP bug which caused all dialing attempts after the first
unsuccessful one to fail.

tip notes:
tip runs here setgid to uucp.  It assumes that /usr/local/lib/acucntrl is
executable by group uucp (in case you want to restrict general execute
permission on this program).  A change has been included to allow comma
separated entries in the "va" field of the remote file.  This is the field
that specifies the dialer type.  With more dialers available it is more likely
that they will be of different types.  If the number of "va" subfields is less
than the number of "dv" (i.e. device name) fields the device type that of
the last previously specified device.

Example from a past version of our own /etc/remote:
	:dv=/dev/ttyd2,/dev/ttyd1,/dev/ttyd0:at=hayes,vadic:

The first modem /dev/ttyd2 is a hayes.  The second two modems /dev/ttyd1 and
/dev/ttyd0 are vadics.

It is assumed in tip that the dialin/dialout devices have names /dev/ttyd?.
Other names will require modifications in acucntrl and in uucplock.c.

Hopefully, I or someone else will be able to do the equivalent for 4.3 BSD.
I will do it if I can get my hands on a 4.3 BSD system.  Hopefully 4.3 BSD
will provide better hooks to provide these functions than the hooks that
the version of acucntrl used here had to use.

Good luck.  I want to never go back to reserving modems for dialout.

Bill Sebok			Princeton University, Astrophysics
{allegra,akgua,burl,cbosgd,decvax,ihnp4,noao,princeton,vax135}!astrovax!wls
