zip(3N) zip(3N)NAME zip_getmyzone, zip_getzonelist, zip_getlocalzones - provide a AppleTalk Zone Information Protocol (ZIP) interface SYNOPSIS #include <at/appletalk.h> #include <at/zip.h> cc [flags] files -lat [libraries] int zip_getmyzone(zone) at_nvestr_t *zone; int zip_getzonelist(start, zones) int start; at_nvestr_t *zones[]; int zip_getlocalzones(start, zones) int start; at_nvestr_t *zones[]; DESCRIPTION The ZIP interface provides applications with access to the AppleTalk Zone Information Protocol operations. The zip_getmyzone routine obtains the zone name for the local network. In the case of LocalTalk, this involves sending a ZIP request to a local bridge to get the zone name of the default network. In the case of EtherTalk, the request is completed on the node itself. The parameters are zone A pointer to the zone name. The zone string is defined by the following structure (see <at/nbp.h>): typedef struct at_nvestr { u_char len; u_char str[NBP_NVE_STR_SIZE]; } at_nvestr_t; len The size of the string in bytes. str The zone name. This routine returns 0 upon success. The zip_getzonelist routine obtains a complete list of all the zone names defined in the internet. This routine sends a ZIP request to a bridge for the list of zone names in the internet. The list is placed in the supplied buffer as concatenated at_nvestr_t structures. The parameters are start The starting index for the get zone list request. The start index is the value of the index at which to start including zone names in the response. It is used to obtain a zone list that may not fit into one ATP January 1992 1
zip(3N) zip(3N)response packet. The start index should initially be 1. While zip_getzonelist returns a value greater than 0, the caller must reissue zip_getzonelist calls to get more zone names from the bridge, specifying a start index of the previous start index plus the previous return value of zip_getzonelist. buf A buffer to hold this list of zone names. Each zone name is an at_nvestr_t structure. The size of this buffer (in bytes) must be at least ATP_DATA_SIZE. Upon successful completion, this routine returns the number of zone names in the list. When all zones in the bridge's Zone Information Table have been returned, this routine returns 0. The use and behavior of the zip_getlocalzones routine are the same as for zip_getzonelist, except that the former returns the list of zones on the local EtherTalk cable rather than all the zones on the internet. On LocalTalk, zip_getlocalzones returns only the current zone name. STATUS MESSAGES AND VALUES All routines return -1 on error, with a detailed error code stored in errno: [EINVAL] A parameter is invalid. [ENETUNREACH] A bridge node could not be found to process the request. Routines also return any error codes returned by the underlying ATP or DDP layers. WARNINGS The returned zone strings are not NULL-terminated. SEE ALSO ddp(3N), atp(3N) Inside AppleTalk ``AppleTalk Programming Guide,'' in A/UX Network Applications Programming 2 January 1992