diff -r -c tcpdump-3.0/Makefile.in tcpdump-3.0-next/Makefile.in
*** tcpdump-3.0/Makefile.in	Fri Jun 17 12:55:54 1994
--- tcpdump-3.0-next/Makefile.in	Sat Aug 13 00:29:33 1994
***************
*** 24,30 ****
  #
  
  # Full pathname of where to install the binaries
! BINDEST = /usr/local/sbin/tcpdump
  # Full pathname of where to install the manual entries
  MANDEST = /usr/local/man/man1/tcpdump.1
  
--- 24,31 ----
  #
  
  # Full pathname of where to install the binaries
! #BINDEST = /usr/local/sbin/tcpdump
! BINDEST = /usr/local/etc/tcpdump
  # Full pathname of where to install the manual entries
  MANDEST = /usr/local/man/man1/tcpdump.1
  
***************
*** 55,61 ****
  #have-solaris#OS_DEFINES = -DSOLARIS
  
  CCOPT = -O
! INCLUDES = -Ilibpcap -I/usr/local/include
  OPTIONAL_DEFINES = $(ETHERS_DEFINES) $(DNET_DEFINES) $(OS_DEFINES)
  DEFINES = $(CSLIP_DEFINES) -DPPP -DFDDI $(OPTIONAL_DEFINES)
  
--- 56,62 ----
  #have-solaris#OS_DEFINES = -DSOLARIS
  
  CCOPT = -O
! INCLUDES = -I. -Ilibpcap -I/usr/local/include
  OPTIONAL_DEFINES = $(ETHERS_DEFINES) $(DNET_DEFINES) $(OS_DEFINES)
  DEFINES = $(CSLIP_DEFINES) -DPPP -DFDDI $(OPTIONAL_DEFINES)
  
***************
*** 154,160 ****
  	    grep -v 'possible pointer alignment problem'
  
  clean:
! 	rm -f $(OBJ) tcpdump $(GEN)
  
  realclean:
  	rm -f $(OBJ) tcpdump $(GEN) md.h os.h libpcap Makefile tags
--- 155,161 ----
  	    grep -v 'possible pointer alignment problem'
  
  clean:
! 	rm -f $(OBJ) tcpdump stdlib.h unistd.h $(GEN)
  
  realclean:
  	rm -f $(OBJ) tcpdump $(GEN) md.h os.h libpcap Makefile tags
diff -r -c tcpdump-3.0/appletalk.h tcpdump-3.0-next/appletalk.h
*** tcpdump-3.0/appletalk.h	Wed Jun 15 12:11:44 1994
--- tcpdump-3.0-next/appletalk.h	Fri Sep  2 17:48:30 1994
***************
*** 133,159 ****
  
  /* Routing Table Maint. Protocol */
  
! #define	rtmpSkt		1	/* number of RTMP socket */
! #define	rtmpSize	4	/* minimum size */
! #define	rtmpTupleSize	3
  
  
  /* Zone Information Protocol */
  
! struct zipHeader {
  	u_char	command;
  	u_char	netcount;
  };
  
! #define	zipHeaderSize	2
! #define	zipQuery	1
! #define	zipReply	2
! #define	zipTakedown	3
! #define	zipBringup	4
! #define	ddpZIP		6
! #define	zipSkt		6
! #define	GetMyZone	7
! #define	GetZoneList	8
  
  /*
   * UDP port range used for ddp-in-udp encapsulation is 16512-16639
--- 133,193 ----
  
  /* Routing Table Maint. Protocol */
  
! #define	rtmpSkt		        1   /* number of RTMP socket */
! #define	rtmpHeaderSize	        4   /* RTMP header size */
! #define	rtmpTupleSize   	3   /* tuple size for non-extended network */
! #define	rtmpTupleExtSize        6   /* tuple size for extended network */
  
+ struct atRtmp {
+   u_short snet;
+   u_char id_length;             /* == 8 */
+   u_char snode;
+ };
+ 
+ struct atRtmpTuple {
+   u_char net[2];
+   u_char distance;
+ };
+ 
+ struct atRtmpTupleExt {
+   u_char net_start[2];
+   u_char distance;
+   u_char net_end[2];
+   u_char version;
+ };
+ 
+ /* Routing Table Maint. Protocol (Request) */
+ 
+ #define	rtmpRequestHeaderSize	1 /* RTMP Request header size */
+ #define rtmpRequest             1
+ #define rtmpRouteDataRequest_2  2
+ #define rtmpRouteDataRequest_3  3
+ 
+ struct atRtmpRequest {
+   u_char command;
+ };
  
  /* Zone Information Protocol */
  
! struct atZip {
  	u_char	command;
  	u_char	netcount;
  };
  
