HP-UX Reference (11i v2 03/08) - 3 Library Functions A-M (vol 6)
l
libslp(3N) libslp(3N)
If lifetime is set to SLP_LIFETIME_MAXIMUM
, it will remain registered for the lifetime of the cal-
ling process.
The srvtype parameter is always ignored because the Service URL syntax required for the srvurl
parameter encapsulates the service-type.
Attributes list consists of comma separated attribute assignment expressions for the registered ser-
vice. If no attributes are to be provided, use an empty string
"" when registering services.
Example: (attr1=val1),(attr2
=val2),(attr3=val3)
SLPDereg()
Deregisters the advertisement for URL srvurl in all scopes where the service is registered in all
language locales. The deregistration is not just confined to the locale of the
SLPHandle; it is in all
locales. The API library is required to perform the operation in all scopes obtained through
configuration.
SLPFindSrvs()
Issue a query for services.
SLPFindSrvTypes()
The SLPFindSrvTypes()
function issues an SLP service type request for service types in the
scopes indicated by the scopelist . The results are returned through the callback parameter. The
service types are independent of language locale, but only for services registered in one of scopes
and for the indicated naming authority.
If the naming authority is "
*", then results are returned for all naming authorities. If the naming
authority is the empty string, i.e. "" , then the default naming authority, "IANA", is used. It is
not valid to specify "IANA" explicitly as a naming authority, and it will be taken by default. It will
return SLP_PARAMETER_BAD
error if it is included explicitly.
The service type names are returned with the naming authority intact. If the naming authority is
the default (i.e. empty string), then it is omitted, as is the separating "
.". Service type names from
URLs of the service :scheme are returned with the service : prefix intact.
SLPFindAttrs()
This function returns service attributes matching the attrids for the indicated Service URL or ser-
vice type. If srvurlorsrvtype is a service type name, then the attributes for all the registrations of
that service type are returned.
Callback Functions
Callback functions are required for all of the major SLP APIs that have been mentioned above. The call-
back functions and their semantics are listed below.
The parameters include:
hslp is the SLP handle.
errcode is a variable that is used to pass the status of the operation to the callback function by
the library function.
cookie is a pointer to memory passed on by the application code to the SLP library call.
srvurl contains the SLP service URL of the requested service.
lifetime is the lifetime of the service in seconds.
attrlist is a pointer to a buffer containing a comma separated null terminated list of attribute
id/value assignments in SLP wire format
(attr-id=attr-value-list) .
The functions are:
typedef void SLPRegReport(SLPHandle hslp, SLPError errcode,
void* cookie)
The SLPRegReport callback type is used as the type for the callback function that is passed in to the
SLPReg(), SLPDeReg() and SLPDelAttrs() functions. This callback function does not return
any value.
typedef SLPBoolean SLPSrvURLCallback(SLPHandle hslp,
const char* srvurl,
unsigned short lifetime,
SLPError errcode,
Section 3−−572 Hewlett-Packard Company − 4 − HP-UX 11i Version 2: August 2003