aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/iomgr/socket_utils_posix.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/iomgr/socket_utils_posix.h')
-rw-r--r--src/core/iomgr/socket_utils_posix.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/core/iomgr/socket_utils_posix.h b/src/core/iomgr/socket_utils_posix.h
index 8e0492802a..d330d1986e 100644
--- a/src/core/iomgr/socket_utils_posix.h
+++ b/src/core/iomgr/socket_utils_posix.h
@@ -38,19 +38,20 @@
#include <sys/socket.h>
/* a wrapper for accept or accept4 */
-int grpc_accept4 (int sockfd, struct sockaddr *addr, socklen_t * addrlen, int nonblock, int cloexec);
+int grpc_accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen,
+ int nonblock, int cloexec);
/* set a socket to non blocking mode */
-int grpc_set_socket_nonblocking (int fd, int non_blocking);
+int grpc_set_socket_nonblocking(int fd, int non_blocking);
/* set a socket to close on exec */
-int grpc_set_socket_cloexec (int fd, int close_on_exec);
+int grpc_set_socket_cloexec(int fd, int close_on_exec);
/* set a socket to reuse old addresses */
-int grpc_set_socket_reuse_addr (int fd, int reuse);
+int grpc_set_socket_reuse_addr(int fd, int reuse);
/* disable nagle */
-int grpc_set_socket_low_latency (int fd, int low_latency);
+int grpc_set_socket_low_latency(int fd, int low_latency);
/* Returns true if this system can create AF_INET6 sockets bound to ::1.
The value is probed once, and cached for the life of the process.
@@ -60,20 +61,19 @@ int grpc_set_socket_low_latency (int fd, int low_latency);
and bind IPv6 sockets, but cannot connect to a getsockname() of [::]:port
without a valid loopback interface. Rather than expose this half-broken
state to library users, we turn off IPv6 sockets. */
-int grpc_ipv6_loopback_available (void);
+int grpc_ipv6_loopback_available(void);
/* Tries to set SO_NOSIGPIPE if available on this platform.
Returns 1 on success, 0 on failure.
If SO_NO_SIGPIPE is not available, returns 1. */
-int grpc_set_socket_no_sigpipe_if_possible (int fd);
+int grpc_set_socket_no_sigpipe_if_possible(int fd);
/* An enum to keep track of IPv4/IPv6 socket modes.
Currently, this information is only used when a socket is first created, but
in the future we may wish to store it alongside the fd. This would let calls
like sendto() know which family to use without asking the kernel first. */
-typedef enum grpc_dualstack_mode
-{
+typedef enum grpc_dualstack_mode {
/* Uninitialized, or a non-IP socket. */
GRPC_DSMODE_NONE,
/* AF_INET only. */
@@ -107,6 +107,7 @@ extern int grpc_forbid_dualstack_sockets_for_testing;
IPv4, so that bind() or connect() see the correct family.
Also, it's important to distinguish between DUALSTACK and IPV6 when
listening on the [::] wildcard address. */
-int grpc_create_dualstack_socket (const struct sockaddr *addr, int type, int protocol, grpc_dualstack_mode * dsmode);
+int grpc_create_dualstack_socket(const struct sockaddr *addr, int type,
+ int protocol, grpc_dualstack_mode *dsmode);
#endif /* GRPC_INTERNAL_CORE_IOMGR_SOCKET_UTILS_POSIX_H */