! #define	zipHeaderSize	   2
! #define	zipQuery	   1
! #define	zipReply	   2
! #define	zipTakedown	   3
! #define	zipBringup	   4
! #define zipGetNetInfo      5
! #define zipGetNetInfoReply 6
! #define zipNotify          7
! #define zipExtendedReply   8
! #define	ddpZIP		   6
! #define	zipSkt		   6
! #define	GetMyZone	   7
! #define	GetZoneList	   8
! #define	GetLocalZones	   9
  
  /*
   * UDP port range used for ddp-in-udp encapsulation is 16512-16639
diff -r -c tcpdump-3.0/configure tcpdump-3.0-next/configure
*** tcpdump-3.0/configure	Mon Jun 20 05:53:55 1994
--- tcpdump-3.0-next/configure	Sat Aug 13 00:26:13 1994
***************
*** 31,36 ****
--- 31,48 ----
  	set md=sun3
  	set name=sunos
  	set vers=3
+ else if ( -d /NextApps ) then
+ 	# NEXTSTEP
+ 	set name=nextstep
+ 	if ( -f /usr/bin/arch ) then
+ 		# 'arch' returns "m68k" or "i386" or ...
+ 		set md=next-`/usr/bin/arch`
+ 		set vers=3
+ 	else
+ 		echo "configure: Suppose NEXTSTEP 3.x for m68k."
+ 		set md=next-m68k
+ 		set vers=3
+ 	endif
  else
  	goto bail
  endif
***************
*** 62,67 ****
--- 74,83 ----
  		set md=mips
  		breaksw
  
+ 	case next-m68k:
+ 		set md=next
+ 		breaksw
+ 
  	default:
  		goto bail
  		breaksw
***************
*** 76,88 ****
  if ( -e /dev/bpf0 ) set bpf='-e s/^#have-bpf#//'
  if ( -f /usr/include/net/slip.h ) set cslip='-e s/^#have-cslip#//'
  if ( -f /usr/lib/libdnet.a ) set dnet='-e s/^#have-dnet#//'
! foreach f ( /usr/lib/libc.a /lib/libc.a /usr/lib/libc_s.a )
  	if ( -f $f ) then
  		set libc=$f
  		break
  	endif
  end
! if ( "$f" == "" ) then
  	echo "configure: couldn't find libc"
  else
  	nm $libc | grep ether_ntoa > /dev/null
--- 92,104 ----
  if ( -e /dev/bpf0 ) set bpf='-e s/^#have-bpf#//'
  if ( -f /usr/include/net/slip.h ) set cslip='-e s/^#have-cslip#//'
  if ( -f /usr/lib/libdnet.a ) set dnet='-e s/^#have-dnet#//'
! foreach f ( /usr/lib/libc.a /lib/libc.a /usr/lib/libc_s.a /lib/libsys_s.a )
  	if ( -f $f ) then
  		set libc=$f
  		break
  	endif
  end
! if ( "$libc" == "" ) then
  	echo "configure: couldn't find libc"
  else
  	nm $libc | grep ether_ntoa > /dev/null
***************
*** 95,101 ****
  	set gcc='-e s/^#have-gcc#//'
  endif
  if ( "$name$vers" == "sunos5") set solaris='-e s/^#have-solaris#//'
! if ( ! -f /usr/include/stdlib.h ) ln -s /dev/null stdlib.h
  ln -s md-$md.h md.h
  ln -s os-$os.h os.h
  sed -e "s/^#$md-$os#//" $bpf $cslip $ethers $dnet $gcc $solaris \
--- 111,120 ----
  	set gcc='-e s/^#have-gcc#//'
  endif
  if ( "$name$vers" == "sunos5") set solaris='-e s/^#have-solaris#//'
! if ( ! -f /usr/include/stdlib.h && ! -f /usr/include/ansi/stdlib.h ) \
! 	ln -s /dev/null stdlib.h
! if ( ! -f /usr/include/unistd.h && ! -f /usr/include/bsd/unistd.h ) \
! 	ln -s /dev/null unistd.h
  ln -s md-$md.h md.h
  ln -s os-$os.h os.h
  sed -e "s/^#$md-$os#//" $bpf $cslip $ethers $dnet $gcc $solaris \
diff -r -c tcpdump-3.0/extract.h tcpdump-3.0-next/extract.h
*** tcpdump-3.0/extract.h	Wed Jun 15 12:11:45 1994
--- tcpdump-3.0-next/extract.h	Thu Sep  1 23:57:49 1994
***************
*** 25,49 ****
  #if BYTEORDER == LITTLE_ENDIAN
  #define EXTRACT_SHORT(p)\
  	((u_short)\
! 		((u_short)*((u_char *)p+1)<<8|\
! 		 (u_short)*((u_char *)p+0)<<0))
  #define EXTRACT_LONG(p)\
! 		((u_int32)*((u_char *)p+3)<<24|\
! 		 (u_int32)*((u_char *)p+2)<<16|\
! 		 (u_int32)*((u_char *)p+1)<<8|\
! 		 (u_int32)*((u_char *)p+0)<<0)
  #else
  #define EXTRACT_SHORT(p)\
  	((u_short)\
! 		((u_short)*((u_char *)p+0)<<8|\
! 		 (u_short)*((u_char *)p+1)<<0))
  #define EXTRACT_LONG(p)\
! 		((u_int32)*((u_char *)p+0)<<24|\
! 		 (u_int32)*((u_char *)p+1)<<16|\
! 		 (u_int32)*((u_char *)p+2)<<8|\
! 		 (u_int32)*((u_char *)p+3)<<0)
  #endif
  #else
! #define EXTRACT_SHORT(p)	((u_short)ntohs(*(u_short *)p))
! #define EXTRACT_LONG(p)		(ntohl(*(u_int32 *)p))
  #endif
--- 25,49 ----
  #if BYTEORDER == LITTLE_ENDIAN
  #define EXTRACT_SHORT(p)\
  	((u_short)\
! 		((u_short)*((u_char *)(p)+1)<<8|\
! 		 (u_short)*((u_char *)(p)+0)<<0))
  #define EXTRACT_LONG(p)\
! 		((u_int32)*((u_char *)(p)+3)<<24|\
! 		 (u_int32)*((u_char *)(p)+2)<<16|\
! 		 (u_int32)*((u_char *)(p)+1)<<8|\
! 		 (u_int32)*((u_char *)(p)+0)<<0)
  #else
  #define EXTRACT_SHORT(p)\
  	((u_short)\
! 		((u_short)*((u_char *)(p)+0)<<8|\
! 		 (u_short)*((u_char *)(p)+1)<<0))
  #define EXTRACT_LONG(p)\
! 		((u_int32)*((u_char *)(p)+0)<<24|\
! 		 (u_int32)*((u_char *)(p)+1)<<16|\
! 		 (u_int32)*((u_char *)(p)+2)<<8|\
! 		 (u_int32)*((u_char *)(p)+3)<<0)
  #endif
  #else
! #define EXTRACT_SHORT(p)	((u_short)ntohs(*(u_short *)(p)))
! #define EXTRACT_LONG(p)		(ntohl(*(u_int32 *)(p)))
  #endif
diff -r -c tcpdump-3.0/interface.h tcpdump-3.0-next/interface.h
*** tcpdump-3.0/interface.h	Wed Jun 15 12:21:41 1994
--- tcpdump-3.0-next/interface.h	Sun Aug 28 16:53:55 1994
***************
*** 114,119 ****
--- 114,122 ----
  
  extern void aarp_print(const u_char *, int);
  extern void atalk_print(const u_char *, int);
+ /* ***** Added by S.Adachi (94/08/28) ***** */
+ extern void atalk_kip_print(const u_char *, int);
+ /* ***** */
  extern void bootp_print(const u_char *, int, u_short, u_short);
  extern void decnet_print(const u_char *, int, int);
  extern void egp_print(const u_char *, int, const u_char *);
