summaryrefslogtreecommitdiff
path: root/src/dhcp
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-03-09 18:27:24 +0100
committerThomas Haller <thaller@redhat.com>2018-03-20 21:03:20 +0100
commit512fa33ef4915bef43d132af8e02fa10ef7a4cec (patch)
tree36c8aaf4b7dd730b820380a90d360b2386d554e5 /src/dhcp
parent745d60c06ecccc7cbb0f916d5c62f3f72ac5e60b (diff)
dhcp: remove unused nm_dhcp_manager_get_lease_ip_configs() function
Diffstat (limited to 'src/dhcp')
-rw-r--r--src/dhcp/nm-dhcp-client.h7
-rw-r--r--src/dhcp/nm-dhcp-dhclient.c27
-rw-r--r--src/dhcp/nm-dhcp-dhcpcanon.c1
-rw-r--r--src/dhcp/nm-dhcp-dhcpcd.c1
-rw-r--r--src/dhcp/nm-dhcp-manager.c25
-rw-r--r--src/dhcp/nm-dhcp-manager.h9
-rw-r--r--src/dhcp/nm-dhcp-systemd.c31
7 files changed, 0 insertions, 101 deletions
diff --git a/src/dhcp/nm-dhcp-client.h b/src/dhcp/nm-dhcp-client.h
index f389f534c..0d92d7430 100644
--- a/src/dhcp/nm-dhcp-client.h
+++ b/src/dhcp/nm-dhcp-client.h
@@ -194,13 +194,6 @@ typedef struct {
GType (*get_type)(void);
const char *name;
const char *(*get_path) (void);
- GSList *(*get_lease_ip_configs) (struct _NMDedupMultiIndex *multi_idx,
- int addr_family,
- const char *iface,
- int ifindex,
- const char *uuid,
- guint32 route_table,
- guint32 route_metric);
} NMDhcpClientFactory;
extern const NMDhcpClientFactory _nm_dhcp_client_factory_dhcpcanon;
diff --git a/src/dhcp/nm-dhcp-dhclient.c b/src/dhcp/nm-dhcp-dhclient.c
index 56b74d43b..738e9f918 100644
--- a/src/dhcp/nm-dhcp-dhclient.c
+++ b/src/dhcp/nm-dhcp-dhclient.c
@@ -158,32 +158,6 @@ get_dhclient_leasefile (int addr_family,
return NULL;
}
-static GSList *
-nm_dhcp_dhclient_get_lease_ip_configs (NMDedupMultiIndex *multi_idx,
- int addr_family,
- const char *iface,
- int ifindex,
- const char *uuid,
- guint32 route_table,
- guint32 route_metric)
-{
- gs_free char *contents = NULL;
- gs_free char *leasefile = NULL;
-
- leasefile = get_dhclient_leasefile (addr_family, iface, uuid, NULL);
- if (!leasefile)
- return NULL;
-
- if ( g_file_test (leasefile, G_FILE_TEST_EXISTS)
- && g_file_get_contents (leasefile, &contents, NULL, NULL)
- && contents
- && contents[0]) {
- return nm_dhcp_dhclient_read_lease_ip_configs (multi_idx, addr_family, iface, ifindex,
- route_table, route_metric, contents, NULL);
- }
- return NULL;
-}
-
static gboolean
merge_dhclient_config (NMDhcpDhclient *self,
int addr_family,
@@ -721,7 +695,6 @@ const NMDhcpClientFactory _nm_dhcp_client_factory_dhclient = {
.name = "dhclient",
.get_type = nm_dhcp_dhclient_get_type,
.get_path = nm_dhcp_dhclient_get_path,
- .get_lease_ip_configs = nm_dhcp_dhclient_get_lease_ip_configs,
};
#endif /* WITH_DHCLIENT */
diff --git a/src/dhcp/nm-dhcp-dhcpcanon.c b/src/dhcp/nm-dhcp-dhcpcanon.c
index 66ce45c63..82b3db4fe 100644
--- a/src/dhcp/nm-dhcp-dhcpcanon.c
+++ b/src/dhcp/nm-dhcp-dhcpcanon.c
@@ -265,7 +265,6 @@ const NMDhcpClientFactory _nm_dhcp_client_factory_dhcpcanon = {
.name = "dhcpcanon",
.get_type = nm_dhcp_dhcpcanon_get_type,
.get_path = nm_dhcp_dhcpcanon_get_path,
- .get_lease_ip_configs = NULL,
};
#endif /* WITH_DHCPCANON */
diff --git a/src/dhcp/nm-dhcp-dhcpcd.c b/src/dhcp/nm-dhcp-dhcpcd.c
index 8e4ebb196..c4bcb0843 100644
--- a/src/dhcp/nm-dhcp-dhcpcd.c
+++ b/src/dhcp/nm-dhcp-dhcpcd.c
@@ -251,7 +251,6 @@ const NMDhcpClientFactory _nm_dhcp_client_factory_dhcpcd = {
.name = "dhcpcd",
.get_type = nm_dhcp_dhcpcd_get_type,
.get_path = nm_dhcp_dhcpcd_get_path,
- .get_lease_ip_configs = NULL,
};
#endif /* WITH_DHCPCD */
diff --git a/src/dhcp/nm-dhcp-manager.c b/src/dhcp/nm-dhcp-manager.c
index 526dbfd79..bf22872d4 100644
--- a/src/dhcp/nm-dhcp-manager.c
+++ b/src/dhcp/nm-dhcp-manager.c
@@ -333,31 +333,6 @@ nm_dhcp_manager_set_default_hostname (NMDhcpManager *manager, const char *hostna
priv->default_hostname = g_strdup (hostname);
}
-GSList *
-nm_dhcp_manager_get_lease_ip_configs (NMDhcpManager *self,
- NMDedupMultiIndex *multi_idx,
- int addr_family,
- const char *iface,
- int ifindex,
- const char *uuid,
- guint32 route_table,
- guint32 route_metric)
-{
- NMDhcpManagerPrivate *priv;
-
- g_return_val_if_fail (NM_IS_DHCP_MANAGER (self), NULL);
- g_return_val_if_fail (iface != NULL, NULL);
- g_return_val_if_fail (ifindex >= -1, NULL);
- g_return_val_if_fail (uuid != NULL, NULL);
- g_return_val_if_fail (NM_IN_SET (addr_family, AF_INET, AF_INET6), NULL);
-
- priv = NM_DHCP_MANAGER_GET_PRIVATE (self);
- if ( priv->client_factory
- && priv->client_factory->get_lease_ip_configs)
- return priv->client_factory->get_lease_ip_configs (multi_idx, addr_family, iface, ifindex, uuid, route_table, route_metric);
- return NULL;
-}
-
const char *
nm_dhcp_manager_get_config (NMDhcpManager *self)
{
diff --git a/src/dhcp/nm-dhcp-manager.h b/src/dhcp/nm-dhcp-manager.h
index 3cf8cf871..f8a7e31d2 100644
--- a/src/dhcp/nm-dhcp-manager.h
+++ b/src/dhcp/nm-dhcp-manager.h
@@ -78,15 +78,6 @@ NMDhcpClient * nm_dhcp_manager_start_ip6 (NMDhcpManager *manager,
NMSettingIP6ConfigPrivacy privacy,
guint needed_prefixes);
-GSList * nm_dhcp_manager_get_lease_ip_configs (NMDhcpManager *self,
- struct _NMDedupMultiIndex *multi_idx,
- int addr_family,
- const char *iface,
- int ifindex,
- const char *uuid,
- guint32 route_table,
- guint32 route_metric);
-
/* For testing only */
extern const char* nm_dhcp_helper_path;
diff --git a/src/dhcp/nm-dhcp-systemd.c b/src/dhcp/nm-dhcp-systemd.c
index db392c421..1305f1a2a 100644
--- a/src/dhcp/nm-dhcp-systemd.c
+++ b/src/dhcp/nm-dhcp-systemd.c
@@ -450,36 +450,6 @@ get_leasefile_path (int addr_family, const char *iface, const char *uuid)
iface);
}
-static GSList *
-nm_dhcp_systemd_get_lease_ip_configs (NMDedupMultiIndex *multi_idx,
- int addr_family,
- const char *iface,
- int ifindex,
- const char *uuid,
- guint32 route_table,
- guint32 route_metric)
-{
- GSList *leases = NULL;
- gs_free char *path = NULL;
- sd_dhcp_lease *lease = NULL;
- NMIP4Config *ip4_config;
- int r;
-
- if (addr_family != AF_INET)
- return NULL;
-
- path = get_leasefile_path (addr_family, iface, uuid);
- r = dhcp_lease_load (&lease, path);
- if (r == 0 && lease) {
- ip4_config = lease_to_ip4_config (multi_idx, iface, ifindex, lease, NULL, route_table, route_metric, FALSE, NULL);
- if (ip4_config)
- leases = g_slist_append (leases, ip4_config);
- sd_dhcp_lease_unref (lease);
- }
-
- return leases;
-}
-
/*****************************************************************************/
static void
@@ -1091,5 +1061,4 @@ const NMDhcpClientFactory _nm_dhcp_client_factory_internal = {
.name = "internal",
.get_type = nm_dhcp_systemd_get_type,
.get_path = NULL,
- .get_lease_ip_configs = nm_dhcp_systemd_get_lease_ip_configs,
};