83 #if defined(LWS_ESP_PLATFORM)
84 #include <lwip/sockets.h>
88 #if defined(LWS_WITH_IPV6)
91 #if defined(LWS_ESP_PLATFORM)
98 #define sa46_sockaddr(_sa46) ((struct sockaddr *)(_sa46))
100 #if defined(LWS_WITH_IPV6)
101 #define sa46_socklen(_sa46) (socklen_t)((_sa46)->sa4.sin_family == AF_INET ? \
102 sizeof(struct sockaddr_in) : \
103 sizeof(struct sockaddr_in6))
104 #define sa46_sockport(_sa46, _sp) { if ((_sa46)->sa4.sin_family == AF_INET) \
105 (_sa46)->sa4.sin_port = (_sp); else \
106 (_sa46)->sa6.sin6_port = (_sp); }
107 #define sa46_address(_sa46) ((uint8_t *)((_sa46)->sa4.sin_family == AF_INET ? \
108 &_sa46->sa4.sin_addr : &_sa46->sa6.sin6_addr ))
110 #define sa46_socklen(_sa46) (socklen_t)sizeof(struct sockaddr_in)
111 #define sa46_sockport(_sa46, _sp) (_sa46)->sa4.sin_port = (_sp)
112 #define sa46_address(_sa46) (uint8_t *)&_sa46->sa4.sin_addr
115 #define sa46_address_len(_sa46) ((_sa46)->sa4.sin_family == AF_INET ? 4 : 16)
117 #if defined(LWS_WITH_UDP)
150 struct lws_vhost *
vh;
216 const char *readbuf,
size_t len);
244 #define LWS_CAUDP_BIND (1 << 0)
245 #define LWS_CAUDP_BROADCAST (1 << 1)
246 #define LWS_CAUDP_PF_PACKET (1 << 2)
248 #if defined(LWS_WITH_UDP)
271 lws_create_adopt_udp(
struct lws_vhost *vhost,
const char *ads,
int port,
272 int flags,
const char *protocol_name,
const char *ifname,
273 struct lws *parent_wsi,
void *opaque,
const char * vh_prot_name
LWS_VISIBLE LWS_EXTERN struct lws * lws_adopt_socket_vhost(struct lws_vhost *vh, lws_sockfd_type accept_fd)
struct lws_adopt_desc lws_adopt_desc_t
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)
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(struct lws_context *context, 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_ADOPT_FLAG_RAW_PROXY
@ LWS_ADOPT_RAW_FILE_DESC
@ LWS_ADOPT_RAW_SOCKET_UDP