diff -r -c tcpdump-3.0/print-atalk.c tcpdump-3.0-next/print-atalk.c
*** tcpdump-3.0/print-atalk.c	Tue Jun 21 11:44:37 1994
--- tcpdump-3.0-next/print-atalk.c	Mon Sep  5 23:42:24 1994
***************
*** 76,82 ****
  
  static char tstr[] = "[|atalk]";
  
! static void atp_print(const struct atATP *, int);
  static void atp_bitmap_print(u_char);
  static void nbp_print(const struct atNBP *, int, u_short, u_char, u_char);
  static const char *print_cstring(const char *, const u_char *);
--- 76,82 ----
  
  static char tstr[] = "[|atalk]";
  
! static void atp_print(const struct atATP *, int, u_char, u_char);
  static void atp_bitmap_print(u_char);
  static void nbp_print(const struct atNBP *, int, u_short, u_char, u_char);
  static const char *print_cstring(const char *, const u_char *);
***************
*** 86,104 ****
  static const struct atNBPtuple *nbp_name_print(const struct atNBPtuple *,
  					       const u_char *);
  static const char *ataddr_string(u_short, u_char);
! static void ddp_print(const u_char *, int, int, u_short, u_char, u_char);
  static const char *ddpskt_string(int);
  
  /*
   * Print AppleTalk Datagram Delivery Protocol packets.
   */
  void
  atalk_print(register const u_char *bp, int length)
  {
  	register const struct LAP *lp;
  	register const struct atDDP *dp;
  	register const struct atShortDDP *sdp;
  	u_short snet;
  
  	lp = (struct LAP *)bp;
  	bp += sizeof(*lp);
--- 86,148 ----
  static const struct atNBPtuple *nbp_name_print(const struct atNBPtuple *,
  					       const u_char *);
  static const char *ataddr_string(u_short, u_char);
! static void ddp_print(const u_char *, int, int, u_short, u_char, u_char,
! 		      u_char);
  static const char *ddpskt_string(int);
  
+ static void zip_print(const struct atZip *, int);
+ static const u_char * zip_netnumber_print(register const u_char *,
+ 					  register const u_char *);
+ static const u_char * zip_zonename_print(register const u_char *,
+ 					 register const u_char *);
+ static const u_char * zip_multicast_print(register const u_char *,
+ 					  register const u_char *);
+ static void atp_zip_req_print(register const u_char *, int);
+ static void atp_zip_res_print(register const u_char *, int);
+ static void rtmp_print(const struct atRtmp *, int);
+ static void rtmpRequest_print(const struct atRtmpRequest *, int);
+ static void echo_print(const struct atEcho *, int);
+ 
  /*
   * Print AppleTalk Datagram Delivery Protocol packets.
   */
  void
  atalk_print(register const u_char *bp, int length)
  {
+ 	register const struct atDDP *dp;
+ 	u_short snet;
+ 	int ddp_length;
+ 
+ 	if (length < ddpSize) {
+ 	  (void)printf(" [|ddp %d]", length);
+ 	  return;
+ 	}
+ 	dp = (const struct atDDP *)bp;
+ 	ddp_length = EXTRACT_SHORT(&dp->length) % 1024;
+ 	snet = EXTRACT_SHORT(&dp->srcNet);
+ 	printf("%s.%s", ataddr_string(snet, dp->srcNode),
+ 	       ddpskt_string(dp->srcSkt));
+ 	printf(" > %s.%s:",
+ 	       ataddr_string(EXTRACT_SHORT(&dp->dstNet), dp->dstNode),
+ 	       ddpskt_string(dp->dstSkt));
+ 	bp += ddpSize;
+ 	length -= ddpSize;
+ 	ddp_length -= ddpSize;
+ 	ddp_print(bp, ddp_length,
+ 		  dp->type, snet, dp->srcNode, dp->srcSkt, dp->dstSkt);
+ }
+ 
+ /*
+  * Print AppleTalk Datagram Delivery Protocol packets for KIP.
+  */
+ void
+ atalk_kip_print(register const u_char *bp, int length)
+ {
  	register const struct LAP *lp;
  	register const struct atDDP *dp;
  	register const struct atShortDDP *sdp;
  	u_short snet;
+ 	int ddp_length;
  
  	lp = (struct LAP *)bp;
  	bp += sizeof(*lp);
***************
*** 111,123 ****
  			return;
  		}
  		sdp = (const struct atShortDDP *)bp;
  		printf("%s.%s",
  		    ataddr_string(0, lp->src), ddpskt_string(sdp->srcSkt));
  		printf(" > %s.%s:",
  		    ataddr_string(0, lp->dst), ddpskt_string(sdp->dstSkt));
  		bp += ddpSSize;
  		length -= ddpSSize;
! 		ddp_print(bp, length, sdp->type, 0, lp->src, sdp->srcSkt);
  		break;
  
  	case lapDDP:
--- 155,170 ----
  			return;
  		}
  		sdp = (const struct atShortDDP *)bp;
