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

l
libslp(3N) libslp(3N)
const char* attrids,
SLPSrvURLCallback callback,
void* cookie
);
DESCRIPTION
The SLP (Service Location Protocol) library routines provide a standard interface for writing application
programs that are SLP enabled. The SLP API is an interface that allows programmers to write client and
server applications to provide dynamic service discovery and selection.
The C language binding presents a minimal overhead implementation that maps directly into the protocol.
There is one C language function per protocol request, with the exception of the
SLPDereg() and
SLPDelAttrs()
functions, which map into different uses of the SLP deregister request. Parameters are
for the most part character buffers. Memory management is kept simple by having the client allocate most
memory and requiring that client callback functions copy incoming parameters into memory allocated by
the client code. Any memory returned directly from the API functions is deallocated using the
SLPFree() function.
To conform with standard C practice, all character strings passed to and returned through the API are null
terminated, even though the SLP protocol does not use null terminated strings. Strings passed as parame-
ters are UTF-8 but they may still be passed as a C string (a null terminated sequence of bytes.) Escaped
characters must be encoded by the API client as UTF-8. In the common case of US-ASCII, the usual one
byte per character C strings work. API functions are provided that assist in escaping and unescaping
strings.
Unless otherwise noted, parameters to API functions and callbacks are non-NULL. Some parameters may
have other restrictions. If any parameter fails to satisfy the restrictions on its value, the operation returns
a PARAMETER_BAD error.
Arguments
lang points to the language tag to be used.
isasync denotes whether the required operation is to be done asynchronously or synchronously.
Currently only synchronous operation is supported.
srvurl is the URL to be registered/deregistered.
lifetime is the lifetime of the Service URL to be registered in seconds less than or equal to
SLP_LIFETIME_MAXIMUM
and greater than zero.
srvtype is the service type name in the service
:scheme format.
attrs is the list of attributes of the service type.
fresh is used with SLP service registration and denotes whether the registration request is a new
one or if it is a request for update of existing registration. Currently updating an existing
registration is not supported.
Note: Currently asynchronous operations and incremental registrations are not supported.
Hence isasync has be set to SLP_FALSE always, and fresh has to be set to SLP_TRUE
. Oth-
erwise an
SLP_NOT_IMPLEMENTED error is returned.
callback is a pointer to a callback function of appropriate type that will be called for processing the
reply.
cookie is the pointer to memory passed from the application to the SLP library for the callback to fill
the return values.
scopelist is the comma-separated list of scopes.
filter is a pattern matching expression formed of attributes in LDAPv3 search filter syntax, which
will be used by the server to filter the results.
namingauthority
is the naming authority to search for.
Callbacks
The callback function allows the application developer to control the processing of the results of the library
calls. With asynchronous programming calls, it allows the program code, which passes the callback func-
tion as one of the paramaters to the library function, to continue to perform its job, while the result of that
HP-UX 11i Version 3: February 2007 2 Hewlett-Packard Company 747