Patch #: 14 Type: update Priority: medium Modification: add ForceDDPCheckSum.hqx Modification: add support for IPTnnl adev Submitted: David Hornsby Archived: munnari.OZ.AU mac/cap.patches/uar.1.0.patch14 Application: 'cd uar; patch -p < uar.1.0.patch14' NOTE: The IPTnnl adev is available via anonymous FTP NOTE: from munnari.OZ.AU as the file iptnnladev.1.0.sit.hqx.Z *** Makefile.orig Mon Mar 20 22:36:57 1995 --- Makefile Wed Mar 22 00:27:27 1995 *************** *** 98,102 **** --- 98,103 ---- tar: tar -cvf uar.tar Makefile README uar.1l \ + ForceDDPCheckSum.hqx IPTnnl.1.0.sit.hqx \ uar.h aarp.c cap.c ddp.c nbp.c \ pf.c rtmp.c stats.c uar.c zip.c tnnl.c uar.conf *** uar.h.orig Wed Nov 2 12:13:14 1994 --- uar.h Mon Mar 20 23:15:47 1995 *************** *** 15,21 **** * djh@munnari.OZ.AU * * $Author: djh $ ! * $Revision: 1.1.1.5 $ * */ --- 15,21 ---- * djh@munnari.OZ.AU * * $Author: djh $ ! * $Revision: 1.1.1.6 $ * */ *************** *** 167,172 **** --- 167,176 ---- #define MAXZIPQUERY 255 #define MAXZIPREPLYLEN 550 + + #define UAR_CONF 1 + #define UAR_CONF_REQ 1 + #define UAR_CONF_DATA 2 /* UAR debug flags */ *** tnnl.c.orig Sun Oct 24 20:31:52 1993 --- tnnl.c Mon Mar 20 23:16:01 1995 *************** *** 15,21 **** * djh@munnari.OZ.AU * * $Author: djh $ ! * $Revision: 1.1.1.1 $ * */ --- 15,21 ---- * djh@munnari.OZ.AU * * $Author: djh $ ! * $Revision: 1.1.1.2 $ * */ *************** *** 29,38 **** extern char *stats_msg[]; extern u_char buf[]; static struct sockaddr_in lsin; - int tnnlfd = -1; - /* * open tunnel UDP loopback port and set socket options * --- 29,37 ---- extern char *stats_msg[]; extern u_char buf[]; + static int tnnlfd = -1; static struct sockaddr_in lsin; /* * open tunnel UDP loopback port and set socket options * *************** *** 48,53 **** --- 47,53 ---- int len; u_long addr = 0; struct servent *s, *getservbyname(); + void exit(); if (tnnlfd != -1) return(tnnlfd); *************** *** 113,118 **** --- 113,120 ---- u_char lapType; int cc, fromlen; struct sockaddr_in from; + void ddp(), dumppacket(); + void tnnl_sendconf(); fromlen = sizeof(struct sockaddr); *************** *** 141,146 **** --- 143,169 ---- lapType = pkt[3]; /* + * check if configuration request + * + */ + if (pkt[0] == UAR_CONF) { + if (dstNode == 0x00) { + switch (lapType) { + case UAR_CONF_REQ: + tnnl_sendconf(ifn, &from); + break; + case UAR_CONF_DATA: + /* + * ignore it for now + * + */ + break; + } + } + return; + } + + /* * check destination * */ *************** *** 204,209 **** --- 227,233 ---- u_char srcNode; char *inet_ntoa(); struct sockaddr_in to; + void dumppacket(); dstNode = pkt[1]; srcNode = pkt[2]; *************** *** 213,220 **** if (i != srcNode) { if (iflist[ifn].mnode[i].client == MNODE_TNNL && iflist[ifn].mnode[i].state == MNODE_VALID) { ! pkt[1] = i; /* not BCAST */ ! tnnl_write(ifn, pkt, len); } } } --- 237,244 ---- if (i != srcNode) { if (iflist[ifn].mnode[i].client == MNODE_TNNL && iflist[ifn].mnode[i].state == MNODE_VALID) { ! pkt[1] = i; /* not BCAST */ ! (void)tnnl_write(ifn, pkt, len); } } } *************** *** 243,246 **** --- 267,342 ---- if (debug) perror("sendto()"); return(len); + } + + /* + * send the TNNL configuration data to requestor + * (silently ignored if not a configured client) + * + */ + + void + tnnl_sendconf(ifn, host) + int ifn; + struct sockaddr_in *host; + { + int i, len; + u_char *pkt; + u_long *addr; + void dumppacket(); + + if (host->sin_addr.s_addr == 0) + return; + + /* + * check if requestor is known peer + * + */ + for (i = 1; i < MAXNODES-1; i++) + if (iflist[ifn].mnode[i].addr == (u_long)host->sin_addr.s_addr) + break; + + if (i == MAXNODES-1) + return; + + /* + * build packet + * + */ + pkt = buf+HDRSIZ; + + pkt[0] = UAR_CONF; + pkt[1] = 0x00; + pkt[2] = 0x00; + pkt[3] = UAR_CONF_DATA; + pkt[4] = iflist[ifn].net >> 8; + pkt[5] = iflist[ifn].net & 0xff; + pkt[6] = 0x00; /* must be zero */ + pkt[7] = i & 0xff; /* requestor node */ + + /* + * copy client address data + * + */ + addr = (u_long *)(pkt+8); + + for (i = 0; i < MAXNODES; i++) + *addr++ = iflist[ifn].mnode[i].addr; + + len = 1032; + + if (debug & TNNLDEBUG) { + fprintf(stderr, " UAR: %-5s WRITE %3d config bytes to %d @ %s\n", + iflist[ifn].if_name, len, pkt[7], inet_ntoa(host->sin_addr)); + if (debug & PKTDEBUG) + dumppacket(pkt, len); + } + + incr(uarTNNLPacketsOut); + + if (sendto(iflist[ifn].etfd, (char *)pkt, len, 0, + (struct sockaddr *)host, sizeof(struct sockaddr)) < 0) + if (debug) perror("sendto()"); + + return; } *** ForceDDPCheckSum.hqx.orig Mon Mar 20 22:40:11 1995 --- ForceDDPCheckSum.hqx Mon Mar 20 22:38:02 1995 *************** *** 0 **** --- 1,50 ---- + ForceDDPCheckSum patches the PWriteDDP control call to the AppleTalk + driver to set the "Compute Checksum" bit for all packets the Mac + sends into the network. This will allow the receiver of a corrupted + packet to detect the error and discard the packet. + + You can also use the following URL to get the file via FTP: + ftp://ftp.dartmouth.edu/pub/mac/ForceDDPCheckSum.bin + + To use ForceDDPChecksum, simply drag it to your system folder (it's + an extension) and restart. + + Rich Brown E-Mail: richard.e.brown@dartmouth.edu + Manager of Special Projects AppleLink address: RICH.BROWN + Dartmouth College + 6028 Kiewit Computer Center Telephone: 603/646-3648 + Hanover, NH 03755-3523 USA Fax: 603/646-2810 + + (This file must be converted with BinHex 4.0) + + :&%C[FQ0P4%433fKPBfY6G@dZFfPd!&0*9%46593K!*!%"@m!N!44TP0*9#%!!3! + !"@pb6'&e![m!N!-@rrm0!""'Eh*MC84%8%0SC@0V8h9Y593!N!h"S!#3'[q3"%P + 1594%6e9()3#M!DZ[TYpq-J!!$0S!N!B%k3#3"1Bp!*!)#jdd"%%5"&(R*)+)`US + N0bdaPKBA&BjS@PE800fB2D*T6RC"!C&F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U,q@KH2#q6UFZ&#A12NLb-(jeH,J!JE1JA3cVB0B9Ir + M8HaBXU3qJT)10R!lH',6cc,$MA$F5Yl#i4QZ41Aql*aYh'iY`"*`F0%lZ"$SihI + 8ad5Lp%Kp2NmT6hRD5II-Jj@2-apb'[qIH6b&aqFGph4m0F5hC[3)iLYChKYb%mV + la)R1*PQEZZmdNiH6B%P$pVh6Gp$dAMc4FmQ5MF&pqI6NjGK2VX+3!"Qcaa-p,4, + df#FGeIGDT$khM+MPZZReFHE*![9Lpf#3!#e0$$4h4cK@&2M#Mr$&I8VIK0&"lZF + (NVk*fh)[CqZDiY[CXT,m-L2l%VA1L#pY+pQAY(APSdEKke4pGXlHaV,5celPP%D + [$+R9!LPCC"`4cEqFX,f58T2lBVr4r0*bTrQPj9lc1mYAmR0+fIlVq6N&(E&r(2Y + Tf$q,21![B3rmGA`eficp1qcE&rAYl(X9p8ICa%df[mbA+YQ")Q3TfHJ"!jqd0aG + j6jPj'mP',kHaQ%Q3!"-3QmAce%-3Qf('[S9B-BqjldFXb'2'3iMPmeM+BiK4*X# + m3a%EKdB[3%m6d1XQ-fmjBNr8kcqQ%0rek,9bE6Q1eC!!Y1bbR*(XXb3Q5HqAR9r + i2`!Cp3!!: + *** README.orig Sat Dec 17 17:54:49 1994 --- README Wed Mar 22 00:29:56 1995 *************** *** 4,10 **** The University of Melbourne djh@munnari.OZ.AU October, 1993 ! version 1.0.13 --- 4,10 ---- The University of Melbourne djh@munnari.OZ.AU October, 1993 ! version 1.0.14 *************** *** 25,31 **** NOTICE ! Copyright (c) 1993-1994, The University of Melbourne. All Rights Reserved. --- 25,31 ---- NOTICE ! Copyright (c) 1993-1995, The University of Melbourne. All Rights Reserved. *************** *** 215,229 **** peer "252 @ 128.250.73.40" phase 2 ! 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. ! 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. 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 --- 215,234 ---- peer "252 @ 128.250.73.40" phase 2 ! A Macintosh using the IPTnnl adev (a Network Control Panel client) can also ! be connected to a UAR tunnel, or used to connect to other IPTnnl equipped ! Macintoshes. For more details, refer to the 'IPTnnl userDoc' file which is ! available via FTP from munnari.OZ.AU in the file iptnnladev.1.0.sit.hqx.Z ! ! Each UAR host or IPTnnl Macintosh 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. ! For security reasons, remote UAR/IPTnnl clients are not permitted to ! participate in tunneling unless their IP address is explicitly listed as ! a peer in the local uar.conf file or IPTnnl configuration. 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 *************** *** 255,260 **** --- 260,283 ---- uar.h or defining a new path in the Makefile. ie: -DLOGFILE="/var/log/uar.log" + + + ForceDDPCheckSum + + The Macintosh AppleTalk code does not normally send DDP packets with DDP + checksums enabled. In some situations, this can result in corrupted + AppleShare files or print jobs. + + ForceDDPCheckSum patches the PWriteDDP control call to the AppleTalk + driver to set the "Compute Checksum" bit for all packets the Mac sends + into the network. This will allow the receiver of a corrupted packet to + detect the error and discard the packet. + + You can also use the following URL to get the file via FTP: + ftp://ftp.dartmouth.edu/pub/mac/ForceDDPCheckSum.bin + + To use ForceDDPChecksum, simply drag it to your system folder (it's an + extension) and restart. NOTES