[comp.protocols.appletalk] Ethernet packet filter and Ethertalk support available for SunOS

hedrick@athos.rutgers.edu (Charles Hedrick) (08/07/90)

A couple of weeks ago I mentioned that I was working on Ethertalk
support for SunOS that worked directly, rather than using UAB.  I've
now got a test version of it available.  It's running on one of our
larger systems, but still hasn't gotten a lot of testing.  So you
should only use it if you want to be a test site.  I don't expect to
see a lot of bugs though, since it's mostly existing code just
repackaged somewhat.

For performance reasons, I prefer to use the Ethernet packet filter to
read and write packets, rather than using /dev/nit as UAB does.  Thus
you will need both a new version of CAP and the Ethernet packet
filter.  The packet filter is taken from the user-contributed software
in 4.3-tahoe.  I modified it slightly to get it to work under SunOS.
In particular, I chose to use an interface that allows it to be
installed even by sites without kernel source.

I've just put the code out for public FTP on athos.rutgers.edu.
You'll want to connect to athos.rutgers.edu, and log in as anonymous.
(Any password will do.)  The files are in a subdirectory called pub.
They are enet.shar and etalk.tar.Z.  Use the "bin" command to
FTP before retrieving etalk.tar.Z, since it's a binary file.

enet.shar should be passed to the shell, e.g.
  sh enet.shar
It will unpack itself in the current directory.  (You'll probably
want to do this in an empty directory.)  It contains source to
the Ethernet packet filter.  README will tell you how to install
it.  README is intended to be complete instructions.

etalk.tar.Z is a new version of the CAP distribution.  It has the same
structure as the usual distribution, and has the old README files.  It
includes binaries for a Sun 4.  Note that this version supports both
IPtalk (the traditional CAP method) and Ethertalk.  The same binaries
are used for both.  The mode is selected at runtime based on
/etc/atalk.local.  For IPtalk, you install it as usual.  For
Ethertalk, you need to do three things:

  - /etc/atalk.local should contain one line, e.g.
      enet0 MyZone
    where enet0 is the name of Ethernet packet filter device 
    corresponding to the network you want to use.  /dev/ is
    prepended, so there better be a /dev/enet0.  MyZone is
    your zone name.

  - create a zero-length file /etc/cap.ether.shared, with
    protection 744.  This is a shared file that will be used
    to communicate among all the CAP software.

  - make sure your startup script runs aarpd before any CAP
    software.  Do not put & after it.  It will wait until it
    has assigned an Appletalk node ID, and then detach from the
    terminal.

  - You should run atis, even if you normally don't need it.
    Atis figures out what network number you are on, and
    maintains the default gateway.

The Ethernet packet filter appears to be finished, and the
distribution is in pretty good shape, with documentation and
README.  The new CAP still has a few rough edges:

  - no documentation for the new features other than this posting,
	though I think the configure scripts, makefiles, etc.
	are updated correctly.

  - the subroutine that opens /dev/enet does not set up a
	filter priority.  This doesn't affect functionality, but
	may affect efficiency.  I just discovered this, but
	didn't want to make changes right before creating a
	version for export.  This will be fixed in the final
	release.

This software will work only under SunOS 4.0.3 or later.  (Actually
the new CAP distribution will work anywhere, but on systems other than
SunOS, the Ethertalk support won't be included.)  I understand someone
has ported the Ethernet packet filter to Ultrix.  If so, an Ultrix
version should be easy to do.  I'd be happy to take back the necessary
changes.  The Ethertalk support currently uses lots of funny system
facilities, including SunOS shared memory (the mmap system call) and
RPC.  If somebody wants to change this to use System V shared memory
and either IPC or simply a Unix-domain socket, that might make it more
portable.  I think some sort of shared memory is needed in order to
keep the default gateway up to date as defined by the Appletalk specs.

Note that I had to add an ioctl to the packet filter, in order to
specify which Ethernet packet types the filter should get.  This is
because of the way Sun did their hooks for external protocol support.
If you use someone else's packet filter implementation (e.g. under
Ultrix or BSD), you'll probably need to modify snitp.c to remove that
ioctl.  The packet filter also includes the Ethernet packet type, so
simply removing the ioctl should be enough.