1 #include <sys/socket.h>
3 #define F(t,n) {t *y = &x.n;}
4 #define C(n) switch(n){case n:;}
13 F(sa_family_t,sa_family)
17 struct sockaddr_storage x;
18 F(sa_family_t, ss_family)
23 F(socklen_t,msg_namelen)
24 F(struct iovec*,msg_iov)
27 F(socklen_t,msg_controllen)
93 {int(*p)(int,struct sockaddr*restrict,socklen_t*restrict) = accept;}
94 {int(*p)(int,const struct sockaddr*,socklen_t) = bind;}
95 {int(*p)(int,const struct sockaddr*,socklen_t) = connect;}
96 {int(*p)(int,struct sockaddr*restrict,socklen_t*restrict) = getpeername;}
97 {int(*p)(int,struct sockaddr*restrict,socklen_t*restrict) = getsockname;}
98 {int(*p)(int,int,int,void*restrict,socklen_t*restrict) = getsockopt;}
99 {int(*p)(int,int) = listen;}
100 {ssize_t(*p)(int,void*,size_t,int) = recv;}
101 {ssize_t(*p)(int,void*restrict,size_t,int,struct sockaddr*restrict,socklen_t*restrict) = recvfrom;}
102 {ssize_t(*p)(int,struct msghdr*,int) = recvmsg;}
103 {ssize_t(*p)(int,const void*,size_t,int) = send;}
104 {ssize_t(*p)(int,const struct msghdr*,int) = sendmsg;}
105 {ssize_t(*p)(int,const void*,size_t,int,const struct sockaddr*,socklen_t) = sendto;}
106 {int(*p)(int,int,int,const void*,socklen_t) = setsockopt;}
107 {int(*p)(int,int) = shutdown;}
108 {int(*p)(int) = sockatmark;}
109 {int(*p)(int,int,int) = socket;}
110 {int(*p)(int,int,int,int[]) = socketpair;}