Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ nbp(3N) — A/UX 2.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ddp(3n)




nbp(3N) nbp(3N)
NAME nbp_parse_entity, nbp_make_entity, nbp_confirm, nbp_lookup, nbp_register, nbp_remove - AppleTalk Name Binding Protocol (NBP) interface. SYNOPSIS #include <at/appletalk.h> #include <at/nbp.h> cc [flags] files -lat [libraries] int nbp_parse_entity(entity, str); at_entity_t *entity; char *str; int nbp_make_entity(entity, object, type, zone); at_entity_t *entity; char *object, *type, *zone; int nbp_confirm(entity, dest, retry); at_entity_t *entity; at_inet_t *dest; at_retry_t *retry; int nbp_lookup(entity, buf, max, retry); at_entity_t *entity; at_nbptuple_t *buf; int max; at_retry_t *retry; int nbp_register(entity, fd, retry); at_entity_t *entity; int fd; at_retry_t *retry; int nbp_remove(entity, fd ) ; at_entity_t *entity; int fd; DESCRIPTION The NBP interface provides applications with access to the NBP operations. The routines use these structures (defined in <at/appletalk.h>): typedef struct at_inet { at_net net; at_node node; at_socket socket; } at_inet_t; typedef struct at_retry { short interval; April, 1990 1



nbp(3N) nbp(3N)
short retries; u_char backoff; } at_retry_t; The AppleTalk NBP operations also use these structures (de- fined in <at/nbp.h>): typedef struct at_nvestr { char len; char str[NBP_NVE_STR_SIZE]; } at_nvestr_t; typedef struct at_entity { at_nvestr_t object; at_nvestr_t type; at_nvestr_t zone; } at_entity_t; typedef struct at_nbptuple { at_inet_t enu_addr; u_char enu_enum; at_entity_t enu_entity; } at_nbptuple_t; The at_inet_t structure specifies the AppleTalk internet ad- dress of a DDP socket endpoint. The at_retry_t structure specifies the retry interval and maximum count for a transaction. The members of this struc- ture are interval The interval in seconds before NBP retries a re- quest. retries The maximum number of retries for this NBP re- quest. backoff Not used by NBP. The at_nvestr_t structure specifies an NBP entity string. The members of this structure are: len The length of the string in bytes. str The character data for this string. The at_entity_t structure describes an entity name, which consists of three NBP entity strings: object, type, and zone. 2 April, 1990



nbp(3N) nbp(3N)
All NBP routines work with the at_entity_t structure. Two utility routines, nbp_parse_entity, and nbp_make_entity, are provided to aid in creating at_entity_t structures from C strings. The nbp_parse_entity structure constructs an NBP entity name from a NULL-terminated C string of the form object, object:type, or object:type@zone. The entity name is placed in the at_entity_t structure entity. This routine returns 0 on success. The nbp_make_entity structure constructs an NBP entity name from object, type, and zone strings. The strings are NULL- terminated C strings. The entity name is placed into the at_entity_t structure entity. Use the object, type, and zone character strings to construct the entity name. This rou- tine returns 0 on success. The nbp_confirm structure sends a confirmation request to the specified node to see if an entity name is still re- gistered at the specified AppleTalk internet address. entity A pointer to the at_entity_t structure containing the entity name. No wildcards are allowed in the entity name strings, but an asterisk (*) for zone is acceptable. dest The AppleTalk internet address to confirm. If the name is still registered on the node but at a dif- ferent socket number, the socket number in dest is updated. retry A pointer to the structure that specifies the NBP request retry interval in seconds and the maximum retry count. If retry is NULL, the system uses the default values: a 1-second interval and eight retries. On success, nbp_confirm returns 1. It returns 0 when the name is not confirmed, and -1 on error. The nbp_lookup structure returns a list of registered name- address pairs via an NBP lookup. The parameters are entity A pointer to the at_entity_t structure containing the entity name to be looked up. buf An array of at_nbptuple_t to receive entity tu- ples. max The maximum number of entity tuples to accept. If max or more distinct tuples are received before April, 1990 3



nbp(3N) nbp(3N)
the lookup retry is exceeded, the lookup ter- minates. retry The pointer to the structure that specifies the NBP request retry interval in seconds and the max- imum retry count. If retry is NULL, the system uses the default values: a one-second interval and eight retries. On success, nbp_lookup returns the number of entity tuples actually received. The nbp_register structure adds the specified name-socket pair to the list of registered names on this node. The parameters are entity A pointer to the at_entity_t structure containing the entity name to be registered. The zone field of entity is always ignored. No wildcards are al- lowed in the entity strings. fd An AppleTalk file descriptor to be registered with the given name. retry A pointer to the structure that specifies the NBP request retry interval in seconds and the maximum retry count. If retry is NULL, the system uses the default values: a 1-second interval and eight retries. The nbp_remove structure removes the specified entity name from the list of registered names on this node. The parame- ters are entity A pointer to the at_entity_t structure containing the entity name to be removed. The zone field of entity is always ignored. No wildcards are al- lowed in the entity strings. fd The AppleTalk file descriptor that is registered with the given name. WARNINGS Strings in entity names and entity tuples are not NULL ter- minated. All characters in NVE names are significant, including trailing blanks. See Inside AppleTalk for a description of NVE names. 4 April, 1990



nbp(3N) nbp(3N)
DIAGNOSTICS All routines return -1 on error with a detailed error code in errno: [EINVAL] The entity name is invalid. [ETIMEDOUT] The request exceeded maximum retry count. SEE ALSO ddp(3n), Inside AppleTalk. April, 1990 5

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026