summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-03-08 13:57:20 +0100
committerThomas Haller <thaller@redhat.com>2016-03-15 12:56:58 +0100
commit2eab5ed347cabca9e45fcdc1d198c7d9c3b425f0 (patch)
tree74db3ef3e3deeecfa02b7aca068039c722a9bc63
parent56121fec8314d0c02b932506d59422c973d8c55b (diff)
downloadNetworkManager-2eab5ed347cabca9e45fcdc1d198c7d9c3b425f0.tar.gz
utils: inject platform into nm_utils_complete_generic()
-rw-r--r--src/NetworkManagerUtils.c10
-rw-r--r--src/NetworkManagerUtils.h3
-rw-r--r--src/devices/adsl/nm-device-adsl.c3
-rw-r--r--src/devices/bluetooth/nm-device-bt.c7
-rw-r--r--src/devices/nm-device-bond.c3
-rw-r--r--src/devices/nm-device-bridge.c3
-rw-r--r--src/devices/nm-device-ethernet.c3
-rw-r--r--src/devices/nm-device-infiniband.c3
-rw-r--r--src/devices/nm-device-ip-tunnel.c3
-rw-r--r--src/devices/nm-device-macvlan.c3
-rw-r--r--src/devices/nm-device-tun.c3
-rw-r--r--src/devices/nm-device-vlan.c3
-rw-r--r--src/devices/nm-device-vxlan.c3
-rw-r--r--src/devices/team/nm-device-team.c3
-rw-r--r--src/devices/wifi/nm-device-olpc-mesh.c3
-rw-r--r--src/devices/wifi/nm-device-wifi.c3
-rw-r--r--src/devices/wwan/nm-modem-broadband.c6
-rw-r--r--src/nm-manager.c3
18 files changed, 45 insertions, 23 deletions
diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c
index 50fe4efda8..09ed25c566 100644
--- a/src/NetworkManagerUtils.c
+++ b/src/NetworkManagerUtils.c
@@ -127,7 +127,8 @@ get_new_connection_name (const GSList *existing,
}
static char *
-get_new_connection_ifname (const GSList *existing,
+get_new_connection_ifname (NMPlatform *platform,
+ const GSList *existing,
const char *prefix)
{
int i;
@@ -138,7 +139,7 @@ get_new_connection_ifname (const GSList *existing,
for (i = 0; i < 500; i++) {
name = g_strdup_printf ("%s%d", prefix, i);
- if (nm_platform_link_get_by_ifname (NM_PLATFORM_GET, name))
+ if (nm_platform_link_get_by_ifname (platform, name))
goto next;
for (iter = existing, found = FALSE; iter; iter = g_slist_next (iter)) {
@@ -205,7 +206,8 @@ nm_utils_get_ip_config_method (NMConnection *connection,
}
void
-nm_utils_complete_generic (NMConnection *connection,
+nm_utils_complete_generic (NMPlatform *platform,
+ NMConnection *connection,
const char *ctype,
const GSList *existing,
const char *preferred_id,
@@ -241,7 +243,7 @@ nm_utils_complete_generic (NMConnection *connection,
/* Add an interface name, if requested */
if (ifname_prefix && !nm_setting_connection_get_interface_name (s_con)) {
- ifname = get_new_connection_ifname (existing, ifname_prefix);
+ ifname = get_new_connection_ifname (platform, existing, ifname_prefix);
g_object_set (G_OBJECT (s_con), NM_SETTING_CONNECTION_INTERFACE_NAME, ifname, NULL);
g_free (ifname);
}
diff --git a/src/NetworkManagerUtils.h b/src/NetworkManagerUtils.h
index b3c384da4e..9b5b9106fd 100644
--- a/src/NetworkManagerUtils.h
+++ b/src/NetworkManagerUtils.h
@@ -28,7 +28,8 @@
const char *nm_utils_get_shared_wifi_permission (NMConnection *connection);
-void nm_utils_complete_generic (NMConnection *connection,
+void nm_utils_complete_generic (NMPlatform *platform,
+ NMConnection *connection,
const char *ctype,
const GSList *existing,
const char *preferred_id,
diff --git a/src/devices/adsl/nm-device-adsl.c b/src/devices/adsl/nm-device-adsl.c
index 86abaf8459..ebb7a319b4 100644
--- a/src/devices/adsl/nm-device-adsl.c
+++ b/src/devices/adsl/nm-device-adsl.c
@@ -125,7 +125,8 @@ complete_connection (NMDevice *device,
if (s_adsl && !nm_setting_verify (NM_SETTING (s_adsl), NULL, error))
return FALSE;
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_ADSL_SETTING_NAME,
existing_connections,
NULL,
diff --git a/src/devices/bluetooth/nm-device-bt.c b/src/devices/bluetooth/nm-device-bt.c
index 4ecb56edbc..eef4ed0a1b 100644
--- a/src/devices/bluetooth/nm-device-bt.c
+++ b/src/devices/bluetooth/nm-device-bt.c
@@ -20,12 +20,13 @@
#include "nm-default.h"
+#include "nm-device-bt.h"
+
#include <stdio.h>
#include <string.h>
#include "nm-bluez-common.h"
#include "nm-bluez-device.h"
-#include "nm-device-bt.h"
#include "nm-device-private.h"
#include "ppp-manager/nm-ppp-manager.h"
#include "nm-setting-connection.h"
@@ -39,6 +40,7 @@
#include "nm-utils.h"
#include "nm-bt-error.h"
#include "nm-bt-enum-types.h"
+#include "nm-platform.h"
#include "nmdbus-device-bt.h"
@@ -315,7 +317,8 @@ complete_connection (NMDevice *device,
return FALSE;
}
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_BLUETOOTH_SETTING_NAME,
existing_connections,
preferred,
diff --git a/src/devices/nm-device-bond.c b/src/devices/nm-device-bond.c
index cef104e672..b88b2511b9 100644
--- a/src/devices/nm-device-bond.c
+++ b/src/devices/nm-device-bond.c
@@ -97,7 +97,8 @@ complete_connection (NMDevice *device,
{
NMSettingBond *s_bond;
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_BOND_SETTING_NAME,
existing_connections,
NULL,
diff --git a/src/devices/nm-device-bridge.c b/src/devices/nm-device-bridge.c
index cc72b003ab..c35d286396 100644
--- a/src/devices/nm-device-bridge.c
+++ b/src/devices/nm-device-bridge.c
@@ -103,7 +103,8 @@ complete_connection (NMDevice *device,
{
NMSettingBridge *s_bridge;
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_BRIDGE_SETTING_NAME,
existing_connections,
NULL,
diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c
index db6b434d14..11356d46e9 100644
--- a/src/devices/nm-device-ethernet.c
+++ b/src/devices/nm-device-ethernet.c
@@ -1388,7 +1388,8 @@ complete_connection (NMDevice *device,
/* Default to an ethernet-only connection, but if a PPPoE setting was given
* then PPPoE should be our connection type.
*/
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
s_pppoe ? NM_SETTING_PPPOE_SETTING_NAME : NM_SETTING_WIRED_SETTING_NAME,
existing_connections,
NULL,
diff --git a/src/devices/nm-device-infiniband.c b/src/devices/nm-device-infiniband.c
index e899752d75..a27af3144b 100644
--- a/src/devices/nm-device-infiniband.c
+++ b/src/devices/nm-device-infiniband.c
@@ -166,7 +166,8 @@ complete_connection (NMDevice *device,
const char *setting_mac;
const char *hw_address;
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_INFINIBAND_SETTING_NAME,
existing_connections,
NULL,
diff --git a/src/devices/nm-device-ip-tunnel.c b/src/devices/nm-device-ip-tunnel.c
index f95f30e68b..089b10352c 100644
--- a/src/devices/nm-device-ip-tunnel.c
+++ b/src/devices/nm-device-ip-tunnel.c
@@ -338,7 +338,8 @@ complete_connection (NMDevice *device,
{
NMSettingIPTunnel *s_ip_tunnel;
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_IP_TUNNEL_SETTING_NAME,
existing_connections,
NULL,
diff --git a/src/devices/nm-device-macvlan.c b/src/devices/nm-device-macvlan.c
index 2dc9d4f6b2..cd02cb8e00 100644
--- a/src/devices/nm-device-macvlan.c
+++ b/src/devices/nm-device-macvlan.c
@@ -420,7 +420,8 @@ complete_connection (NMDevice *device,
{
NMSettingMacvlan *s_macvlan;
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_MACVLAN_SETTING_NAME,
existing_connections,
NULL,
diff --git a/src/devices/nm-device-tun.c b/src/devices/nm-device-tun.c
index a8ae3edc91..eac2fb825b 100644
--- a/src/devices/nm-device-tun.c
+++ b/src/devices/nm-device-tun.c
@@ -121,7 +121,8 @@ complete_connection (NMDevice *device,
{
NMSettingTun *s_tun;
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_TUN_SETTING_NAME,
existing_connections,
NULL,
diff --git a/src/devices/nm-device-vlan.c b/src/devices/nm-device-vlan.c
index e6e3708b75..4d606e9d82 100644
--- a/src/devices/nm-device-vlan.c
+++ b/src/devices/nm-device-vlan.c
@@ -439,7 +439,8 @@ complete_connection (NMDevice *device,
{
NMSettingVlan *s_vlan;
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_VLAN_SETTING_NAME,
existing_connections,
NULL,
diff --git a/src/devices/nm-device-vxlan.c b/src/devices/nm-device-vxlan.c
index 7994245870..d308d47abc 100644
--- a/src/devices/nm-device-vxlan.c
+++ b/src/devices/nm-device-vxlan.c
@@ -365,7 +365,8 @@ complete_connection (NMDevice *device,
{
NMSettingVxlan *s_vxlan;
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_VXLAN_SETTING_NAME,
existing_connections,
NULL,
diff --git a/src/devices/team/nm-device-team.c b/src/devices/team/nm-device-team.c
index c3d48b41e1..60842c18ab 100644
--- a/src/devices/team/nm-device-team.c
+++ b/src/devices/team/nm-device-team.c
@@ -107,7 +107,8 @@ complete_connection (NMDevice *device,
{
NMSettingTeam *s_team;
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_TEAM_SETTING_NAME,
existing_connections,
NULL,
diff --git a/src/devices/wifi/nm-device-olpc-mesh.c b/src/devices/wifi/nm-device-olpc-mesh.c
index 11da011ee9..6fbc63a1b2 100644
--- a/src/devices/wifi/nm-device-olpc-mesh.c
+++ b/src/devices/wifi/nm-device-olpc-mesh.c
@@ -138,7 +138,8 @@ complete_connection (NMDevice *device,
}
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_OLPC_MESH_SETTING_NAME,
existing_connections,
NULL,
diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c
index 2bf3b56a16..95a89eab32 100644
--- a/src/devices/wifi/nm-device-wifi.c
+++ b/src/devices/wifi/nm-device-wifi.c
@@ -845,7 +845,8 @@ complete_connection (NMDevice *device,
str_ssid = nm_utils_ssid_to_utf8 (ssid->data, ssid->len);
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_WIRELESS_SETTING_NAME,
existing_connections,
str_ssid,
diff --git a/src/devices/wwan/nm-modem-broadband.c b/src/devices/wwan/nm-modem-broadband.c
index 363a878af1..769e6a2753 100644
--- a/src/devices/wwan/nm-modem-broadband.c
+++ b/src/devices/wwan/nm-modem-broadband.c
@@ -647,7 +647,8 @@ complete_connection (NMModem *_self,
if (!nm_setting_gsm_get_number (s_gsm))
g_object_set (G_OBJECT (s_gsm), NM_SETTING_GSM_NUMBER, "*99#", NULL);
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_GSM_SETTING_NAME,
existing_connections,
NULL,
@@ -670,7 +671,8 @@ complete_connection (NMModem *_self,
if (!nm_setting_cdma_get_number (s_cdma))
g_object_set (G_OBJECT (s_cdma), NM_SETTING_CDMA_NUMBER, "#777", NULL);
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_CDMA_SETTING_NAME,
existing_connections,
NULL,
diff --git a/src/nm-manager.c b/src/nm-manager.c
index 409079a3e4..0ccb987a1b 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -3569,7 +3569,8 @@ impl_manager_add_and_activate_connection (NMManager *self,
goto error;
}
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_VPN_SETTING_NAME,
all_connections,
NULL,