summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-08-12 02:04:17 +0200
committerLennart Poettering <lennart@poettering.net>2014-08-12 02:04:17 +0200
commit7bfe1e9cb0a63ecaa13ef59a37e65698ba3121d8 (patch)
tree2a0f0c5a2dac4b3159bb70c1d91d3a620d8527c1
parentee8c45689526ca973407cbb77bce7b96a062c40b (diff)
sd-network: remove client-side dhcp API
The networkd should abstract the difference between DHCP supplied and configured data, and hence the DHCP lease concept should not exposed on the client side. Should we want to support arbitrary DHCP fields one day, we can add a new sd_network_get_link_dhcp_field() call or so.
-rw-r--r--src/network/sd-network.c38
-rw-r--r--src/systemd/sd-network.h5
2 files changed, 0 insertions, 43 deletions
diff --git a/src/network/sd-network.c b/src/network/sd-network.c
index cc4b160e74..6375788c95 100644
--- a/src/network/sd-network.c
+++ b/src/network/sd-network.c
@@ -33,7 +33,6 @@
#include "fileio.h"
#include "sd-network.h"
#include "network-internal.h"
-#include "dhcp-lease-internal.h"
_public_ int sd_network_get_link_state(int ifindex, char **state) {
_cleanup_free_ char *s = NULL, *p = NULL;
@@ -131,33 +130,6 @@ _public_ int sd_network_get_link_llmnr(int ifindex, char **llmnr) {
return 0;
}
-_public_ int sd_network_get_link_dhcp_lease(int ifindex, sd_dhcp_lease **ret) {
- _cleanup_free_ char *p = NULL, *s = NULL;
- sd_dhcp_lease *lease = NULL;
- int r;
-
- assert_return(ifindex > 0, -EINVAL);
- assert_return(ret, -EINVAL);
-
- if (asprintf(&p, "/run/systemd/netif/links/%d", ifindex) < 0)
- return -ENOMEM;
-
- r = parse_env_file(p, NEWLINE, "DHCP_LEASE", &s, NULL);
-
- if (r < 0)
- return r;
- else if (!s)
- return -EIO;
-
- r = dhcp_lease_load(s, &lease);
- if (r < 0)
- return r;
-
- *ret = lease;
-
- return 0;
-}
-
static int network_get_link_strv(const char *key, int ifindex, char ***ret) {
_cleanup_free_ char *p = NULL, *s = NULL;
_cleanup_strv_free_ char **a = NULL;
@@ -227,16 +199,6 @@ _public_ int sd_network_monitor_new(sd_network_monitor **m, const char *category
good = true;
}
- if (!category || streq(category, "leases")) {
- k = inotify_add_watch(fd, "/run/systemd/netif/leases/", IN_MOVED_TO|IN_DELETE);
- if (k < 0) {
- safe_close(fd);
- return -errno;
- }
-
- good = true;
- }
-
if (!good) {
close_nointr(fd);
return -EINVAL;
diff --git a/src/systemd/sd-network.h b/src/systemd/sd-network.h
index e69679ae5a..3e950728c5 100644
--- a/src/systemd/sd-network.h
+++ b/src/systemd/sd-network.h
@@ -26,8 +26,6 @@
#include <sys/types.h>
#include <inttypes.h>
-#include "sd-dhcp-lease.h"
-
#include "_sd-common.h"
/*
@@ -73,9 +71,6 @@ int sd_network_get_link_state(int ifindex, char **state);
*/
int sd_network_get_link_operational_state(int ifindex, char **state);
-/* Get DHCPv4 lease from ifindex. */
-int sd_network_get_link_dhcp_lease(int ifindex, sd_dhcp_lease **ret);
-
/* Indicates whether or not LLMNR should be enabled for the link
* Possible levels of support: yes, no, resolve
* Possible return codes: