Classes | Macros | Typedefs | Functions
ytcp.h File Reference
#include "ydef.h"
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netinet/tcp.h>
#include "ythread.h"
Include dependency graph for ytcp.h:
This graph shows which files directly or indirectly include this file:

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 _RequestStyReqAlloc (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)
 

Macro Definition Documentation

#define closesocket (   s)    close(s)

Definition at line 64 of file ytcp.h.

#define INVALID_SOCKET   -1

Definition at line 63 of file ytcp.h.

#define NB_OS_IFACES   8

Definition at line 163 of file ytcp.h.

#define NB_SSDP_CACHE_ENTRY   32

Definition at line 162 of file ytcp.h.

#define OS_IFACE_CAN_MCAST   1

Definition at line 130 of file ytcp.h.

#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';}

Definition at line 82 of file ytcp.h.

#define SEND_NOSIGPIPE   0

Definition at line 74 of file ytcp.h.

#define SOCK_ERR   (errno)

Definition at line 80 of file ytcp.h.

#define SOCKET_ERROR   -1

Definition at line 62 of file ytcp.h.

#define SSDP_URL_LEN   48

Definition at line 146 of file ytcp.h.

#define SSDP_UUID_LEN   48

Definition at line 145 of file ytcp.h.

#define yNetSetErr ( )    yNetSetErrEx(__LINE__,SOCK_ERR,errmsg)

Definition at line 84 of file ytcp.h.

#define YTCP_REMOTE_CLOSE   1

Definition at line 88 of file ytcp.h.

Typedef Documentation

typedef void(* ssdpHubDiscoveryCallback) (const char *serial, const char *urlToRegister, const char *urlToUnregister)

Definition at line 160 of file ytcp.h.

Function Documentation

void* ws_thread ( void *  ctx)

Background thread for WebSocket Hub

Definition at line 2537 of file ytcp.c.

int yConsumeWakeUpSocket ( WakeUpSocket wuce,
char *  errmsg 
)

Definition at line 271 of file ytcp.c.

int yDringWakeUpSocket ( WakeUpSocket wuce,
u8  signal,
char *  errmsg 
)

Definition at line 263 of file ytcp.c.

void yDupSet ( char **  storage,
const char *  val 
)

Definition at line 128 of file ytcp.c.

void yFreeWakeUpSocket ( WakeUpSocket wuce)

Definition at line 281 of file ytcp.c.

void yInitWakeUpSocket ( WakeUpSocket wuce)

Definition at line 218 of file ytcp.c.

int yNetSetErrEx ( u32  line,
unsigned  err,
char *  errmsg 
)

Definition at line 141 of file ytcp.c.

struct _RequestSt* yReqAlloc ( struct _HubSt hub)

Definition at line 1337 of file ytcp.c.

void yReqClose ( struct _RequestSt tcpreq)

Definition at line 1561 of file ytcp.c.

void yReqFree ( struct _RequestSt tcpreq)

Definition at line 1606 of file ytcp.c.

int yReqGet ( struct _RequestSt tcpreq,
u8 **  buffer 
)

Definition at line 1504 of file ytcp.c.

int yReqHasPending ( struct _HubSt hub)

Definition at line 1629 of file ytcp.c.

int yReqIsAsync ( struct _RequestSt req)

Definition at line 1596 of file ytcp.c.

int yReqIsEof ( struct _RequestSt tcpreq,
char *  errmsg 
)

Definition at line 1486 of file ytcp.c.

int yReqMultiSelect ( struct _RequestSt **  tcpreq,
int  size,
u64  ms,
WakeUpSocket wuce,
char *  errmsg 
)

Definition at line 1479 of file ytcp.c.

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 
)

Definition at line 1362 of file ytcp.c.

int yReqRead ( struct _RequestSt rcoreq,
u8 *  buffer,
int  len 
)

Definition at line 1525 of file ytcp.c.

int yReqSelect ( struct _RequestSt tcpreq,
u64  ms,
char *  errmsg 
)

Definition at line 1470 of file ytcp.c.

u32 yResolveDNS ( const char *  name,
char *  errmsg 
)

Definition at line 296 of file ytcp.c.

int ySSDPDiscover ( SSDPInfos SSDP,
char *  errmsg 
)

Definition at line 3233 of file ytcp.c.

int ySSDPStart ( SSDPInfos SSDP,
ssdpHubDiscoveryCallback  callback,
char *  errmsg 
)

Definition at line 3253 of file ytcp.c.

void ySSDPStop ( SSDPInfos SSDP)

Definition at line 3330 of file ytcp.c.

int yStartWakeUpSocket ( WakeUpSocket wuce,
char *  errmsg 
)

Definition at line 225 of file ytcp.c.

int yTcpDownload ( const char *  host,
const char *  url,
u8 **  out_buffer,
u32  mstimeout,
char *  errmsg 
)

Definition at line 702 of file ytcp.c.

int yTcpInit ( char *  errmsg)

Definition at line 364 of file ytcp.c.

void yTcpShutdown ( void  )

Definition at line 382 of file ytcp.c.



yoctopuce_altimeter
Author(s): Anja Sheppard
autogenerated on Mon Jun 10 2019 15:49:13