HP-UX Reference (11i v3 07/02) - 3 Library Functions A-M (vol 6)

l
libslp(3N) libslp(3N)
operation is being evaluated by the callback function.
The callback function is called whenever the API library has results to report. The callback code is
required to check the error code parameter before looking at the other parameters. If the error code is not
SLP_OK, the other parameters may be NULL or otherwise invalid. The API library can terminate any
outstanding operation on which an error occurs. The callback code can similarly indicate that the operation
should be terminated by passing back SLP_FALSE to indicate that it is not interested in receiving more
results. Callback functions are not permitted to recursively call into the API on the same
SLPHandle.
If an attempt is made to call the API, the API function returns
SLP_HANDLE_IN_USE
. Prohibiting
recursive callbacks on the same handle simplifies implementation of thread safe code, since locks held on
the handle will not be in place during a second outcall on the handle.
The total number of results received can be controlled by setting the net.slp.maxResults parameter.
On the last call to a callback, whether asynchronous or synchronous, the status code passed to the callback
has the value,
SLP_LAST_CALL
.
Primary Routines
SLPOpen()
Returns an SLPHandle handle in the hslp parameter for the language locale passed in as the lang
parameter. The handle encapsulates the language locale for SLP requests issued through the handle,
and any other resources required by the implementation. The return value of the function is an
SLPError code indicating the status of the operation. Upon failure, the hslp parameter is set to
NULL.
An SLPHandle can only be used for one SLP API operation at a time. If the original operation was
started asynchronously, any attempt to start an additional operation on the handle while the original
operation is pending results in the return of an SLP_HANDLE_IN_USE
error from the API function.
Currently asynchronous operation is not supported. If the isasync parameter is set to
SLP_TRUE,
SLP_NOT_IMPLEMENTED
is returned.
lang is a pointer to a null terminated array of characters containing the RFC 1766 Language Tag.
Pass in NULL or the empty string,
"" , to use the locale the machine is configured to use.
Currently English is the only supported language tag. Any other value passed to langtag will cause
SLP_NOT_IMPLEMENTED
to be returned.
Return values are:
SLP_OK
SLP_PARAMETER_BAD
SLP_NOT_IMPLEMENTED
SLP_MEMORY_ALLOC_FAILED
SLPClose()
Frees all resources associated with the handle hslp. If the handle was invalid, the functions returns
silently. Any outstanding synchronous or asynchronous operations are cancelled so their callback
functions will not be called any longer.
SLPReg()
Registers the URL in srvurl having the lifetime, lifetime, and the attribute list in attrs. The attrs list
is a comma separated list of attribute assignments in the wire format (including escaping of reserved
characters). The lifetime parameter must be nonzero and less than or equal to
SLP_LIFETIME_MAXIMUM. If the fresh argument is SLP_TRUE, then the registration is new (the
SLP protocol FRESH flag is set), and the registration replaces any existing registrations. The srvtype
parameter is a service type name and can be included for service URLs that are not in the
service
:scheme.
If the URL is in the service :scheme, the srvtype parameter is ignored. If the fresh argument is
SLP_FALSE, then an existing registration is updated.
The service URL to be registered must conform to the SLP Service URL syntax, and it may not be the
empty string or NULL. SLP_INVALID_REGISTRATION will be returned if srvurl is not a SLP
Service URL.
If lifetime is set to
SLP_LIFETIME_MAXIMUM, it will remain registered for the lifetime of the cal-
ling process.
748 Hewlett-Packard Company 3 HP-UX 11i Version 3: February 2007