Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!amdahl!nsc!voder!apple!palevich From: palevich@Apple.COM (Jack Palevich) Newsgroups: comp.sys.mac.programmer Subject: Re: What zones can be accessed from my Mac? Keywords: zones mac programming Message-ID: <12362@apple.Apple.COM> Date: 17 Jun 88 19:26:12 GMT References: <620@tasis.utas.oz> Reply-To: palevich@apple.apple.com.UUCP (Jack Palevich) Organization: Apple Computer Inc, Cupertino, CA Lines: 45 In article <620@tasis.utas.oz> luke@tasis.utas.oz (Luke Visser) writes: >Ok, the question is this, how do I find what zones are accessible from a >particular Mac attached to a network? It's not too hard. You have to ask the bridge for the names of the zones. You do this by: 1) Using GetBridgeAddress to get the bridge address. If there isn't a bridge, there aren't any zones, so your zone name is "*". 2) Send an ATP request to socket 6 of the bridge. The userData field is either $07000000 (if you want the name of the local zone) or $08000000 + index, if you want the names of all the zones that the bridge knows about, starting with the "indexth" one. The index starts at 1, not zero.... 3) The bridge will send you back a 1-packet response which contains either the name of the local zone (if you used $07000000) or as many of the zone names as will fit into a packet. The names are stored as Pascal strings. The userBytes field of the packet you get back will have the number of zones returned in its least signifigant two bytes. The most signifigant byte will be set to zero if there are more names to get. 4) If there are more names to get, add the number of names you just got to the index, and go back to step 2. 5) Once you have all the names, you should sort them into alphabetical order before displaying them to the user. Here at Apple we have over 50 zones, and it's a real problem trying to find a particular zone in an unsorted list. ---- Of course, a much more complete description of all this can be found in the manual "Inside Appletalk". I think that this manual is available from APDA. ---- In response to your question "Why Zones?", the answer is that, once you have a large network, you run into exactly the same computational and user-interface problems that are posed by directories on a large disk. Zones act like folders -- they partition the network into more managable chunks. --------------------------- Jack Palevich, Advanced Technology Group, Apple Computer, Inc. Disclaimer: Although, to the best of my knowlege, this information is correct, this message is not an official pronouncement by Apple Computer, Inc. Use the information provided at your own risk.