Commit 56e29155 authored by Dan Williams's avatar Dan Williams

trivial: spacing and code cleanups in nm-manager.h

Remove some dead code and a redundant function.
parent 3382d3e1
......@@ -496,24 +496,6 @@ nm_manager_get_device_by_path (NMManager *manager, const char *path)
return NULL;
}
NMDevice *
nm_manager_get_device_by_master (NMManager *manager, const char *master, const char *driver)
{
GSList *iter;
g_return_val_if_fail (master != NULL, NULL);
for (iter = NM_MANAGER_GET_PRIVATE (manager)->devices; iter; iter = iter->next) {
NMDevice *device = NM_DEVICE (iter->data);
if (!strcmp (nm_device_get_iface (device), master) &&
(!driver || !strcmp (nm_device_get_driver (device), driver)))
return device;
}
return NULL;
}
NMDevice *
nm_manager_get_device_by_ifindex (NMManager *manager, int ifindex)
{
......@@ -1864,20 +1846,7 @@ find_device_by_ip_iface (NMManager *self, const gchar *iface)
return NULL;
}
static NMDevice *
find_device_by_ifindex (NMManager *self, guint32 ifindex)
{
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
GSList *iter;
for (iter = priv->devices; iter; iter = g_slist_next (iter)) {
NMDevice *candidate = NM_DEVICE (iter->data);
if (ifindex == nm_device_get_ifindex (candidate))
return candidate;
}
return NULL;
}
/*******************************************************************/
static void
factory_device_added_cb (NMDeviceFactory *factory,
......@@ -2105,7 +2074,7 @@ platform_link_added (NMManager *self,
if (priv->ignore_link_added_cb > 0)
return;
if (find_device_by_ifindex (self, ifindex))
if (nm_manager_get_device_by_ifindex (self, ifindex))
return;
/* Try registered device factories */
......@@ -2154,7 +2123,7 @@ platform_link_added (NMManager *self,
case NM_LINK_TYPE_VLAN:
/* Have to find the parent device */
if (nm_platform_vlan_get_info (ifindex, &parent_ifindex, NULL)) {
parent = find_device_by_ifindex (self, parent_ifindex);
parent = nm_manager_get_device_by_ifindex (self, parent_ifindex);
if (parent)
device = nm_device_vlan_new (plink, parent);
else {
......@@ -2228,7 +2197,7 @@ platform_link_cb (NMPlatform *platform,
NMManager *self = NM_MANAGER (user_data);
NMDevice *device;
device = find_device_by_ifindex (self, ifindex);
device = nm_manager_get_device_by_ifindex (self, ifindex);
if (device)
remove_device (self, device, FALSE);
break;
......
......@@ -92,45 +92,38 @@ typedef struct {
GType nm_manager_get_type (void);
/* nm_manager_new() should only be used by main.c */
NMManager *nm_manager_new (NMSettings *settings,
const char *state_file,
gboolean initial_net_enabled,
gboolean initial_wifi_enabled,
gboolean initial_wwan_enabled,
gboolean initial_wimax_enabled,
GError **error);
NMManager * nm_manager_new (NMSettings *settings,
const char *state_file,
gboolean initial_net_enabled,
gboolean initial_wifi_enabled,
gboolean initial_wwan_enabled,
gboolean initial_wimax_enabled,
GError **error);
NMManager *nm_manager_get (void);
NMManager * nm_manager_get (void);
void nm_manager_start (NMManager *manager);
const GSList *nm_manager_get_active_connections (NMManager *manager);
GSList *nm_manager_get_activatable_connections (NMManager *manager);
void nm_manager_start (NMManager *manager);
NMState nm_manager_get_state (NMManager *manager);
const GSList *nm_manager_get_active_connections (NMManager *manager);
GSList * nm_manager_get_activatable_connections (NMManager *manager);
/* Device handling */
const GSList *nm_manager_get_devices (NMManager *manager);
NMDevice *nm_manager_get_device_by_master (NMManager *manager,
const char *master,
const char *driver);
NMDevice *nm_manager_get_device_by_ifindex (NMManager *manager,
int ifindex);
NMActiveConnection *nm_manager_activate_connection (NMManager *manager,
NMConnection *connection,
const char *specific_object,
NMDevice *device,
NMAuthSubject *subject,
GError **error);
const GSList * nm_manager_get_devices (NMManager *manager);
gboolean nm_manager_deactivate_connection (NMManager *manager,
const char *connection_path,
NMDeviceStateReason reason,
GError **error);
NMDevice * nm_manager_get_device_by_ifindex (NMManager *manager,
int ifindex);
/* State handling */
NMActiveConnection *nm_manager_activate_connection (NMManager *manager,
NMConnection *connection,
const char *specific_object,
NMDevice *device,
NMAuthSubject *subject,
GError **error);
NMState nm_manager_get_state (NMManager *manager);
gboolean nm_manager_deactivate_connection (NMManager *manager,
const char *connection_path,
NMDeviceStateReason reason,
GError **error);
#endif /* __NETWORKMANAGER_MANAGER_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment