From 3132597182c806e5193aebb0b67cdc0f73154a51 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 18 Nov 2020 10:25:27 +0100 Subject: 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). --- src/basic/socket-util.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/basic/socket-util.h') 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); -- cgit v1.2.3