+ 		ddp_length = EXTRACT_SHORT(&sdp->length) % 1024;
  		printf("%s.%s",
  		    ataddr_string(0, lp->src), ddpskt_string(sdp->srcSkt));
  		printf(" > %s.%s:",
  		    ataddr_string(0, lp->dst), ddpskt_string(sdp->dstSkt));
  		bp += ddpSSize;
  		length -= ddpSSize;
! 		ddp_length -= ddpSize;
! 		ddp_print(bp, ddp_length,
! 			  sdp->type, 0, lp->src, sdp->srcSkt, sdp->dstSkt);
  		break;
  
  	case lapDDP:
***************
*** 126,131 ****
--- 173,179 ----
  			return;
  		}
  		dp = (const struct atDDP *)bp;
+ 		ddp_length = EXTRACT_SHORT(&dp->length) % 1024;
  		snet = EXTRACT_SHORT(&dp->srcNet);
  		printf("%s.%s", ataddr_string(snet, dp->srcNode),
  		    ddpskt_string(dp->srcSkt));
***************
*** 134,140 ****
  		    ddpskt_string(dp->dstSkt));
  		bp += ddpSize;
  		length -= ddpSize;
! 		ddp_print(bp, length, dp->type, snet, dp->srcNode, dp->srcSkt);
  		break;
  
  #ifdef notdef
--- 182,190 ----
  		    ddpskt_string(dp->dstSkt));
  		bp += ddpSize;
  		length -= ddpSize;
! 		ddp_length -= ddpSize;
! 		ddp_print(bp, ddp_length,
! 			  dp->type, snet, dp->srcNode, dp->srcSkt, dp->dstSkt);
  		break;
  
  #ifdef notdef
***************
*** 171,177 ****
  
  		case 2:				/* response */
  			(void)printf("reply %s is-at %s",
! 			    AT(pdaddr), etheraddr_string(ap->hdaddr));
  			return;
  
  		case 3:				/* probe (oy!) */
--- 221,227 ----
  
  		case 2:				/* response */
  			(void)printf("reply %s is-at %s",
! 			    AT(psaddr), etheraddr_string(ap->hsaddr));
  			return;
  
  		case 3:				/* probe (oy!) */
