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).
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user