From: rogerj@cs.cornell.edu (Roger Jagoda)
Subject: CAP 6.0 problems
Organization: Cornell Univ. CS Dept, Ithaca NY 14853
Date: Mon, 13 Apr 1992 21:56:48 GMT

Fellow CAPpers,
 
 I have been struggling for three weeks with the below situation
in a vain attempt to get CAP 6.0 working so our SPARCs can print
to Apple LaserWriters on the MAC side (idea being we just
do NOT have budget to buy new second lasers for the UNIX side)
of our network.

Here's the Hardware:

Sun SPARCs running SunOS 4.1.1 (mostly right off the CD...no patches
					really)
MACintosh Mac OS 6.0.7 (MultiFinder)

SHIVA FastPath (K-STAR 9.1, FastPath Manager 5.3, PROM version 5.1)
CAP Version 6.0 patchlevel 100 (C'mon, shouldn't we just make this 7.0?!)
(we have enabled AppleTalk Phase 2 routing and K-STAR IP)

Here's the Network Layout:



Ethernet       SHIVA Box             Xceivers
===============|||||============##======##======##======
		+                |       |       |
		+                |  AUI cables   |
		+                |       |       |
		+                 (SPARCStations)
		+
		++++LaserWriter
		+
		+
		++++Macintosh II
		+
		+
		+
		(ZoneName is LPSAPPLETALK)

The Plan: Use CAP/papif-papof to allow the UNIX SPARCs
to send PostScript files via lpd to the LWs on the MAC
side.

PROBLEMS: After installing CAP, the getzones, atistest, everything
seems to point to the fact that the SPARCs can't "see" into the MAC
Zones. The plan was to go with IPTalk originally as that seemed easiest.
But that didn't work. After reading this group a bit, we decided that
EtherTalk is the way Apple Intended packets to be put on Ethernet
so we went with that...still had the same problems.


SPECIFICS:

IPTALK attempt:

1) Compiled CAP 6.0pl100. No problems with libraries or
binaries.

We can start /etc/atis, but atistest fails and atis dump doesn't
give what you'd expect:

----------/etc/atalk.local-----------------------

# LPS derivation:
#
#       SHIVA Box: IP addres - 128.84.246.200
#       HOST Address: 128.84.246.xxx 20-diode, 40-solar, 60-zenith
#       AppleTalk Net Number:  246.00 (62976) (Zone=LPSAPPLETALK)
#       IPTalk Net Number: 246.01 (62977) (Zone=LPSIPTALK)
#        (3rd octet of subdomain.0,1)
#
# mynet         mynode          myzone
246.00 60 LPSAPPLETALK
# bridgenet     bridgenode      bridgeIP
246.00 200 128.84.246.200
# nisnet          nisnode
246.00 60
# asyncnet      asynczone
# 170.170               "unimelb Async"


----------/etc/atalk.local-----------------------

We start atis with this command: 

In rc.local:

if [ -d /usr/local/cap -a -f /etc/atalk.local ] ; then
	/usr/local/etc/start-cap-servers
	echo    'Starting AppleTalk Services'   >/dev/console
fi


------------start-cap-servers--------------------------

#
#
LOGd=/usr/tmp
LOGf=/dev/null
CAP=/usr/local/cap
LIB=/usr/local/lib/cap

# ${CAP}/atis
${CAP}/atis -l /usr/adm/cap.log

# sleep 5
sleep 15
 
${CAP}/snitch -S
#


------------start-cap-servers--------------------------

NOTE: We HAVE added the following to our /etc/services table:

at-rmtp         201/udp         at-rtmp         # AppleTalk Routing
at-nbp          202/udp                         # AppleTalk Name Binding
at-3            203/udp                         # AppleTalk Unused
at-echo         204/udp                         # AppleTalk Echo
at-5            205/udp                         # AppleTalk Unused
at-zis          206/udp         at-zis          # AppleTalk Zone
at-7            207/udp                         # AppleTalk Unused
at-8            208/udp                         # AppleTalk Unused
#



