42#if LWIP_NETCONN || LWIP_SOCKET
61#define NETCONN_NOFLAG 0x00
62#define NETCONN_NOCOPY 0x00
63#define NETCONN_COPY 0x01
64#define NETCONN_MORE 0x02
65#define NETCONN_DONTBLOCK 0x04
66#define NETCONN_NOAUTORCVD 0x08
67#define NETCONN_NOFIN 0x10
71#define NETCONN_FLAG_MBOXCLOSED 0x01
73#define NETCONN_FLAG_NON_BLOCKING 0x02
75#define NETCONN_FLAG_IN_NONBLOCKING_CONNECT 0x04
76#if LWIP_NETCONN_FULLDUPLEX
78#define NETCONN_FLAG_MBOXINVALID 0x08
82#define NETCONN_FLAG_CHECK_WRITESPACE 0x10
87#define NETCONN_FLAG_IPV6_V6ONLY 0x20
89#if LWIP_NETBUF_RECVINFO
91#define NETCONN_FLAG_PKTINFO 0x40
94#define NETCONN_FIN_RX_PENDING 0x80
97#define NETCONNTYPE_GROUP(t) ((t)&0xF0)
98#define NETCONNTYPE_DATAGRAM(t) ((t)&0xE0)
100#define NETCONN_TYPE_IPV6 0x08
101#define NETCONNTYPE_ISIPV6(t) (((t)&NETCONN_TYPE_IPV6) != 0)
102#define NETCONNTYPE_ISUDPLITE(t) (((t)&0xF3) == NETCONN_UDPLITE)
103#define NETCONNTYPE_ISUDPNOCHKSUM(t) (((t)&0xF3) == NETCONN_UDPNOCHKSUM)
105#define NETCONNTYPE_ISIPV6(t) (0)
106#define NETCONNTYPE_ISUDPLITE(t) ((t) == NETCONN_UDPLITE)
107#define NETCONNTYPE_ISUDPNOCHKSUM(t) ((t) == NETCONN_UDPNOCHKSUM)
119 NETCONN_TCP_IPV6 = NETCONN_TCP | NETCONN_TYPE_IPV6 ,
124 NETCONN_UDPLITE = 0x21,
126 NETCONN_UDPNOCHKSUM = 0x22,
130 NETCONN_UDP_IPV6 = NETCONN_UDP | NETCONN_TYPE_IPV6 ,
132 NETCONN_UDPLITE_IPV6 = NETCONN_UDPLITE | NETCONN_TYPE_IPV6 ,
134 NETCONN_UDPNOCHKSUM_IPV6 = NETCONN_UDPNOCHKSUM | NETCONN_TYPE_IPV6 ,
141 , NETCONN_RAW_IPV6 = NETCONN_RAW | NETCONN_TYPE_IPV6
183 NETCONN_EVT_RCVMINUS,
184 NETCONN_EVT_SENDPLUS,
185 NETCONN_EVT_SENDMINUS,
189#if LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD)
199#define NETCONN_DNS_DEFAULT NETCONN_DNS_IPV4_IPV6
200#define NETCONN_DNS_IPV4 0
201#define NETCONN_DNS_IPV6 1
202#define NETCONN_DNS_IPV4_IPV6 2
203#define NETCONN_DNS_IPV6_IPV4 3
220 enum netconn_type
type;
222 enum netconn_state
state;
232#if !LWIP_NETCONN_SEM_PER_THREAD
244#if LWIP_NETCONN_FULLDUPLEX
247 int mbox_threads_waiting;
282 struct api_msg *current_msg;
301#define API_EVENT(c,e,l) if (c->callback) { \
302 (*c->callback)(c, e, l); \
310#define netconn_new(t) netconn_new_with_proto_and_callback(t, 0, NULL)
311#define netconn_new_with_callback(t, c) netconn_new_with_proto_and_callback(t, 0, c)
312struct netconn *netconn_new_with_proto_and_callback(
enum netconn_type
t,
u8_t proto,
317#define netconn_type(conn) (conn->type)
322#define netconn_peer(c,i,p) netconn_getaddr(c,i,p,0)
324#define netconn_addr(c,i,p) netconn_getaddr(c,i,p,1)
332#define netconn_listen(conn) netconn_listen_with_backlog(conn, TCP_DEFAULT_LISTEN_BACKLOG)
344 u8_t apiflags,
size_t *bytes_written);
345err_t netconn_write_vectors_partly(
struct netconn *conn,
struct netvector *vectors,
u16_t vectorcnt,
346 u8_t apiflags,
size_t *bytes_written);
348#define netconn_write(conn, dataptr, size, apiflags) \
349 netconn_write_partly(conn, dataptr, size, apiflags, NULL)
353#if LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD)
355 const ip_addr_t *netif_addr,
enum netconn_igmp join_or_leave);
357 u8_t if_idx,
enum netconn_igmp join_or_leave);
360#if LWIP_IPV4 && LWIP_IPV6
362#define netconn_gethostbyname(name, addr) netconn_gethostbyname_addrtype(name, addr, NETCONN_DNS_DEFAULT)
365#define netconn_gethostbyname_addrtype(name, addr, dns_addrtype) netconn_gethostbyname(name, addr)
370#define netconn_recv_bufsize(conn) ((conn)->recv_bufsize)
372#define netconn_set_flags(conn, set_flags) do { (conn)->flags = (u8_t)((conn)->flags | (set_flags)); } while(0)
373#define netconn_clear_flags(conn, clr_flags) do { (conn)->flags = (u8_t)((conn)->flags & (u8_t)(~(clr_flags) & 0xff)); } while(0)
374#define netconn_is_flag_set(conn, flag) (((conn)->flags & (flag)) != 0)
376#define netconn_set_callback_arg(conn, arg) do { (conn)->callback_arg.ptr = (arg); } while(0)
377#define netconn_get_callback_arg(conn) ((conn)->callback_arg.ptr)
380#define netconn_set_nonblocking(conn, val) do { if(val) { \
381 netconn_set_flags(conn, NETCONN_FLAG_NON_BLOCKING); \
383 netconn_clear_flags(conn, NETCONN_FLAG_NON_BLOCKING); }} while(0)
385#define netconn_is_nonblocking(conn) (((conn)->flags & NETCONN_FLAG_NON_BLOCKING) != 0)
391#define netconn_set_ipv6only(conn, val) do { if(val) { \
392 netconn_set_flags(conn, NETCONN_FLAG_IPV6_V6ONLY); \
394 netconn_clear_flags(conn, NETCONN_FLAG_IPV6_V6ONLY); }} while(0)
398#define netconn_get_ipv6only(conn) (((conn)->flags & NETCONN_FLAG_IPV6_V6ONLY) != 0)
403#define netconn_set_sendtimeout(conn, timeout) ((conn)->send_timeout = (timeout))
405#define netconn_get_sendtimeout(conn) ((conn)->send_timeout)
409#define netconn_set_recvtimeout(conn, timeout) ((conn)->recv_timeout = (timeout))
411#define netconn_get_recvtimeout(conn) ((conn)->recv_timeout)
415#define netconn_set_recvbufsize(conn, recvbufsize) ((conn)->recv_bufsize = (recvbufsize))
417#define netconn_get_recvbufsize(conn) ((conn)->recv_bufsize)
420#if LWIP_NETCONN_SEM_PER_THREAD
421void netconn_thread_init(
void);
422void netconn_thread_cleanup(
void);
424#define netconn_thread_init()
425#define netconn_thread_cleanup()
void netconn_close(struct netconn *conn)
BOOL netconn_recv(struct netconn *conn, void *buf, size_t len, int flags, int *recvd)
BOOL netconn_send(struct netconn *conn, const void *msg, size_t len, int *sent)
GLuint GLuint GLsizei GLenum type
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum const GLvoid * addr
int const JOCTET * dataptr
static IPrintDialogCallback callback
SOCKET WSAAPI socket(IN INT af, IN INT type, IN INT protocol)