summaryrefslogtreecommitdiffstats
path: root/src/basic/socket-util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-11-18 10:25:27 +0100
committerLennart Poettering <lennart@poettering.net>2020-12-02 15:14:21 +0100
commit3132597182c806e5193aebb0b67cdc0f73154a51 (patch)
treed647d7028a42e23f9f62ba499d5f9c32c84e2e53 /src/basic/socket-util.h
parentMerge pull request #17707 from yuwata/network-fix-reconfigure (diff)
downloadsystemd-3132597182c806e5193aebb0b67cdc0f73154a51.tar.xz
systemd-3132597182c806e5193aebb0b67cdc0f73154a51.zip
socket-util: add sockaddr_in_addr() helper
This extracts the IP address (as union in_addr_union) from a socket address (i.e. a struct sockaddr).
Diffstat (limited to 'src/basic/socket-util.h')
-rw-r--r--src/basic/socket-util.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/basic/socket-util.h b/src/basic/socket-util.h
index 9f7928040d..923898a3fc 100644
--- a/src/basic/socket-util.h
+++ b/src/basic/socket-util.h
@@ -102,6 +102,7 @@ const char* socket_address_get_path(const SocketAddress *a);
bool socket_ipv6_is_supported(void);
int sockaddr_port(const struct sockaddr *_sa, unsigned *port);
+const union in_addr_union *sockaddr_in_addr(const struct sockaddr *sa);
int sockaddr_pretty(const struct sockaddr *_sa, socklen_t salen, bool translate_ipv6, bool include_port, char **ret);
int getpeername_pretty(int fd, bool include_port, char **ret);