summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-12-21 21:49:56 +0100
committerThomas Haller <thaller@redhat.com>2020-12-22 16:33:34 +0100
commit45ed23c46e70f23cc76f7f230831d236eeda06c3 (patch)
treee58b321c23543033f72847f6c0c8391e76552067
parent0fca809bfddd42f779e49dd5181f089c20e93320 (diff)
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".
-rw-r--r--libnm-core/nm-utils.h5
1 files changed, 4 insertions, 1 deletions
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);