Patch #: 1 Type: update Priority: low Modification: minor changes for Solaris 2.N, DEC Alpha OSF/1 Modification: add dummy zone for GetNetInfo lookup, update README Archived: munnari.OZ.AU mac/cap.patches/uar.1.0.patch01 Application: 'cd uar; patch -p < uar.1.0.patch01' *** Makefile.orig Sat Jun 12 23:44:00 1993 --- Makefile Sat Oct 23 20:52:46 1993 *************** *** 25,30 **** --- 25,34 ---- # CFLAGS=-DSOLARIS # LIBS=-lsocket -lnsl # + # For DEC Aplha OSF/1, Phase 1 or Phase 2 + # CFLAGS= + # LIBS=pfopen.o + # CFLAGS= LIBS= CC=cc *** README.orig Wed Jul 28 19:35:22 1993 --- README Sun Oct 24 19:06:59 1993 *************** *** 3,10 **** The University of Melbourne djh@munnari.OZ.AU ! October, 1992 ! version 1.0 --- 3,10 ---- The University of Melbourne djh@munnari.OZ.AU ! October, 1993 ! version 1.0.1 *************** *** 33,47 **** This software is supplied "as is" without express or implied warranty. - UAR is available via FTP from munnari.OZ.AU as mac/uar.tar.Z - Please report any problems via email to uar@munnari.OZ.AU - - FREEWARE ! UAR is "freeware", it may be used to route AppleTalk packets on a ! small number of UNIX hosts within a single organisation at no cost (please note the distribution and reuse restrictions listed above). Sites may, however, elect to pay a nominal/negotiable shareware or site --- 33,43 ---- This software is supplied "as is" without express or implied warranty. FREEWARE ! UAR version 1.0 is "freeware", it may be used to route AppleTalk packets ! on a small number of UNIX hosts within a single organisation at no cost (please note the distribution and reuse restrictions listed above). Sites may, however, elect to pay a nominal/negotiable shareware or site *************** *** 50,55 **** --- 46,58 ---- attention for problem reports and, most importantly, encourages further development on this and other packages. + UAR shareware version 1.1 supports + + * ARNS services for Async ATalk2 and IPRemote clients + * CAP services on other than the default zone + * NBP registration of EtherTalk interfaces + * more efficient ZONE list handling + The regular mail address for corresponence or payments is UNIX AppleTalk Router *************** *** 60,71 **** Victoria Australia ! Unfortunately we can only process AU$ or US$ non-personal che{que,ck}s, ! please don't send cash. Cheques should be payable to "The University ! of Melbourne, Department of Computer Science". Please include both your regular and email addresses in any correspondence. CONFIGURATION The router is configured from a configuration file, if no file is provided --- 63,77 ---- Victoria Australia ! Cheques (please don't send cash) should be payable to "The University of ! Melbourne, Department of Computer Science". Please include both your regular and email addresses in any correspondence. + UAR version 1.0 is available via FTP from munnari.OZ.AU as mac/uar.tar.Z + Please report any problems via email to uar@munnari.OZ.AU + + CONFIGURATION The router is configured from a configuration file, if no file is provided *************** *** 130,136 **** services are specified in the configuration file. Use -C only for non-seed routers (no config file). ! one or more interface names as listed by 'netstat -i' EG: uar -d 3967 -l logfile -2 ie0 ie1 --- 136,144 ---- services are specified in the configuration file. Use -C only for non-seed routers (no config file). ! one or more ethernet interface names as listed by ! 'netstat -i' or the special interface name "tnnl", ! must match those listed in uar.conf. EG: uar -d 3967 -l logfile -2 ie0 ie1 *************** *** 138,148 **** CAP ! To use CAP with UAR, configure CAP for use with UAB. On hosts where UAB ! support is not available in the "Configure" script, or CAP is to be used ! with Phase 2, compile CAP for IPTalk (select the default answers for all ! "Configure" questions) and edit the m4.features file to include the lines # + PHASE2 add support for AppleTalk Phase 2 define(`specialcflags',concat(specialcflags,` -DPHASE2')) # --- 146,173 ---- CAP ! If your CAP distribution is at patch level 144 or greater, run the ! Configure script and choose the UAR (and, if appropriate, Phase 2) ! options. Run 'gen.makes' and rebuild CAP. Start UAR first in the ! start-cap-servers script with a 'sleep 20' prior to starting 'atis' + CAP=/usr/local/cap + + ${CAP}/uar ie0 ie1 arns + sleep 20 + + # aarpd is not necessary with UAR + + ${CAP}/atis + sleep 5 + ... + + If CAP is at a patch level less than 144, Configure CAP for use with UAB. + On hosts where UAB support is not available in the "Configure" script, or + CAP is to be used with Phase 2, compile CAP for IPTalk (select the default + answers for all "Configure" questions) and edit the m4.features file to + include the lines + # + PHASE2 add support for AppleTalk Phase 2 define(`specialcflags',concat(specialcflags,` -DPHASE2')) # *************** *** 252,257 **** --- 277,307 ---- 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. + + If "netstat -i" shows interfaces called en0 and et0, then your RS6000 system + is configured to run with 802.3 Ethernet (the "et0" adapter) and you will not + be able to run UAR with EtherTalk Phase 2. + + Unless you really need 802.3 Ethernet support, it is safe to turn off the + "et0" interface. This is done using + + smit tcpip + + Select the following menu items + + Further Configuration + Network Interfaces + Network Interface Selection + Remove a Network Interface + et0 IEEE 802.3 Ethernet Network Interface + + You may have to reboot the machine afterwards. + + -------------------------------------------- + Notes for DEC Alpha OSF/1 release 1.3 users: + + You MUST manually set the define for LIBS=pfopen.o in the Makefile + and copy /usr/lib/examples/packetfilter/pfopen.c to the UAR directory. -------------------------- (edited ARNS version, as of July '93 UAR is untested on Sony NEWS) *** cap.c.orig Sun Jul 25 21:38:41 1993 --- cap.c Sun Oct 24 20:31:37 1993 *************** *** 15,21 **** * djh@munnari.OZ.AU * * $Author: djh $ ! * $Revision: 1.1 $ * */ --- 15,21 ---- * djh@munnari.OZ.AU * * $Author: djh $ ! * $Revision: 1.1.1.1 $ * */ *************** *** 44,50 **** cap_initialize(ifn) int ifn; { ! long len; struct servent *s, *getservbyname(); if (capfd != -1) { --- 44,50 ---- cap_initialize(ifn) int ifn; { ! int len; struct servent *s, *getservbyname(); if (capfd != -1) { *************** *** 68,80 **** } len = SKTBUFSIZ; ! if (setsockopt(capfd,SOL_SOCKET,SO_RCVBUF,(char *)&len,sizeof(long))<0){ perror("SO_RCVBUF"); exit(1); } len = SKTBUFSIZ; ! if (setsockopt(capfd,SOL_SOCKET,SO_SNDBUF,(char *)&len,sizeof(long))<0){ perror("SO_SNDBUF"); exit(1); } --- 68,80 ---- } len = SKTBUFSIZ; ! if (setsockopt(capfd,SOL_SOCKET,SO_RCVBUF,(char *)&len,sizeof(int))<0){ perror("SO_RCVBUF"); exit(1); } len = SKTBUFSIZ; ! if (setsockopt(capfd,SOL_SOCKET,SO_SNDBUF,(char *)&len,sizeof(int))<0){ perror("SO_SNDBUF"); exit(1); } *** pf.c.orig Sun Jul 25 21:45:37 1993 --- pf.c Sun Oct 24 19:22:49 1993 *************** *** 15,20 **** --- 15,21 ---- * Supports: * SunOS Network InterFace Tap (SNITPF) * DEC ULTRIX Packet Filter (UPFILT) + * DEC OSF/Alpha Packet Filter (UPFILT) * Stanford Ethernet Packet Filter (ENETPF) * Solaris STREAMS Data Link Provider Interface (DLPIPF) * SGI IRIX SNOOP PF for promisc, DRAIN PF for non-promisc *************** *** 23,29 **** * AIX Ethernet Device (AIXETH) * * $Author: djh $ ! * $Revision: 1.9 $ * */ --- 24,30 ---- * AIX Ethernet Device (AIXETH) * * $Author: djh $ ! * $Revision: 1.12 $ * */ *************** *** 49,54 **** --- 50,59 ---- #endif BPFILT #endif ultrix + #ifdef __alpha + #define UPFILT + #endif __alpha + #ifdef sony_news #define RAWETH #endif sony_news *************** *** 316,322 **** /* label file descriptor with ethernet type */ bind_req.dl_primitive = DL_BIND_REQ; ! bind_req.dl_sap = (typ == 2) ? 0 : protocol; bind_req.dl_max_conind = 0; bind_req.dl_service_mode = DL_CLDLS; bind_req.dl_conn_mgmt = 0; --- 321,327 ---- /* label file descriptor with ethernet type */ bind_req.dl_primitive = DL_BIND_REQ; ! bind_req.dl_sap = (typ == 2) ? 16 : protocol; bind_req.dl_max_conind = 0; bind_req.dl_service_mode = DL_CLDLS; bind_req.dl_conn_mgmt = 0; *************** *** 596,602 **** #ifdef USE_PFILT #define s_offset(structp, element) (&(((structp)0)->element)) ! bzero(&pf, sizeof(pf)); pf.Pf_Priority = 128; offset = ((int)s_offset(struct ether_header *, ether_type))/sizeof(u_short); if (typ == 2) /* EtherTalk Phase 2 */ --- 601,607 ---- #ifdef USE_PFILT #define s_offset(structp, element) (&(((structp)0)->element)) ! bzero((char *)&pf, sizeof(pf)); pf.Pf_Priority = 128; offset = ((int)s_offset(struct ether_header *, ether_type))/sizeof(u_short); if (typ == 2) /* EtherTalk Phase 2 */ *************** *** 874,880 **** int eth_addmulti(s, interface, addr) int s; ! char *interface, *addr; { int sock; --- 879,886 ---- int eth_addmulti(s, interface, addr) int s; ! char *interface; ! u_char *addr; { int sock; *************** *** 898,904 **** #endif ENETPF ifr.ifr_addr.sa_family = AF_UNSPEC; ! bcopy(addr, ifr.ifr_addr.sa_data, 6); /* * open a socket, temporarily, to use for SIOC* ioctls --- 904,910 ---- #endif ENETPF ifr.ifr_addr.sa_family = AF_UNSPEC; ! bcopy((char *)addr, ifr.ifr_addr.sa_data, 6); /* * open a socket, temporarily, to use for SIOC* ioctls *************** *** 995,1001 **** int eth_delmulti(s, interface, addr) int s; ! char *interface, *addr; { int sock; --- 1001,1008 ---- int eth_delmulti(s, interface, addr) int s; ! char *interface; ! u_char *addr; { int sock; *************** *** 1019,1025 **** #endif ENETPF ifr.ifr_addr.sa_family = AF_UNSPEC; ! bcopy(addr, ifr.ifr_addr.sa_data, 6); /* * open a socket, temporarily, to use for SIOC* ioctls --- 1026,1032 ---- #endif ENETPF ifr.ifr_addr.sa_family = AF_UNSPEC; ! bcopy((char *)addr, ifr.ifr_addr.sa_data, 6); /* * open a socket, temporarily, to use for SIOC* ioctls *************** *** 1191,1197 **** #endif hpux #ifndef sgi ! return(read(fd, buf, len)); #endif sgi } --- 1198,1204 ---- #endif hpux #ifndef sgi ! return(read(fd, (char *)buf, len)); #endif sgi } *************** *** 1211,1217 **** struct strbuf pbuf, dbuf; sa.sa_family = AF_UNSPEC; ! bcopy(buf, sa.sa_data, sizeof(sa.sa_data)); pbuf.len = sizeof(struct sockaddr); pbuf.buf = (char *) &sa; dbuf.len = len-14; --- 1218,1224 ---- struct strbuf pbuf, dbuf; sa.sa_family = AF_UNSPEC; ! bcopy((char *)buf, (char *)sa.sa_data, sizeof(sa.sa_data)); pbuf.len = sizeof(struct sockaddr); pbuf.buf = (char *) &sa; dbuf.len = len-14; *** tnnl.c.orig Sun Jul 25 21:39:13 1993 --- tnnl.c Sun Oct 24 20:31:52 1993 *************** *** 15,21 **** * djh@munnari.OZ.AU * * $Author: djh $ ! * $Revision: 1.1 $ * */ --- 15,21 ---- * djh@munnari.OZ.AU * * $Author: djh $ ! * $Revision: 1.1.1.1 $ * */ *************** *** 45,51 **** int mode, typ; { int i; ! long len; u_long addr = 0; struct servent *s, *getservbyname(); --- 45,51 ---- int mode, typ; { int i; ! int len; u_long addr = 0; struct servent *s, *getservbyname(); *************** *** 83,89 **** len = SKTBUFSIZ; if (setsockopt(tnnlfd, SOL_SOCKET, SO_RCVBUF, (char *)&len, ! sizeof(long)) < 0) { perror("SO_RCVBUF"); exit(1); } --- 83,89 ---- len = SKTBUFSIZ; if (setsockopt(tnnlfd, SOL_SOCKET, SO_RCVBUF, (char *)&len, ! sizeof(int)) < 0) { perror("SO_RCVBUF"); exit(1); } *************** *** 90,96 **** len = SKTBUFSIZ; if (setsockopt(tnnlfd, SOL_SOCKET, SO_SNDBUF, (char *)&len, ! sizeof(long)) < 0) { perror("SO_SNDBUF"); exit(1); } --- 90,96 ---- len = SKTBUFSIZ; if (setsockopt(tnnlfd, SOL_SOCKET, SO_SNDBUF, (char *)&len, ! sizeof(int)) < 0) { perror("SO_SNDBUF"); exit(1); } *** uar.c.orig Sun Jul 25 21:39:19 1993 --- uar.c Sun Oct 24 20:31:55 1993 *************** *** 15,21 **** * djh@munnari.OZ.AU * * $Author: djh $ ! * $Revision: 1.1 $ * */ --- 15,21 ---- * djh@munnari.OZ.AU * * $Author: djh $ ! * $Revision: 1.1.1.1 $ * */ *************** *** 276,288 **** /* * add multicast addresses to interfaces after disassociation ! * (some operating systems associate mcasts with process ids) * */ for (i = 0; i < numintfc; i++) { if (iflist[i].itype == ITYPE_ETHERTALK) { if (iflist[i].phase == PHASE2) { ! eth_addmulti(iflist[i].etfd, iflist[i].if_name, maddr); if (iflist[i].net_lo != 0) /* interface already seeded */ zip_multicast(i, ADDMULTI); } --- 276,292 ---- /* * add multicast addresses to interfaces after disassociation ! * (some operating systems associate mcasts with process ids, ! * and some associate mcasts with descriptors ie: Solaris 2.N) * */ for (i = 0; i < numintfc; i++) { if (iflist[i].itype == ITYPE_ETHERTALK) { if (iflist[i].phase == PHASE2) { ! if (iflist[i].etfd >= 0) ! eth_addmulti(iflist[i].etfd, iflist[i].if_name, maddr); ! if (iflist[i].aarpfd >= 0) ! eth_addmulti(iflist[i].aarpfd, iflist[i].if_name, maddr); if (iflist[i].net_lo != 0) /* interface already seeded */ zip_multicast(i, ADDMULTI); } *************** *** 485,491 **** for (i = 0; i < numintfc; i++) { if (iflist[i].itype == ITYPE_ETHERTALK) { if (iflist[i].phase == PHASE2) { ! eth_delmulti(iflist[i].etfd, iflist[i].if_name, maddr); if (iflist[i].net_lo != 0) /* interface already seeded */ zip_multicast(i, DELMULTI); } --- 489,498 ---- for (i = 0; i < numintfc; i++) { if (iflist[i].itype == ITYPE_ETHERTALK) { if (iflist[i].phase == PHASE2) { ! if (iflist[i].etfd >= 0) ! eth_delmulti(iflist[i].etfd, iflist[i].if_name, maddr); ! if (iflist[i].aarpfd >= 0) ! eth_delmulti(iflist[i].aarpfd, iflist[i].if_name, maddr); if (iflist[i].net_lo != 0) /* interface already seeded */ zip_multicast(i, DELMULTI); } *** uar.h.orig Sun Jul 25 21:39:22 1993 --- uar.h Sun Oct 24 20:31:26 1993 *************** *** 15,21 **** * djh@munnari.OZ.AU * * $Author: djh $ ! * $Revision: 1.1 $ * */ --- 15,21 ---- * djh@munnari.OZ.AU * * $Author: djh $ ! * $Revision: 1.1.1.1 $ * */ *************** *** 110,115 **** --- 110,116 ---- #define NBPTYPE "\014RemoteClient" #define ECHOMSG "[Are You There ?]" + #define NETINFOZONE "UAR GetNetInfo Zone" #define PHASE1 0x01 #define PHASE2 0x02 *** zip.c.orig Sun Jul 25 21:39:26 1993 --- zip.c Sun Oct 24 20:31:59 1993 *************** *** 15,21 **** * djh@munnari.OZ.AU * * $Author: djh $ ! * $Revision: 1.1 $ * */ --- 15,21 ---- * djh@munnari.OZ.AU * * $Author: djh $ ! * $Revision: 1.1.1.1 $ * */ *************** *** 629,638 **** while (zit != ZITNULL) { zaddr = zone_mcast(zit->zone->name+1, zit->zone->name[0]); if (zaddr != NULL) { ! if (fn == ADDMULTI) ! eth_addmulti(iflist[ifn].etfd, iflist[ifn].if_name, zaddr); ! else ! eth_delmulti(iflist[ifn].etfd, iflist[ifn].if_name, zaddr); if (debug & ZIPDEBUG) { fprintf(stderr, " ZIP: %-5s %s Zone Multicast", iflist[rtmp->intfc].if_name, --- 629,641 ---- while (zit != ZITNULL) { zaddr = zone_mcast(zit->zone->name+1, zit->zone->name[0]); if (zaddr != NULL) { ! if (fn == ADDMULTI) { ! if (iflist[ifn].etfd >= 0) ! eth_addmulti(iflist[ifn].etfd, iflist[ifn].if_name, zaddr); ! } else { ! if (iflist[ifn].etfd >= 0) ! eth_delmulti(iflist[ifn].etfd, iflist[ifn].if_name, zaddr); ! } if (debug & ZIPDEBUG) { fprintf(stderr, " ZIP: %-5s %s Zone Multicast", iflist[rtmp->intfc].if_name, *************** *** 811,821 **** { short len; struct pd opd; ! u_char *pkt, buf[64]; struct rtmp *rtmp_route(); pkt = buf+HDRSIZ+LDDPHDRSIZ; pkt[0] = ZIPINFOREQ; pkt[1] = 0x00; /* must be zero */ pkt[2] = 0x00; /* must be zero */ --- 814,826 ---- { short len; struct pd opd; ! u_char *pkt, buf[80]; struct rtmp *rtmp_route(); pkt = buf+HDRSIZ+LDDPHDRSIZ; + len = strlen(NETINFOZONE); + pkt[0] = ZIPINFOREQ; pkt[1] = 0x00; /* must be zero */ pkt[2] = 0x00; /* must be zero */ *************** *** 822,831 **** pkt[3] = 0x00; /* must be zero */ pkt[4] = 0x00; /* must be zero */ pkt[5] = 0x00; /* must be zero */ ! pkt[6] = 0x00; /* zone length */ ! len = 0x07; opd.lapType = LDDP; opd.ddpType = ZIP; opd.dstNet = iflist[ifn].net; --- 827,838 ---- pkt[3] = 0x00; /* must be zero */ pkt[4] = 0x00; /* must be zero */ pkt[5] = 0x00; /* must be zero */ ! pkt[6] = len; /* zone length */ ! bcopy(NETINFOZONE, (char *)(pkt+7), len); + len += 0x07; + opd.lapType = LDDP; opd.ddpType = ZIP; opd.dstNet = iflist[ifn].net; *************** *** 898,907 **** net_lo = (pkt[2] << 8) | pkt[3]; net_hi = (pkt[4] << 8) | pkt[5]; - rtmp_intfc(ifn, net_lo, net_hi, pd); - zlen = pkt[6]; znam = pkt+7; mcast = znam+zlen; --- 905,919 ---- net_lo = (pkt[2] << 8) | pkt[3]; net_hi = (pkt[4] << 8) | pkt[5]; zlen = pkt[6]; znam = pkt+7; + + if (zlen != strlen(NETINFOZONE) + || bcmp((char *)znam, NETINFOZONE, zlen) != 0) + /* reply not ours */ + drop(zipInErrors); + + rtmp_intfc(ifn, net_lo, net_hi, pd); mcast = znam+zlen;