libwebsockets
Lightweight C library for HTML5 websockets
lws-adopt.h File Reference

Go to the source code of this file.

Data Structures

union  lws_sock_file_fd_type
 
union  lws_sockaddr46
 
struct  lws_adopt_desc
 

Macros

#define sa46_sockaddr(_sa46)   ((struct sockaddr *)(_sa46))
 
#define sa46_socklen(_sa46)   (socklen_t)sizeof(struct sockaddr_in)
 
#define sa46_sockport(_sa46, _sp)   (_sa46)->sa4.sin_port = (_sp)
 
#define sa46_address(_sa46)   (uint8_t *)&_sa46->sa4.sin_addr
 
#define sa46_address_len(_sa46)   ((_sa46)->sa4.sin_family == AF_INET ? 4 : 16)
 
#define LWS_CAUDP_BIND   (1 << 0)
 
#define LWS_CAUDP_BROADCAST   (1 << 1)
 
#define LWS_CAUDP_PF_PACKET   (1 << 2)
 

Typedefs

typedef struct lws_adopt_desc lws_adopt_desc_t
 

Enumerations

enum  lws_adoption_type {
  LWS_ADOPT_RAW_FILE_DESC = 0 , LWS_ADOPT_HTTP = 1 , LWS_ADOPT_SOCKET = 2 , LWS_ADOPT_ALLOW_SSL = 4 ,
  LWS_ADOPT_FLAG_UDP = 16 , LWS_ADOPT_FLAG_RAW_PROXY = 32 , LWS_ADOPT_RAW_SOCKET_UDP = LWS_ADOPT_SOCKET | LWS_ADOPT_FLAG_UDP
}
 

Functions

LWS_VISIBLE LWS_EXTERN struct lws * lws_adopt_socket (struct lws_context *context, lws_sockfd_type accept_fd)
 
LWS_VISIBLE LWS_EXTERN struct lws * lws_adopt_socket_vhost (struct lws_vhost *vh, lws_sockfd_type accept_fd)
 
LWS_VISIBLE LWS_EXTERN struct lws * lws_adopt_descriptor_vhost (struct lws_vhost *vh, lws_adoption_type type, lws_sock_file_fd_type fd, const char *vh_prot_name, struct lws *parent)
 
LWS_VISIBLE LWS_EXTERN struct lws * lws_adopt_descriptor_vhost_via_info (const lws_adopt_desc_t *info)
 
LWS_VISIBLE LWS_EXTERN struct lws * lws_adopt_socket_readbuf (struct lws_context *context, lws_sockfd_type accept_fd, const char *readbuf, size_t len)
 
LWS_VISIBLE LWS_EXTERN struct lws * lws_adopt_socket_vhost_readbuf (struct lws_vhost *vhost, lws_sockfd_type accept_fd, const char *readbuf, size_t len)