The log doesn't show anything unusual:

---------/usr/adm/cap.log----------------------

36 zenith ## cat /usr/adm/cap.log
14:46:32 04/13/92  Reply num max for lkup reply is 5 (based on 104)
14:46:33 04/13/92  pid = 125
37 zenith ##

---------/usr/adm/cap.log----------------------


BUT, atistest claims atis isn't running:

28 zenith ## cd /usr/local/cap
/usr/local/cap
29 zenith ## atistest
CAP distribution 6.00 using UDP encapsulation, January 1991
Copyright (c) 1986,1987,1988 by The Trustees of Columbia University in
the City of New York

abInit: [ddp: 246.01, 60] starting
debugging NBP
Registering "atis test:testing@*"
NBP SndNBP: sending
NBP nbp_timeout: 4 tick timeout on -134220380, 3 remain
NBP SndNBP: sending
NBP nbp_timeout: 4 tick timeout on -134220380, 2 remain
NBP SndNBP: sending
NBP nbp_timeout: 4 tick timeout on -134220380, 1 remain
NBP SndNBP: sending
NBP nbp_timeout: 4 tick timeout on -134220380, 0 remain
NBP SndNBP: sending
NBP nbp_timeout: 4 tick timeout on -134220380, 3 remain
NBP SndNBP: sending
NBP nbp_timeout: 4 tick timeout on -134220380, 2 remain
NBP SndNBP: sending
NBP nbp_timeout: 4 tick timeout on -134220380, 1 remain
NBP SndNBP: sending
NBP nbp_timeout: 4 tick timeout on -134220380, 0 remain
nbp register error because: couldn't register name - is atis running?
30 zenith ## 

ANNNND, getzones fails:

27 zenith ## /usr/local/cap/getzones
error -1096 getting zone list
28 zenith ## 


But of course atis IS running (from ps-auxww | grep atis):

30 zenith ## ps -auxww | grep atis
root       125  0.0  0.0   76    0 ?  IW   14:46   0:00
/usr/local/cap/atis -l /usr/adm/cap.log
root       232  0.0  0.8   32  188 p5 S    14:56   0:00 grep atis
31 zenith ##



Also atlook fails which is strange because
interpoll sees the SHIVA box and all the other
MACs in the Zone: LPSAPPLETALK. We expected atlook to at least
so the SHIVA box, but nope.:

55 zenith ## atlook
abInit: [ddp: 246.01, 60] starting
Looking for =:=@LPSAPPLETALK ...
56 zenith ##

(minimally, it should see the SHIVA box, no?)

From InterPoll:

Inter%Poll

Monday, April 13, 1992 - 3:36 PM

Total Entries:  20
Sorted by: Net
Net     Node    Name    Type    Zone

62976   33      LPS_Theory      Macintosh II    LPSAPPLETALK
62976   33      128.84.246.248  IPADDRESS       LPSAPPLETALK
62976   210     LPS-ADMIN       LaserWriter     LPSAPPLETALK
62976   220     LPSATGW SNMP Agent      LPSAPPLETALK
62976   220     128.84.246.200  IPGATEWAY       LPSAPPLETALK
62976   220     128.84.246.200  IPADDRESS       LPSAPPLETALK
62976   220     LPSATGW FastPath        LPSAPPLETALK
62976   220     LPSATGW SNMP    LPSAPPLETALK


We configured the K-BOX for IPTalk and EtherTalk with FastPath Manager:

LocalTalk Interface:

AppleTalk Zone Name: LPSAPPLETALK
AppleTalk Net Number: 62976
AppleTalk Node Number: 220 <--- Seems to be fixed, can't be changed

IPTalk Config:

Zone Name: LPSAPPLETALK
AppleTalk Network Number: 62976
AppleTalk Node Number: 200  <--- Seems to be fixed, can't be changed.


EtherTalk Config:

Range Start: 500	Range End: 500
ETalk 2.0 Net Number: 500
ETalk 2.0 Node Number: 161  <---- Seems to be fixed, can't be changed

Other notes:
SHIVA Box IP address: 128.84.246.200
LPS-Network broadcast address:  128.84.246.255
Netmask: 255.255.255.0
Default Router: 128.84.246.10



Well, all this failed. So we read the nets (mostly this group!
SHIVA was next to useless as no one there knows squat about
CAP, then again, they claim not to support it, although they
should!), and figured maybe we should try EtherTalk instead.
It seems that there's a debate here. IPTalk was developed
JUST for this, but Apple defines EtherTalk...which to go
with? Well, we didn't know where to get the "enet" services
and patches for SunOS 4.1.1 so we went with /dev/nit interfaces.
(BTW, where DOES one get the ENET files needed for that stuff
on SPARCs...anyone?).

OK, so EtherTalk effort:

We changed the /etc/atalk.local file:

------------------NEW /etc/atalk.local----------------------------

# mynet         mynode          myzone 
500 60 LPSAPPLETALK     
# bridgenet     bridgenode      bridgeIP
500 200 128.84.246.200
# nisnet        nisnode
500 60
# asyncnet      asynczone
# 170.170               "unimelb Async"
41 zenith ## 


------------------NEW /etc/atalk.local----------------------------

And added the aarpd lines to /usr/local/etc/start-cap-servers:

------------------NEW /etc/atalk.local----------------------------


----------------- NEW start-cap-servers---------------------------
#
# /usr/local/cap/aarpd "interface" "zone"
/usr/local/cap/aarpd -l /usr/adm/cap.log le0 LPSAPPLETALK

----------------- NEW start-cap-servers---------------------------

We compiled the whole thing over again with
EtherTalk Native as a choice (kernel EtherTalk doesn't
do phase 2 yet) and went for the /dev/nit interface.
The ONLY compile errors we got were:

From the compiling steps:

(cd support/uab; make)
(cd support/capd; make)
(cd support/ethertalk; make)
   make: Warning: Both `makefile' and `Makefile' exists
   Current working directory
/usr/local/src/RUTGERS/cap60/support/ethertalk
cc -DPHASE2 -O  -target sun4 -c  aarpd.c
cc -DPHASE2 -O  -target sun4 -c  aarpd_svc.c
cc  -o aarpd aarpd.o aarpd_svc.o -lcap
ld: /usr/local/lib/libcap.a(abetalk.o): _GetNodeAddress: multiply
	defined
/usr/local/lib/libcap.a(abetalk.o): _ddp2ipskt: multiply
	 defined
/usr/local/lib/libcap.a(abetalk.o): _abnet_cacheit:
	  multiply defined
/usr/local/lib/libcap.a(abetalk.o): _routeddp: multiply defined
/usr/local/lib/libcap.a(abetalk.o): _abOpen: multiply defined
/usr/local/lib/libcap.a(abetalk.o): _abInit: multiply defined
/usr/local/lib/libcap.a(abetalk.o): _GetBridgeAddress:
		  multiply defined
/usr/local/lib/libcap.a(abetalk.o): _lap_proto: multiply defined
/usr/local/lib/libcap.a(abetalk.o): _abClose: multiply defined
/usr/local/lib/libcap.a(abetalk.o): _SetBridgeAddress: multiply defined

*** Error code 2
	 make: Fatal error: Command failed for target `aarpd'
	  

NOTE: The make still made a binary aarpd so maybe error level 2
is just a warning level???? Dunno? Anyway......


BUT the same problems are cropping up: atistest doesn't
recognize that atis is running. ALSO, /etc/etalk.local, which is made
from seed values in /etc/atalk.local, doesn't seem to make the
correct values:

---------------"made" etalk.local------------------------
38 zenith ## cat /etc/etalk.local
#
# EtherTalk dynamic configuration data
#
# Last update:  Mon Apr 13 17:28:11 1992
#
interface       "le0"
netRangeStart    0.00
netRangeEnd     255.254
thisNet         255.00
thisNode        60
thisZone        "LPSAPPLETALK"
bridgeNet        0.00
bridgeNode      0
bridgeIP        127.0.0.1
nisNet            255.00
nisNode         60
asyncNet         0.00
asyncZone       ""
39 zenith ## 

---------------etalk.local------------------------

It has the IP address of the SHIVA box wrong, the "bridge-node"
wrong...a LOT of things.

AND, atlook STILL doesn't find anything:

46 zenith ## atlook
abInit: [ddp:   1.244, 60] starting
Looking for =:=@LPSAPPLETALK ...
47 zenith ##


Sigh......


So folks, what did we do wrong. After three weeks we hope to just
get a fresh llok from someone who's done it before. After banging
our heads against this, we REALLY don't know what to try next.
Any ideas? Anything at all?????

Thanks a TON for any insights!!

BTW, here's the crucialm4.setup lines, if you read that sort of stuff,
we made no mods.:

--------------------------m4.setup lines--------------------------
   
define(`concat',$1$2$3$4$5$6$7$8$9)
changequote([,])

# os - one of:
#   "bsd" - bsd 4.2, bsd 4.3, ultrix 1.1, acis 4.2,4.3 other
#       "standard" bsd systems without nfs
#   "ultrix12" - Ultrix 1.2
#   "ultrix20" - Ultrix 2.0 or greater
#   "ultrix40" - Ultrix 4.0 or greater
#   "hpux" - HP/UX
#   "aux" - A/UX
#   "uts" - Amdahl UTS
#   "xenix5" - SCO Xenix System V
#   "aix" - IBM AIX System V
#   "pyr" - pyramid (in BSD universe)
#   "sunos" - SunOS
#   "encore" - Encore MultiMax
#   "next" - NeXT/MACH
#   "dynix" - Sequent Balance
#   "irix" - Silicon Graphics IRIS-4D/IRIX
#   "newsos" - Sony NEWS
# Warning: hpux, pyr are hardcoded in some of the makefiles (sorry)

# MAJOR CONFIGURATION
# set to one of the above (or configure your own below)
define([os],[sunos])

# System call configuration (not for system v compatibilty)
# known: X_GETOPT, X_VPRINTF, X_GETMNT, X_STATFS, X_QUOTA,
# X_SUNQUOTA, X_FLOCK, X_LOCKF, X_FCNTLLOCKF
# getopt - "cap: argument processing"
define([X_GETOPT],1)
# getmnt - "aufs: info on file systems (dec)"
# define([X_GETMNT],1)
# statfs - "aufs: info on file systems (sun nfs)"
define([X_STATFS],1)
# quota - "aufs: info on user quota"
# define([X_QUOTA],1)
# getmntent - "aufs: used by sunquota"
define([X_SUNQUOTA],1)
# flock - "afp: file locking"
define([X_FLOCK],1)
# lockf - "afp: byte range locking using unistd.h"
define([X_LOCKF],1)
# lockf - "afp: byte range locking using fcntl.h"
# define([X_FCNTLLOCKF],1)
# vfprintf - "cap: variable arg fprintf"
define([X_VPRINTF],1)
# recvmsg - "cap: lib: scatter gather recv"
# define([X_NORECVMSG],1)
# sendmsg - "cap: lib: scatter gather send"
# define([X_NOSENDMSG],1)
# ffs - "cap: lib: ffs - find first set bit"
# define([X_NOFFS],1)

# GETOPT support
ifdef([X_GETOPT],[],[define([needgetopt],[att_getopt.o])])
# VPRINTF support
ifdef([X_VPRINTF],[define([usevprintf], 1)],[])

# Path to cap sources: useful for testing
define([cwd],[/usr/local/src/RUTGERS/cap60])
# turn on if your system sends packets very quickly
# (see applications/aufs/INSTALLATION)
define([fastether],1) # For papif and samples

