From 45ed23c46e70f23cc76f7f230831d236eeda06c3 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 21 Dec 2020 21:49:56 +0100 Subject: libnm: avoid in_addr_t/in6addr use in libnm header "in_addr_t" and "struct in6_addr" require headers from libc (or linux). In particular, some libc headers conflict with the linux headers (or they have to be included in a specific order). To avoid that we want that our libnm headers include a minimum of other headers (and only drag in glib headers, which we anyway need). - instead of "in_addr_t", use guint32. For all practical purposes, "in_addr_t" is a plain 32 bit integers and we can do this replacement in our public headers. - forward declare "struct in6_addr". --- libnm-core/nm-utils.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libnm-core/nm-utils.h b/libnm-core/nm-utils.h index 9589c51499..052660d705 100644 --- a/libnm-core/nm-utils.h +++ b/libnm-core/nm-utils.h @@ -185,7 +185,10 @@ gboolean nm_utils_is_uuid(const char *str); * for both nm_utils_inet4_ntop() and nm_utils_inet6_ntop(). **/ #define NM_UTILS_INET_ADDRSTRLEN INET6_ADDRSTRLEN -const char *nm_utils_inet4_ntop(in_addr_t inaddr, char *dst); + +const char *nm_utils_inet4_ntop(guint32 inaddr, char *dst); + +struct in6_addr; const char *nm_utils_inet6_ntop(const struct in6_addr *in6addr, char *dst); gboolean nm_utils_ipaddr_valid(int family, const char *ip); -- cgit v1.2.3