***************
*** 185,201 ****
  
  static void
  ddp_print(register const u_char *bp, register int length, register int t,
! 	  register u_short snet, register u_char snode, u_char skt)
  {
  
  	switch (t) {
  
  	case ddpNBP:
! 		nbp_print((const struct atNBP *)bp, length, snet, snode, skt);
  		break;
  
  	case ddpATP:
! 		atp_print((const struct atATP *)bp, length);
  		break;
  
  	default:
--- 235,268 ----
  
  static void
  ddp_print(register const u_char *bp, register int length, register int t,
! 	  register u_short snet, register u_char snode, u_char sskt,
! 	  u_char dskt)
  {
  
  	switch (t) {
  
  	case ddpNBP:
! 		nbp_print((const struct atNBP *)bp, length, snet, snode, sskt);
  		break;
  
  	case ddpATP:
! 		atp_print((const struct atATP *)bp, length, sskt, dskt);
! 		break;
! 
! 	case ddpZIP:
! 		zip_print((const struct atZip *)bp, length);
! 		break;
! 
! 	case ddpRTMP:
! 		rtmp_print((const struct atRtmp *)bp, length);
! 		break;
! 
! 	case ddpRTMPrequest:
! 		rtmpRequest_print((const struct atRtmpRequest *)bp, length);
! 		break;
! 
! 	case ddpECHO:
! 		echo_print((const struct atEcho *)bp, length);
  		break;
  
  	default:
***************
*** 205,211 ****
  }
  
  static void
! atp_print(register const struct atATP *ap, int length)
  {
  	char c;
  	u_int32 data;
--- 272,279 ----
  }
  
  static void
! atp_print(register const struct atATP *ap, int length,
! 	  u_char sskt, u_char dskt)
  {
  	char c;
  	u_int32 data;
***************
*** 294,299 ****
--- 362,384 ----
  	data = EXTRACT_LONG(&ap->userData);
  	if (data != 0)
  		(void)printf(" 0x%x", data);
+ 
+ 	{
+ 	  const u_char *cp = (u_char *)&ap->userData;
+ 	  length -= sizeof(*ap) - sizeof(ap->userData);
+ 	  switch (ap->control & 0xc0) {
+ 	  case atpReqCode:
+ 	    if (dskt == zipSkt)
+ 	      atp_zip_req_print(cp, length);
+ 	    break;
+ 	  case atpRspCode:
+ 	    if (sskt == zipSkt)
+ 	      atp_zip_res_print(cp, length);
+ 	    break;
+ 	  case atpRelCode:
+ 	    break;
+ 	  }
+ 	}
  }
  
  static void
***************
*** 568,571 ****
--- 653,1039 ----
  		return (buf);
  	}
  	return (tok2str(skt2str, "%d", skt));
+ }
+ 
+ static
+ void zip_print(const struct atZip * zp, int length)
+ {
+   register const u_char *cp = (u_char *)zp + zipHeaderSize;
+   register const u_char *cp1;
+   const u_char *ep = snapend;
+   int i;
+   char c;
+ 
+   length -= zipHeaderSize;
+   if (cp >= ep) {
+     fputs(tstr, stdout);
+     return;
+   }
+   switch (zp->command) {
+   case zipQuery:
+     (void)printf(" zip-query: %d (", zp->netcount);
+     c = 0;
+     for (i = zp->netcount; --i >= 0 && cp; ) {
+       if (c != 0)
+ 	putchar(c);
+       cp = zip_netnumber_print(cp, ep);
+       c = ',';
+     }
+     putchar(')');
+     break;
+   case zipReply:
+   case zipExtendedReply:
+     (void)printf(" %s: %d (",
+ 		 (zp->command == zipReply) ? "zp-reply" : "zip-extendedReply",
+ 		 zp->netcount);
+     c = 0;
+     while(length > 0) {
+       if (c != 0)
+ 	putchar(c);
+       cp1 = zip_netnumber_print(cp, ep);
+       if (cp1 == 0)
+ 	break;
+       length -= cp1 - cp; cp = cp1;
+       putchar(' ');
+       cp1 = zip_zonename_print(cp, ep);
+       if (cp1 == 0)
+ 	break;
+       length -= cp1 - cp; cp = cp1;
+       c = ',';
+     }
+     putchar(')');
+     break;
+   case zipGetNetInfo:
+     (void)printf(" zip-getNetInfo:");
+     cp += 4;
+     zip_zonename_print(cp, ep);
+     break;
+   case zipGetNetInfoReply:
+   case zipNotify:
+     {
+       int inactive_zone_p = zp->netcount & 0x80;
+       int use_broadcast_p = zp->netcount & 0x40;
+       int single_zone_p = zp->netcount & 0x20;
+ 
+       (void)printf(" %s:", (zp->command == zipGetNetInfoReply) ?
+ 		   "zip-getNetInfoReply" : "zip-notify");
+ 
+       c = '[';
+       if (inactive_zone_p) {
+ 	printf("%cinactive_zone", c);
+ 	c = ',';
+       }
+       if (use_broadcast_p) {
+ 	printf("%cuse_broadcast", c);
+ 	c = ',';
+       }
+       if (single_zone_p) {
+ 	printf("%csingle_zone", c);
+ 	c = ',';
+       }
+       if (c != '[')
+ 	putchar(']');
+ 
+       if (zp->command == zipGetNetInfoReply) {
+ 	printf(" net=<");
+ 	cp = zip_netnumber_print(cp, ep);
+ 	if (cp == 0) {
+ 	  putchar('>');
+ 	  break;
+ 	}
+ 	putchar(',');
+ 	cp = zip_netnumber_print(cp, ep);
+ 	putchar('>');
+ 	if (cp == 0)
+ 	  break;
+ 	printf(",zone=");
+ 	cp = zip_zonename_print(cp, ep);
+ 	if (cp == 0)
+ 	  break;
+ 	printf(",multicast=");
+ 	cp = zip_multicast_print(cp, ep);
+ 	if (cp == 0)
+ 	  break;
+ 	if (inactive_zone_p) {
+ 	  printf(",default_zone=");
+ 	  cp = zip_zonename_print(cp, ep);
+ 	}
+       }
+       else {
+ 	cp += 4;
+ 	printf(" old_zone=");
+ 	cp = zip_zonename_print(cp, ep);
+ 	if (cp == 0)
+ 	  break;
+ 	printf(",new_multicast=");
+ 	cp = zip_multicast_print(cp, ep);
+ 	if (cp == 0)
+ 	  break;
+ 	printf(",new_zone=");
+ 	cp = zip_zonename_print(cp, ep);
+       }
+     }
+     break;
+   default:
+     (void)printf(" zip-0x%x  %d (%d)", zp->command, zp->netcount, length);
+     break;
+   }
+ }
+ 
+ static const u_char *
+ zip_netnumber_print(register const u_char *cp, register const u_char *ep)
+ {
+   if (cp + 2 > ep || cp == 0) {
+     fputs(tstr, stdout);
+     return 0;
+   }
+   printf("%d.%d", (int)(*cp), (int)(*(cp + 1)));
+   return cp + 2;
+ }
+ 
+ static const u_char *
+ zip_zonename_print(register const u_char *cp, register const u_char *ep)
+ {
+   int i;
+   if (cp + 1 > ep || cp == 0) {
+     fputs(tstr, stdout);
+     return 0;
+   }
+   i = *cp++;
+   putchar('"');
+   while (--i >= 0) {
+     if (cp < ep)
+       putchar(*cp++);
+     else {
+       fputs(tstr, stdout);
+       putchar('"');
+       return 0;
+     }
+   }
+   putchar('"');
+   return cp;
+ }
+ 
+ static const u_char *
+ zip_multicast_print(register const u_char *cp, register const u_char *ep)
+ {
+   int i;
+   char c;
+   if (cp + 1 > ep || cp == 0) {
+     fputs(tstr, stdout);
+     return 0;
+   }
+   i = *cp++;
+   if (cp + i > ep) {
+     fputs(tstr, stdout);
+     return 0;
+   }
+   c = 0;
+   while (--i >= 0) {
+     if (cp < ep) {
+       if (c != 0)
+ 	putchar(c);
+       printf("%d", (int)(*cp++));
+       c = '.';
+     }
+     else {
+       fputs(tstr, stdout);
+       return 0;
+     }
+   }
+   return cp;
+ }
+ 
+ static void
+ atp_zip_req_print(register const u_char *cp, int length)
+ {
+   u_char command;
+   u_short index;
+   char *command_name;
+   const u_char *ep = snapend;
+ 
+   if (cp + 4 > ep) {
+     fputs(tstr, stdout);
+     return;
+   }
+ 
+   command = *cp;
+   index = EXTRACT_SHORT(cp + 2);
+ 
+   switch (command) {
+   case GetMyZone:
+     command_name = "getMyZone";
+     break;
+   case GetZoneList:
+     command_name = "getZoneList";
+     break;
+   case GetLocalZones:
+     command_name = "getLocalZones";
+     break;
+   default:
+     command_name = "<unknown command>";
+     break;
+   }
+   printf(": zip-%s: index=%d", command_name, (int)index);
+ }
+ 
+ static void
+ atp_zip_res_print(register const u_char *cp, int length)
+ {
+   u_char last_flag;
+   u_short num_zones;
+   int i;
+   char c;
+   const u_char *ep = snapend;
+ 
+   if (cp + 4 > ep) {
+     fputs(tstr, stdout);
+     return;
+   }
+ 
+   last_flag = *cp;
+   num_zones = EXTRACT_SHORT(cp + 2);
+   /* GetZoneListReply or GetLocalZonesReply or GetMyZoneReply */
+   printf(": zip-getZoneReply: last=%d,#zone=%d,zones=(",
+ 	 (int)last_flag, (int)num_zones);
+   cp += 4;
+   length -= 4;
+   c = 0;
+   for (i = num_zones; --i >= 0 && cp; ) {
+     if (c != 0)
+       putchar(c);
+     cp = zip_zonename_print(cp, ep);
+     c = ',';
+   }
+   putchar(')');
+ }
+ 
+ static void
+ rtmp_print(const struct atRtmp *rp, int length)
+ {
+   register const u_char *cp = (u_char *)rp + rtmpHeaderSize;
+   const u_char *ep = snapend;
+   char c;
+   struct atRtmpTuple *rtp;
+ 
+   length -= rtmpHeaderSize;
+   if (cp >= ep) {
+     fputs(tstr, stdout);
+     return;
+   }
+ 
+   (void)printf(" rtmp: sender=%s,",
+ 	       ataddr_string(EXTRACT_SHORT(&rp->snet), rp->snode));
+ 
+   /* Branch according to the network type, non-extened or extended. */
+   rtp = (struct atRtmpTuple *)cp;
+   if (cp + rtmpTupleSize > ep) {
+     fputs(tstr, stdout);
+     return;
+   }
+   if ((rtp->net[0] == 0) && (rtp->net[1] == 0)
+       && (rtp->distance == 0x82)) {
+     /* non-extended netowrk */
+     cp += rtmpTupleSize;
+     length -= rtmpTupleSize;
+     /* Print all tuples. */
+     c = 0;
+     while (length > 0) {
+       rtp = (struct atRtmpTuple *)cp;
+       if (cp + rtmpTupleSize > ep) {
+ 	fputs(tstr, stdout);
+ 	return;
+       }
+       if (c == 0)
+ 	printf("(net,dist)=");
+       else
+ 	putchar(c);
+       if ((rtp->distance & 0x80) != 0) {
+ 	printf("*** mixture extend and non-extended network ? ***");
+ 	return;
+       }
+       printf("(%d.%d,%d)", (int)rtp->net[0], (int)rtp->net[1], 
+ 	     rtp->distance & 0x1f);
+       c = ',';
+       cp += rtmpTupleSize;
+       length -= rtmpTupleSize;
+     }
+   }
+   else if ((rtp->distance & 0x80) != 0) {
+     /* extended network */
+     /* Print all tuples. */
+     c = 0;
+     while (length > 0) {
+       struct atRtmpTupleExt *rtep = (struct atRtmpTupleExt *)cp;
+       if (cp + rtmpTupleExtSize > ep) {
+ 	fputs(tstr, stdout);
+ 	return;
+       }
+       if (c == 0)
+ 	printf("ver=%d,(net,dist)=", rtep->version);
+       else
+ 	putchar(c);
+       if ((rtep->distance & 0x80) == 0) {
+ 	printf("*** mixture extend and non-extended network ? ***");
+ 	return;
+       }
+       printf("(<%d.%d,%d.%d>,%d)",
+ 	     (int)rtep->net_start[0], (int)rtep->net_start[1], 
+ 	     (int)rtep->net_end[0], (int)rtep->net_end[1], 
+ 	     rtep->distance & 0x1f);
+       c = ',';
+       cp += rtmpTupleExtSize;
+       length -= rtmpTupleExtSize;
+     }
+   }
+   else {
+     printf("*** unknown format ***");
+     return;
+   }
+ }
+ 
+ static void
+ rtmpRequest_print(const struct atRtmpRequest *rp, int length)
+ {
+   if ((u_char *)(rp + 1) > snapend) {
+     fputs(tstr, stdout);
+     return;
+   }
+   switch (rp->command) {
+   case rtmpRequest:
+     printf(" rtmp-request");
+     break;
+   case rtmpRouteDataRequest_2:
+     printf(" rtmp-routeDataRequest (2)");
+     break;
+   case rtmpRouteDataRequest_3:
+     printf(" rtmp-routeDataRequest (3)");
+     break;
+   default:
+     printf(" rtmp-#%d %d", rp->command, length);
+     break;
+   }
+ }
+ 
+ static void
+ echo_print(const struct atEcho *ecp, int length)
+ {
+   if ((u_char *)(ecp + 1) > snapend) {
+     fputs(tstr, stdout);
+     return;
+   }
+   length -= echoSize;
+   switch (ecp->echoFunction) {
+   case echoRequest:
+     printf(" echo-request: ");
+     break;
+   case echoReply:
+     printf(" echo-reply: ");
+     break;
+   default:
+     printf(" echo-#%d: ", ecp->echoFunction);
+     break;
+   }
+   if (length != 0)
+     printf("[len=%d]", length);
  }
diff -r -c tcpdump-3.0/print-udp.c tcpdump-3.0-next/print-udp.c
*** tcpdump-3.0/print-udp.c	Sat Jun 11 09:01:43 1994
--- tcpdump-3.0-next/print-udp.c	Sun Aug 28 16:52:35 1994
***************
*** 224,230 ****
  		    (atalk_port(sport) || atalk_port(dport))) {
  			if (vflag)
  				fputs("kip ", stdout);
! 			atalk_print(cp, length);
  			return;
  		}
  	}
