~ubuntu-branches/ubuntu/oneiric/network-manager/oneiric

« back to all changes in this revision

Viewing changes to libnm-glib/nm-client.c

  • Committer: Bazaar Package Importer
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2011-07-25 20:01:12 UTC
  • mfrom: (1.1.48 upstream)
  • Revision ID: james.westby@ubuntu.com-20110725200112-iwxhtsy6hko0ffkt
Tags: 0.8.9997+git.20110721t045648.36db194-0ubuntu1
* upstream snapshot 2011-07-21 04:56:48 (GMT)
  + 36db194ae95e35cc7b8f431ab984780dea24656d
  - libnm-util: default to allowing v6 connections to fail (set to optional)
* debian/patches/ipv6-dont-block-ipv4.patch: don't block waiting for IPv6 to
  apply IPv4 connection settings.
* debian/libnm-glib4.symbols: add new nm_client_get_device_by_iface symbol.
* debian/libnm-util2.symbols: add new symbols:
  - nm_setting_wired_get_mac_address_blacklist
  - nm_setting_wireless_get_mac_address_blacklist

Show diffs side-by-side

added added

removed removed

Lines of Context:
557
557
        return device;
558
558
}
559
559
 
 
560
/**
 
561
 * nm_client_get_device_by_iface:
 
562
 * @client: a #NMClient
 
563
 * @iface: the interface name to search for
 
564
 *
 
565
 * Gets a #NMDevice from a #NMClient.
 
566
 *
 
567
 * Returns: (transfer none): the #NMDevice for the given @iface or %NULL if none is found.
 
568
 **/
 
569
NMDevice *
 
570
nm_client_get_device_by_iface (NMClient *client, const char *iface)
 
571
{
 
572
        const GPtrArray *devices;
 
573
        int i;
 
574
        NMDevice *device = NULL;
 
575
 
 
576
        g_return_val_if_fail (NM_IS_CLIENT (client), NULL);
 
577
        g_return_val_if_fail (iface, NULL);
 
578
 
 
579
        devices = nm_client_get_devices (client);
 
580
        if (!devices)
 
581
                return NULL;
 
582
 
 
583
        for (i = 0; i < devices->len; i++) {
 
584
                NMDevice *candidate = g_ptr_array_index (devices, i);
 
585
                if (!strcmp (nm_device_get_iface (candidate), iface)) {
 
586
                        device = candidate;
 
587
                        break;
 
588
                }
 
589
        }
 
590
 
 
591
        return device;
 
592
}
 
593
 
560
594
typedef struct {
561
595
        NMClient *client;
562
596
        NMClientActivateFn act_fn;