ispx_service_query(SAPD)
ispx_service_query --
query a local NetWare subnet for advertised network services
Syntax
cc . . . -lsaprqsts
#include <netware/sap_srvcs.h>
int ispx_service_query(service_type, server_name, server_type, retries,
delay, user_buffer)
int service_type;
char *server_name;
unsigned short server_type;
int retries;
int delay;
char **user_buffer;
Description
The ispx_service_query call
performs a local query of a NetWare subnet for advertised network services.
It is typically used by a client application
for the general or selective querying of SAPD.
When called with a
service_type
of
GENERAL_SERVICE_REQUEST,
the function returns one of the following:
-
an array of SAP_IDs for
all servers of all types
-
an array of SAP_IDs for
all servers of the type specified by server_type
-
an array of SAP_IDs for
all services of the server specified by server_name
When called with a
service_type
of
NEAREST_SERVICE_REQUEST,
the function returns a one-element array of SAP_IDs
holding the nearest server of the type specified by server_type.
service_type-
specifies either NEAREST_SERVER_REQUEST or
GENERAL_SERVICE_REQUEST.
server_name-
should be either a NULL-terminated character string
specifying a server to query, in which case the returned
list of services will be limited to those advertised on the server,
or NULL for a complete list of services.
server_type-
specifies a Novell object type.
retries-
specifies the number of retries.
It must be less than or equal to MAX_RETRIES.
It is recommended that MAX_RETRIES be used as the number of retries.
delay-
specifies the poll delay value.
If retries is set to 0, the delay value will be set to
MAX_DELAY.
It is recommended that MAX_DELAY be used as the poll delay value.
user_buffer-
is a doubly indirected pointer;
ispx_service_query
will dynamically allocate a buffer for the data and set
user_buffer
to point to it.
It is the user's responsibility to call
free
on this buffer.
The only exception to this rule is that one should not
call free if MALLOC_FAILED is returned.
Return values
On completion,
the ispx_service_query call
returns the number of
SAP_ID
structures contained in the buffer pointed to by
user_buffer,
or a value less than zero if unsuccessful.
On failure, return values are interpreted as follows:
[IPXDEV_OPEN_FAILED]-
the TLI t_open of /dev/ipx failed.
[T_BIND_FAILED]-
the TLI t_bind call failed.
[INVALID_SERVICE_TYPE]-
the SAP request type was invalid.
[T_SNDUDATA_FAILED]-
the TLI t_sndudata call failed and the
SAP request was not transmitted.
[POLL_FAILED]-
the poll call failed.
Note that a single SAP query
can result in multiple and unknown number of responses.
The ispx_service_query function polls
the connection end-point until all responses
have been processed.
[T_RCVUDATA_FAILED]-
the TLI t_rcvudata call failed.
[T_UNBIND_FAILED]-
the TLI t_unbind call failed.
[T_CLOSE_FAILED]-
the TLI t_close call failed.
[NAME_UNRESOLVED]-
the name could not be resolved, that is, an address
matching the specified name could not be found.
[MALLOC_FAILED]-
the call to dynamically allocate the
data buffer failed.
[REALLOC_FAILED]-
the call to dynamically allocate a
larger data buffer failed (in cases where the original buffer
was insufficient to hold all of the allocated data).
See also
ispx_advertise(SAPD),
ispx_get_address(SAPD),
ispx_nsrvr_rqst(SAPD)
Standards conformance
ispx_service_query is not part of any currently supported standard;
it is an extension of AT&T System V provided by The Santa Cruz Operation, Inc.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003