libslp.3n (2010 09)

l
libslp(3N) libslp(3N)
const char* scopelist,
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 proto-
col. 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 allo-
cated 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
parameters 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 unes-
caping 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
2 Hewlett-Packard Company 2 HP-UX 11i Version 3: September 2010