⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 slp.h

📁 SLP协议在linux下的实现。此版本为1.2.1版。官方网站为www.openslp.org
💻 H
📖 第 1 页 / 共 5 页
字号:
/* type, the value of pcAttrList and calling behavior depend on whether    *//* the handle was opened asynchronously or synchronously.  If the handle   *//* was opened asynchronously, the callback is called every time the API    *//* library has results from a remote agent.  The pcAttrList parameter      *//* MAY be uncollated between calls.  It contains a comma separated list    *//* with the results from the agent that immediately returned results.      *//* If the handle was opened synchronously, the results must be collated    *//* from all returning agents and the callback is called once, with the     *//* pcAttrList parameter set to the collated result.                        *//*                                                                         *//* hSLP         The SLPHandle used to initiate the operation.              *//*                                                                         *//* pcAttrList   A character buffer containing a comma separated, null      *//*              terminated list of attribute id/value assignments, in SLP  *//*              wire format; i.e.  "(attr-id=attr-value-list)".            *//*                                                                         *//* errCode      An error code indicating if an error occurred during the   *//*              operation.  The callback should check this error code      *//*              before processing the parameters.  If the error code is    *//*              other than SLP_OK, then the API library may choose to      *//*              terminate the outstanding operation.                       *//*                                                                         *//* pvCookie     Memory passed down from the client code that called the    *//*              original API function, starting the operation.             *//*              May be NULL.                                               *//*                                                                         *//* Returns      The client code should return SLP_TRUE if more data is     *//*              desired,otherwise return SLP_FALSE                         *//*=========================================================================*//*=========================================================================*/SLPEXP SLPError SLPAPI SLPOpen(const char *pcLang,                             SLPBoolean isAsync,                             SLPHandle *phSLP);/*                                                                         *//* Returns a SLPHandle handle in the phSLP parameter for the language      *//* locale passed in as the pcLang parameter.  The client indicates if      *//* operations on the handle are to be synchronous or asynchronous          *//* through the isAsync parameter.  The handle encapsulates the language    *//* locale for SLP requests issued through the handle, and any other        *//* resources required by the implementation.  However, SLP properties      *//* are not encapsulated by the handle; they are global.  The return        *//* value of the function is an SLPError code indicating the status of      *//* the operation.  Upon failure, the phSLP parameter is NULL.              *//*                                                                         *//* An SLPHandle can only be used for one SLP API operation at a time.      *//* If the original operation was started asynchronously, any attempt to    *//* start an additional operation on the handle while the original          *//* operation is pending results in the return of an SLP_HANDLE_IN_USE      *//* error from the API function.  The SLPClose() API function terminates    *//* any outstanding calls on the handle.  If an implementation is unable    *//* to support a asynchronous( resp.  synchronous) operation, due to        *//* memory constraints or lack of threading support, the                    *//* SLP_NOT_IMPLEMENTED flag may be returned when the isAsync flag is       *//* SLP_TRUE (resp.  SLP_FALSE).                                            *//*                                                                         *//* pcLang   A pointer to an array of characters containing the RFC 1766    *//*          Language Tag RFC 1766 for the natural language locale of       *//*          requests and registrations issued on the handle. Pass in NULL  *//*          or the empty string, "" to use the default locale              *//*                                                                         *//* isAsync  An SLPBoolean indicating whether the SLPHandle should be opened*//*          for asynchronous operation or not.                             *//*                                                                         *//* phSLP    A pointer to an SLPHandle, in which the open SLPHandle is      *//*          returned.  If an error occurs, the value upon return is NULL.  *//*                                                                         *//* Returns  SLPError code                                                  *//*=========================================================================*//*=========================================================================*/SLPEXP void SLPAPI SLPClose(SLPHandle hSLP);/*                                                                         *//* Frees all resources associated with the handle.  If the handle was      *//* invalid, the function returns silently.  Any outstanding synchronous    *//* or asynchronous operations are cancelled so their callback functions    *//* will not be called any further.                                         *//*                                                                         *//* SLPHandle    A SLPHandle handle returned from a call to SLPOpen().      *//*=========================================================================*/#ifndef MI_NOT_SUPPORTED/*=========================================================================*/SLPEXP SLPError SLPAssociateIFList( SLPHandle hSLP, const char* McastIFList);/*                                                                         *//* Associates a list of interfaces McastIFList on which multicast needs to *//* be done with a particular SLPHandle hSLP. McastIFList is a comma        *//* separated list of host interface IP addresses.                          *//*                                                                         *//* hSLP                 The SLPHandle with which the interface list is to  *//*                      be associated with.                                *//*                                                                         *//* McastIFList          A comma separated list of host interface IP        *//*                      addresses on which multicast needs to be done.     *//*                                                                         *//* Returns  SLPError code                                                  *//*=========================================================================*/#endif /* MI_NOT_SUPPORTED */#ifndef UNICAST_NOT_SUPPORTED/*=========================================================================*/SLPEXP SLPError SLPAssociateIP( SLPHandle hSLP, const char* unicast_ip);/*                                                                         *//* Associates an IP address unicast_ip with a particular SLPHandle hSLP.   *//* unicast_ip is the IP address of the SA/DA from which service is         *//* requested.                                                              *//*                                                                         *//* hSLP                 The SLPHandle with which the unicast_ip address is *//*                      to be associated with.                             *//*                                                                         *//* unicast_ip           IP address of the SA/DA from which service is      *//*                      requested.                                         *//*                                                                         *//* Returns  SLPError code                                                  *//*=========================================================================*/#endif#define SLP_REG_FLAG_FRESH      (1)#define SLP_REG_FLAG_WATCH_PID  (1 << 1)/*=========================================================================*/SLPEXP SLPError SLPAPI SLPReg(SLPHandle   hSLP,                const char  *pcSrvURL,                const unsigned short usLifetime,                const char  *pcSrvType,                const char  *pcAttrs,                SLPBoolean fresh,                SLPRegReport callback,                void *pvCookie); /*                                                                         *//* Registers the URL in pcSrvURL having the lifetime usLifetime with the   *//* attribute list in pcAttrs.  The pcAttrs list is a comma separated       *//* list of attribute assignments in the wire format (including escaping    *//* of reserved characters).  The usLifetime parameter must be nonzero      *//* and less than or equal to SLP_LIFETIME_MAXIMUM. If the fresh flag is    *//* SLP_TRUE, then the registration is new (the SLP protocol FRESH flag     *//* is set) and the registration replaces any existing registrations.       *//* The pcSrvType parameter is a service type name and can be included      *//* for service URLs that are not in the service:  scheme.  If the URL is   *//* in the service:  scheme, the pcSrvType parameter is ignored.  If the    *//* fresh flag is SLP_FALSE, then an existing registration is updated.      *//* Registrations and updates take place in the language locale of the      *//* hSLP handle.                                                            *//*                                                                         *//* hSLP         The language specific SLPHandle on which to register the   *//*              advertisement.                                             *//*                                                                         *//* pcSrvURL     The URL to register.  May not be the empty string. May not *//*              be NULL.  Must conform to SLP Service URL syntax.          *//*              SLP_INVALID_REGISTRATION will be returned if it does not.  *//*                                                                         *//* usLifetime   An unsigned short giving the life time of the service      *//*              advertisement, in seconds.  The value must be an unsigned  *//*              integer less than or equal to SLP_LIFETIME_MAXIMUM and     *//*              greater than zero. If SLP_LIFETIME_MAXIMUM is used, the    *//*              registration will remain for the life of the calling       *//*              process.  Also, OpenSLP, will not allow registrations to   *//*              be made with SLP_LIFETIME_MAXIMUM unless                   *//*              SLP_REG_FLAG_WATCH_PID is also used                        *//*                                                                         *//* pcSrvType    This parameter is ALWAYS ignored since the SLP Service URL *//*              syntax required for the pcSrvURL encapsulates the service  *//*              type.                                                      *//*                                                                         *//* pcAttrs      A comma separated list of attribute assignment expressions *//*              for the attributes of the advertisement.  Use empty string,*//*              "" for no attributes.                                      *//*                                                                         *//* fresh        Use of non-fresh registrations is deprecated.  SLP_TRUE    *//*              must be passed in for this parameter or SLP_BAD_PARAMETER  *//*              will be returned                                           *//*                                                                         *//* callback     A SLPRegReport callback to report the operation completion *//*              status.                                                    *//*                                                                         *//* pvCookie     Memory passed to the callback code from the client.  May be*//*              NULL.                                                      *//*                                                                         *//* Returns:     If an error occurs in starting the operation, one of the   *//*              SLPError codes is returned.                                *//*=========================================================================*//*=========================================================================*/SLPEXP SLPError SLPAPI SLPDereg(SLPHandle  hSLP,                  const char *pcSrvURL,                  SLPRegReport callback,                  void *pvCookie);   /*                                                                         *//* Deregisters the advertisement for URL pcURL in all scopes where the     *//* service is registered and 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.                                  */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -