[network-manager-applet] core: remove connection validation and filtering functions, use libnm-glib ones



commit 697269e20f47df6529ed45be81445f2c92b39cd9
Author: JiÅÃ KlimeÅ <jklimes redhat com>
Date:   Mon Mar 19 10:04:20 2012 +0100

    core: remove connection validation and filtering functions, use libnm-glib ones
    
    utils_connection_valid_for_device() and utils_filter_connections_for_device()
    are removed from utils and libnm-glib's nm_device_filter_connections() and
    nm_access_point_filter_connections() are used instead.
    It saves us code and makes things less error-prone.

 src/applet-device-bt.c    |    4 +-
 src/applet-device-cdma.c  |    4 +-
 src/applet-device-gsm.c   |    4 +-
 src/applet-device-wifi.c  |   29 +---
 src/applet-device-wimax.c |    4 +-
 src/applet-device-wired.c |    4 +-
 src/utils/utils.c         |  399 ---------------------------------------------
 src/utils/utils.h         |    8 +-
 8 files changed, 20 insertions(+), 436 deletions(-)
---
diff --git a/src/applet-device-bt.c b/src/applet-device-bt.c
index 8a262f5..76ec74b 100644
--- a/src/applet-device-bt.c
+++ b/src/applet-device-bt.c
@@ -17,7 +17,7 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2008 - 2011 Red Hat, Inc.
+ * (C) Copyright 2008 - 2012 Red Hat, Inc.
  * (C) Copyright 2008 Novell, Inc.
  */
 
@@ -141,7 +141,7 @@ bt_add_menu_item (NMDevice *device,
 	GSList *connections, *all;
 
 	all = applet_get_all_connections (applet);
-	connections = utils_filter_connections_for_device (device, all);
+	connections = nm_device_filter_connections (device, all);
 	g_slist_free (all);
 
 	text = nm_device_bt_get_name (NM_DEVICE_BT (device));
diff --git a/src/applet-device-cdma.c b/src/applet-device-cdma.c
index e72dddb..4c18131 100644
--- a/src/applet-device-cdma.c
+++ b/src/applet-device-cdma.c
@@ -17,7 +17,7 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2008 - 2011 Red Hat, Inc.
+ * (C) Copyright 2008 - 2012 Red Hat, Inc.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -331,7 +331,7 @@ cdma_add_menu_item (NMDevice *device,
 	info = g_object_get_data (G_OBJECT (device), "devinfo");
 
 	all = applet_get_all_connections (applet);
-	connections = utils_filter_connections_for_device (device, all);
+	connections = nm_device_filter_connections (device, all);
 	g_slist_free (all);
 
 	if (n_devices > 1) {
diff --git a/src/applet-device-gsm.c b/src/applet-device-gsm.c
index d20bf5e..f1cfed1 100644
--- a/src/applet-device-gsm.c
+++ b/src/applet-device-gsm.c
@@ -17,7 +17,7 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2008 - 2011 Red Hat, Inc.
+ * (C) Copyright 2008 - 2012 Red Hat, Inc.
  * (C) Copyright 2008 Novell, Inc.
  */
 
@@ -378,7 +378,7 @@ gsm_add_menu_item (NMDevice *device,
 	info = g_object_get_data (G_OBJECT (device), "devinfo");
 
 	all = applet_get_all_connections (applet);
-	connections = utils_filter_connections_for_device (device, all);
+	connections = nm_device_filter_connections (device, all);
 	g_slist_free (all);
 
 	if (n_devices > 1) {
diff --git a/src/applet-device-wifi.c b/src/applet-device-wifi.c
index fecfff1..f17324c 100644
--- a/src/applet-device-wifi.c
+++ b/src/applet-device-wifi.c
@@ -17,7 +17,7 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2008 - 2011 Red Hat, Inc.
+ * (C) Copyright 2008 - 2012 Red Hat, Inc.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -545,21 +545,6 @@ find_duplicate (gpointer d, gpointer user_data)
 		data->found = NM_NETWORK_MENU_ITEM (widget);
 }
 
-static GSList *
-filter_connections_for_access_point (GSList *connections, NMDeviceWifi *device, NMAccessPoint *ap)
-{
-	GSList *ap_connections = NULL;
-	GSList *iter;
-
-	for (iter = connections; iter; iter = g_slist_next (iter)) {
-		NMConnection *candidate = NM_CONNECTION (iter->data);
-
-		if (utils_connection_valid_for_device (candidate, NM_DEVICE (device), (gpointer) ap))
-			ap_connections = g_slist_append (ap_connections, candidate);
-	}
-	return ap_connections;
-}
-
 static NMNetworkMenuItem *
 create_new_ap_item (NMDeviceWifi *device,
                     NMAccessPoint *ap,
@@ -570,11 +555,15 @@ create_new_ap_item (NMDeviceWifi *device,
 	WirelessMenuItemInfo *info;
 	GSList *iter;
 	NMNetworkMenuItem *item = NULL;
+	GSList *dev_connections = NULL;
 	GSList *ap_connections = NULL;
 	const GByteArray *ssid;
 	guint32 dev_caps;
 
-	ap_connections = filter_connections_for_access_point (connections, device, ap);
+	dev_connections = nm_device_filter_connections (NM_DEVICE (device), connections);
+	ap_connections = nm_access_point_filter_connections (ap, dev_connections);
+	g_slist_free (dev_connections);
+	dev_connections = NULL;
 
 	item = NM_NETWORK_MENU_ITEM (nm_network_menu_item_new (dup_data->hash,
 	                                                       !!g_slist_length (ap_connections)));
@@ -814,7 +803,7 @@ wireless_add_menu_item (NMDevice *device,
 	gtk_widget_show (widget);
 
 	all = applet_get_all_connections (applet);
-	connections = utils_filter_connections_for_device (device, all);
+	connections = nm_device_filter_connections (device, all);
 	g_slist_free (all);
 
 	/* Add the active AP if we're connected to something and the device is available */
@@ -1040,14 +1029,14 @@ idle_check_avail_access_point_notification (gpointer datap)
 		return FALSE;	
 
 	all_connections = applet_get_all_connections (applet);
-	connections = utils_filter_connections_for_device (NM_DEVICE (device), all_connections);
+	connections = nm_device_filter_connections (NM_DEVICE (device), all_connections);
 	g_slist_free (all_connections);	
 	all_connections = NULL;
 
 	aps = nm_device_wifi_get_access_points (device);
 	for (i = 0; aps && (i < aps->len); i++) {
 		NMAccessPoint *ap = aps->pdata[i];
-		GSList *ap_connections = filter_connections_for_access_point (connections, device, ap);
+		GSList *ap_connections = nm_access_point_filter_connections (ap, connections);
 		GSList *iter;
 		gboolean is_autoconnect = FALSE;
 
diff --git a/src/applet-device-wimax.c b/src/applet-device-wimax.c
index 05533a1..042653a 100644
--- a/src/applet-device-wimax.c
+++ b/src/applet-device-wimax.c
@@ -17,7 +17,7 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2008 - 2011 Red Hat, Inc.
+ * (C) Copyright 2008 - 2012 Red Hat, Inc.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -279,7 +279,7 @@ wimax_add_menu_item (NMDevice *device,
 		applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"), -1);
 
 		all = applet_get_all_connections (applet);
-		connections = utils_filter_connections_for_device (device, all);
+		connections = nm_device_filter_connections (device, all);
 		g_slist_free (all);
 
 		/* And add menu items for each NSP */
diff --git a/src/applet-device-wired.c b/src/applet-device-wired.c
index bf32d57..8cdd02b 100644
--- a/src/applet-device-wired.c
+++ b/src/applet-device-wired.c
@@ -17,7 +17,7 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2008 - 2011 Red Hat, Inc.
+ * (C) Copyright 2008 - 2012 Red Hat, Inc.
  * (C) Copyright 2008 Novell, Inc.
  */
 
@@ -190,7 +190,7 @@ wired_add_menu_item (NMDevice *device,
 	gboolean carrier = TRUE;
 
 	all = applet_get_all_connections (applet);
-	connections = utils_filter_connections_for_device (device, all);
+	connections = nm_device_filter_connections (device, all);
 	g_slist_free (all);
 
 	if (n_devices > 1) {
diff --git a/src/utils/utils.c b/src/utils/utils.c
index 084d402..62f0307 100644
--- a/src/utils/utils.c
+++ b/src/utils/utils.c
@@ -232,405 +232,6 @@ utils_ether_addr_valid (const struct ether_addr *test_addr)
 	return TRUE;
 }
 
-static gboolean
-utils_check_ap_compatible (NMAccessPoint *ap,
-                           NMConnection *connection)
-{
-	NMSettingWireless *s_wireless;
-	NMSettingWirelessSecurity *s_wireless_sec;
-	const GByteArray *setting_bssid;
-	const char *setting_mode;
-	const char *setting_band;
-	NM80211Mode ap_mode;
-	guint32 freq, channel;
-
-	g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), FALSE);
-	g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE);
-
-	s_wireless = nm_connection_get_setting_wireless (connection);
-	if (s_wireless == NULL)
-		return FALSE;
-	
-	if (!nm_utils_same_ssid (nm_setting_wireless_get_ssid (s_wireless), nm_access_point_get_ssid (ap), TRUE))
-		return FALSE;
-
-	setting_bssid = nm_setting_wireless_get_bssid (s_wireless);
-	if (setting_bssid) {
-		struct ether_addr ap_addr;
-		const char *hw_addr;
-
-		hw_addr = nm_access_point_get_hw_address (ap);
-		if (hw_addr && ether_aton_r (hw_addr, &ap_addr)) {
-			if (memcmp (setting_bssid->data, &ap_addr, ETH_ALEN))
-				return FALSE;
-		}
-	}
-
-	ap_mode = nm_access_point_get_mode (ap);
-	setting_mode = nm_setting_wireless_get_mode (s_wireless);
-	if (setting_mode) {
-		if (   !strcmp (setting_mode, "infrastructure")
-		    && (ap_mode != NM_802_11_MODE_INFRA))
-			return FALSE;
-		if (   !strcmp (setting_mode, "adhoc")
-		    && (ap_mode != NM_802_11_MODE_ADHOC))
-			return FALSE;
-	}
-
-	freq = nm_access_point_get_frequency (ap);
-	setting_band = nm_setting_wireless_get_band (s_wireless);
-	if (setting_band) {
-		if (!strcmp (setting_band, "a")) {
-			if (freq < 4915 || freq > 5825)
-				return FALSE;
-		} else if (!strcmp (setting_band, "bg")) {
-			if (freq < 2412 || freq > 2484)
-				return FALSE;
-		}
-	}
-
-	channel = nm_setting_wireless_get_channel (s_wireless);
-	if (channel) {
-		guint32 ap_chan = nm_utils_wifi_freq_to_channel (freq);
-
-		if (channel != ap_chan)
-			return FALSE;
-	}
-
-	s_wireless_sec = nm_connection_get_setting_wireless_security (connection);
-
-	return nm_setting_wireless_ap_security_compatible (s_wireless,
-	                                                   s_wireless_sec,
-	                                                   nm_access_point_get_flags (ap),
-	                                                   nm_access_point_get_wpa_flags (ap),
-	                                                   nm_access_point_get_rsn_flags (ap),
-	                                                   nm_access_point_get_mode (ap));
-}
-
-static gboolean
-connection_valid_for_wired (NMConnection *connection,
-                            NMSettingConnection *s_con,
-                            NMDevice *device,
-                            gpointer specific_object)
-{
-	NMDeviceEthernet *ethdev = NM_DEVICE_ETHERNET (device);
-	NMSettingWired *s_wired;
-	const char *str_mac;
-	struct ether_addr *bin_mac;
-	const char *connection_type;
-	const GByteArray *setting_mac;
-	gboolean is_pppoe = FALSE;
-
-	connection_type = nm_setting_connection_get_connection_type (s_con);
-	if (!strcmp (connection_type, NM_SETTING_PPPOE_SETTING_NAME))
-		is_pppoe = TRUE;
-	
-	if (!is_pppoe && strcmp (connection_type, NM_SETTING_WIRED_SETTING_NAME))
-		return FALSE;
-
-	s_wired = nm_connection_get_setting_wired (connection);
-	if (!is_pppoe && !s_wired)
-		return FALSE;
-
-	if (s_wired) {
-		/* Match MAC address */
-		setting_mac = nm_setting_wired_get_mac_address (s_wired);
-		if (!setting_mac)
-			return TRUE;
-
-		str_mac = nm_device_ethernet_get_permanent_hw_address (ethdev);
-		g_return_val_if_fail (str_mac != NULL, FALSE);
-
-		bin_mac = ether_aton (str_mac);
-		g_return_val_if_fail (bin_mac != NULL, FALSE);
-
-		if (memcmp (bin_mac->ether_addr_octet, setting_mac->data, ETH_ALEN))
-			return FALSE;
-	}
-
-	return TRUE;
-}
-
-static gboolean
-connection_valid_for_wireless (NMConnection *connection,
-                               NMSettingConnection *s_con,
-                               NMDevice *device,
-                               gpointer specific_object)
-{
-	NMDeviceWifi *wdev = NM_DEVICE_WIFI (device);
-	NMSettingWireless *s_wireless;
-	NMSettingWirelessSecurity *s_wireless_sec;
-	const GByteArray *setting_mac;
-	const char *setting_security, *key_mgmt;
-	guint32 wcaps;
-	NMAccessPoint *ap;
-
-	if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_WIRELESS_SETTING_NAME))
-		return FALSE;
-
-	s_wireless = nm_connection_get_setting_wireless (connection);
-	g_return_val_if_fail (s_wireless != NULL, FALSE);
-
-	/* Match MAC address */
-	setting_mac = nm_setting_wireless_get_mac_address (s_wireless);
-	if (setting_mac) {
-		const char *str_mac;
-		struct ether_addr *bin_mac;
-
-		str_mac = nm_device_wifi_get_permanent_hw_address (wdev);
-		g_return_val_if_fail (str_mac != NULL, FALSE);
-
-		bin_mac = ether_aton (str_mac);
-		g_return_val_if_fail (bin_mac != NULL, FALSE);
-
-		if (memcmp (bin_mac->ether_addr_octet, setting_mac->data, ETH_ALEN))
-			return FALSE;
-	}
-
-	/* If an AP was given make sure that's compatible with the connection first */
-	if (specific_object) {
-		ap = NM_ACCESS_POINT (specific_object);
-		g_assert (ap);
-
-		if (!utils_check_ap_compatible (ap, connection))
-			return FALSE;
-	}
-
-	setting_security = nm_setting_wireless_get_security (s_wireless);
-	if (!setting_security || strcmp (setting_security, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME))
-		return TRUE; /* all devices can do unencrypted networks */
-
-	s_wireless_sec = nm_connection_get_setting_wireless_security (connection);
-	if (!s_wireless_sec)
-		return TRUE; /* all devices can do unencrypted networks */
-
-	key_mgmt = nm_setting_wireless_security_get_key_mgmt (s_wireless_sec);
-
-	/* All devices should support static WEP */
-	if (!strcmp (key_mgmt, "none"))
-		return TRUE;
-
-	/* All devices should support legacy LEAP and Dynamic WEP */
-	if (!strcmp (key_mgmt, "ieee8021x"))
-		return TRUE;
-
-	/* Match security with device capabilities */
-	wcaps = nm_device_wifi_get_capabilities (wdev);
-
-	/* At this point, the device better have basic WPA support. */
-	if (   !(wcaps & NM_WIFI_DEVICE_CAP_WPA)
-	    || !(wcaps & NM_WIFI_DEVICE_CAP_CIPHER_TKIP))
-		return FALSE;
-
-	/* Check for only RSN */
-	if (   (nm_setting_wireless_security_get_num_protos (s_wireless_sec) == 1)
-	    && !strcmp (nm_setting_wireless_security_get_proto (s_wireless_sec, 0), "rsn")
-	    && !(wcaps & NM_WIFI_DEVICE_CAP_RSN))
-		return FALSE;
-
-	/* Check for only pairwise CCMP */
-	if (   (nm_setting_wireless_security_get_num_pairwise (s_wireless_sec) == 1)
-	    && !strcmp (nm_setting_wireless_security_get_pairwise (s_wireless_sec, 0), "ccmp")
-	    && !(wcaps & NM_WIFI_DEVICE_CAP_CIPHER_CCMP))
-		return FALSE;
-
-	/* Check for only group CCMP */
-	if (   (nm_setting_wireless_security_get_num_groups (s_wireless_sec) == 1)
-	    && !strcmp (nm_setting_wireless_security_get_group (s_wireless_sec, 0), "ccmp")
-	    && !(wcaps & NM_WIFI_DEVICE_CAP_CIPHER_CCMP))
-		return FALSE;
-
-	return TRUE;
-}
-
-static gboolean
-connection_valid_for_gsm (NMConnection *connection,
-                          NMSettingConnection *s_con,
-                          NMDevice *device,
-                          gpointer specific_object)
-{
-	NMSettingGsm *s_gsm;
-	
-	if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_GSM_SETTING_NAME))
-		return FALSE;
-
-	s_gsm = nm_connection_get_setting_gsm (connection);
-	g_return_val_if_fail (s_gsm != NULL, FALSE);
-
-	return TRUE;
-}
-
-static gboolean
-connection_valid_for_cdma (NMConnection *connection,
-                           NMSettingConnection *s_con,
-                           NMDevice *device,
-                           gpointer specific_object)
-{
-	NMSettingCdma *s_cdma;
-	
-	if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_CDMA_SETTING_NAME))
-		return FALSE;
-
-	s_cdma = nm_connection_get_setting_cdma (connection);
-	g_return_val_if_fail (s_cdma != NULL, FALSE);
-
-	return TRUE;
-}
-
-static guint32
-get_connection_bt_type (NMConnection *connection)
-{
-	NMSettingBluetooth *s_bt;
-	const char *bt_type;
-
-	s_bt = nm_connection_get_setting_bluetooth (connection);
-	if (!s_bt)
-		return NM_BT_CAPABILITY_NONE;
-
-	bt_type = nm_setting_bluetooth_get_connection_type (s_bt);
-	g_assert (bt_type);
-
-	if (!strcmp (bt_type, NM_SETTING_BLUETOOTH_TYPE_DUN))
-		return NM_BT_CAPABILITY_DUN;
-	else if (!strcmp (bt_type, NM_SETTING_BLUETOOTH_TYPE_PANU))
-		return NM_BT_CAPABILITY_NAP;
-
-	return NM_BT_CAPABILITY_NONE;
-}
-
-static gboolean
-connection_valid_for_bt (NMConnection *connection,
-                         NMSettingConnection *s_con,
-                         NMDevice *device,
-                         gpointer specific_object)
-{
-	NMSettingBluetooth *s_bt;
-	const GByteArray *array;
-	char *str;
-	const char *hw_addr;
-	int addr_match = FALSE;
-	guint32 bt_type;
-
-	if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_BLUETOOTH_SETTING_NAME))
-		return FALSE;
-
-	s_bt = nm_connection_get_setting_bluetooth (connection);
-	if (!s_bt)
-		return FALSE;
-
-	array = nm_setting_bluetooth_get_bdaddr (s_bt);
-	if (!array || (array->len != ETH_ALEN))
-		return FALSE;
-
-	bt_type = get_connection_bt_type (connection);
-	if (!(bt_type & nm_device_bt_get_capabilities (NM_DEVICE_BT (device))))
-		return FALSE;
-
-	str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X",
-	                       array->data[0], array->data[1], array->data[2],
-	                       array->data[3], array->data[4], array->data[5]);
-	hw_addr = nm_device_bt_get_hw_address (NM_DEVICE_BT (device));
-	if (hw_addr)
-		addr_match = !g_ascii_strcasecmp (hw_addr, str);
-	g_free (str);
-
-	return addr_match;
-}
-
-static gboolean
-connection_valid_for_wimax (NMConnection *connection,
-                            NMSettingConnection *s_con,
-                            NMDevice *device,
-                            gpointer specific_object)
-{
-	NMDeviceWimax *wimax = NM_DEVICE_WIMAX (device);
-	NMSettingWimax *s_wimax;
-	const char *str_mac;
-	struct ether_addr *bin_mac;
-	const char *connection_type;
-	const GByteArray *setting_mac;
-
-	connection_type = nm_setting_connection_get_connection_type (s_con);
-	if (strcmp (connection_type, NM_SETTING_WIMAX_SETTING_NAME))
-		return FALSE;
-
-	s_wimax = nm_connection_get_setting_wimax (connection);
-	if (!s_wimax)
-		return FALSE;
-
-	if (s_wimax) {
-		/* Match MAC address */
-		setting_mac = nm_setting_wimax_get_mac_address (s_wimax);
-		if (!setting_mac)
-			return TRUE;
-
-		str_mac = nm_device_wimax_get_hw_address (wimax);
-		g_return_val_if_fail (str_mac != NULL, FALSE);
-
-		bin_mac = ether_aton (str_mac);
-		g_return_val_if_fail (bin_mac != NULL, FALSE);
-
-		if (memcmp (bin_mac->ether_addr_octet, setting_mac->data, ETH_ALEN))
-			return FALSE;
-	}
-
-	return TRUE;
-}
-
-gboolean
-utils_connection_valid_for_device (NMConnection *connection,
-                                   NMDevice *device,
-                                   gpointer specific_object)
-{
-	NMSettingConnection *s_con;
-
-	g_return_val_if_fail (connection != NULL, FALSE);
-	g_return_val_if_fail (device != NULL, FALSE);
-
-	s_con = nm_connection_get_setting_connection (connection);
-	g_return_val_if_fail (s_con != NULL, FALSE);
-	g_return_val_if_fail (nm_setting_connection_get_connection_type (s_con) != NULL, FALSE);
-
-	if (NM_IS_DEVICE_ETHERNET (device))
-		return connection_valid_for_wired (connection, s_con, device, specific_object);
-	else if (NM_IS_DEVICE_WIFI (device))
-		return connection_valid_for_wireless (connection, s_con, device, specific_object);
-	else if (NM_IS_DEVICE_MODEM (device)) {
-		NMDeviceModemCapabilities caps;
-
-		caps = nm_device_modem_get_current_capabilities (NM_DEVICE_MODEM (device));
-		if (caps & NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS)
-			return connection_valid_for_gsm (connection, s_con, device, specific_object);
-		else if (caps & NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO)
-			return connection_valid_for_cdma (connection, s_con, device, specific_object);
-		else
-			g_warning ("Unhandled modem capabilities 0x%X", caps);
-	} else if (NM_IS_DEVICE_BT (device))
-		return connection_valid_for_bt (connection, s_con, device, specific_object);
-	else if (NM_IS_DEVICE_WIMAX (device))
-		return connection_valid_for_wimax (connection, s_con, device, specific_object);
-	else
-		g_warning ("Unknown device type '%s'", g_type_name (G_OBJECT_TYPE(device)));
-
-	return FALSE;
-}
-
-GSList *
-utils_filter_connections_for_device (NMDevice *device, GSList *connections)
-{
-	GSList *iter;
-	GSList *filtered = NULL;
-
-	for (iter = connections; iter; iter = g_slist_next (iter)) {
-		NMConnection *connection = NM_CONNECTION (iter->data);
-
-		if (utils_connection_valid_for_device (connection, device, NULL))
-			filtered = g_slist_append (filtered, connection);
-	}
-
-	return filtered;
-}
-
 char *
 utils_hash_ap (const GByteArray *ssid,
                NM80211Mode mode,
diff --git a/src/utils/utils.h b/src/utils/utils.h
index d5eee02..bc37670 100644
--- a/src/utils/utils.h
+++ b/src/utils/utils.h
@@ -17,7 +17,7 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2007 - 2011 Red Hat, Inc.
+ * (C) Copyright 2007 - 2012 Red Hat, Inc.
  */
 
 #ifndef UTILS_H
@@ -38,12 +38,6 @@ guint32 utils_find_next_channel (guint32 channel, int direction, char *band);
 
 gboolean utils_ether_addr_valid (const struct ether_addr *test_addr);
 
-gboolean utils_connection_valid_for_device (NMConnection *connection,
-                                            NMDevice *device,
-                                            gpointer specific_object);
-
-GSList *utils_filter_connections_for_device (NMDevice *device, GSList *connections);
-
 char *utils_hash_ap (const GByteArray *ssid,
                      NM80211Mode mode,
                      guint32 flags,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]