summaryrefslogtreecommitdiffstats
path: root/src/vcl/ldp_socket_wrapper.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2023-02-02 12:56:16 -0800
committerDave Barach <vpp@barachs.net>2023-02-07 18:06:44 +0000
commit3684794336602435b91b91a1dc5bd9401a974432 (patch)
tree9475f51d264a35774422009f7a720d6073676e97 /src/vcl/ldp_socket_wrapper.h
parent656a550f1feda3ddfa96f8e1fc510e8eebd3ce7a (diff)
vcl: better handlig of ldp apis that rely on gnu source
Control use of apis that rely on _GNU_SOURCE being defined with compile time macro. Also fixes sendmmsg and recvmmsg which were not probably wrapped. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I207de23210d4b9dc960bb4289159502760c5614d
Diffstat (limited to 'src/vcl/ldp_socket_wrapper.h')
-rw-r--r--src/vcl/ldp_socket_wrapper.h38
1 files changed, 21 insertions, 17 deletions
diff --git a/src/vcl/ldp_socket_wrapper.h b/src/vcl/ldp_socket_wrapper.h
index 0d167cf1aeb..bf1b0e3f17c 100644
--- a/src/vcl/ldp_socket_wrapper.h
+++ b/src/vcl/ldp_socket_wrapper.h
@@ -98,16 +98,16 @@
* has probably something todo with with the linker.
* So we need load each function at the point it is called the first time.
*/
-int libc_accept4 (int sockfd, struct sockaddr *addr, socklen_t * addrlen,
+int libc_accept4 (int sockfd, __SOCKADDR_ARG addr, socklen_t *addrlen,
int flags);
-int libc_accept (int sockfd, struct sockaddr *addr, socklen_t * addrlen);
+int libc_accept (int sockfd, __SOCKADDR_ARG addr, socklen_t *addrlen);
-int libc_bind (int sockfd, const struct sockaddr *addr, socklen_t addrlen);
+int libc_bind (int sockfd, __CONST_SOCKADDR_ARG addr, socklen_t addrlen);
int libc_close (int fd);
-int libc_connect (int sockfd, const struct sockaddr *addr, socklen_t addrlen);
+int libc_connect (int sockfd, __CONST_SOCKADDR_ARG addr, socklen_t addrlen);
#if 0
/* TBD: dup and dup2 to be implemented later */
@@ -128,9 +128,9 @@ int libc_vfcntl64 (int fd, int cmd, va_list ap);
int libc_vioctl (int fd, int cmd, va_list ap);
-int libc_getpeername (int sockfd, struct sockaddr *addr, socklen_t * addrlen);
+int libc_getpeername (int sockfd, __SOCKADDR_ARG addr, socklen_t *addrlen);
-int libc_getsockname (int sockfd, struct sockaddr *addr, socklen_t * addrlen);
+int libc_getsockname (int sockfd, __SOCKADDR_ARG addr, socklen_t *addrlen);
int
libc_getsockopt (int sockfd,
@@ -144,25 +144,29 @@ ssize_t libc_readv (int fd, const struct iovec *iov, int iovcnt);
int libc_recv (int sockfd, void *buf, size_t len, int flags);
-int
-libc_recvfrom (int sockfd,
- void *buf,
- size_t len,
- int flags, struct sockaddr *src_addr, socklen_t * addrlen);
+int libc_recvfrom (int sockfd, void *buf, size_t len, int flags,
+ __SOCKADDR_ARG src_addr, socklen_t *addrlen);
int libc_recvmsg (int sockfd, struct msghdr *msg, int flags);
+#ifdef _GNU_SOURCE
+int libc_recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen,
+ int flags, struct timespec *tmo);
+#endif
+
int libc_send (int sockfd, const void *buf, size_t len, int flags);
ssize_t libc_sendfile (int out_fd, int in_fd, off_t * offset, size_t len);
int libc_sendmsg (int sockfd, const struct msghdr *msg, int flags);
-int
-libc_sendto (int sockfd,
- const void *buf,
- size_t len,
- int flags, const struct sockaddr *dst_addr, socklen_t addrlen);
+#ifdef _GNU_SOURCE
+int libc_sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen,
+ int flags);
+#endif
+
+int libc_sendto (int sockfd, const void *buf, size_t len, int flags,
+ __CONST_SOCKADDR_ARG dst_addr, socklen_t addrlen);
int
libc_setsockopt (int sockfd,
@@ -210,7 +214,7 @@ int libc_epoll_pwait (int __epfd, struct epoll_event *__events,
int libc_poll (struct pollfd *__fds, nfds_t __nfds, int __timeout);
-#ifdef __USE_GNU
+#ifdef _GNU_SOURCE
int libc_ppoll (struct pollfd *__fds, nfds_t __nfds,
const struct timespec *__timeout, const __sigset_t * __ss);
#endif