Subject: [netatalk-admins] Autoselect problem with asun mods

From: "William R. Dickson" <[email-masked]>
Date: Mon, 14 Jul 1997 15:11:46 -0700 (PDT)

Hi all,

Adrian has been unable to figure out this problem, and I don't know enough
to be much help, so I thought I'd see if anybody else is experiencing it.
Using his afp/tcp modifications, I see the following symptoms:

- AppleTalk-only clients (AppleShare previous to 3.7) automatically establish
  an AppleTalk connection to the server without trouble.  Their aliases and
  mount-on-startup volumes work normally.

- TCP-only clients (people connecting from outside the local network)
  automatically establish a TCP connection to the server without trouble.
  Their aliases and mount-on-startup volumes work normally.

- AppleTalk and TCP clients (AppleShare 3.7 and 3.7.1 on the local network)
  have problems.  If they simply double-click on the server name in the
  Chooser, the system thinks for about 30 seconds before eventually
  establishing an AppleTalk connection instead of a TCP/IP connection.
  If you option-click to force an AppleTalk connection, it works fine.
  If you enter a TCP address for the server, it mounts fine over TCP/IP.
  But it can't autoselect.  In addition, no matter how the volume is
  mounted, aliases and mount-on-startup volumes set at that time always
  experience the 30-second delay and AppleTalk connections the next time
  the system tries to mount the volume.

I've tried this on NetBSD 1.2.1 and -current, with and without zones on
the network, and duplicated the problem on a 7100 running MacOS 8b5 with
AppleShare client 3.7.1, and a Mac IIsi running 7.5.5 with AS client 3.7.

Anybody else seeing this behavior?  Or any ideas what could be causing it?

Thanks,

-Bill

-- 
 William R. Dickson -- Consuming the Earth's limited resources since 1968
 [email-masked]  <>  http://www.halcyon.com/wrd/  <>  VNB3T, VSC1T, VSX1T

        Am I to understand that, to save his contemptible life,
        he dared to practice on our credulous simplicity?  Our
        revenge shall be swift and terrible!

                                        -The Pirates of Penzance 
                                         Gilbert & Sullivan

---

From: Stefan Bethke <[email-masked]>
Date: Tue, 15 Jul 1997 10:18:47 +0200

>  establishing an AppleTalk connection instead of a TCP/IP connection.

Might it be that the liswt of IP addresses in GetStatus is botched?

The following snippet decodes the GetStatus data:

----------------

void ptocstr __P((const char *p, char *c));

void
ptocstr (p, c)
	const char *p;
	char *c;
{
	bcopy (p+1, c, (unsigned char)*p);
	c[(unsigned char)*p] = 0;
}

char *status_flagnames[16] = {
	"SupportsCopyFile",
	"SupportChgPwd",
	"DontAllowSavePwd",
	"SupportsServerMessages",

	"SupportsServerSignature",
	"SupportsTCP/IP",
	"(Flag 6)",
	"(Flag 7)",

	"(Flag 8)",
	"(Flag 9)",
	"(Flag 10)",
	"(Flag 11)",

	"(Flag 12)",
	"(Flag 13)",
	"(Flag 14)",
	"(Flag 15)",
};

void
dump_status(data0,len)
	char *data0;
	int len;
{
	unsigned char *data = (unsigned char *)data0;
	struct afp_status *as = (struct afp_status *)data;
	char s[256];
	int i, j;
	unsigned char *cp, *cp2;

	if (!(debug & DEBUG_INIT))
		return;
	ptocstr (data+sizeof(struct afp_status), s);
	fprintf (stderr, "FPGetSrvrStatus: length=%d\n\tname=\"%s\"\n",
len, s);

	if (as->as_machoff) {
		ptocstr (data+ntohs(as->as_machoff), s);
		fprintf (stderr, "\tmachine=\"%s\" (%d)\n", s,
ntohs(as->as_machoff));
	}

	fprintf (stderr, "\tflags:\n");
	for (i=0; i<16; i++)
		if (ntohs(as->as_flags) & (1 << i))
			fprintf (stderr, "\t\t%s\n", status_flagnames[i]);

	if (as->as_versoff) {
		cp = data + ntohs(as->as_versoff);
		fprintf (stderr, "\tversions: (%d)\n", cp - data);
		for (i=*cp++; i--; ) {
			ptocstr (cp, s);
			fprintf (stderr, "\t\t\"%s\"\n", s);
			cp += *cp + 1;
		}
	}

	if (as->as_uamsoff) {
		cp = data + ntohs(as->as_uamsoff);
		fprintf (stderr, "\tuams: (%d)\n", cp - data);
		for (i=*cp++; i--; ) {
			ptocstr (cp, s);
			fprintf (stderr, "\t\t\"%s\"\n", s);
			cp += *cp + 1;
		}
	}

	if (as->as_iconoff)
		fprintf (stderr, "\ticon (%d)\n", ntohs (as->as_iconoff));

	cp2 = data + sizeof (*as);
	cp2 += ((unsigned char)data[sizeof(*as)] + 1) & ~1;

	if (ntohs(as->as_flags) & AFPSRVRINFO_SIGNATURE) {
		fprintf (stderr, "\tsignature: ");
		cp = data + ntohs(*(unsigned short *)cp2);
		for (i=0; i<16; i++, cp++)
			fprintf (stderr, "%02x ", *cp);
		cp = data + ntohs(*(unsigned short *)cp2);
		for (i=0; i<16; i++, cp++)
			fprintf (stderr, "%c", isprint (*cp) ? *cp : '.');
		fprintf (stderr, "(%d)\n", ntohs(*(unsigned short *)cp2));
	}

	if (ntohs(as->as_flags) & AFPSRVRINFO_DSI) {
		cp = data + ntohs(((unsigned short *)cp2)[1]);
		fprintf (stderr, "\taddresses: (%d)\n", cp - data);
		for (i=*cp++; i--; ) {
			switch (cp[1]) {
				case AFPADDR_IP:
				case AFPADDR_IPPORT:
					j = ntohl(*(unsigned int *)(cp+2));
					fprintf (stderr, "\t\tIP:
%d.%d.%d.%d",
						(j >> 24) & 0xFF, (j >> 16)
& 0xFF,
						(j >>  8) & 0xFF, j & 0xFF);
					if (cp[1] == AFPADDR_IPPORT)
						fprintf (stderr, ":%d",
ntohs(*(unsigned short *)(cp+6)));
					fprintf (stderr, "\n");
					break;
				case AFPADDR_DDP:
					fprintf (stderr, "\t\tAT: %d.%d:%d\n",
						ntohs(*(unsigned short
*)(cp+2)),
						cp[4], cp[5]);
					break;
				default:
					fprintf (stderr, "\t\taddress type
%d with %d bytes\n", cp[1], cp[0]);
			}
			cp += cp[0];
		}
	}
}

-------------

Hope this helps,
Stefan

--
Stefan Bethke
Promo Datentechnik      |  Tel. +49-40-851744-0
+ Systemberatung GmbH   |  Fax. +49-40-851744-44
Eduardstrasse 46-48     |  e-mail: [email-masked]
D-20257 Hamburg         |  http://www.Promo.DE/

---

From: a sun <[email-masked]>
Date: Tue, 15 Jul 1997 08:04:22 -0700 (PDT)

fyi, i already have a little test program. i don't see any difference
between what i get on my machine (works) and what i get on
bill's. furthermore, the mistakes should actually be in the direction
of my machine (because it's little-endian) rather than bill's (which
is big-endian).

-a