summaryrefslogtreecommitdiff
path: root/lwip/src/api/compat-sockets.c
blob: 39d62094c6c8494c5160a0209919d26b97c31fb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#include "lwip/opt.h"

#include "lwip/sockets.h"
#include "lwip/priv/sockets_priv.h"
#include "lwip/api.h"
#include "lwip/igmp.h"
#include "lwip/inet.h"
#include "lwip/tcp.h"
#include "lwip/raw.h"
#include "lwip/udp.h"
#include "lwip/memp.h"
#include "lwip/pbuf.h"
#include "lwip/netif.h"
#include "lwip/priv/tcpip_priv.h"
#include "lwip/mld6.h"
#include "arch/sys_arch.h"
#if LWIP_CHECKSUM_ON_COPY
#include "lwip/inet_chksum.h"
#endif

#if LWIP_COMPAT_SOCKETS == 2 && LWIP_POSIX_SOCKETS_IO_NAMES
#include <stdarg.h>
#endif

#include <string.h>

#ifdef LWIP_HOOK_FILENAME
#include LWIP_HOOK_FILENAME
#endif

/* If the netconn API is not required publicly, then we include the necessary
   files here to get the implementation */
#if !LWIP_NETCONN
#undef LWIP_NETCONN
#define LWIP_NETCONN 1
#include "api_msg.c"
#include "api_lib.c"
#include "netbuf.c"
#undef LWIP_NETCONN
#define LWIP_NETCONN 0
#endif

int 
setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen){
return lwip_setsockopt(s, level, optname, optval, optlen);
}

const char *
inet_ntop(int af, const void *src, char *dst, socklen_t size){
    return lwip_inet_ntop(af, src, dst, size);
}

int
accept(int s, struct sockaddr *addr, socklen_t *addrlen){
    return lwip_accept(s, addr, addrlen);
}

int
socket(int domain, int type, int protocol){
    return lwip_socket(domain, type, protocol);
}

int
bind(int s, const struct sockaddr *name, socklen_t namelen){
    return lwip_bind(s, name, namelen);
}

int
listen(int s, int backlog){
    return lwip_listen(s, backlog);

}

ssize_t
sendto(int s, const void *data, size_t size, int flags,
            const struct sockaddr *to, socklen_t tolen){
    return lwip_sendto(s, data, size, flags, to, tolen);
}