Consider the following notes when you review the SLP APIs used in the examples (Section : Running the Example Configuration) provided with the OpenSLP component:
•A service registration with no scope specified is a member of the default scope. Service registrations containing a scope must have DEFAULT listed to be a member of the default scope. A service registration with no naming authority specified is a member of the default naming authority (IANA, represented by the empty string).
•The SLPOpen API, used in all examples, returns an SLP handle for a particular language locale. The default language is English (represented by en). The isAsync parameter must be SLP_FALSE.
•The SLPClose API, also used in all examples, closes an open SLP handle and frees all resources associated with the handle. Callback functions will no longer be called.
•The SLPFindSrvTypes API, used in Example 1, locates service types (i.e., service:scheme). The query can be limited by a scope list and a naming authority. Results are returned in the callback function specified. Queries are independent of the language locale; service types for all language locales will be returned regardless of the language locale specified in the SLPOpen call and represented by the SLPHandle parameter to this function.
•The SLPSrvTypeCallback API, used in Example 1, is a function type that returns service types from the SLPFindSrvTypes query. The name of the function is user defined and is a parameter to the SLPFindSrvTypes function. Data can be passed between the client who makes the SLPFindSrvTypes call and the callback function via the pvCookie parameter.
•The SLPFindSrvs API, used in Examples 2, 4, and 5, locates the services. The query can be limited by a service type, scope list, or attribute search filter. Results are returned in the callback function specified. Queries are limited to the language locale specified in the SLPOpen call and represented by the SLPHandle parameter to this function.
•The SLPSrvURLCallback API, used in Examples 2, 4, and 5, is a function type that returns services from the SLPFindSrvs query. The name of the function is user defined and is a parameter to the SLPFindSrvs function. Data can be passed between the client who makes the SLPFindSrvs call and the callback function via the pvCookie parameter. This function serves as an iterator to return multiple values. This function must return SLP_TRUE to continue to return data. When the value of the errCode parameter is SLP_LAST_CALL, there will be no additional data to retrieve.
•The SLPFindAttrs API, used in Examples 3, 6, and 7, locates service attributes. The query can be limited by a scope list, attribute IDs, and either a service type or a service URL. Results are returned in the callback function specified. Queries are limited to the language locale specified in the SLPOpen call and represented by the SLPHandle parameter to this function.
•The SLPFindAttrCallback API, used in Examples 3, 6, and 7, is a function type that returns services from the SLPFinAttrs query. The name of the function is user defined and is a parameter to the SLPFindAttrs function. Data can be passed between the client who makes the SLPFindAttrs call and the callback function via the pvCookie parameter. This function serves as an iterator to return multiple values. This function must return SLP_TRUE to continue to return data. When the value of the errCode parameter is SLP_LAST_CALL, there will be no additional data to retrieve.
•Example 8 uses SLPFindSrvTypes, SLPFindSrvs, SLPSrvTypeCallback, and
SLPSrvURLCallback. The example demonstrates a complicated query using multiple SLP APIs.
Documentation
Documentation for OpenSLP can be accessed online from the Caldera Systems, Inc. Web site and from other SLP sites on the Web. Example and configuration files (Section : Configuration Files