Problem
How do I set up UUCP over TCP/IP with the Transport Layer Interface?
Solution
The rest of this document assumes knowledge of both UUCP and SCO TCP/IP.
There are several reasons you may wish to configure the (U)nix
to (U)nix (C)o(P)y system, UUCP, over TCP/IP. Some sites do
not provide ftpd or rshd servers, and/or their respective
clients, ftp and rcp. Thus transferring files across a
TCP/IP network is not an option with these systems.
Additionally, some versions of TCP/IP do not provide the
(S)imple (M)ail (T)ransfer (P)rotocol, SMTP, for mail transfer.
In both of these cases, setting up UUCP to use TCP/IP may be an
option to allow both file transfer and exchange of mail between
such systems.In the following paragraphs, the word "client" refers to a system which executes the uucp(C) or uux(C) command, while the term "server" or "listener" refers to a system that responds to a request from a client system.
There are two approaches to configuring UUCP over TCP/IP. They are as follows:
1. The TCP socket interface:The server system uses the inetd superserver to listen for incoming uucp requests on TCP port 540. When receiving a request from a client uucico process, the server system forks the daemon called uucpd, which logs in a user whose "shell" is uucico. The two uucico processes can now transfer information similar to the way they would in a standard serial line configuration. Graphically, if machine bomb20 initiates a uucp connection to the machine terrapin we have the following representa- tion:
bomb20 terrapin
--------- ---------
uucp or uux
|
uucico----------------------------->inetd-->uucpd-->uucico2. The TLI (Transport Layer Interface) method:
The server system uses a process called "listen" to
wait for requests from a predefined TCP port and then
when receiving a request, forks a uucico process directly,
bypassing the standard UUCP login sequence. Graphically,
if machine bomb20 initiates a uucp request to machine
terrapin, we have the following representation: bomb20 terrapin
--------- ---------
uucp or uux
|
uucico----------------------------->listen-->uucicoSCO UNIX System V/386 Release 3.2 Version 4.0 has a uucico(ADM) program
which supports both of the above methods using the "e" protocol. In
the case where two SCO UNIX System V/386 Release 3.2 Version 4.0
systems are involved, the SCO Support Department strongly recommends
use of the first method, although both will work. In the case where
you want to configure an SCO UNIX System V/386 Release 3.2 Version 4.0
system to talk to another vendor's UUCP package over TCP/IP, you will
have to determine which method listed above the other vendor's UUCP
package supports. The SCO Support Department strongly recommends use
of the TCP socket implementation with the "e" protocol whenever
possible, as it is easier to configure and maintain. Note that the uucico(ADM) program supplied with SCO UNIX System V/386
Release 3.2 Version 4.0 supports the "e", "f", "x", and "g" protocols.
The "e" protocol is for use with TCP/IP. Other protocols may
not work
across TCP/IP. See the default /usr/lib/uucp/Systems file for an
explanation of which protocol to use over a particular network.The rest of this document describes configuration of UUCP over
TCP/IP using TLI. For an explanation of configuring UUCP over the
TCP socket interface, see the item in this database entitled:"How to configure UUCP over TCP/IP with the TCP socket interface."
Configuring UUCP over TCP/IP with TLI
=====================================The following steps demonstrate how to configure UUCP over TCP/IP using TLI between the systems bomb20 and terrapin. This explanation assumes that both systems are running SCO UNIX System V/386 Release 3.2 Version 4.0 and SCO TCP/IP. The explanation shows a configuration where the machine bomb20 initiates all UUCP requests, while the machine terrapin listens and responds to all requests. If you want both machines to be able to use the uucp(C) command to initiate a UUCP transaction, repeat the procedure described below twice, exchanging machine names where appropriate.
Before proceeding, verify that SCO TCP/IP is installed and running properly on both machines.
1. Pick a TCP port on which terrapin will listen for incoming UUCP requests. The following example uses port 698. The port chosen should not already appear in the /etc/services file, and should not be port 540.
2. Determine the address on which terrapin will listen for requests. This number is the representation of a sockaddr_in structure as defined in the header file /usr/include/sys/socket.h. This number is a 16 byte number and needs to be constructed both in hexadecimal and in octal. Use of the bc(C) command is helpful here. To construct the number in hexadecimal, take the following steps:
a. The first byte represents the address family. This is always AF_INET, or 02, as defined in the header file /usr/include/sys/socket.h.
b. The second byte is always 00.
c. The third and fourth bytes are the hexadecimal representation of the port on which terrapin listens for UUCP requests. In our case, decimal 698 equals 2ba in hexadecimal, hence the third byte is 02, and the fourth byte is ba.
d. The fifth, sixth, seventh, and eighth bytes represent the hexadecimal equivalent of each octet of the IP number of terrapin. If the IP number of terrapin is 132.147.144.77, then the fifth, sixth, seventh, and eighth bytes are:
84, 93, 90, and 4drespectively.e. The last eight bytes are all 00.
f. Thus, putting it all together, the address constructed is:
02|00|02|ba|84|93|90|4d|00|00|00|00|00|00|00|00for a total of 16 bytes. The "|"s are just for clarity.g. To create the octal representation of the address, convert each hexadecimal byte above into octal:
\002\000\002\272\204\223\220\115\000\000\000\000\000\000\000\0003. Set up the Network Listening Service as follows on terrapin:
a. As root, execute:# nlsadmin -i inet/tcpThis creates the directory /usr/net/nls/inet/tcp, and allows us to add services that listen on the device /dev/inet/tcp.
b. Execute: # nlsadmin -a 101 -c "/usr/lib/uucp/uucico -r0 -iTLI
\
-unuucp" -w uucp -y "TLI UUCP" inet/tcpThis command should be all on one line. (No \). This adds service number 101, which executes the command "/usr/lib/uucp/uucico -r0 -iTLI -unuucp" as the user "uucp", when a request for service number 101 is received on the device /dev/inet/tcp.
The options and arguments to nlsadmin are:
-a 101: Add a service with label 101. (Service code)
-c "/usr/lib/uucp/uucico -r0 -iTLI -unuucp": Fork the command in quotes.
-w uucp: Execute the command given in the -c option as the user "uucp".
-y "TLI UUCP": Commentinet/tcp: This service is to listen on /dev/inet/tcp. This step requires that the command in step 3a has already been executed.
The options to the uucico command in the -c option of nlsadmin are:
-r0: Act in slave mode -iTLI: use the TLI interface -u nuucp: Start up as the user "nuucp". This is different from the -w option in the nlsadmin command.
c. Execute the command:# nlsadmin -l "\x020002ba8493904d0000000000000000" inet/tcpThis is the hexadecimal representation of the address constructed in step 2.
4. Add the following line to /usr/lib/uucp/Systems on terrapin.
bomb20 Never TLI,e AnyIf this line for bomb20 has already been added for TLI so that terrapin can initiate a connection, make no changes to the /usr/lib/uucp/Systems file.
5. Add the following set of lines to /usr/lib/uucp/Permissions on terrapin:
MACHINE=bomb20 LOGNAME=nuucp \
COMMANDS=rmail:rnews:uucp \
READ=/usr/spool/uucppublic:/usr/tmp \
WRITE=/usr/spool/uucppublic:/usr/tmp \
SENDFILES=yes REQUEST=yes6. Add the following line to the /usr/lib/uucp/Systems file on bomb20:
terrapin Any TLI,e Any <address>where <address> is the octal representation of the address constructed in step 2. Thus the line to add is:
terrapin Any TLI,e Any \
\002\000\002\272\204\223\220\115\000\000\000\000\000\000\000\000This should all be on one line, without the first "\". The other "\"s surrounding each octal byte are required.
7. Add the following line to the /usr/lib/uucp/Devices file on bomb20:
TLI inet/tcp - Any TLI \D nls8. Add the following line to the /usr/lib/uucp/Dialers file on bomb20:
nls "" "" NLPS:000:001:101\N\cNote that the "101" specified here matches the service code added with nlsadmin -a in step 3b.
9. Add the following lines to the /usr/lib/uucp/Permissions file on bomb20:
MACHINE=terrapin LOGNAME=nuucp \
COMMANDS=rmail:rnews:uucp \
READ=/usr/spool/uucppublic:/usr/tmp \
WRITE=/usr/spool/uucppublic:/usr/tmp \
SENDFILES=yes REQUEST=yes10. Verify that each machine is listed in the other's /etc/hosts file or resolvable by the nameserver. Add the following lines to the end of the file /etc/rc2.d/S87USRDAEMON on terrapin, so that the listener is started when the system is booted:
nlsadmin -s inet/tcp 2>/dev/null
[ $? = 0 ] && echo "Started listener"11. Shutdown and reboot both systems. Verify that the process called "listen" is running on terrapin. You should now be able to issue uucp requests for terrapin from bomb20.
NOTES: The nlsadmin command generates the following files in the directory /usr/net/nls:
Step 3a. created the directory /usr/net/nls/inet/tcp,
and created files called dbf, addr, and lock
in this directory.Step 3b. added the line:101:n:uucp:reserved:NULL,:/usr/lib/uucp/uucico -r0 -iTLI -uuucp" #TLI UUCPto the dbf file in the directory /usr/net/nls/inet/tcp. See the comments in this file for an explanation of the fields in this entry.
Step 3c. added the line\x020002ba8493904d0000000000000000to the file addr in the directory
/usr/net/nls/inet/tcp.See the manual page nlsadmin(ADM) for more information on the nlsadmin program.
Port numbers greater than 255 are split across two bytes. In our example, the port being used was 698. In the hexadecimal representation, this port was 02|ba, in two bytes. We do a byte by byte conversion to octal. 02 in octal is \002, and ba is \272, hence we have \002\272, not \001\272, which would be a direct conversion from decimal. Port numbers less than 256 should have the first byte in both hexadecimal and octal equal to 0. For example, port 253 is 00|fd in hexadecimal, and \000\375 in octal.
For general UUCP configuration information, see the database
item entitled "How to configure UUCP for SCO UNIX System
V/386."Also, see Chapter 18 of SCO UNIX System V/386 Release 3.2 Version 4.0 Administrator's Guide, "Building a Remote Network with UUCP", or Chapter 13 of the SCO Open Desktop Release 2.0 System Administrator's Guide, also titled: "Building a Remote Network with UUCP".