summaryrefslogtreecommitdiff
path: root/src/systemd
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-08-11 17:33:12 +0200
committerThomas Haller <thaller@redhat.com>2016-08-12 09:38:51 +0200
commitf5a4a7e007bc1e27459c29fbae0588f61ca7e1f4 (patch)
tree1f7eca6499113af96b59c346266646105ca99254 /src/systemd
parent4c849d148f330c17117b60137740a1e66ac1a237 (diff)
downloadNetworkManager-f5a4a7e007bc1e27459c29fbae0588f61ca7e1f4.tar.gz
systemd: hide "nm-sd-adapt.h" and expose required internal API in "nm-sd.h"
Users outside of src/systemd should not make use of internal API. Currently, "nm-dhcp-systemd.c" still makes use of internal systemd functions. Instead of letting "nm-dhcp-systemd.c" include internal headers, handpick the required defines to "nm-sd.h" and hide "nm-sd-adapt.h". "nm-sd-adapt.h" is now only used to compile internal systemd sources.
Diffstat (limited to 'src/systemd')
-rw-r--r--src/systemd/nm-sd.c7
-rw-r--r--src/systemd/nm-sd.h11
-rw-r--r--src/systemd/sd-adapt/nm-sd-adapt.c (renamed from src/systemd/nm-sd-adapt.c)0
-rw-r--r--src/systemd/sd-adapt/nm-sd-adapt.h (renamed from src/systemd/nm-sd-adapt.h)0
4 files changed, 18 insertions, 0 deletions
diff --git a/src/systemd/nm-sd.c b/src/systemd/nm-sd.c
index 4d596020c9..43ae0a8b58 100644
--- a/src/systemd/nm-sd.c
+++ b/src/systemd/nm-sd.c
@@ -134,3 +134,10 @@ nm_sd_event_attach_default (void)
/*****************************************************************************/
+/* ensure that defines in nm-sd.h correspond to the internal defines. */
+
+#include "nm-sd-adapt.h"
+#include "dhcp-lease-internal.h"
+
+/*****************************************************************************/
+
diff --git a/src/systemd/nm-sd.h b/src/systemd/nm-sd.h
index 888d44ab0c..f07a708269 100644
--- a/src/systemd/nm-sd.h
+++ b/src/systemd/nm-sd.h
@@ -21,5 +21,16 @@
guint nm_sd_event_attach_default (void);
+/*****************************************************************************
+ * expose internal systemd API
+ *
+ * FIXME: don't use any internal systemd API.
+ *****************************************************************************/
+
+struct sd_dhcp_lease;
+
+int dhcp_lease_save(struct sd_dhcp_lease *lease, const char *lease_file);
+int dhcp_lease_load(struct sd_dhcp_lease **ret, const char *lease_file);
+
#endif /* __NM_SD_H__ */
diff --git a/src/systemd/nm-sd-adapt.c b/src/systemd/sd-adapt/nm-sd-adapt.c
index 4e3082762d..4e3082762d 100644
--- a/src/systemd/nm-sd-adapt.c
+++ b/src/systemd/sd-adapt/nm-sd-adapt.c
diff --git a/src/systemd/nm-sd-adapt.h b/src/systemd/sd-adapt/nm-sd-adapt.h
index cf27c1af1e..cf27c1af1e 100644
--- a/src/systemd/nm-sd-adapt.h
+++ b/src/systemd/sd-adapt/nm-sd-adapt.h