📄 libslp.h
字号:
#endif SLPHandleCallParams params;}SLPHandleInfo, *PSLPHandleInfo; #ifdef ENABLE_ASYNC_API/*=========================================================================*/typedef void* (*ThreadStartProc)(void *); /*=========================================================================*//*=========================================================================*/SLPError ThreadCreate(ThreadStartProc startproc, void *arg);/* Creates a thread *//* *//* startproc (IN) Address of the thread start procedure. *//* *//* arg (IN) An argument for the thread start procedure. *//* *//* Returns SLPError code *//*=========================================================================*/#endif/*=========================================================================*/int NetworkConnectToMulticast(struct sockaddr_in* peeraddr);/*=========================================================================*//*=========================================================================*/int NetworkConnectToSlpd(struct sockaddr_in* peeraddr); /* Connects to slpd and provides a peeraddr to send to *//* *//* peeraddr (OUT) pointer to receive the connected DA's address *//* *//* Returns Connected socket or -1 if no DA connection can be made *//*=========================================================================*//*=========================================================================*/void NetworkDisconnectDA(PSLPHandleInfo handle); /* Called after DA fails to respond *//* *//* handle (IN) a handle previously passed to NetworkConnectToDA() *//*=========================================================================*//*=========================================================================*/void NetworkDisconnectSA(PSLPHandleInfo handle); /* Called after SA fails to respond *//* *//* handle (IN) a handle previously passed to NetworkConnectToSA() *//*=========================================================================*//*=========================================================================*/int NetworkConnectToDA(PSLPHandleInfo handle, const char* scopelist, int scopelistlen, struct sockaddr_in* peeraddr); /* Connects to slpd and provides a peeraddr to send to *//* *//* handle (IN) SLPHandle info (caches connection reuse info) *//* *//* scopelist (IN) Scope that must be supported by DA. Pass in NULL *//* for any scope *//* *//* scopelistlen (IN) Length of the scope list in bytes. Ignored if *//* scopelist is NULL *//* *//* peeraddr (OUT) pointer to receive the connected DA's address *//* *//* Returns Connected socket or -1 if no DA connection can be made *//*=========================================================================*//*=========================================================================*/int NetworkConnectToSA(PSLPHandleInfo handle, const char* scopelist, int scopelistlen, struct sockaddr_in* peeraddr); /* Connects to slpd and provides a peeraddr to send to *//* *//* handle (IN) SLPHandle info (caches connection info) *//* *//* scopelist (IN) Scope that must be supported by SA. Pass in NULL *//* for any scope *//* *//* scopelistlen (IN) Length of the scope list in bytes. Ignored if *//* scopelist is NULL *//* *//* peeraddr (OUT) pointer to receive the connected SA's address *//* *//* Returns Connected socket or -1 if no SA connection can be made *//*=========================================================================*//*=========================================================================*/typedef SLPBoolean NetworkRplyCallback(SLPError errorcode, struct sockaddr_in* peerinfo, SLPBuffer replybuf, void* cookie); /* Function called by NetworkRqstRply to notify caller of the replies *//* received. Callback returns 0 when no more replies are desired *//* *//* errorcode (IN) errorcode that may have occured during the *//* Request process. May be set by the callback *//* to indicate an error in processing the replybuf *//* If errorcode is set then replybuf is probably not *//* valid *//* *//* peerinfo (IN) the peer that sent replybuf *//* *//* replybuf (IN) Buffer containing the reply *//* *//* *//* cookie (IN) Pointer to opaque data from the caller of *//* NetworkRqstRply() *//* *//* Returns: Callback should return SLP_TRUE if it wants to be *//* called again, or SLP_FALSE if it is finished *//*=========================================================================*//*=========================================================================*/SLPError NetworkRqstRply(int sock, struct sockaddr_in* peeraddr, const char* langtag, int extoffset, char* buf, char buftype, int bufsize, NetworkRplyCallback callback, void * cookie); /* Transmits and receives SLP messages via multicast convergence algorithm *//* *//* Returns - SLP_OK on success *//*=========================================================================*//*=========================================================================*/ #ifndef MI_NOT_SUPPORTEDSLPError NetworkMcastRqstRply(PSLPHandleInfo handle,#elseSLPError NetworkMcastRqstRply(const char* langtag,#endif /* MI_NOT_SUPPORTED */ char* buf, char buftype, int bufsize, NetworkRplyCallback callback, void * cookie);/* Description: *//* *//* Broadcasts/multicasts SLP messages via multicast convergence algorithm *//* *//* langtag (IN) Language tag to use in SLP message header *//* *//* buf (IN) pointer to the portion of the SLP message to send. The *//* portion to that should be pointed to is everything after *//* the pr-list. NetworkXcastRqstRply() automatically *//* generates the header and the prlist. *//* *//* buftype (IN) the function-id to use in the SLPMessage header *//* *//* bufsize (IN) the size of the buffer pointed to by buf *//* *//* callback (IN) the callback to use for reporting results *//* *//* cookie (IN) the cookie to pass to the callback *//* *//* Returns - SLP_OK on success. SLP_ERROR on failure *//*=========================================================================*/ #ifndef UNICAST_NOT_SUPPORTED/*=========================================================================*/SLPError NetworkUcastRqstRply(PSLPHandleInfo handle, char* buf, char buftype, int bufsize, NetworkRplyCallback callback, void * cookie);/* Description: *//* *//* Unicasts SLP messages *//* *//* handle (IN) pointer to the SLP handle *//* *//* buf (IN) pointer to the portion of the SLP message to send. *//* *//* buftype (IN) the function-id to use in the SLPMessage header *//* *//* bufsize (IN) the size of the buffer pointed to by buf *//* *//* callback (IN) the callback to use for reporting results *//* *//* cookie (IN) the cookie to pass to the callback *//* *//* Returns - SLP_OK on success. SLP_ERROR on failure *//*=========================================================================*/#endif /*=========================================================================*/int KnownDAConnect(PSLPHandleInfo handle, int scopelistlen, const char* scopelist, struct sockaddr_in* peeraddr);/* handle (IN) SLPHandle info (caches connection info) *//* *//* Get a connected socket to a DA that supports the specified scope *//* *//* scopelistlen (IN) stringlen of the scopelist *//* *//* scopelist (IN) DA must support this scope *//* *//* peeraddr (OUT) the peer that was connected to *//* *//* *//* returns: valid socket file descriptor or -1 if no DA is found *//*=========================================================================*//*=========================================================================*/void KnownDABadDA(struct in_addr* daaddr);/* Mark a KnownDA as a Bad DA. *//* *//* peeraddr (IN) address of the bad DA *//* *//* Returns: zero on success. *//*=========================================================================*//*=========================================================================*/int KnownDAGetScopes(int* scopelistlen,#ifndef MI_NOT_SUPPORTED char** scopelist, PSLPHandleInfo handle);#else char** scopelist);#endif /* MI_NOT_SUPPORTED *//* Gets a list of scopes from the known DA list *//* *//* scopelistlen (OUT) stringlen of the scopelist *//* *//* scopelist (OUT) NULL terminated list of scopes *//* *//* returns: zero on success, non-zero on failure *//*=========================================================================*//*=========================================================================*/void KnownDAProcessSrvRqst(PSLPHandleInfo handle);/* Process a SrvRqst for service:directory-agent *//* *//* handle (IN) the handle used to make the SrvRqst *//* *//* returns: none *//*=========================================================================*/#ifdef DEBUG/*=========================================================================*/void KnownDAFreeAll();/* Frees all (cached) resources associated with known DAs *//* *//* returns: none *//*=========================================================================*/#endif#endif /*LIBSLP_H_INCLUDED*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -