Patch #: 10 Type: maintenance fix Priority: medium Submitted: David Hornsby Summary: fix RTMPR bug, add -f uar.conf option, ignore bad GetNetInfo Summary: replies, improve Solaris performance, add manual entry Archived: munnari.OZ.AU mac/cap.patches/uar.1.0.patch10 Application: 'cd uar; patch -p < uar.1.0.patch10' *** pf.c.orig Mon Jun 6 07:14:57 1994 --- pf.c Tue Oct 18 10:58:27 1994 *************** *** 25,31 **** * AIX Ethernet Device (AIXETH) * * $Author: djh $ ! * $Revision: 1.15 $ * */ --- 25,31 ---- * AIX Ethernet Device (AIXETH) * * $Author: djh $ ! * $Revision: 1.16 $ * */ *************** *** 377,382 **** --- 377,388 ---- si.ic_dp = NULL; if (ioctl(s, I_STR, &si) < 0) { perror("DLIOCRAW"); + return(-1); + } + + /* set up messages */ + if (ioctl(s, I_SRDOPT, (char *)RMSGD) < 0) { + perror("I_SRDOPT"); return(-1); } #endif DLPIPF *** uar.c.orig Mon Aug 22 18:46:36 1994 --- uar.c Tue Oct 18 11:39:28 1994 *************** *** 15,21 **** * djh@munnari.OZ.AU * * $Author: djh $ ! * $Revision: 1.1.1.4 $ * */ --- 15,21 ---- * djh@munnari.OZ.AU * * $Author: djh $ ! * $Revision: 1.1.1.5 $ * */ *************** *** 34,39 **** --- 34,40 ---- u_long uar_stats[maxCounters]; /* UAR statistics */ + char *conffile = CONFIG_FILE; /* Default configuration file */ char *logfile = LOGFILE; /* Default logfile */ char *interface = NULL; /* Network interface */ char *progname = NULL; /* Saved argv[0] */ *************** *** 99,109 **** * process command line options * */ ! while ((c = getopt(argc, argv, "d:l:z:c12C")) != -1) { switch (c) { case 'd': debug = strtol(optarg, NULL, 0); break; case 'l': logfile = optarg; break; --- 100,113 ---- * process command line options * */ ! while ((c = getopt(argc, argv, "d:f:l:z:c12C")) != -1) { switch (c) { case 'd': debug = strtol(optarg, NULL, 0); break; + case 'f': + conffile = optarg; + break; case 'l': logfile = optarg; break; *************** *** 183,189 **** * read interface configuration file * */ ! configure(CONFIG_FILE); /* * attach CAP to first interface, if requested --- 187,193 ---- * read interface configuration file * */ ! configure(conffile); /* * attach CAP to first interface, if requested *************** *** 338,345 **** void usage() { ! fprintf(stderr, "usage: %s [-d flags] [-c] [-C]\n", progname); ! fprintf(stderr, "\t[-l logfile] [-z zone] [-1] [-2] interfaces\n"); return; } --- 342,349 ---- void usage() { ! fprintf(stderr, "usage: %s [-d flags] [-f uar.conf] [-c]\n", progname); ! fprintf(stderr, "\t[-C] [-l logfile] [-z zone] [-1] [-2] interfaces\n"); return; } *************** *** 705,711 **** if ((p = (char *)index(value, '@')) == NULL) { fprintf(stderr, " UAR: bad format peer entry \"%s %s\" in %s\n", ! name, value, CONFIG_FILE); exit(1); } *p++ = '\0'; --- 709,715 ---- if ((p = (char *)index(value, '@')) == NULL) { fprintf(stderr, " UAR: bad format peer entry \"%s %s\" in %s\n", ! name, value, filename); exit(1); } *p++ = '\0'; *************** *** 735,741 **** } fprintf(stderr, " UAR: I don't understand \"%s %s\" in %s\n", ! name, value, CONFIG_FILE); exit(1); } --- 739,745 ---- } fprintf(stderr, " UAR: I don't understand \"%s %s\" in %s\n", ! name, value, filename); exit(1); } *** zip.c.orig Mon Aug 22 18:47:40 1994 --- zip.c Tue Oct 18 11:39:29 1994 *************** *** 15,21 **** * djh@munnari.OZ.AU * * $Author: djh $ ! * $Revision: 1.1.1.4 $ * */ --- 15,21 ---- * djh@munnari.OZ.AU * * $Author: djh $ ! * $Revision: 1.1.1.5 $ * */ *************** *** 938,943 **** --- 938,945 ---- /* lkup zone invalid */ zlen = mcast[mlen]; znam = mcast+mlen+1; + if (zlen == 0) + drop(zipInErrors); } if ((zone = zone_find(znam, zlen)) == ZONENULL) { *** rtmp.c.orig Mon Aug 22 18:48:13 1994 --- rtmp.c Tue Oct 18 11:41:25 1994 *************** *** 15,21 **** * djh@munnari.OZ.AU * * $Author: djh $ ! * $Revision: 1.1.1.2 $ * */ --- 15,21 ---- * djh@munnari.OZ.AU * * $Author: djh $ ! * $Revision: 1.1.1.3 $ * */ *************** *** 358,364 **** if (len > MAXDDPLEN) drop(ddpTooLongErrors); ! if (pd->dstSkt != RTMPR) drop(uarNoSocketHandler); opd.lapType = LDDP; --- 358,364 ---- if (len > MAXDDPLEN) drop(ddpTooLongErrors); ! if (pd->dstSkt != RTMP) drop(uarNoSocketHandler); opd.lapType = LDDP; *************** *** 410,415 **** --- 410,416 ---- } opd.dataLen = len; + opd.data = pkt; if (debug & RTMPDEBUG) fprintf(stderr, "RTMP: %-5s Sending RTMP Response\n", *** uar.1l.orig Tue Oct 18 11:22:29 1994 --- uar.1l Tue Oct 18 11:55:59 1994 *************** *** 0 **** --- 1,216 ---- + .\" troff -man + .TH UAR 1L "Jul 12 1994" "UNIX AppleTalk Router" + .SH NAME + UAR \- UNIX AppleTalk Router + .SH SYNOPSIS + .B uar + [ + .BI \-d " " + ] [ + .BI \-f " " + ] [ + .BI \-l " " + ] [ + .BI \-z " " + ] [ + .BI \-c + ] [ + .BI \-C + ] [ + .BI \-1 + ] [ + .BI \-2 + ] + .BI interfaces + .SH DESCRIPTION + .I uar + is a 'UNIX AppleTalk Router' supporting Phase 1 or Phase 2 AppleTalk + routing between multiple ethernet interfaces on a UNIX workstation. UAR + also supports CAP services and simple AppleTalk packet tunneling over an + IP internet. + .sp + UAR currently supports Phase 1 and Phase 2 EtherTalk networks connected + to SUN, DEC ULTRIX/Alpha, 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 and 386BSD/FreeBSD + workstations. + .PP + The options that + .I uar + accepts are: + .TP + .BI \-d " " + specifies the uar debugging level. is a number obtained by + OR'ing the required debugging flags to enable debugging for each subsystem + .sp + .nf + 0x0001 - Routing Table Maintenance Protocol + 0x0002 - Name Binding Protocol + 0x0004 - AppleTalk Echo Protocol + 0x0008 - Zone Information Protocol + 0x0010 - Internet Protocol + 0x0020 - Ethernet level + 0x0040 - Routing + 0x0080 - packet dumps + 0x0100 - timers + 0x0200 - AppleTalk Address Resolution Protocol + 0x0400 - CAP + 0x1000 - TNNL + .fi + .TP + .BI \-f " " + specifies that UAR use the specified uar.conf file, rather than the + default which is expected to be in /usr/local/lib/cap/uar.conf. + .TP + .BI \-l " " + specifies the file to be used for logging notification or configuration + mismatch PANIC errors. The default file name is /usr/tmp/uar.log. + .TP + .BI \-z " " + specifies the default zone for CAP services. This zone must be defined + for the local Phase 2 network. + .TP + .BI \-1 + specifies AppleTalk Phase 1. This option is normally used only when no + configuration file is present. + .TP + .BI \-2 + specifies AppleTalk Phase 2, the default. This option is normally used only + when no configuration file is present. + .TP + .BI \-c + disables DDP checksums (default is on). + .TP + .BI \-C + attaches CAP to the first interface. This option is normally used only when + no configuration file is present. + .TP + .BI interfaces + one or more ethernet interface names as listed + by 'netstat -i' or the special interface name "tnnl", + must match those listed in uar.conf. + .SH FILES + /usr/local/lib/cap/uar.conf - configuration file. + .SH CONFIGURATION + The router is configured from a configuration file, if no file is provided + the router will glean the necessary information from other routers on the + network (ie: it acts as a non-seed router). + An example file: + .sp + .nf + # configuration file for UAR + # + interface le0 + node 244 + network 83.5 + networklo 83.5 + networkhi 83.6 + zone unimelb-CompSci + zonelist unimelb-CompSci + zonelist unimelb-Maths + zonelist unimelb-Stats + zonename unimelb-Maths + phase 2 + cap on + interface le1 + network 83.4 + zone "unimelb-CompSci" + zonelist "unimelb-CompSci" + phase 2 + cap off + .fi + .sp + There should be a "zonelist" entry for each of the zones on a Phase 2 + network (including the default zone). NB: this is not the same as the + full zone list for the entire network. The "zone" entry should contain + the default zone name for the cable. CAP services will appear in the + default zone unless explicitly set to one of the local cable zones with + a "zonename" entry. + .sp + The "node" entry is optional. If not supplied, node numbers are assigned + starting from 253 (for Phase 2 networks and 254 on Phase 1 networks). On + EtherTalk interfaces the node numbers are dynamically assigned using the + "node" entry as a hint. Multinode services, ie: CAP are assigned starting + from the interface node number downwards. For this reason it is suggested + that the node hint be chosen from the high end of the valid range (1-253). + .sp + The configuration information in uar.conf *MUST* be identical to that + configured into other routers for the local network. If the network range + or default zone information in the usr.conf file does not match that of + other routers on the network, UAR will write a PANIC message to a log file + (by default /usr/tmp/uar.log) and exit. + .sp + .SH 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' + .sp + .nf + CAP=/usr/local/cap + + ${CAP}/uar ie0 ie1 + sleep 20 + + # aarpd is not necessary with UAR + + ${CAP}/atis + sleep 5 + ... + .fi + .sp + .SH TUNNELING + UAR supports a simple method for tunneling AppleTalk packets over an IP + internet. That is, EtherTalk networks separated by IP-only routers may + be joined seamlessly by running UAR on UNIX hosts connected to each net. + .sp + The only restriction is that network numbers at each location must be + unique across the extended EtherTalk network. ie: network number remapping + is not supported. + .sp + IP tunneling is specified as an additional interface in each uar.conf file + as follows + .sp + .nf + interface tnnl + node 253 + network 83.3 + zone unimelb-CompSci + peer "253 @ 128.250.97.86" + peer "252 @ 128.250.73.40" + phase 2 + .fi + .sp + Each UAR host participating in IP tunneling must contain identical + network, zone, peer and phase entries and each must have a unique node + number. A UAR tunnel, since it is effectively a separate network/cable, + must be assigned a unique network number. The peer entries are used to + map node numbers to IP addresses. + .sp + For security reasons, remote UAR hosts are not permitted to participate + in tunneling unless their IP address is explicitly listed as a peer in + the local uar.conf file. + .sp + On UNIX hosts that have multiple ethernet interfaces (and thus multiple + IP addresses), a peer entry for the local node number (253 in the above + example) is used to specify which interface address is to be used for + outgoing traffic. + .sp + The default UDP port used for tunneling is 9115. To change this, add + an entry to /etc/services for all participating hosts: + .sp + .nf + tnnl 9115/udp # UAR tunneling port + .fi + .sp + .SH SEE ALSO + CAP (Columbia AppleTalk Package) + .SH AUTHOR + djh\@munnari.OZ.AU, May 1994. + .SH UPDATES + Updates via FTP from munnari.OZ.AU as mac/uar.tar.Z + .SH NOTICE + Copyright (c) 1994, The University of Melbourne. + .sp + UAR may NOT be publicly redistributed (for example via + anonymous FTP), sold, or the source used for any other + purpose without the permission of the copyright owner. *** Makefile.orig Thu May 19 19:50:51 1994 --- Makefile Tue Oct 18 11:34:52 1994 *************** *** 85,90 **** rm -rf *.o core uar tar: ! tar -cvf uar.tar Makefile README \ uar.h aarp.c cap.c ddp.c nbp.c \ pf.c rtmp.c stats.c uar.c zip.c tnnl.c uar.conf --- 85,90 ---- rm -rf *.o core uar tar: ! tar -cvf uar.tar Makefile README uar.1l \ uar.h aarp.c cap.c ddp.c nbp.c \ pf.c rtmp.c stats.c uar.c zip.c tnnl.c uar.conf *** README.orig Mon Aug 22 19:00:58 1994 --- README Tue Oct 18 11:35:31 1994 *************** *** 4,10 **** The University of Melbourne djh@munnari.OZ.AU October, 1993 ! version 1.0.9 --- 4,10 ---- The University of Melbourne djh@munnari.OZ.AU October, 1993 ! version 1.0.10