HP-UX Reference (11i v2 07/12) - 3 Library Functions A-M (vol 6)
l
libslp(3N) libslp(3N)
The SLPSrvURLCallback type is the type of the callback function parameter to
SLPFindSrvs()
function. If the hslp handle parameter was opened asynchronously, the results returned through the
callback MAY be uncollated. The callback should return
SLP_TRUE if more data is desired. The call-
back may continue to return
SLP_TRUE until it is called with an errcode of
SLP_LAST_CALL
.Ifno
more data is requested the callback should return
SLP_FALSE.
typedef SLPBoolean SLPAttrCallback(SLPHandle hslp,
const char* attrlist,
SLPError errcode,
void* cookie)
The SLPAttrCallback type is the type of callback function passed as a parameter to the
SLPFin-
dAttrs()
function. The behavior of the library differs depending on whether the attribute request
was by Service URL or by service type.
If the SLPFindAttrs()
function was called with a Service URL, then the callback is called once
regardless of whether the handle was opened asynchronously or synchronously. The attrlist parame-
ter will contain a comma separated list of attributes.
If the
SLPFindAttrs()
function was called with a service type, then the callback is called until no
more results are available. The attrlist parameter will contain a comma separated list of attributes.
Replies from SA’s and DA’s will be collated to remove duplicates if
SLPFindAttrs() was called
synchronously. But when called asynchronously the attrlist may return duplicates.
The callback should return
SLP_TRUE if more data is desired. The callback may continue to return
SLP_TRUE until it is called with an errcode of SLP_LAST_CALL
. If no more data is requested the
callback should return
SLP_FALSE.
Miscellaneous routines
The following are the routines for parsing the service URL.
SLPParseSrvURL(const char* srvurl, SLPSrvURL** parsedurl)
Parses a Service URL passed in as a null terminated character string and returns the results in a
pointer to a dynamically allocated SLPSrvURL structure. The pointer returned in parsedurl should
be freed by SLPFree().
SLPSrvURL
structure is defined in <slp.h> as follows:
typedef struct srvurl
{
char *s_pcSrvType;
char *s_pcHost;
int s_iPort;
char *s_pcNetFamily;
char *s_pcSrvPart;
} SLPSrvURL;
SLPError SLPEscape(const char* unescaped,
char** escaped, SLPBoolean istag)
Processes the input string to escape any SLP reserved characters and returns the escaped string in
dynamically allocated memory. If the istag parameter is SLP_TRUE, then SLPEscape() will look
for bad tag characters.
SLPError SLPUnescape(const char* escaped, char** unescaped,
SLPBoolean istag)
Process the input escaped string to unescape any SLP reserved characters. The unescaped string is
returned in dynamically allocated memory the pointer to which is returned in unescaped . The
memory should be freed by calling SLPFree() when no longer needed. If the istag parameter is
SLP_TRUE, then SLPUnEscape() will look for bad tag characters.
void SLPFree (void* mem)
Frees memory that was returned from SLPParseSrvURL(), SLPFindScopes()
, SLPEs-
cape()
, and SLPUnescape().
The following routines may be used to determine the configuration of SLP on the local machine and on the
network.
unsigned short SLPGetRefreshInterval(void)
Returns the minimum refresh interval that will be accepted by all SLP SA and DA agents on the net-
work.
HP-UX 11i Version 2: December 2007 Update − 5 − Hewlett-Packard Company 697