--- 224,232 ----
  		    (atalk_port(sport) || atalk_port(dport))) {
  			if (vflag)
  				fputs("kip ", stdout);
! 			/* ***** Modified by S.Adachi (94/08/28) ***** */
! 			/* atalk_print(cp, length); */
! 			atalk_kip_print(cp, length);
  			return;
  		}
  	}
diff -r -c tcpdump-3.0/tcpdump.1 tcpdump-3.0-next/tcpdump.1
*** tcpdump-3.0/tcpdump.1	Tue Jun 21 10:54:32 1994
--- tcpdump-3.0-next/tcpdump.1	Sat Sep  3 00:15:08 1994
***************
*** 936,946 ****
  replies using the transaction ID.  If a reply does not closely follow the
  corresponding request, it might not be parseble.
  .HD
! KIP Appletalk (DDP in UDP)
  .LP
! Appletalk DDP packets encapsulated in UDP datagrams are de-encapsulated
  and dumped as DDP packets (i.e., all the UDP header information is
! discarded).  The file
  .I /etc/atalk.names
  is used to translate appletalk net and node numbers to names.
  Lines in this file have the form
--- 936,947 ----
  replies using the transaction ID.  If a reply does not closely follow the
  corresponding request, it might not be parseble.
  .HD
! Appletalk DDP Packets (KIP and EtherTalk)
  .LP
