mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 06:38:11 +02:00
dhcp: remove unused nm_dhcp_manager_get_lease_ip_configs() function
This commit is contained in:
parent
745d60c06e
commit
512fa33ef4
7 changed files with 0 additions and 101 deletions
|
|
@ -194,13 +194,6 @@ typedef struct {
|
||||||
GType (*get_type)(void);
|
GType (*get_type)(void);
|
||||||
const char *name;
|
const char *name;
|
||||||
const char *(*get_path) (void);
|
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;
|
} NMDhcpClientFactory;
|
||||||
|
|
||||||
extern const NMDhcpClientFactory _nm_dhcp_client_factory_dhcpcanon;
|
extern const NMDhcpClientFactory _nm_dhcp_client_factory_dhcpcanon;
|
||||||
|
|
|
||||||
|
|
@ -158,32 +158,6 @@ get_dhclient_leasefile (int addr_family,
|
||||||
return NULL;
|
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
|
static gboolean
|
||||||
merge_dhclient_config (NMDhcpDhclient *self,
|
merge_dhclient_config (NMDhcpDhclient *self,
|
||||||
int addr_family,
|
int addr_family,
|
||||||
|
|
@ -721,7 +695,6 @@ const NMDhcpClientFactory _nm_dhcp_client_factory_dhclient = {
|
||||||
.name = "dhclient",
|
.name = "dhclient",
|
||||||
.get_type = nm_dhcp_dhclient_get_type,
|
.get_type = nm_dhcp_dhclient_get_type,
|
||||||
.get_path = nm_dhcp_dhclient_get_path,
|
.get_path = nm_dhcp_dhclient_get_path,
|
||||||
.get_lease_ip_configs = nm_dhcp_dhclient_get_lease_ip_configs,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* WITH_DHCLIENT */
|
#endif /* WITH_DHCLIENT */
|
||||||
|
|
|
||||||
|
|
@ -265,7 +265,6 @@ const NMDhcpClientFactory _nm_dhcp_client_factory_dhcpcanon = {
|
||||||
.name = "dhcpcanon",
|
.name = "dhcpcanon",
|
||||||
.get_type = nm_dhcp_dhcpcanon_get_type,
|
.get_type = nm_dhcp_dhcpcanon_get_type,
|
||||||
.get_path = nm_dhcp_dhcpcanon_get_path,
|
.get_path = nm_dhcp_dhcpcanon_get_path,
|
||||||
.get_lease_ip_configs = NULL,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* WITH_DHCPCANON */
|
#endif /* WITH_DHCPCANON */
|
||||||
|
|
|
||||||
|
|
@ -251,7 +251,6 @@ const NMDhcpClientFactory _nm_dhcp_client_factory_dhcpcd = {
|
||||||
.name = "dhcpcd",
|
.name = "dhcpcd",
|
||||||
.get_type = nm_dhcp_dhcpcd_get_type,
|
.get_type = nm_dhcp_dhcpcd_get_type,
|
||||||
.get_path = nm_dhcp_dhcpcd_get_path,
|
.get_path = nm_dhcp_dhcpcd_get_path,
|
||||||
.get_lease_ip_configs = NULL,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* WITH_DHCPCD */
|
#endif /* WITH_DHCPCD */
|
||||||
|
|
|
||||||
|
|
@ -333,31 +333,6 @@ nm_dhcp_manager_set_default_hostname (NMDhcpManager *manager, const char *hostna
|
||||||
priv->default_hostname = g_strdup (hostname);
|
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 *
|
const char *
|
||||||
nm_dhcp_manager_get_config (NMDhcpManager *self)
|
nm_dhcp_manager_get_config (NMDhcpManager *self)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -78,15 +78,6 @@ NMDhcpClient * nm_dhcp_manager_start_ip6 (NMDhcpManager *manager,
|
||||||
NMSettingIP6ConfigPrivacy privacy,
|
NMSettingIP6ConfigPrivacy privacy,
|
||||||
guint needed_prefixes);
|
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 */
|
/* For testing only */
|
||||||
extern const char* nm_dhcp_helper_path;
|
extern const char* nm_dhcp_helper_path;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -450,36 +450,6 @@ get_leasefile_path (int addr_family, const char *iface, const char *uuid)
|
||||||
iface);
|
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
|
static void
|
||||||
|
|
@ -1091,5 +1061,4 @@ const NMDhcpClientFactory _nm_dhcp_client_factory_internal = {
|
||||||
.name = "internal",
|
.name = "internal",
|
||||||
.get_type = nm_dhcp_systemd_get_type,
|
.get_type = nm_dhcp_systemd_get_type,
|
||||||
.get_path = NULL,
|
.get_path = NULL,
|
||||||
.get_lease_ip_configs = nm_dhcp_systemd_get_lease_ip_configs,
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue