}
static char *
-get_new_connection_ifname (const GSList *existing,
+get_new_connection_ifname (NMPlatform *platform,
+ const GSList *existing,
const char *prefix)
{
int i;
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)) {
}
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,
/* 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);
}
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,
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,
#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"
#include "nm-utils.h"
#include "nm-bt-error.h"
#include "nm-bt-enum-types.h"
+#include "nm-platform.h"
#include "nmdbus-device-bt.h"
return FALSE;
}
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_BLUETOOTH_SETTING_NAME,
existing_connections,
preferred,
{
NMSettingBond *s_bond;
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_BOND_SETTING_NAME,
existing_connections,
NULL,
{
NMSettingBridge *s_bridge;
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_BRIDGE_SETTING_NAME,
existing_connections,
NULL,
/* 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,
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,
{
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,
{
NMSettingMacvlan *s_macvlan;
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_MACVLAN_SETTING_NAME,
existing_connections,
NULL,
{
NMSettingTun *s_tun;
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_TUN_SETTING_NAME,
existing_connections,
NULL,
{
NMSettingVlan *s_vlan;
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_VLAN_SETTING_NAME,
existing_connections,
NULL,
{
NMSettingVxlan *s_vxlan;
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_VXLAN_SETTING_NAME,
existing_connections,
NULL,
{
NMSettingTeam *s_team;
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_TEAM_SETTING_NAME,
existing_connections,
NULL,
}
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_OLPC_MESH_SETTING_NAME,
existing_connections,
NULL,
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,
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,
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,
goto error;
}
- nm_utils_complete_generic (connection,
+ nm_utils_complete_generic (NM_PLATFORM_GET,
+ connection,
NM_SETTING_VPN_SETTING_NAME,
all_connections,
NULL,