! Appletalk DDP packets encapsulated in UDP datagrams for KIP are de-encapsulated
  and dumped as DDP packets (i.e., all the UDP header information is
! discarded).  Native Appletalk DDP packets used for EtherTalk are directly
! dumped.  The file
  .I /etc/atalk.names
  is used to translate appletalk net and node numbers to names.
  Lines in this file have the form
***************
*** 991,998 ****
  number \- for this reason it's a good idea to keep node names and
  net names distinct in /etc/atalk.names).
  .LP
! NBP (name binding protocol) and ATP (Appletalk transaction protocol)
! packets have their contents interpreted.  Other protocols just dump
  the protocol name (or number if no name is registered for the
  protocol) and packet size.
  
--- 992,1001 ----
  number \- for this reason it's a good idea to keep node names and
  net names distinct in /etc/atalk.names).
  .LP
! NBP (name binding protocol), ATP (Appletalk transaction protocol)
! packets, ZIP (zone information protocol),
! RTMP (routing table maintenance prorocol) and AEP (Appletalk echo protocol)
! have their contents interpreted.  Other protocols just dump
  the protocol name (or number if no name is registered for the
  protocol) and packet size.
  
***************
*** 1049,1054 ****
--- 1052,1130 ----
  resends them then jssmag.209 releases the transaction.  Finally,
  jssmag.209 initiates the next request.  The `*' on the request
  indicates that XO (`exactly once') was \fInot\fP set.
