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)
88 {int(*p)(int,struct sockaddr*restrict,socklen_t*restrict) = accept;}
89 {int(*p)(int,const struct sockaddr*,socklen_t) = bind;}
90 {int(*p)(int,const struct sockaddr*,socklen_t) = connect;}
91 {int(*p)(int,struct sockaddr*restrict,socklen_t*restrict) = getpeername;}
92 {int(*p)(int,struct sockaddr*restrict,socklen_t*restrict) = getsockname;}
93 {int(*p)(int,int,int,void*restrict,socklen_t*restrict) = getsockopt;}
94 {int(*p)(int,int) = listen;}
95 {ssize_t(*p)(int,void*,size_t,int) = recv;}
96 {ssize_t(*p)(int,void*restrict,size_t,int,struct sockaddr*restrict,socklen_t*restrict) = recvfrom;}
97 {ssize_t(*p)(int,struct msghdr*,int) = recvmsg;}
98 {ssize_t(*p)(int,const void*,size_t,int) = send;}
99 {ssize_t(*p)(int,const struct msghdr*,int) = sendmsg;}
100 {ssize_t(*p)(int,const void*,size_t,int,const struct sockaddr*,socklen_t) = sendto;}
101 {int(*p)(int,int,int,const void*,socklen_t) = setsockopt;}
102 {int(*p)(int,int) = shutdown;}
103 {int(*p)(int) = sockatmark;}
104 {int(*p)(int,int,int) = socket;}
105 {int(*p)(int,int,int,int[]) = socketpair;}