Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!husc6!cmcl2!rutgers!ames!ucbcad!ucbvax!CUNIXC.COLUMBIA.EDU!cck From: cck@CUNIXC.COLUMBIA.EDU (Charlie C. Kim) Newsgroups: comp.protocols.appletalk Subject: re: Other problems with KFPS/KIP/CAP Message-ID: <8708011704.AA28191@columbia.edu> Date: Sat, 1-Aug-87 13:06:34 EDT Article-I.D.: columbia.8708011704.AA28191 Posted: Sat Aug 1 13:06:34 1987 Date-Received: Sun, 2-Aug-87 10:12:19 EDT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 281 The first problem, with MacIP Telnet (MPW version or Lisa Pascal version), is that it uses the old style ien116 server to do name lookup - silly, but it was never modified to use the domain nameserver and with the stuff coming from Stanford and NCSA, I don't think it's worth the trouble to fix unless the licensing issues from those sites really gets out of hand. Just run the old ien116 server for a while (copy tacked on to end of message). If you're worried because it doesn't do domain name services, then don't - it uses gethostbyname which should use the resolv libraries to go the domain server if your machine has them installed. The sources for the MPW version of Telnet (copy distributed by Kinetics and available at Stanford) are available upon request (to me) if you want to take a hand at modifying the code - be warned that simple changes can be quite frustrating due to the "multi-tasking" with multiple interdependent (in terms of size) stacks. >- telneting to a machine on the 129 (or any other) subnet > times out (while I can connect to anywhere else I've tried > on the Internet). Someone will surely correct me if I'm wrong on the following, but I'm pretty sure this is pretty much the case. The KIP code doesn't really have full support for subnets. It assumes that, for the connected (class A,B,C) network (not the connected subnet), it can simply attempt to "send" the packet directly (e.g. arp, and send). Packets are sent to the default gateway otherwise (thus your internet connections work). Unfortunately, if your subnet gateways don't do proxy arp (e.g. subnet arp hack), then this will not work correctly. You have a number of alternatives: (a) install proxy arp code into your 4.3BSD gateway (easy - code was published in comp.sources.unix (formerly mod.sources) in Volume 4 as subnet.arp). I have it installed in an Ultrix 2.0 system and it works fine. It's a great help in an environment where some of the systems don't understand subnets. (b) hack the KIP code so it does the "right" thing. In this case, it would mean allowing a subnet mask in the configuration that it could use to figure out (could use a simple convention like 0 mask means no subnetting, etc.) if a packet was going to the connected subnet. Otherwise, it would route the packet to the default gateway (problematic if this isn't the correct subnet gateway - hopefully ICMP redirects would fix it. Don't really want the RIP (routed) listener code in the KFPS while it is so memory limited...). (c) assign the ethernet that the KFPS resides on a different network number - thus, it will route correctly - this is the worst possible solution that I could think of, but doesn't require any hacking. efsd will be "depreciated" in the next distribution of CAP (this means it will be there someplace, but won't be compiled by default, etc). efsd isn't as good as the Aufs (though it is much simpler) and the file handling is different (and I don't feel up to making them match up). The client code has two major flaws: (a) compiled with Sumacc C compiler - this means that it doesn't work on a Mac II because the Sumacc C runtime libraries builds trap on the fly - this causes major problems on a instruction cached 68020. (b) doesn't support multiple external file systems correctly - thus it doesn't work with AppleShare, TOPS, etc. Improved documentation on installing papif will be included in any future distributions of CAP. If you need help, send me mail and I will send you the new installation notes. hqx files are output from "binhex". Currently, there are two major versions of Binhex - version 5 and version 4. You can get version 4 (and the hqx file for version 5) from sumex.stanford.edu in the directory ps:. The version 4 executable is available as binhex.rsrc - make sure you type "tenex" before transfering the file since sumex is a tops-20 machine. You can download to your mac using telnet/tftp or kermit. Note: I think version 5 is shareware. Charlie C. Kim User Services Columbia University ien116 name server. add the following line to your /etc/services file: > name 42/udp nameserver # pcip Note: there's a bunch of ifdefs for MACIP - these are for the version you get from Kinetics which is probably the old copy compiled under Lisa Pascal. It had a bug dealing with word alignment and the ifdefs try to get around it. Ignore them and just compile the code. You need to run this from "root". Also, it's probably worth redoing this code to work with the 4.3 inetd someday (if that someday is before the MacIP code is outdated). /* * Copyright, 1984 The Regents of the University of California. This software * was produced under a U.S. Government contract, W-7405-ENG-36, by the * Los Alamos National Laboratory, which is operated by the University of * California for the U.S. Department of Energy. The U.S. Government is * licensed to use, reproduce, and distribute this software. Permission * is granted to the public to copy and use this software without charge, * provided that this notice and any statement of authorship are reproduced * on all copies. Neither the Government nor the University makes any warranty * expressed or implied, or assumes any liability or responsibility for * the use of this software. * * $Header: named.c,v 1.1 84/11/21 17:29:59 tomlin Exp $ * * $State: Exp $ * * $Log: named.c,v $ * Revision 1.1 84/11/21 17:29:59 tomlin * Initial revision * */ #ifndef lint static char rcsid[] = "$Header: named.c,v 1.1 84/11/21 17:29:59 root Exp $"; #endif lint #include #include #include #include #include #include #include #include #include #include #include #include struct sockaddr_in sin = { AF_INET }; typedef struct namerequest { char nr_nameoctet; char nr_namelen; char nr_namestr[1024]; /* 1024 is arbitrary */ }; unsigned char *replybuf; unsigned char *malloc(); #define ERRORMESSAGE "Unknown machine" extern errno; char myname[32]; struct servent *sp; int s = -1; main() { struct sockaddr_in from; struct hostent *hp; sp = getservbyname("name", "udp"); if (sp == 0) { fprintf(stderr, "named: udp/name: unknown service\n"); exit(1); } #ifndef DEBUG if (fork()) exit(0); { int s; for (s = 0; s < 10; s++) (void) close(s); (void) open("/", 0); (void) dup2(0, 1); (void) dup2(0, 2); s = open("/dev/tty", 2); if (s >= 0) { ioctl(s, TIOCNOTTY, 0); (void) close(s); } } #endif if (getuid()) { fprintf(stderr, "named: not super user\n"); exit(1); } if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { perror("named: socket"); exit(1); } /* * Establish host name as returned by system. */ if (gethostname(myname, sizeof (myname) - 1) < 0) { perror("gethostname"); exit(1); } hp = gethostbyname(myname); if (hp == NULL) { fprintf(stderr, "%s: don't know my own name\n", myname); exit(1); } sin.sin_family = hp->h_addrtype; sin.sin_port = sp->s_port; if (bind(s, &sin, sizeof (sin)) < 0) { perror("named: bind"); exit(1); } for (;;) { int cc, i, len = sizeof (from); struct namerequest request; struct hostent *rh; cc = recvfrom(s, (char *)&request, sizeof (request), 0, &from, &len); if (cc <= 0) { if (cc < 0 && errno != EINTR) perror("named: recv"); continue; } if (from.sin_port != sp->s_port) { fprintf(stderr, "named: %d: bad from port, continuing...\n", ntohs(from.sin_port)); /* continue; */ } request.nr_namestr[request.nr_namelen] = '\0'; #ifdef DEBUG fprintf(stderr,"Requesting \"%s\"\n",request.nr_namestr); fprintf(stderr,"Packet len is %d, name len is %d\n", cc, request.nr_namelen); #endif rh = gethostbyname(request.nr_namestr); if (rh == NULL) { fprintf(stderr, "%s: unknown machine\n", request.nr_namestr); /* 3 = error type + length + error code */ replybuf=malloc(cc+3+sizeof (ERRORMESSAGE)); bcopy(&request, replybuf, cc); i=cc; replybuf[i++]=(unsigned char)3; /* 3 denotes an error */ replybuf[i++]=(unsigned char)strlen(ERRORMESSAGE); bcopy(ERRORMESSAGE, &replybuf[i], strlen(ERRORMESSAGE)); i+=strlen(ERRORMESSAGE); (void) sendto(s, (char *)replybuf, i, 0, &from, len); free(replybuf); continue; } #ifndef NOMACIP /* patch for mac since one below screws up */ #ifdef notdef if (request.nr_namelen != (cc - 2)) request.nr_namelen = cc - 2; #endif #endif /* 6 = addr type + len + internet addr */ #ifdef NOMACIP replybuf=malloc(cc+6); bcopy(&request, replybuf, cc); i=cc; #else /* doing this causes the mac to crash ??? */ /* MACIP sends a null terminated name, but doesn't count the */ /* null in the name length, so code is confused - easy patch */ /* use nr_namelen + 2 (for octect, length) (+ 6 for response)*/ i = request.nr_namelen + 2; fprintf(stderr,"Awk at %d\n",i); if ((i%2) == 1 ) { i++; request.nr_namelen++; } replybuf=malloc(i + 6); bcopy(&request, replybuf, i); #endif replybuf[i++]=(unsigned char)2; /* 2 denotes an addr */ replybuf[i++]=(unsigned char)rh->h_length; bcopy(rh->h_addr, &replybuf[i], rh->h_length); i+=(rh->h_length); #ifdef DEBUG fprintf(stderr,"Replying with address %x, (pkt len %d)\n", rh->h_addr, i); #endif #ifndef NOMACIP { int j; for (j=0; j < 2; j++) (void) sendto(s, (char *)replybuf, i, 0, &from, len); } #endif free(replybuf); } }