March 1993

This is an unofficial patch for arns 1.5 to use the VENET1 packet
filter.  You'll need Larry Wall's patch utility to apply it.

cd to the arns source directory, then
	patch -p < arns.patch
-------
Index: Makefile
*** Makefile.orig	Tue Mar  9 00:25:14 1993
--- Makefile
***************
*** 12,17 ****
--- 12,18 ----
  # -DSNITPF 	SUN NIT PF (default)
  # -DUPFILT	ULTRIX PF (default)
  # -DENETPF	ENET PF
+ # -DVENET1PF	VENET1 PF
  #
  # For Sony NEWS OS4.2 or later to allow use of EtherTalk Phase 2
  # CFLAGS=-Dsony_phaseII
***************
*** 22,31 ****
  # For SUN Solaris 2.N, Phase 1 or Phase 2
  # CFLAGS=-DSOLARIS
  #
! # For NeXT
! # CFLAGS=-bsd -O
  # 
! CFLAGS=
  
  all: arns arnsrd
  
--- 23,32 ----
  # For SUN Solaris 2.N, Phase 1 or Phase 2
  # CFLAGS=-DSOLARIS
  #
! # For NeXT, Phase 1 only
! # CFLAGS=-bsd -O -DVENET1PF
  # 
! CFLAGS=-bsd -O -DVENET1PF
  
  all: arns arnsrd
  
Index: arns.c
Prereq: 1.5
*** arns.c.orig	Mon Mar  8 20:10:52 1993
--- arns.c
***************
*** 16,22 ****
   * djh@munnari.OZ.AU
   *
   * $Author: djh $
!  * $Revision: 1.5 $
   *
   */
  
--- 16,22 ----
   * djh@munnari.OZ.AU
   *
   * $Author: djh $
!  * $Revision: 1.5.1 $
   *
   */
  
***************
*** 133,139 ****
  	  }
  	}
  
! #ifdef	sony_news
  #ifndef	sony_phaseII
  	if (phase == 2) {
  	  fprintf(stderr, "Phase 2 is not supported.\n");
--- 133,139 ----
  	  }
  	}
  
! #if defined(sony_news)||defined(VENET1PF)
  #ifndef	sony_phaseII
  	if (phase == 2) {
  	  fprintf(stderr, "Phase 2 is not supported.\n");
Index: pf.c
Prereq: 1.8
*** pf.c.orig	Mon Mar  8 20:11:30 1993
--- pf.c
***************
*** 21,29 ****
   *	Sony NEWS-OS 4.N rawether (RAWETH) [Phase 1 only for 4.0]
   *	Hewlett Packard HP-UX Link Level Access (LLAPF)
   *	AIX Ethernet Device (AIXETH)
   *	
   * $Author: djh $
!  * $Revision: 1.8 $
   *
   */
  
--- 21,30 ----
   *	Sony NEWS-OS 4.N rawether (RAWETH) [Phase 1 only for 4.0]
   *	Hewlett Packard HP-UX Link Level Access (LLAPF)
   *	AIX Ethernet Device (AIXETH)
+  *	SFSU NeXT EtherTalk Phase 1 Protocol Access (VENET1PF)
   *	
   * $Author: djh $
!  * $Revision: 1.8.1 $
   *
   */
  
***************
*** 107,112 ****
--- 108,117 ----
  #include <sys/pfmod.h>
  #endif	DLPIPF
  
+ #ifdef	VENET1PF
+ #include <net/etherdefs.h>
+ #endif	VENET1PF
+ 
  #ifdef	sgi
  #include <net/raw.h>
  #endif	sgi
***************
*** 174,179 ****
--- 179,188 ----
  #define	USE_WRITEV
  #endif	DLPIPF
  
+ #ifdef	VENET1PF
+ #define	USE_WRITEV
+ #endif	VENET1PF
+ 
  #ifdef	sgi
  #define	USE_WRITEV
  #define	USE_GIFADDR
***************
*** 330,335 ****
--- 339,354 ----
  #endif	DLPIPF
  
  
+ #ifdef	VENET1PF
+   if (typ == 2) return(-1);
+   sprintf(device, "/dev/%s", interface);
+   if ((s = open(device, mode)) < 0) {
+     perror(device);
+     return(-1);
+   }
+ #endif	VENET1PF
+ 
+ 
  #ifdef	sgi
    if ((s = rawopen(interface, protocol, typ)) < 0) {
      perror(interface);
***************
*** 478,483 ****
--- 497,506 ----
  #endif	DLPIPF
  
  
+ #ifdef	VENET1PF
+ #endif	VENET1PF
+ 
+ 
  #ifdef	sgi
    if (promisc) {
      ioarg = 1;
***************
*** 551,556 ****
--- 574,584 ----
  #endif	DLPIPF
  
  
+ #ifdef	VENET1PF
+   if (typ != 1 || prot != 0x809b) return(-1);
+ #endif	VENET1PF
+ 
+ 
  #ifdef	USE_ENET
    struct enfilter pf;
    register u_short *fwp = pf.enf_Filter;
***************
*** 849,854 ****
--- 877,892 ----
    }
  #endif	DLPIPF
  
+ #ifdef	VENET1PF
+   bzero((char *)&ifr, sizeof ifr);
+   if (ioctl(s, SIOCGIFADDR, &ifr) < 0) {
+     perror("SIOCGIFADDR");
+     return(-1);
+   }
+   bcopy((char *)((struct ether_header *)&ifr.ifr_addr.sa_data)->ether_shost,
+     (char *)addr, 6);
+ #endif	VENET1PF
+ 
    return(0);
  }
  
***************
*** 1118,1123 ****
--- 1156,1165 ----
    if (phase == 2)
      return(0);
  #endif	sgi
+ 
+ #ifdef	VENET1PF
+   return(0);
+ #endif	VENET1PF
  
    return(1);
  }
Index: clients/Makefile
*** clients/Makefile.orig	Tue Mar  9 00:53:29 1993
--- clients/Makefile
***************
*** 12,18 ****
  # For NeXT
  # CFLAGS=-bsd -O
  # 
! CFLAGS=
  
  LFLAGS=
  PROGS=async
--- 12,18 ----
  # For NeXT
  # CFLAGS=-bsd -O
  # 
! CFLAGS=-bsd -O
  
  LFLAGS=
  PROGS=async