+ 
+ \fBZIP packets\fP are formatted like the following example:
+ .RS
+ .nf
+ .sp .5
+ \s-2\f(CWringo.zip > 0.0.zip: zip-getNetInfo:"orchard"
+ cronus.zip > ringo.zip: zip-getNetInfoReply: net=<38.1,38.3>,zone="orchard",multicast=9.0.7.0.0.159\fP\s+2
+ .sp .5
+ .fi
+ .RE
+ The first line is a information request for zone orchard
+ broadcasted by host ringo. The second line shows a reply for this request
+ from host cronus, which informs that zone orchard occupies network numbers
+ from 38.1 to 38.3 and uses mutlicast address 9.0.7.0.0.159.
+ 
+ Some ZIP services are implemented on ATP protocol. For these services,
+ the contents of ATP packets are shown as follows:
+ .RS
+ .nf
+ .sp .5
+ \s-2\f(CWwisdom.131 > cronus.zip: atp-req* 60593<0> 0x8000001: zip-getZoneList: index=1
+ cronus.zip > wisdom.131: atp-resp*60593:0 (20) 0x1000003: zip-getZoneReply: last=1,#zone=3,zones=("apnet","solar","orchard")\fP\s+2
+ .sp .5
+ .fi
+ .RE
+ In the first line, host wisdom asks host cronus to send back the list of
+ all zones whose index in the internal table is equal to or greater than 1.
+ In the next line, Host cronus answers that it knows 3 zones apnet, solar
+ and orchard and set the last flag since the answer is contained in this
+ single packet.
+ 
+ \fBRTMP packets\fP are displayed as follows:
+ .RS
+ .nf
+ .sp .5
+ \s-2\f(CWcronus.rtmp > 0.0.rtmp: rtmp: sender=cronus,ver=130,(net,dist)=(<38.1,38.3>,0)\fP\s+2
+ .sp .5
+ .fi
+ .RE
+ In the above example, host cronus broadcasts the information that
+ network range from 38.1 to 38.3 is reached with 0 distance.
+ Namely, it is the local network.
+ 
+ \fBAEP packets\fP are displayed as follows:
+ .RS
+ .nf
+ .sp .5
+ \s-2\f(CWwisdom.132 > ringo.echo: echo-request: [len=24]
+ ringo.echo > wisdom.132: echo-reply: [len=24]\fP\s+2
+ .sp .5
+ .fi
+ .RE
+ In this example, host wisdom send a data of length 24 bytes to host ringo
+ and ask it to echo back the data. Host ringo echos back the data to host wisdom
+ in the next line.
+ 
+ .HD
+ AARP Packets
+ .LP
+ The packets used in Appletalk Address Resolution Protocol (AARP)
+ are displyed as follows:
+ .RS
+ .nf
+ .sp .5
+ \s-2\f(CWaarp who-has wisdom tell ringo
+ aarp reply wisdom is-at 0:0:f:0:ac:2d\fP\s+2
+ .sp .5
+ .fi
+ .RE
+ In the first line, host ringo broadcasts a request for the Ethernet
+ hardware address of host wisdom. In the next line, the reply packet sent to
+ ringo tells that the Ethernet hardware address of wisdom is
+ 0:0:f:0:ac:2d.
  
  .HD
  IP Fragmentation
