📄 slp.h
字号:
/* A basic failure of the API causes this error to be returned. *//* This occurs when a system call or library fails. The operation *//* could not recover. */#define SLP_HANDLE_IN_USE -25/* In the C API, callback functions are not permitted to *//* recursively call into the API on the same SLPHandle, either *//* directly or indirectly. If an attempt is made to do so, this *//* error is returned from the called API function. */#define SLP_TYPE_ERROR -26 #ifndef UNICAST_NOT_SUPPORTED/* The SLP UA needs to send a unicast query to a SA because this SA has *//* sent a packet > MTU size */# define SLP_RETRY_UNICAST -27#endif /* If the API supports type checking of registrations against *//* service type templates, this error can arise if the attributes *//* in a registration do not match the service type template for *//* the service. *//*==========================================================================*//* SLPBoolean *//*------------ *//* The SLPBoolean enum is used as a boolean flag. */typedef enum{ SLP_FALSE = 0, SLP_TRUE = 1} SLPBoolean;/*==========================================================================*//* SLPSrvURL *//*----------- *//* The SLPSrvURL structure is filled in by the SLPParseSrvURL() function *//* with information parsed from a character buffer containing a service *//* URL. The fields correspond to different parts of the URL. Note that *//* the structure is in conformance with the standard Berkeley sockets *//* struct servent, with the exception that the pointer to an array of *//* characters for aliases (s_aliases field) is replaced by the pointer *//* to host name (s_pcHost field). */typedef struct srvurl{ char *s_pcSrvType; /* A pointer to a character string containing the service */ /* type name, including naming authority. The service type */ /* name includes the "service:" if the URL is of the service: */ /* scheme. */ char *s_pcHost; /* A pointer to a character string containing the host */ /* identification information. */ int s_iPort; /* The port number, or zero if none. The port is only available */ /* if the transport is IP. */ char *s_pcNetFamily; /* A pointer to a character string containing the network address */ /* family identifier. Possible values are "ipx" for the IPX */ /* family, "at" for the Appletalk family, and "" (i.e. the empty */ /* string) for the IP address family. */ char *s_pcSrvPart; /* The remainder of the URL, after the host identification. */} SLPSrvURL;/*=========================================================================*/#if(!defined SLPHANDLE_INTERNAL)/*=========================================================================*/typedef void* SLPHandle;/* *//* The SLPHandle type is returned by SLPOpen() and is a parameter to all *//* SLP functions. It serves as a handle for all resources allocated on *//* behalf of the process by the SLP library. The type is opaque, since *//* the exact nature differs depending on the implementation. *//*=========================================================================*/#endif/*=========================================================================*/typedef void SLPCALLBACK SLPRegReport(SLPHandle hSLP, SLPError errCode, void *pvCookie);/* *//* The SLPRegReport callback type is the type of the callback function *//* to the SLPReg(), SLPDereg(), and SLPDelAttrs() functions. *//* *//* hSLP The SLPHandle used to initiate the operation. *//* *//* errCode An error code indicating if an error occurred during the *//* operation. *//* *//* pvCookie Memory passed down from the client code that called the *//* original API function, starting the operation. May be NULL. *//*=========================================================================*//*=========================================================================*/typedef SLPBoolean SLPCALLBACK SLPSrvTypeCallback(SLPHandle hSLP, const char* pcSrvTypes, SLPError errCode, void *pvCookie);/* *//* The SLPSrvTypeCallback type is the type of the callback function *//* parameter to SLPFindSrvTypes() function. If the hSLP handle *//* parameter was opened asynchronously, the results returned through the *//* callback MAY be uncollated. If the hSLP handle parameter was opened *//* synchronously, then the returned results must be collated and *//* duplicates eliminated. *//* *//* hSLP The SLPHandle used to initiate the operation. *//* *//* pcSrvTypes A character buffer containing a comma separated, null *//* terminated list of service types. *//* *//* errCode An error code indicating if an error occurred during the *//* operation. The callback should check this error code befor*//* 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 *//*=========================================================================*//*=========================================================================*/typedef SLPBoolean SLPCALLBACK SLPSrvURLCallback(SLPHandle hSLP, const char* pcSrvURL, unsigned short sLifetime, SLPError errCode, void *pvCookie);/* *//* 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. If the hSLP handle parameter was opened *//* synchronously, then the returned results must be collated and *//* duplicates eliminated. *//* *//* hSLP The SLPHandle used to initiate the operation. *//* *//* pcSrvURL A character buffer containing the returned service URL. *//* May be NULL if errCode not SLP_OK. *//* *//* sLifetime 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. *//* *//* 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. SLP_LAST_CALL is *//* returned when no more services are available and the *//* callback will not be called again.. *//* *//* 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 *//*=========================================================================*//*=========================================================================*/typedef SLPBoolean SLPCALLBACK SLPAttrCallback(SLPHandle hSLP, const char* pcAttrList, SLPError errCode, void *pvCookie); /* *//* The SLPAttrCallback type is the type of the callback function *//* parameter to SLPFindAttrs() function. *//* *//* The behavior of the callback differs depending on whether the *//* attribute request was by URL or by service type. If the *//* SLPFindAttrs() operation was originally called with a URL, the *//* callback is called once regardless of whether the handle was opened *//* asynchronously or synchronously. The pcAttrList parameter contains *//* the requested attributes as a comma separated list (or is empty if no *//* attributes matched the original tag list). *//* *//* If the SLPFindAttrs() operation was originally called with a service */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -