1. 16 Nov, 2016 1 commit
  2. 14 Nov, 2016 1 commit
  3. 10 Nov, 2016 2 commits
    • Lubomir Rintel's avatar
      libnm/client: drop some unneeded includes · d4412711
      Lubomir Rintel authored
      d4412711
    • Lubomir Rintel's avatar
      libnm: use the o.fd.DBus.ObjectManager API for object management · 1f5b48a5
      Lubomir Rintel authored
      This speeds up the initial object tree load significantly. Also, it
      reduces the object management complexity by shifting the duties to
      GDBusObjectManager.
      
      The lifetime of all NMObjects is now managed by the NMClient via the
      object manager. The NMClient creates the NMObjects for GDBus objects,
      triggers the initialization and serves as an object registry (replaces
      the nm-cache).
      
      The ObjectManager uses the o.fd.DBus.ObjectManager API to learn of the
      object creation, removal and property changes. It takes care of the
      property changes so that we don't have to and lets us always see a
      consistent object state.  Thus at the time we learn of a new object we
      already know its properties.
      
      The NMObject unfortunately can't be made synchronously initializable as
      the NMRemoteConnection's settings are not managed with standard
      o.fd.DBus Properties and ObjectManager APIs and thus are not known to
      the ObjectManager.  Thus most of the asynchronous object property
      changing code in nm-object.c is preserved. The objects notify the
      properties that reference them of their initialization in from their
      init_finish() methods, thus the asynchronously created objects are not
      allowed to fail creation (or the dependees would wait forever). Not a
      problem -- if a connection can't get its Settings, it's either invisible
      or being removed (presumably we'd learn of the removal from the object
      manager soon).
      
      The NMObjects can't be created by the object manager itself, since we
      can't determine the resulting object type in proxy_type() yet (we can't
      tell from the name and can't access the interface list). Therefore the
      GDBusObject is coupled with a NMObject later on.
      
      Lastly, now that all the objects are managed by the object manager, the
      NMRemoteSettings and NMManager go away when the daemon is stopped. The
      complexity of dealing with calls to NMClient that would require any of
      the resources that these objects manage (connection or device lists,
      etc.) had to be moved to NMClient. The bright side is that his allows
      for removal all of the daemon presence tracking from NMObject.
      1f5b48a5
  4. 13 Oct, 2016 1 commit
    • Thomas Haller's avatar
      libnm: move backported symbols from libnm-core to libnm · 0e47b327
      Thomas Haller authored
      Backported symbols only make sense for libnm itself, not for
      libnm-core which is statically linked with NetworkManager and
      nm-ifcace-helper. Declaring the symbols in libnm-core, means
      that NetworkManager binary also contains them, although there
      are not used.
      
      Move them to libnm.
      0e47b327
  5. 03 Oct, 2016 1 commit
  6. 04 Aug, 2016 1 commit
  7. 07 Jul, 2016 1 commit
  8. 29 Mar, 2016 1 commit
  9. 19 Feb, 2016 1 commit
    • Thomas Haller's avatar
      all: cleanup includes and let "nm-default.h" include "config.h" · 8bace23b
      Thomas Haller authored
      - All internal source files (except "examples", which are not internal)
        should include "config.h" first. As also all internal source
        files should include "nm-default.h", let "config.h" be included
        by "nm-default.h" and include "nm-default.h" as first in every
        source file.
        We already wanted to include "nm-default.h" before other headers
        because it might contains some fixes (like "nm-glib.h" compatibility)
        that is required first.
      
      - After including "nm-default.h", we optinally allow for including the
        corresponding header file for the source file at hand. The idea
        is to ensure that each header file is self contained.
      
      - Don't include "config.h" or "nm-default.h" in any header file
        (except "nm-sd-adapt.h"). Public headers anyway must not include
        these headers, and internal headers are never included after
        "nm-default.h", as of the first previous point.
      
      - Include all internal headers with quotes instead of angle brackets.
        In practice it doesn't matter, because in our public headers we must
        include other headers with angle brackets. As we use our public
        headers also to compile our interal source files, effectively the
        result must be the same. Still do it for consistency.
      
      - Except for <config.h> itself. Include it with angle brackets as suggested by
        https://www.gnu.org/software/autoconf/manual/autoconf.html#Configuration-Headers
      8bace23b
  10. 04 Dec, 2015 1 commit
  11. 21 Aug, 2015 1 commit
  12. 05 Aug, 2015 1 commit
  13. 24 Jul, 2015 1 commit
    • Dan Winship's avatar
      all: rename nm-glib-compat.h to nm-glib.h, use everywhere · 3452ee2a
      Dan Winship authored
      Rather than randomly including one or more of <glib.h>,
      <glib-object.h>, and <gio/gio.h> everywhere (and forgetting to include
      "nm-glib-compat.h" most of the time), rename nm-glib-compat.h to
      nm-glib.h, include <gio/gio.h> from there, and then change all .c
      files in NM to include "nm-glib.h" rather than including the glib
      headers directly.
      
      (Public headers files still have to include the real glib headers,
      since nm-glib.h isn't installed...)
      
      Also, remove glib includes from header files that are already
      including a base object header file (which must itself already include
      the glib headers).
      3452ee2a
  14. 09 Jun, 2015 1 commit
  15. 19 Mar, 2015 1 commit
  16. 18 Dec, 2014 1 commit
  17. 04 Dec, 2014 1 commit
  18. 13 Nov, 2014 1 commit
    • Dan Winship's avatar
      all: consistently include config.h · 3bfb163a
      Dan Winship authored
      config.h should be included from every .c file, and it should be
      included before any other include. Fix that.
      
      (As a side effect of how I did this, this also changes us to
      consistently use "config.h" rather than <config.h>. To the extent that
      it matters [which is not much], quotes are more correct anyway, since
      we're talking about a file in our own build tree, not a system
      include.)
      3bfb163a
  19. 07 Nov, 2014 2 commits
  20. 28 Oct, 2014 1 commit
    • Dan Winship's avatar
      libnm: change GSList to GPtrArray in libnm methods · 6ae42248
      Dan Winship authored
      libnm mostly used GPtrArrays in its APIs, except that arrays of
      connections were usually GSLists. Fix this and make them GPtrArrays
      too (and rename nm_client_list_connections() to
      nm_client_get_connections() to match everything else).
      6ae42248
  21. 22 Oct, 2014 1 commit
    • Dan Winship's avatar
      libnm: consolidate NMClientError and NMObjectError · 388a0c5e
      Dan Winship authored
      Consolidate NMClientError and NMObjectError (such that there is now
      only one libnm-API-specific error domain). In particular, merge
      NM_CONNECTION_ERROR_CONNECTION_REMOVED with
      NM_OBJECT_ERROR_OBJECT_CREATION_FAILURE as the new
      NM_CONNECTION_ERROR_OBJECT_CREATION_FAILED.
      
      Also make object_creation_failed() be a plain method rather than a
      signal, since there's no reason for anyone to be connecting to it on
      another object. And remove its GError argument because the subclass
      can just create its own more-specific error.
      388a0c5e
  22. 10 Oct, 2014 6 commits
  23. 05 Oct, 2014 1 commit
  24. 03 Oct, 2014 1 commit
    • Dan Winship's avatar
      libnm: make use of GParamSpecFlags and GParamSpecEnum · fcfb4b40
      Dan Winship authored
      Make enum- and flags-valued properties use GParamSpecEnum and
      GParamSpecFlags, for better introspectability/bindability.
      
      This requires no changes outside libnm-core/libnm since the expected
      data size is still the same with g_object_get()/g_object_set(), and
      GLib will internally convert between int/uint and enum/flags GValues
      when using g_object_get_property()/g_object_set_property().
      fcfb4b40
  25. 01 Oct, 2014 1 commit
  26. 30 Sep, 2014 1 commit
  27. 25 Sep, 2014 2 commits
    • Dan Winship's avatar
      libnm: add some missing sync/async method variants · 41eca3ea
      Dan Winship authored
      Add the missing variant in most places in the API where previously
      there was either only a synchronous version or only an asynchronous
      version.
      
      There is not yet a synchronous nm_client_activate_connection(),
      nm_client_add_and_activate_connection(), or
      nm_remote_settings_add_connection(), because the existing async code
      depends on waiting for other asynchronous events, so making them run
      synchronously is slightly more complicated. But these APIs can be
      added later.
      41eca3ea
    • Dan Winship's avatar
      libnm: make sync/async APIs more GLib-like · 2237ea3d
      Dan Winship authored
      Make synchronous APIs take GCancellables, and make asynchronous APIs
      use GAsyncReadyCallbacks and have names ending in "_async", with
      "_finish" functions to retrieve the results.
      
      Also, make nm_client_activate_connection_finish(),
      nm_client_add_and_activate_finish(), and
      nm_remote_settings_add_connection_finish() be (transfer full) rather
      than (transfer none), because the refcounting semantics become
      slightly confusing in some edge cases otherwise.
      2237ea3d
  28. 18 Sep, 2014 3 commits
    • Dan Winship's avatar
      libnm: port to GDBus · 6793a32a
      Dan Winship authored
      Port libnm-core/libnm to GDBus.
      
      The NetworkManager daemon continues to use dbus-glib; the
      previously-added connection hash/variant conversion methods are now
      moved to NetworkManagerUtils (along with a few other utilities that
      are now only needed by the daemon code).
      6793a32a
    • Dan Winship's avatar
      libnm-core: change connection hash tables to variants in API · acf86f68
      Dan Winship authored
      In preparation for porting to GDBus, make nm_connection_to_dbus(),
      etc, represent connections as GVariants of type 'a{sa{sv}}' rather
      than as GHashTables-of-GHashTables-of-GValues.
      
      This means we're constantly converting back and forth internally, but
      this is just a stepping stone on the way to the full GDBus port, and
      all of that code will go away again later.
      acf86f68
    • 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
  29. 04 Sep, 2014 2 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