#include "ydef.h"
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netinet/tcp.h>
#include "ythread.h"
Go to the source code of this file.
Classes | |
struct | os_ifaces |
struct | SSDP_CACHE_ENTRY |
struct | SSDPInfos |
struct | WakeUpSocket |
Macros | |
#define | closesocket(s) close(s) |
#define | INVALID_SOCKET -1 |
#define | NB_OS_IFACES 8 |
#define | NB_SSDP_CACHE_ENTRY 32 |
#define | OS_IFACE_CAN_MCAST 1 |
#define | REPORT_ERR(msg) if(errmsg){ YSPRINTF(errmsg,YOCTO_ERRMSG_LEN,"%s (%s:%d / errno=%d)",(msg), __FILE_ID__, __LINE__, SOCK_ERR);errmsg[YOCTO_ERRMSG_LEN-1]='\0';} |
#define | SEND_NOSIGPIPE 0 |
#define | SOCK_ERR (errno) |
#define | SOCKET_ERROR -1 |
#define | SSDP_URL_LEN 48 |
#define | SSDP_UUID_LEN 48 |
#define | yNetSetErr() yNetSetErrEx(__LINE__,SOCK_ERR,errmsg) |
#define | YTCP_REMOTE_CLOSE 1 |
Typedefs | |
typedef void(* | ssdpHubDiscoveryCallback) (const char *serial, const char *urlToRegister, const char *urlToUnregister) |
Functions | |
void * | ws_thread (void *ctx) |
int | yConsumeWakeUpSocket (WakeUpSocket *wuce, char *errmsg) |
int | yDringWakeUpSocket (WakeUpSocket *wuce, u8 signal, char *errmsg) |
void | yDupSet (char **storage, const char *val) |
void | yFreeWakeUpSocket (WakeUpSocket *wuce) |
void | yInitWakeUpSocket (WakeUpSocket *wuce) |
int | yNetSetErrEx (u32 line, unsigned err, char *errmsg) |
struct _RequestSt * | yReqAlloc (struct _HubSt *hub) |
void | yReqClose (struct _RequestSt *tcpreq) |
void | yReqFree (struct _RequestSt *tcpreq) |
int | yReqGet (struct _RequestSt *tcpreq, u8 **buffer) |
int | yReqHasPending (struct _HubSt *hub) |
int | yReqIsAsync (struct _RequestSt *req) |
int | yReqIsEof (struct _RequestSt *tcpreq, char *errmsg) |
int | yReqMultiSelect (struct _RequestSt **tcpreq, int size, u64 ms, WakeUpSocket *wuce, char *errmsg) |
int | yReqOpen (struct _RequestSt *tcpreq, int wait_for_start, int tcpchan, const char *request, int reqlen, u64 mstimeout, yapiRequestAsyncCallback callback, void *context, yapiRequestProgressCallback progress_cb, void *progress_ctx, char *errmsg) |
int | yReqRead (struct _RequestSt *rcoreq, u8 *buffer, int len) |
int | yReqSelect (struct _RequestSt *tcpreq, u64 ms, char *errmsg) |
u32 | yResolveDNS (const char *name, char *errmsg) |
int | ySSDPDiscover (SSDPInfos *SSDP, char *errmsg) |
int | ySSDPStart (SSDPInfos *SSDP, ssdpHubDiscoveryCallback callback, char *errmsg) |
void | ySSDPStop (SSDPInfos *SSDP) |
int | yStartWakeUpSocket (WakeUpSocket *wuce, char *errmsg) |
int | yTcpDownload (const char *host, const char *url, u8 **out_buffer, u32 mstimeout, char *errmsg) |
int | yTcpInit (char *errmsg) |
void | yTcpShutdown (void) |
#define REPORT_ERR | ( | msg | ) | if(errmsg){ YSPRINTF(errmsg,YOCTO_ERRMSG_LEN,"%s (%s:%d / errno=%d)",(msg), __FILE_ID__, __LINE__, SOCK_ERR);errmsg[YOCTO_ERRMSG_LEN-1]='\0';} |
#define yNetSetErr | ( | ) | yNetSetErrEx(__LINE__,SOCK_ERR,errmsg) |
typedef void(* ssdpHubDiscoveryCallback) (const char *serial, const char *urlToRegister, const char *urlToUnregister) |
void* ws_thread | ( | void * | ctx | ) |
int yConsumeWakeUpSocket | ( | WakeUpSocket * | wuce, |
char * | errmsg | ||
) |
int yDringWakeUpSocket | ( | WakeUpSocket * | wuce, |
u8 | signal, | ||
char * | errmsg | ||
) |
void yFreeWakeUpSocket | ( | WakeUpSocket * | wuce | ) |
void yInitWakeUpSocket | ( | WakeUpSocket * | wuce | ) |
struct _RequestSt* yReqAlloc | ( | struct _HubSt * | hub | ) |
void yReqClose | ( | struct _RequestSt * | tcpreq | ) |
void yReqFree | ( | struct _RequestSt * | tcpreq | ) |
int yReqGet | ( | struct _RequestSt * | tcpreq, |
u8 ** | buffer | ||
) |
int yReqIsAsync | ( | struct _RequestSt * | req | ) |
int yReqIsEof | ( | struct _RequestSt * | tcpreq, |
char * | errmsg | ||
) |
int yReqMultiSelect | ( | struct _RequestSt ** | tcpreq, |
int | size, | ||
u64 | ms, | ||
WakeUpSocket * | wuce, | ||
char * | errmsg | ||
) |
int yReqOpen | ( | struct _RequestSt * | tcpreq, |
int | wait_for_start, | ||
int | tcpchan, | ||
const char * | request, | ||
int | reqlen, | ||
u64 | mstimeout, | ||
yapiRequestAsyncCallback | callback, | ||
void * | context, | ||
yapiRequestProgressCallback | progress_cb, | ||
void * | progress_ctx, | ||
char * | errmsg | ||
) |
int yReqRead | ( | struct _RequestSt * | rcoreq, |
u8 * | buffer, | ||
int | len | ||
) |
int yReqSelect | ( | struct _RequestSt * | tcpreq, |
u64 | ms, | ||
char * | errmsg | ||
) |
int ySSDPStart | ( | SSDPInfos * | SSDP, |
ssdpHubDiscoveryCallback | callback, | ||
char * | errmsg | ||
) |
int yStartWakeUpSocket | ( | WakeUpSocket * | wuce, |
char * | errmsg | ||
) |
int yTcpDownload | ( | const char * | host, |
const char * | url, | ||
u8 ** | out_buffer, | ||
u32 | mstimeout, | ||
char * | errmsg | ||
) |