# The following selects the correct lap delivery objects
define([lapobj],[abetalk.o abddp.o abnbp.o atalkdbm.o])

# This determines what happens to UAB
define([uabprogs],[])
define([uabplibs],[])
define([uabpobjs],[])

# This sets up Native EtherTalk support
define([etherprogs],[aarpd])
define([etherpobjs],[snitp.o])

# This sets up capd
define([capdprogs],[])
define([capdpobjs],[])

# And this determines if Phase 2 packets are used
define([usephase2],1)

# The following selects byteswapping or otherwise
# define([usebyteswap],1)

# We use the debug flag to restrict CAP to a single directory tree
# define([debug],1)

# Systems with kernel AppleTalk support do not need atis
define([useatis],1)

# uncomment if your param.h includes types.h and types.h doesn't
# prevent itself from being included twice
# define _TYPES
# define([selfdefinetypes],1)
# MINOR CONFIGURATION: configure various programs

#define([columbia],1) # so columbia can do things quickly
#define([rutgers],1) # so rutgers can do things quickly

# location of include files
# define([includedir],[[/usr/include]])
define([includedir],[[/usr/local/include]])
# location of des subroutine source (see lib/afp/README)
define([desloc],[[../../extras]])
# location of atalk.local, etc.
define([etcdest],[[/etc]])
ifdef([columbia],[define([etcdest],[[/usr/local/lib/cap]])])
# location of user cap programs
define([capdestdir],[[/usr/local/cap]])
# location of cap "server" programs (aufs, lwsrv, papif, uab etc.)
define([capsrvrdestdir],[[/usr/local/cap]])
# location of some cap data files
define([caplibdestdir],[[/usr/local/lib/cap]])
ifdef([rutgers],[define([caplibdestdir],[[/usr/local/cap/lib]])])
# location of cap libraries
define([libdestdir],[[/usr/local/lib]])
# override for aux (doesn't search /usr/local/lib)
ifelse(os,[aux],[define([libdestdir],[[/usr/lib]])])
# cap library names
define([caplib],[[libcap.a]])
define([afplib],[[libafp.a]])
define([afpclib],[[libafpc.a]])
# names to load cap libraries with
define([libcap],[[-lcap]])
define([libafp],[[-lafp]])
define([libafpc],[[-lafpc]])
ifelse(os,[encore],
	[define([libcap],concat([-L],libdestdir,[ ],libcap))])
ifelse(os,[encore],
	[define([libafp],concat([-L],libdestdir,[ ],libafp))])
ifelse(os,[encore],
	[define([libafpc],concat([-L],libdestdir,[ ],libafpc))])
ifelse(os,[aix],
	[define([libcap],concat([-L],libdestdir,[ ],libcap))])
ifelse(os,[aix],
	[define([libafp],concat([-L],libdestdir,[ ],libafp))])
ifelse(os,[aix],
	[define([libafpc],concat([-L],libdestdir,[ ],libafpc))])
# any special libraries
define([libspecial],[])
ifelse(os,[ultrix40],[
	define([libspecial],concat(libspecial,[ -lauth]))])
ifelse(os,[xenix5],[
	define([libspecial],concat(libspecial,[ -lsocket]))])
ifelse(os,[uts],[
	define([libspecial],concat(libspecial,[ -lsocket -lbsd -la]))])
ifelse(os,[dynix],[
	define([libspecial],concat(libspecial,[ -lseq]))])
ifelse(os,[irix],[
	define([libspecial],concat(libspecial,[ -lbsd]))])
ifelse(os,[aix],[
	define([libspecial],concat(libspecial,[ -lbsd]))])
ifelse(os,[aux],[
	define([libspecial],concat(libspecial,[ -lat -lbsd]))])
ifelse(os,[hpux],[
	define([libspecial],concat(libspecial,[ -lBSD]))])

#
# special configurations for individual source files
#

#
# Aufs: see applications/aufs/INSTALLATION
#
# WARNING: OS DEPENDENT
# define([smartunixfinderinfo],1)
#
# Set -DNONLXLATE, -DFULL_NCS_SUPPORT, -DGGTYPE="gid_t" or -DNOCHGRPEXEC
#  in m4.features
# Others: USESTATFS, USEGETMNT, USECHOWN, USEQUOTA, USESUNQUOTA
#  are autoconfigured
define([aufsosdefs],[aufsosflags()])

#
# lib/cap/authenticate.c: configuration file
#
define([authconfig],[[\"/etc/cap.auth\"]])

#
# lwsrv: see applications/lwsrv/README
#
# lwflags and simpleflags are now defined in m4.features

#
# lwrename: set name of file containing list of printers to be renamed
#
define([lwrenamefile],concat([\"],caplibdestdir,[/lwrename.list\"]))

#
# papif: see applications/papif/README
#
# uncomment and set to right location to turn on printing "plain text files"
# define([pstextloc],[[\"/usr/local/lib/ps/pstext\"]])
#
# uncomment and set to right location to turn on page reversal
# define([psrevloc],[[\"/usr/local/lib/ps/psrev\"]])
#
# Valid are:
#  -DVERBOSELOG - default (set =0 to turn off)
#  -DNO_STRUCT - default is on (structured)
#  -DNOACCT - default is on (accounting)
#  -DIDLESTUFF - default is off
#  -DSFLOWQ - default is 8 (min 1, max 8)
#  -DRFLOWQ - default is 8 (min 1, max 8)
#  -DATPRESPONSETIMEOUT - default is 120 (2 minutes) - in seconds
#  -DWATCHTIME - default is 10 seconds (in seconds)
#  -DDEBUG - default is off
#  -DSTRIPCONTROLD - default is off
#  -DMAPCRTOLF - default is off
#  -DMACUSER - default is off (need LPD_JOB environment variable in lpd)
#  -DPLP - Use with PLP rather than Berkeley lpd
#  see papif README file for explanations of the above
# The following defines are recommended for System V lp printers (vs. bsd lpd)
#  -DWATCHTIME=0 (no status) -DNOACCT
# define([papflags],[-DMACUSER])
define([papflags],[-DMACUSER -DNOACCT -DSFLOWQ=1])
define([papflags],concat(papflags,[ -DIDLESTUFF]))

# Set -DBANNERFIRST if you want the banner page to come out as the
#  first page instead of the last page 
# Set -DBANNERLAST if want it last
# Set -DPSBANNER if you want a custom PostScipt Banner (must specify
#  short banners in printcap). This still defaults to regular banners
# Add -DCHARGEBANNER if you want to charge the banner page to the user
#  on system V - there is no accounting, so leave blank
# define([papbanner],[-DCHARGEBANNER])
# define([papbanner],[-DCHARGEBANNER])

# for cap.printers - uncomment and change the following line to point
# papif, et. al. to a location other than /etc/cap.printers.  (Note:
# line below would set it to $etcdest/cap.printers)
# define([capprinters],concat([\"],etcdest,[/],[cap.printers],[\"]))
ifdef([columbia],
       [define([capprinters],concat([\"],etcdest,[/],[cap.printers],[\"]))])
# for atalkdbm - allows change following line(s) to modify atalk.local
# (probably shouldn't).  Remember that atalk.local is expected to
# be in etcdest
define([atalklocal],concat([\"],etcdest,[/],[atalk.local],[\"]))
define([etalklocal],concat([\"],etcdest,[/],[etalk.local],[\"]))
define([configdir],concat([\"],etcdest,[\"]))
define([uabpidfile],concat([\"],caplibdestdir,[/],[uab.pid],[\"]))
define([uabbrdescr],concat([\"],caplibdestdir,[/],[bridge_desc],[\"]))

# in case you want to globally change the c compiler
define([thecompiler],[cc])
define([theloader],[ld])
define([theinstaller],[cp])

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#		      END OF CONFIGABLE OPTIONS                            #
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

--------------------------m4.setup lines--------------------------