34#ifndef __LWIP_SOCKETS_H__
35#define __LWIP_SOCKETS_H__
43#include "lwip/ip_addr.h"
67#if !defined(socklen_t) && !defined(SOCKLEN_T_DEFINED)
79#define SO_DEBUG 0x0001
80#define SO_ACCEPTCONN 0x0002
81#define SO_REUSEADDR 0x0004
82#define SO_KEEPALIVE 0x0008
83#define SO_DONTROUTE 0x0010
84#define SO_BROADCAST 0x0020
85#define SO_USELOOPBACK 0x0040
86#define SO_LINGER 0x0080
87#define SO_OOBINLINE 0x0100
88#define SO_REUSEPORT 0x0200
90#define SO_DONTLINGER ((int)(~SO_LINGER))
95#define SO_SNDBUF 0x1001
96#define SO_RCVBUF 0x1002
97#define SO_SNDLOWAT 0x1003
98#define SO_RCVLOWAT 0x1004
99#define SO_SNDTIMEO 0x1005
100#define SO_RCVTIMEO 0x1006
101#define SO_ERROR 0x1007
102#define SO_TYPE 0x1008
103#define SO_CONTIMEO 0x1009
104#define SO_NO_CHECK 0x100a
118#define SOL_SOCKET 0xfff
123#define PF_INET AF_INET
124#define PF_UNSPEC AF_UNSPEC
128#define IPPROTO_UDP 17
129#define IPPROTO_UDPLITE 136
133#define MSG_WAITALL 0x02
135#define MSG_DONTWAIT 0x08
149#define TCP_NODELAY 0x01
150#define TCP_KEEPALIVE 0x02
151#define TCP_KEEPIDLE 0x03
152#define TCP_KEEPINTVL 0x04
153#define TCP_KEEPCNT 0x05
156#if LWIP_UDP && LWIP_UDPLITE
160#define UDPLITE_SEND_CSCOV 0x01
161#define UDPLITE_RECV_CSCOV 0x02
169#define IP_ADD_MEMBERSHIP 3
170#define IP_DROP_MEMBERSHIP 4
171#define IP_MULTICAST_TTL 5
172#define IP_MULTICAST_IF 6
173#define IP_MULTICAST_LOOP 7
197#define IPTOS_TOS_MASK 0x1E
198#define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK)
199#define IPTOS_LOWDELAY 0x10
200#define IPTOS_THROUGHPUT 0x08
201#define IPTOS_RELIABILITY 0x04
202#define IPTOS_LOWCOST 0x02
203#define IPTOS_MINCOST IPTOS_LOWCOST
214#define IPTOS_PREC_MASK 0xe0
215#define IPTOS_PREC(tos) ((tos) & IPTOS_PREC_MASK)
216#define IPTOS_PREC_NETCONTROL 0xe0
217#define IPTOS_PREC_INTERNETCONTROL 0xc0
218#define IPTOS_PREC_CRITIC_ECP 0xa0
219#define IPTOS_PREC_FLASHOVERRIDE 0x80
220#define IPTOS_PREC_FLASH 0x60
221#define IPTOS_PREC_IMMEDIATE 0x40
222#define IPTOS_PREC_PRIORITY 0x20
223#define IPTOS_PREC_ROUTINE 0x00
236#if !defined(FIONREAD) || !defined(FIONBIO)
237#define IOCPARM_MASK 0x7fU
238#define IOC_VOID 0x20000000UL
239#define IOC_OUT 0x40000000UL
240#define IOC_IN 0x80000000UL
241#define IOC_INOUT (IOC_IN|IOC_OUT)
244#define _IO(x,y) (IOC_VOID|((x)<<8)|(y))
246#define _IOR(x,y,t) (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
248#define _IOW(x,y,t) (IOC_IN|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
252#define FIONREAD _IOR('f', 127, unsigned long)
255#define FIONBIO _IOW('f', 126, unsigned long)
260#define SIOCSHIWAT _IOW('s', 0, unsigned long)
261#define SIOCGHIWAT _IOR('s', 1, unsigned long)
262#define SIOCSLOWAT _IOW('s', 2, unsigned long)
263#define SIOCGLOWAT _IOR('s', 3, unsigned long)
264#define SIOCATMARK _IOR('s', 7, unsigned long)
294 #define FD_SETSIZE MEMP_NUM_NETCONN
295 #define FD_SET(n, p) ((p)->fd_bits[(n)/8] |= (1 << ((n) & 7)))
296 #define FD_CLR(n, p) ((p)->fd_bits[(n)/8] &= ~(1 << ((n) & 7)))
297 #define FD_ISSET(n,p) ((p)->fd_bits[(n)/8] & (1 << ((n) & 7)))
298 #define FD_ZERO(p) memset((void*)(p),0,sizeof(*(p)))
308#ifndef LWIP_TIMEVAL_PRIVATE
309#define LWIP_TIMEVAL_PRIVATE 1
312#if LWIP_TIMEVAL_PRIVATE
319void lwip_socket_init(
void);
323int lwip_shutdown(
int s,
int how);
326int lwip_getsockopt (
int s,
int level,
int optname,
void *optval,
socklen_t *optlen);
327int lwip_setsockopt (
int s,
int level,
int optname,
const void *optval,
socklen_t optlen);
328int lwip_close(
int s);
330int lwip_listen(
int s,
int backlog);
332int lwip_read(
int s,
void *
mem,
size_t len);
333int lwip_recvfrom(
int s,
void *
mem,
size_t len,
int flags,
342int lwip_ioctl(
int s,
long cmd,
void *argp);
343int lwip_fcntl(
int s,
int cmd,
int val);
345#if LWIP_COMPAT_SOCKETS
346#define accept(a,b,c) lwip_accept(a,b,c)
347#define bind(a,b,c) lwip_bind(a,b,c)
348#define shutdown(a,b) lwip_shutdown(a,b)
349#define closesocket(s) lwip_close(s)
350#define connect(a,b,c) lwip_connect(a,b,c)
351#define getsockname(a,b,c) lwip_getsockname(a,b,c)
352#define getpeername(a,b,c) lwip_getpeername(a,b,c)
353#define setsockopt(a,b,c,d,e) lwip_setsockopt(a,b,c,d,e)
354#define getsockopt(a,b,c,d,e) lwip_getsockopt(a,b,c,d,e)
355#define listen(a,b) lwip_listen(a,b)
356#define recv(a,b,c,d) lwip_recv(a,b,c,d)
357#define recvfrom(a,b,c,d,e,f) lwip_recvfrom(a,b,c,d,e,f)
358#define send(a,b,c,d) lwip_send(a,b,c,d)
359#define sendto(a,b,c,d,e,f) lwip_sendto(a,b,c,d,e,f)
360#define socket(a,b,c) lwip_socket(a,b,c)
361#define select(a,b,c,d,e) lwip_select(a,b,c,d,e)
362#define ioctlsocket(a,b,c) lwip_ioctl(a,b,c)
364#if LWIP_POSIX_SOCKETS_IO_NAMES
365#define read(a,b,c) lwip_read(a,b,c)
366#define write(a,b,c) lwip_write(a,b,c)
367#define close(s) lwip_close(s)
368#define fcntl(a,b,c) lwip_fcntl(a,b,c)
GLuint GLuint GLsizei GLenum type
GLenum const GLvoid * addr
int const JOCTET * dataptr
struct in_addr imr_interface
struct in_addr imr_multiaddr