1. 19 Oct, 2014 1 commit
    • Dan Winship's avatar
      libnm: further NULL-vs-empty-array fixes · ab878f74
      Dan Winship authored
      In some cases, code may look at the value of an array-valued property
      during object initialization, before NMObject has set it to its actual
      initial value. So ensure that we initialize all such properties to an
      empty array, rather than leaving them NULL.
      
      Also fix another bug in NMClient that could result in
      priv->active_connections being NULL during certain signal emissions,
      and fix nm_client_get_active_connections() to not return NULL when NM
      was not running.
      ab878f74
  2. 18 Sep, 2014 1 commit
    • Dan Winship's avatar
      libnm: let NMObject create all D-Bus proxies · b728d1fb
      Dan Winship authored
      Add _nm_object_class_add_interface(), for declaring that a class
      implements a particular interface, and then have NMObject create the
      corresponding proxies itself. (The subclass can get a copy with
      _nm_object_get_proxy() if it needs it for something).
      
      (In GDBus, creating a proxy is a heavier operation than in dbus-glib,
      so we'll need to create the proxies asynchronously. Moving the
      creation to NMObject makes that easier since we can do it as part
      of the existing init/init_async.)
      b728d1fb
  3. 04 Sep, 2014 3 commits
    • Dan Winship's avatar
      libnm: change empty-GPtrArray-return semantics · 3e5b3833
      Dan Winship authored
      libnm functions that return GPtrArrays of objects had a rule that if
      the array was empty, they would return NULL rather than a 0-length
      array. As it turns out, this is just a nuisance to clients, since in
      most places the code for the non-empty case would end up doing the
      right thing for the empty case as well (and where it doesn't, we can
      check "array->len == 0" just as easily as "array == NULL"). So just
      return the 0-length array instead.
      3e5b3833
    • Dan Winship's avatar
      libnm: drop NM_TYPE_OBJECT_ARRAY, use G_TYPE_PTR_ARRAY · 074c2093
      Dan Winship authored
      Use G_TYPE_PTR_ARRAY for GPtrArray-of-NMObject-valued properties,
      because it has better introspection/bindings support.
      
      As with the strdict change in libnm-core, we need to manually copy the
      array in get_property() implementations, to preserve the standard
      semantics that get_property() returns a copy, not the internal array.
      
      (This patch also changes those properties so that they are always
      non-NULL until dispose(); previously some of them could be either NULL
      or 0-length at different times.)
      074c2093
    • Dan Winship's avatar
      all: stop using virtual interface-name properties · ab26964c
      Dan Winship authored
      The virtual :interface-name properties (eg,
      NMDeviceBond:interface-name) are deprecated in favor of
      NMSettingConnection:interface-name, and nm_connection_verify() ensures
      that their values are kept in sync. So (a) there is no need to set
      those properties when we can just set
      NMSettingConnection:interface-name instead, and (b) we can replace any
      calls to the setting-specific get_interface_name() methods with
      nm_connection_get_interface_name() or
      nm_setting_connection_get_interface_name().
      ab26964c
  4. 18 Aug, 2014 1 commit
  5. 07 Aug, 2014 1 commit
    • Dan Winship's avatar
      libnm-core: include ETH_ALEN/INFINIBAND_ALEN defines in nm-utils.h · 357efd26
      Dan Winship authored
      Include <linux/if_ether.h> and <linux/if_infiniband.h> from
      nm-utils.h, to get ETH_ALEN and INFINIBAND_ALEN, and remove those
      includes (as well as <net/ethernet.h> and <netinet/ether.h>, and
      various headers that had been included to get the ARPHRD_* constants)
      from other files where they're not needed now.
      357efd26
  6. 01 Aug, 2014 5 commits
    • Dan Winship's avatar
      libnm: make the the use of GInitable mandatory · 258e74eb
      Dan Winship authored
      Remove _nm_object_ensure_inited(), etc; objects that implement
      GInitable are now mandatory-to-init().
      
      Remove constructor() implementations that sometimes return NULL; do
      all the relevant checking in init() instead.
      
      Make nm_client_new() and nm_remote_settings_new() take a GCancellable
      and a GError**.
      258e74eb
    • Dan Winship's avatar
      libnm: add init_dbus() virtual method to NMObject · 8ca2998d
      Dan Winship authored
      Rather than having each object type override constructed() to call
      _nm_object_register_properties(), have NMObject call a virtual method
      on the subclass to ask it to register them.
      
      Move some code around in nm-client.c and nm-object.c so that all
      D-Bus-related initialization happens in init_dbus(), and
      non-D-Bus-related stuff stays in construct().
      
      (This simplifies the next commit.)
      8ca2998d
    • Dan Winship's avatar
      libnm: remove _new functions from NMObject subclasses · a0e9a4bd
      Dan Winship authored
      Most NMObjects should not be manually created, they should only be
      received from NMClient or NMRemoteSettings.
      a0e9a4bd
    • Dan Winship's avatar
      libnm: remove Since tags and NM_AVAILABLE_IN_* attributes · b4ae6eae
      Dan Winship authored
      Everything currently in libnm has always been there.
      b4ae6eae
    • Dan Winship's avatar
      libnm: add libnm/libnm-core (part 1) · d595f784
      Dan Winship authored
      This commit begins creating the new "libnm", which will replace
      libnm-util and libnm-glib.
      
      The main reason for the libnm-util/libnm-glib split is that the daemon
      needs to link to libnm-util (to get NMSettings, NMConnection, etc),
      but can't link to libnm-glib (because it uses many of the same type
      names as the NetworkManager daemon. eg, NMDevice). So the daemon links
      to only libnm-util, but basically all clients link to both.
      
      With libnm, there will be only a single client-visible library, and
      NetworkManager will internally link against a private "libnm-core"
      containing the parts that used to be in libnm-util.
      
      (The "libnm-core" parts still need to be in their own directory so
      that the daemon can see those header files without also seeing the
      ones in libnm/ that conflict with its own headers.)
      
      [This commit just copies the source code from libnm-util/ to
      libnm-core/, and libnm-glib/ to libnm/:
      
        mkdir -p libnm-core/tests/
        mkdir -p libnm/tests/
        cp libnm-util/*.[ch] libnm-util/nm-version.h.in libnm-core/
        rm -f libnm-core/nm-version.h libnm-core/nm-setting-template.[ch] libnm-core/nm-utils-enum-types.[ch]
        cp libnm-util/tests/*.[ch] libnm-core/tests/
        cp libnm-glib/*.[ch] libnm/
        rm -f libnm/libnm_glib.[ch] libnm/libnm-glib-test.c libnm/nm-glib-enum-types.[ch]
        cp libnm-glib/tests/*.[ch] libnm/tests/
      
      ]
      d595f784
  7. 15 Jul, 2014 3 commits
    • Dan Winship's avatar
      libnm-util, libnm-glib: whitespace fixes · 2570c5a1
      Dan Winship authored
      Fix indentation, kill trailing whitespace, split some long lines.
      2570c5a1
    • Dan Winship's avatar
      libnm-util, libnm-glib: standardize copyright/license headers · cb7e1893
      Dan Winship authored
      - Remove list of authors from files that had them; these serve no
        purpose except to quickly get out of date (and were only used in
        libnm-util and not libnm-glib anyway).
      
      - Just say "Copyright", not "(C) Copyright" or "Copyright (C)"
      
      - Put copyright statement after the license, not before
      
      - Remove "NetworkManager - Network link manager" from the few files
        that contained it, and "libnm_glib -- Access network status &
        information from glib applications" from the many files that
        contained it.
      
      - Remove vim modeline from nm-device-olpc-mesh.[ch], add emacs modeline
        to files that were missing it.
      cb7e1893
    • Dan Winship's avatar
      libnm-util, libnm-glib: tweak (element-type) annotations in docs · 4223fa47
      Dan Winship authored
      g-i allows you to specify types in annotations using either their
      fully-qualified introspected names (eg, "NMClient.Device") or their
      plain C names ("NMDevice"). Switch from the former to the latter (so
      that they'll still be correct when migrated to libnm later).
      4223fa47
  8. 19 Jun, 2014 1 commit
  9. 06 Mar, 2014 1 commit
  10. 13 Feb, 2014 1 commit
  11. 23 Jan, 2014 1 commit
  12. 20 Dec, 2013 1 commit
  13. 22 Oct, 2013 1 commit
    • Thomas Haller's avatar
      core: cleanup freeing of glib collections of pointers · 3eb1d5e9
      Thomas Haller authored
      When freeing one of the collections such as GArray, GPtrArray, GSList,
      etc. it is common that the items inside the connections must be
      freed/unrefed too.
      
      The previous code often iterated over the collection first with
      e.g. g_ptr_array_foreach and passing e.g. g_free as GFunc argument.
      For one, this has the problem, that g_free has a different signature
      GDestroyNotify then the expected GFunc. Moreover, this can be
      simplified either by setting a clear function
      (g_ptr_array_set_clear_func) or by passing the destroy function to the
      free function (g_slist_free_full).
      Signed-off-by: Thomas Haller's avatarThomas Haller <thaller@redhat.com>
      3eb1d5e9
  14. 11 Oct, 2013 1 commit
    • Dan Winship's avatar
      libnm-util, libnm-glib: fix up some gtk-doc comments · 76cc2bd9
      Dan Winship authored
      gtk-doc recognizes that #NMFoos is the plural of #NMFoo now, so you
      don't need to put an empty comment between the type name and the "s"
      to make it work. (Unfortunately, it's not smart enough to realize that
      "NMIP4Addresses" is the plural of "NMIP4Address".)
      
      Also, add some missing "#"s noticed along the way.
      76cc2bd9
  15. 15 Aug, 2013 1 commit
  16. 08 Apr, 2013 1 commit
    • Dan Williams's avatar
      libnm-glib: use helpers to create dbus proxies · 661d0985
      Dan Williams authored
      When using a private connection, we need to use dbus_g_proxy_new_for_peer()
      because the bus isn't involved.  Since many parts of libnm-glib create a
      proxy for their corresponding remote object, consolidate the proxy creation
      logic.
      
      A later patch will add logic to use a private connection versus a bus-based
      one.
      661d0985
  17. 13 Mar, 2013 1 commit
  18. 22 Feb, 2013 1 commit
  19. 26 Oct, 2012 1 commit
  20. 19 Oct, 2012 1 commit
  21. 27 Apr, 2012 1 commit
  22. 23 Apr, 2012 1 commit
  23. 28 Mar, 2012 1 commit
    • Dan Winship's avatar
      libnm-glib: more ensure_inited() fixing · a4f450aa
      Dan Winship authored
      We need to do _nm_object_ensure_inited() /
      _nm_remote_settings_ensure_inited() from the get_property()
      implementations; in most cases, get_property() just calls another
      accessor method (which will call _nm_object_ensure_inited()), but in a
      few places, it reads priv->whatever directly, so we need to make sure
      that it's valid.
      a4f450aa
  24. 16 Mar, 2012 1 commit
  25. 12 Mar, 2012 1 commit
  26. 07 Mar, 2012 1 commit
  27. 05 Mar, 2012 1 commit
  28. 03 Feb, 2012 3 commits
    • Dan Winship's avatar
      libnm-glib: implement GInitable/GAsyncInitable in NMObject · 9fd98ef9
      Dan Winship authored
      Implement GInitable and GAsyncInitable in NMObject, with
      implementations that synchronously or asynchonously load all
      properties, and change _nm_object_ensure_inited() to run
      g_initable_init().
      
      Update the object/object-array property handling to initialize the
      objects after creating them (synchronously or asynchronously,
      according to the situation), so that they will have all of their
      properties preloaded before they are ever visible to the caller.
      
      Move the non-blocking/non-failable parts of various objects'
      constructor() methods to constructed(), and move the blocking/failable
      parts to init(), and implement init_async() methods with non-blocking
      versions of the blocking methods.
      
      Make nm_device_new() and nm_client_new() call
      _nm_object_ensure_inited(), to preserve the behaviour formerly
      enforced by their construct() methods, that properties are guaranteed
      to be initialized before any signals involving them are emitted.
      9fd98ef9
    • Dan Winship's avatar
      libnm-glib: simplify property getter methods · 5afcee46
      Dan Winship authored
      Rather than having every property getter method have code to fetch
      that specific property's value, just call the new
      _nm_object_ensure_inited() (which makes sure that we've read all the
      property values on the object at least once), and then return the
      cached value. (After we've read the initial property values, the
      PropertiesChanged signal handler will ensure that the values are kept
      up to date, so we can always just return cached property values after
      that point.)
      
      This then lets us get rid of _nm_object_get_property() and its
      wrappers.
      5afcee46
    • Dan Winship's avatar
      libnm-glib: simplify and genericize property declaration · 2e48cc09
      Dan Winship authored
      Rename _nm_object_handle_properties_changed(), etc, to be about
      properties in general, rather than just property changes.
      
      Interpret func==NULL in NMPropertiesInfo as meaning "use
      _nm_object_demarshal_generic", and then reorder the fields so that you
      can just leave that field out in the declarations when it's NULL.
      
      Add a way to register properties that exist in D-Bus but aren't
      tracked by the NMObjects, and use that for NMDevice's D-Bus Ip4Address
      property, replacing the existing hack.
      
      Also add a few other missing properties noticed along the way.
      2e48cc09
  29. 02 Feb, 2012 1 commit
  30. 02 Dec, 2011 1 commit