diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-11-07 00:03:54 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-11-07 00:13:58 +0100 |
commit | 4d49b48c60a4ac66fa764fd7a6ae6d0bd0bd9c37 (patch) | |
tree | cde91c2c38f89b146f46577e39c56980fde60271 /src/shared/socket-util.h | |
parent | b7484e2a58038c57591457c1439505607bdcd833 (diff) |
socket: rework things to have only one sockaddr formatter
Diffstat (limited to 'src/shared/socket-util.h')
-rw-r--r-- | src/shared/socket-util.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/shared/socket-util.h b/src/shared/socket-util.h index 13566f9691..d42a2fee31 100644 --- a/src/shared/socket-util.h +++ b/src/shared/socket-util.h @@ -33,7 +33,7 @@ union sockaddr_union { struct sockaddr sa; - struct sockaddr_in in4; + struct sockaddr_in in; struct sockaddr_in6 in6; struct sockaddr_un un; struct sockaddr_nl nl; @@ -92,12 +92,14 @@ bool socket_address_equal(const SocketAddress *a, const SocketAddress *b) _pure_ const char* socket_address_get_path(const SocketAddress *a); +bool socket_ipv6_is_supported(void); + +int sockaddr_pretty(const struct sockaddr *_sa, socklen_t salen, bool translate_ipv6, char **ret); +int getpeername_pretty(int fd, char **ret); +int getsockname_pretty(int fd, char **ret); + const char* socket_address_bind_ipv6_only_to_string(SocketAddressBindIPv6Only b) _const_; SocketAddressBindIPv6Only socket_address_bind_ipv6_only_from_string(const char *s) _pure_; int netlink_family_to_string_alloc(int b, char **s); -int netlink_family_from_string(const char *s); - -bool socket_ipv6_is_supported(void); - -int getpeername_pretty(int fd, char **ret); +int netlink_family_from_string(const char *s) _pure_; |