Patch #: 1 Type: upgrade Priority: none Modification: support operation under AIX and HP-UX Archived: munnari.OZ.AU mac/cap.patches/arns.patch001 Application: 'cd arns; patch -p < arns.patch001' *** Makefile.orig Tue Oct 13 12:01:45 1992 --- Makefile Mon Nov 2 19:54:49 1992 *************** *** 5,10 **** --- 5,26 ---- # djh@munnari.OZ.AU # + # + # Most supported hosts do not require special CFLAG settings + # + # The defines for specific packet filters are + # -DSNITPF SUN NIT PF (default) + # -DUPFILT ULTRIX PF (default) + # -DENETPF ENET PF + # + # For Sony NEWS OS4.2 or later to allow use of EtherTalk Phase 2 + # CFLAGS=-Dsony_phaseII + # + # For IBM RS6000 AIX, Phase 1 or Phase 2 + # CFLAGS=-DAIX + # + CFLAGS= + all: arns arnsrd arns: arns.o pf.o ddp.o aarp.o *************** *** 14,38 **** cc -o arnsrd arnsrd.o arns.o: arns.c arns.h - cc -c arns.c - # For SONY NEWS OS4.2, use the following instead. - # cc -c arns.c -Dsony_phaseII ! # Defines for specific packet filters ! # -DSNITPF SUN NIT PF (default) ! # -DUPFILT ULTRIX PF (default) ! # -DENETPF ENET PF ! # -Dsony_phaseII for SONY NEWS OS4.2 or later ! # - pf.o: pf.c - cc -c pf.c - # For SONY NEWS OS4.2, use the following instead. - # cc -c pf.c -Dsony_phaseII - ddp.o: ddp.c arns.h ! aarp.o: aarp.c arns.h arnsrd.o: arnsrd.c arns.h --- 30,41 ---- cc -o arnsrd arnsrd.o arns.o: arns.c arns.h ! aarp.o: aarp.c arns.h ddp.o: ddp.c arns.h ! pf.o: pf.c arnsrd.o: arnsrd.c arns.h *** README.orig Tue Oct 13 12:32:11 1992 --- README Fri Nov 13 00:29:06 1992 *************** *** 5,10 **** --- 5,11 ---- The University of Melbourne djh@munnari.OZ.AU January, 1992 + version 1.1 ARNS is 'A Remote Network Server' package for AppleTalk that allows a *************** *** 27,37 **** The ARNS server currently supports Phase 1 and Phase 2 EtherTalk networks ! on SUN, DEC ULTRIX, SGI IRIX and Sony NEWS 4.2 workstations, and Phase 1 ! only on Sony NEWS pre-4.2 and HP-UX workstations. Security for access to ! the server is provided with an optional server password and/or username & ! password pair. Access can be restricted to clients that appear on an IP ! address filter list. The server may only be run by a UNIX superuser. ARNS provides specific services on behalf of its connected clients: --- 28,38 ---- The ARNS server currently supports Phase 1 and Phase 2 EtherTalk networks ! on SUN, DEC ULTRIX, SGI IRIX, Sony NEWS 4.2, HP-UX 8.07 and IBM RS6000 AIX ! workstations, and Phase 1 only on Sony NEWS pre-4.2 workstations. Security ! for access to the server is provided with an optional server password and/or ! username & password pair. Access can be restricted to clients that appear ! on an IP address filter list. The server may only be run by a UNIX superuser. ARNS provides specific services on behalf of its connected clients: *************** *** 73,84 **** ARNS SERVER vers 1.1 RESTRICTIONS: The ARNS server has been tested under SunOS 4.1.1, DEC ULTRIX 4.2, SGI IRIX ! 3.3.3 and 4.0.4, Sony NEWS 4.N and HP-UX 8.0. Under ULTRIX 4.N it may be ! necessary to run the command 'pfconfig +copyall '. Additionally, ! to run on Phase 2 networks, you need the appropriate ULTRIX Packet Filter ! patches (the same requirements as for CAP Native EtherTalk). Eventually, ! ARNS should run with the Berkeley Packet Filter on BSD Systems, more work ! needs to be done in this area. It's not currently possible to run ARNS on the same host with CAP in Native EtherTalk mode. To run ARNS on networks where there are no local AppleTalk --- 74,85 ---- ARNS SERVER vers 1.1 RESTRICTIONS: The ARNS server has been tested under SunOS 4.1.1, DEC ULTRIX 4.2, SGI IRIX ! 3.3.3 and 4.0.4, Sony NEWS 4.N, IBM AIX 3.1.5 and HP-UX 8.07. Under ULTRIX ! 4.N it may be necessary to run the command 'pfconfig +copyall '. ! Additionally, to run on Phase 2 networks, you need the appropriate ULTRIX ! Packet Filter patches (the same requirements as for CAP Native EtherTalk). ! Eventually, ARNS should run with the Berkeley Packet Filter on BSD Systems, ! more work needs to be done in this area. It's not currently possible to run ARNS on the same host with CAP in Native EtherTalk mode. To run ARNS on networks where there are no local AppleTalk *************** *** 224,229 **** --- 225,239 ---- the copyright owner. This software is supplied "as is" without express or implied warranty. May not be resold. + + ------------------------ + Notes for IBM AIX users: + + You MUST manually set the define "AIX" in Makefile and clients/Makefile. + + If you use the interfaces named in 'netstat -i' you may receive the message + "en1: A file or directory in the path name does not exist." Instead, use + the network interfaces named "ent0" or "ent1" etc. -------------------------- Notes for Sony NEWS users: *** arns.c.orig Mon Oct 12 14:24:02 1992 --- arns.c Mon Nov 2 19:53:18 1992 *************** *** 16,22 **** * djh@munnari.OZ.AU * * $Author: djh $ ! * $Revision: 1.3 $ * */ --- 16,22 ---- * djh@munnari.OZ.AU * * $Author: djh $ ! * $Revision: 1.4 $ * */ *************** *** 30,35 **** --- 30,36 ---- int debug = 0; /* See arns.h for debug flags */ int promisc = 0; /* Interface non-promiscuous */ int verbose = 0; /* Verbose logging messages */ + int multiopen = 1; /* multiple enet opens allowed */ int users = 0; /* Current active connections */ int maxusers = 20; /* Total possible connections */ *************** *** 76,90 **** extern char *optarg; extern int optind, opterr; struct servent *s, *getservbyname(); ! void readeth(), readaarp(); ! #ifdef sony_news ! void readdev(); ! #endif /* sony_news */ ! #ifdef SYSTYPE_SYSV void readIPFilter(); ! #else /* SYSTYPE_SYSV */ int readIPFilter(); ! #endif /* SYSTYPE_SYSV */ opterr = 0; progname = *argv; --- 77,88 ---- extern char *optarg; extern int optind, opterr; struct servent *s, *getservbyname(); ! void readeth(), readaarp(), readdev(); ! #ifdef SYSTYPE_SYSV void readIPFilter(); ! #else /* SYSTYPE_SYSV */ int readIPFilter(); ! #endif /* SYSTYPE_SYSV */ opterr = 0; progname = *argv; *************** *** 135,148 **** } } ! #ifdef sony_news ! #ifndef sony_phaseII if (phase == 2) { fprintf(stderr, "Phase 2 is not supported.\n"); exit(1); } ! #endif /* sony_phaseII */ ! #endif /* sony_news */ if (maxusers <= 0) { fprintf(stderr, "maxusers set to invalid value (%d)!\n", maxusers); --- 133,146 ---- } } ! #ifdef sony_news ! #ifndef sony_phaseII if (phase == 2) { fprintf(stderr, "Phase 2 is not supported.\n"); exit(1); } ! #endif /* sony_phaseII */ ! #endif /* sony_news */ if (maxusers <= 0) { fprintf(stderr, "maxusers set to invalid value (%d)!\n", maxusers); *************** *** 185,204 **** exit(1); } /* ELAP */ if ((etfd = init_eth(interface, O_RDWR, 0x809b, phase)) < 0) { fprintf(stderr, "%s: failed to open %s\n", progname, interface); exit(1); } ! #ifdef sony_news ! aarpfd = etfd; ! #else /* sony_news */ /* AARP */ ! if ((aarpfd = init_eth(interface, O_RDWR, 0x80f3, phase)) < 0) { ! fprintf(stderr, "%s: failed to open %s\n", progname, interface); ! exit(1); } - #endif /* sony_news */ /* get eth address */ eth_addr(etfd, eaddr); --- 183,204 ---- exit(1); } + multiopen = eth_mopen(phase); + /* ELAP */ if ((etfd = init_eth(interface, O_RDWR, 0x809b, phase)) < 0) { fprintf(stderr, "%s: failed to open %s\n", progname, interface); exit(1); } ! /* AARP */ ! aarpfd = etfd; ! if (multiopen) { ! if ((aarpfd = init_eth(interface, O_RDWR, 0x80f3, phase)) < 0) { ! fprintf(stderr, "%s: failed to open %s\n", progname, interface); ! exit(1); ! } } /* get eth address */ eth_addr(etfd, eaddr); *************** *** 226,232 **** if (!debug) { if (fork()) exit(0); ! #ifdef TIOCNOTTY { int f; if ((f = open("/dev/tty", O_RDWR, 0644)) >= 0) { ioctl(f, TIOCNOTTY, (char *)0); --- 226,232 ---- if (!debug) { if (fork()) exit(0); ! #ifdef TIOCNOTTY { int f; if ((f = open("/dev/tty", O_RDWR, 0644)) >= 0) { ioctl(f, TIOCNOTTY, (char *)0); *************** *** 233,260 **** (void) close(f); } } ! #endif /* TIOCNOTTY */ } for ( ; ; ) { FD_SET(ipfd, &fdset); FD_SET(etfd, &fdset); ! #ifndef sony_news ! FD_SET(aarpfd, &fdset); ! #endif /* sony_news */ if ((res = select(nfds,&fdset,(fd_set *)0,(fd_set *)0,&to)) >= 0) { gettimeofday(&tn, NULL); if (FD_ISSET(ipfd, &fdset)) readip(ipfd); ! #ifdef sony_news ! if (FD_ISSET(etfd, &fdset)) ! readdev(etfd); ! #else /* sony_news */ ! if (FD_ISSET(etfd, &fdset)) ! readeth(etfd); ! if (FD_ISSET(aarpfd, &fdset)) ! readaarp(aarpfd); ! #endif /* sony_news */ if (res == 0 || protTimeout()) process(); } --- 233,259 ---- (void) close(f); } } ! #endif /* TIOCNOTTY */ } for ( ; ; ) { FD_SET(ipfd, &fdset); FD_SET(etfd, &fdset); ! if (multiopen) ! FD_SET(aarpfd, &fdset); if ((res = select(nfds,&fdset,(fd_set *)0,(fd_set *)0,&to)) >= 0) { gettimeofday(&tn, NULL); if (FD_ISSET(ipfd, &fdset)) readip(ipfd); ! if (multiopen) { ! if (FD_ISSET(etfd, &fdset)) ! readeth(etfd); ! if (FD_ISSET(aarpfd, &fdset)) ! readaarp(aarpfd); ! } else { ! if (FD_ISSET(etfd, &fdset)) ! readdev(etfd); ! } if (res == 0 || protTimeout()) process(); } *************** *** 436,442 **** } } - #ifdef sony_news /* * Sony NEWS allows /dev/ether? to be opened once only. * readdev() switches incoming packets to the appropriate input routine. --- 435,440 ---- *************** *** 501,507 **** } } } - #endif /* sony_news */ /* * read an ELAP packet from the net --- 499,504 ---- *************** *** 871,885 **** * */ ! #ifdef SYSTYPE_SYSV /*ARGSUSED*/ void readIPFilter(num) int num; ! #else /* SYSTYPE_SYSV */ int readIPFilter() ! #endif /* SYSTYPE_SYSV */ { needIPFilter = 1; } --- 868,882 ---- * */ ! #ifdef SYSTYPE_SYSV /*ARGSUSED*/ void readIPFilter(num) int num; ! #else /* SYSTYPE_SYSV */ int readIPFilter() ! #endif /* SYSTYPE_SYSV */ { needIPFilter = 1; } *** arns.h.orig Mon Oct 12 14:25:17 1992 --- arns.h Mon Nov 2 19:54:24 1992 *************** *** 16,22 **** * djh@munnari.OZ.AU * * $Author: djh $ ! * $Revision: 1.2 $ * */ --- 16,22 ---- * djh@munnari.OZ.AU * * $Author: djh $ ! * $Revision: 1.3 $ * */ *************** *** 25,40 **** #include #include #include ! #ifdef ultrix #include ! #else /* ultrix */ #include ! #endif /* ultrix */ #include #include ! #ifndef sony_news #include ! #endif /* sony_news */ #include #include #include --- 25,43 ---- #include #include #include ! #if defined (ultrix) || defined (AIX) #include ! #else /* ultrix || AIX */ #include ! #endif /* ultrix || AIX */ ! #ifdef AIX ! #include ! #endif /* AIX */ #include #include ! #ifndef sony_news #include ! #endif /* sony_news */ #include #include #include *** pf.c.orig Tue Oct 13 12:08:07 1992 --- pf.c Fri Nov 13 00:06:54 1992 *************** *** 17,27 **** * DEC ULTRIX Packet Filter (UPFILT) * Stanford Ethernet Packet Filter (ENETPF) * SGI IRIX SNOOP PF for promisc & Phase 2, DRAIN PF non-promisc - * Hewlett Packard HP-UX Link Level Access (LLAPF) [Phase 1 only] * Sony NEWS-OS 4.N rawether (RAWETH) [Phase 1 only for 4.0] * * $Author: djh $ ! * $Revision: 1.4 $ * */ --- 17,28 ---- * DEC ULTRIX Packet Filter (UPFILT) * Stanford Ethernet Packet Filter (ENETPF) * SGI IRIX SNOOP PF for promisc & Phase 2, DRAIN PF non-promisc * 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.7 $ * */ *************** *** 43,48 **** --- 44,53 ---- #define RAWETH #endif sony_news + #ifdef AIX + #define AIXETH + #endif AIX + #include #include #include *************** *** 95,100 **** --- 100,112 ---- #endif sony_phaseII #endif RAWETH + #ifdef AIXETH + #include + #include + #include + #include + #endif AIXETH + #include #include #include *************** *** 140,145 **** --- 152,160 ---- #ifdef RAWETH #endif RAWETH + #ifdef AIXETH + #endif AIXETH + #ifdef hpux int ethtyp; #endif hpux *************** *** 237,242 **** --- 252,266 ---- } #endif RAWETH + + #ifdef AIXETH + sprintf(device, "/dev/%s", interface); + if ((s = open(device, O_RDWR)) < 0) { + perror(interface); + return(-1); + } + #endif AIXETH + /* * set filter for protocol and type (IPTalk, Phase 1/2) * *************** *** 362,367 **** --- 386,395 ---- #ifdef RAWETH #endif RAWETH + + #ifdef AIXETH + #endif AIXETH + return(s); } *************** *** 518,537 **** #ifdef hpux { struct fis fis; ! if (typ == 1) { ! fis.reqtype = LOG_TYPE_FIELD; ! fis.vtype = INTEGERTYPE; ! fis.value.i = prot; /* htons() ?? */ if (ioctl(s, NETCTRL, &fis) < 0) { ! perror("LOG_TYPE_FIELD"); return(-1); } } else { ! fis.reqtype = LOG_SSAP; fis.vtype = INTEGERTYPE; ! fis.value.i = 0xaa; if (ioctl(s, NETCTRL, &fis) < 0) { ! perror("LOG_SSAP"); return(-1); } } --- 546,568 ---- #ifdef hpux { struct fis fis; ! if (typ == 2) { ! /* Tor Lillqvist */ ! static unsigned char elap_snap[5] = { 0x08, 0x00, 0x07, 0x80, 0x9b }; ! static unsigned char aarp_snap[5] = { 0x00, 0x00, 0x00, 0x80, 0xf3 }; ! fis.reqtype = LOG_SNAP_TYPE; ! fis.vtype = 5; ! bcopy((prot == 0x809b) ? elap_snap : aarp_snap, fis.value.s, 5); if (ioctl(s, NETCTRL, &fis) < 0) { ! perror("LOG_SNAP_TYPE"); return(-1); } } else { ! fis.reqtype = LOG_TYPE_FIELD; fis.vtype = INTEGERTYPE; ! fis.value.i = prot; if (ioctl(s, NETCTRL, &fis) < 0) { ! perror("LOG_TYPE_FIELD"); return(-1); } } *************** *** 547,552 **** --- 578,605 ---- } #endif RAWETH + + #ifdef AIXETH + { struct session_blk sblk; + + if (typ == 2) { + sblk.length = 1; + sblk.netid = 0xaa; + if (ioctl(s, CIO_START, &sblk) < 0) { + perror("CIO_START"); + return(-1); + } + } else { + sblk.length = 2; + sblk.netid = prot; + if (ioctl(s, CIO_START, &sblk) < 0) { + perror("CIO_START"); + return(-1); + } + } + } + #endif AIXETH + return(0); } *************** *** 608,613 **** --- 661,678 ---- } #endif RAWETH + + #ifdef AIXETH + { struct devinfo info; + + if (ioctl(s, IOCINFO, &info) < 0) { + perror("IOCINFO"); + return(-1); + } + bcopy(info.un.ethernet.haddr, addr, 6); + } + #endif AIXETH + return(0); } *************** *** 690,699 **** --- 755,798 ---- close(sock); #endif /* sony_phaseII */ + + #ifdef AIXETH + { ent_set_multi_t ent; + + ent.opcode = ENT_ADD; + bcopy(addr, ent.multi_addr, 6); + if (ioctl(s, ENT_SET_MULTI, &ent) < 0) { + perror("ENT_SET_MULTI"); + return(-1); + } + } + #endif AIXETH + return(0); } /* + * return 1 if ethernet interface capable of multiple opens + * + */ + + int + eth_mopen(phase) + int phase; + { + #ifdef sony_news + return(0); + #endif sony_news + + #ifdef AIXETH + if (phase == 2) + return(0); + #endif AIXETH + + return(1); + } + + /* * read a packet * */ *************** *** 742,748 **** struct fis fis; int cc, off; ! off = (ethtyp == 1) ? 14 : 17; if ((cc = read(fd, buf+off, len-off)) <= 0) return(cc); fis.reqtype = FRAME_HEADER; --- 841,847 ---- struct fis fis; int cc, off; ! off = (ethtyp == 1) ? 14 : 22; if ((cc = read(fd, buf+off, len-off)) <= 0) return(cc); fis.reqtype = FRAME_HEADER; *************** *** 803,809 **** struct fis fis; int off; ! off = (ethtyp == 1) ? 14 : 17; fis.reqtype = LOG_DEST_ADDR; fis.vtype = 6; bcopy(buf, fis.value.s, 6); --- 902,908 ---- struct fis fis; int off; ! off = (ethtyp == 1) ? 14 : 22; fis.reqtype = LOG_DEST_ADDR; fis.vtype = 6; bcopy(buf, fis.value.s, 6); *************** *** 821,826 **** --- 920,934 ---- if (write(fd, buf, length) == length) return(len); #endif RAWETH + + + #ifdef AIXETH + int length; + + length = (len < 60) ? 60 : len; + if (write(fd, buf, length) == length) + return(len); + #endif AIXETH return(-1); } *** clients/Makefile.orig Mon Sep 21 17:19:38 1992 --- clients/Makefile Mon Nov 2 19:55:01 1992 *************** *** 6,12 **** --- 6,16 ---- # # + # For IBM RS6000 AIX + # CFLAGS=-DAIX + # CFLAGS= + LFLAGS= PROGS=async DESTDIR=/usr/local/cap *** clients/README.orig Tue Oct 13 12:22:08 1992 --- clients/README Fri Nov 13 00:05:15 1992 *************** *** 17,24 **** ARNS remote clients are currently: ! 1. Asynchronous AppleTalk for UNIX, version 2.0 ! 2. IPRemote AppleTalk, version 1.0 Both of which are 'adev's (clients of the 'Network' Control Panel device). To install the adevs, copy them to the System Folder ('Extensions' under --- 17,24 ---- ARNS remote clients are currently: ! 1. Asynchronous AppleTalk for UNIX, version 2.0.1 ! 2. IPRemote AppleTalk, version 1.0.1 Both of which are 'adev's (clients of the 'Network' Control Panel device). To install the adevs, copy them to the System Folder ('Extensions' under *************** *** 104,111 **** IPREMOTE BETA RESTRICTIONS: ! Naturally, MacTCP ***MUST*** be configured to use EtherNet directly. SEE ALSO --- 104,115 ---- IPREMOTE BETA RESTRICTIONS: ! Naturally, MacTCP ***MUST*** be configured to use EtherNet or SLIP rather ! than LocalTalk or EtherTalk. + If using MacSLIP version 1.0, IPRemote may claim that the link is set to + AppleTalk. Hold down the SHIFT key when dismissing the dialog box. This + behaviour is fixed in later versions of MacSLIP. SEE ALSO *** clients/async.c.orig Wed Oct 7 22:08:36 1992 --- clients/async.c Fri Nov 13 00:05:51 1992 *************** *** 14,20 **** * started on the ARNS server host by inetd(8)) * * $Author: djh $ ! * $Revision: 1.2 $ * * */ --- 14,20 ---- * started on the ARNS server host by inetd(8)) * * $Author: djh $ ! * $Revision: 1.3 $ * * */ *************** *** 1263,1268 **** --- 1263,1272 ---- sgttyb = ttysave; } #else /* SYSTYPE_SYSV */ + #ifdef AIX + /* have to be kidding */ + system("/bin/stty nl"); + #endif /* AIX */ if (ioctl(sofd, TIOCGETP, &sgttyb) != -1) { sgttyb.sg_flags |= RAW; sgttyb.sg_flags &= ~ECHO; ioctl(sofd, TIOCSETP, &sgttyb); *************** *** 1384,1389 **** --- 1388,1397 ---- ioctl(sofd, TCSETAF, &sgttyb); #else /* SYSTYPE_SYSV */ ioctl(sofd, TIOCSETP, &sgttyb); + #ifdef AIX + /* have to be kidding */ + system("/bin/stty -nl"); + #endif /* AIX */ #endif /* SYSTYPE_SYSV */ fchmod(sofd, buf.st_mode); }