diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2016-02-16 15:07:49 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-02-17 18:43:44 +0100 |
commit | adc9895ebe33389a4ef89a319e9480a510bb160d (patch) | |
tree | 359d64c638729dcb9780bcbedf27675835005229 | |
parent | cd81e0bd9ff1fb575e5c98724a3b41d7edd119d2 (diff) | |
download | NetworkManager-adc9895ebe33389a4ef89a319e9480a510bb160d.tar.gz |
manager: export nm_manager_get_connection_iface()
We'll need the actual device name that should be used for a connection
activated on a given device when checking the connection availability.
-rw-r--r-- | src/nm-manager.c | 24 | ||||
-rw-r--r-- | src/nm-manager.h | 6 |
2 files changed, 18 insertions, 12 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c index 9738d49e08..eb9576eeeb 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -948,24 +948,24 @@ find_parent_device_for_connection (NMManager *self, NMConnection *connection) } /** - * get_virtual_iface_name: + * nm_manager_get_connection_iface: * @self: the #NMManager - * @connection: the #NMConnection representing a virtual interface + * @connection: the #NMConnection to get the interface for * @out_parent: on success, the parent device if any * @error: an error if determining the virtual interface name failed * * Given @connection, returns the interface name that the connection - * would represent if it is a virtual connection. %NULL is returned and - * @error is set if the connection is not virtual, or if the name could - * not be determined. + * would need to use when activated. %NULL is returned if the name + * is not specified in connection or a the name for a virtual device + * could not be generated. * * Returns: the expected interface name (caller takes ownership), or %NULL */ -static char * -get_virtual_iface_name (NMManager *self, - NMConnection *connection, - NMDevice **out_parent, - GError **error) +char * +nm_manager_get_connection_iface (NMManager *self, + NMConnection *connection, + NMDevice **out_parent, + GError **error) { NMDeviceFactory *factory; char *iface = NULL; @@ -1021,7 +1021,7 @@ system_create_virtual_device (NMManager *self, NMConnection *connection) g_return_val_if_fail (NM_IS_MANAGER (self), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); - iface = get_virtual_iface_name (self, connection, &parent, &error); + iface = nm_manager_get_connection_iface (self, connection, &parent, &error); if (!iface) { nm_log_warn (LOGD_DEVICE, "(%s) can't get a name of a virtual device: %s", nm_connection_get_id (connection), error->message); @@ -3219,7 +3219,7 @@ validate_activation_request (NMManager *self, char *iface; /* Look for an existing device with the connection's interface name */ - iface = get_virtual_iface_name (self, connection, NULL, error); + iface = nm_manager_get_connection_iface (self, connection, NULL, error); if (!iface) goto error; diff --git a/src/nm-manager.h b/src/nm-manager.h index 2935d2a273..9783020102 100644 --- a/src/nm-manager.h +++ b/src/nm-manager.h @@ -101,6 +101,11 @@ const GSList * nm_manager_get_devices (NMManager *manager); NMDevice * nm_manager_get_device_by_ifindex (NMManager *manager, int ifindex); +char * nm_manager_get_connection_iface (NMManager *self, + NMConnection *connection, + NMDevice **out_parent, + GError **error); + NMActiveConnection *nm_manager_activate_connection (NMManager *manager, NMSettingsConnection *connection, const char *specific_object, @@ -113,4 +118,5 @@ gboolean nm_manager_deactivate_connection (NMManager *manager, NMDeviceStateReason reason, GError **error); + #endif /* __NETWORKMANAGER_MANAGER_H__ */ |