1. 03 Apr, 2019 1 commit
  2. 12 Feb, 2019 1 commit
  3. 10 Nov, 2016 1 commit
    • 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. 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
  5. 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
  6. 07 Nov, 2014 1 commit
  7. 29 Oct, 2014 1 commit
  8. 18 Sep, 2014 2 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: 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
  9. 04 Sep, 2014 1 commit
    • Dan Winship's avatar
      libnm: fix NMIP4Config/NMIP6Config addresses/routes properties · 98959d54
      Dan Winship authored
      The docs for NMIP4Config:addresses and NMIP4Config:routes claimed that
      they were GPtrArrays of NMIP4Address/NMIP4Route, but get_property()
      was actually trying to set them the D-Bus representation type, and it
      was failing anyway because it used g_value_set_boxed() on a parameter
      that was declared GParamSpecPointer. Fix it to use a GPtrArray-valued
      property, and set it to the right thing.
      
      NMIP6Config did the right thing with its :addresses and :routes
      properties, but was using custom types (NM_TYPE_IP6_ADDRESS_OBJECT_ARRAY and
      NM_TYPE_IP6_ROUTE_OBJECT_ARRAY). Make it use G_TYPE_PTR_ARRAY instead.
      
      nm-types.c, nm-types.h, and nm-types-private.h are now empty, and so
      can be dropped.
      98959d54
  10. 01 Aug, 2014 6 commits
    • Dan Winship's avatar
      libnm: rename NetworkManager.h and NetworkManagerVPN.h · 3ddce748
      Dan Winship authored
      "NetworkManager.h"'s name (and non-standard capitalization) suggest
      that it's some sort of high-level super-important header, but it's
      really just low-level D-Bus stuff. Rename it to "nm-dbus-interface.h"
      and likewise "NetworkManagerVPN.h" to "nm-vpn-dbus-interface.h"
      3ddce748
    • 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, core, cli, tui: fix the capitalization of various types · 3ac0f528
      Dan Winship authored
      GLib/Gtk have mostly settled on the convention that two-letter
      acronyms in type names remain all-caps (eg, "IO"), but longer acronyms
      become initial-caps-only (eg, "Tcp").
      
      NM was inconsistent, with most long acronyms using initial caps only
      (Adsl, Cdma, Dcb, Gsm, Olpc, Vlan), but others using all caps (DHCP,
      PPP, PPPOE, VPN). Fix libnm and src/ to use initial-caps only for all
      three-or-more-letter-long acronyms (and update nmcli and nmtui for the
      libnm changes).
      3ac0f528
    • 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
  11. 15 Jul, 2014 2 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
  12. 19 Jun, 2014 1 commit
  13. 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
  14. 01 Apr, 2013 1 commit
  15. 27 Feb, 2013 2 commits
  16. 26 Feb, 2013 1 commit
  17. 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
  18. 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
  19. 10 Mar, 2011 1 commit
  20. 22 Feb, 2011 1 commit
  21. 15 Feb, 2011 1 commit
  22. 21 Jan, 2011 1 commit
  23. 03 Aug, 2010 1 commit
  24. 27 Nov, 2008 1 commit
  25. 14 Nov, 2008 1 commit
  26. 05 Sep, 2008 1 commit
  27. 26 Aug, 2008 1 commit
  28. 12 Aug, 2008 1 commit
  29. 07 Aug, 2008 2 commits
    • Dan Williams's avatar
      2008-08-07 Dan Williams <dcbw@redhat.com> · 641a7072
      Dan Williams authored
      	* callouts/nm-dispatcher-action.c
      		- (nm_dispatcher_action): grab device path and create the device; pass
      			the device's DHCP4 config to script caller
      		- (dispatch_scripts): dump the DHCP4 config to the environment of called
      			scripts
      
      	* libnm-glib/nm-dhcp4-config.c
      	  libnm-glib/nm-dhcp4-config.h
      		- (nm_dhcp4_config_get_options): expose
      		- (nm_dhcp4_config_get_one_option): renamed from nm_dhcp4_config_get_option
      
      
      
      git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3907 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
      641a7072
    • Dan Williams's avatar
      2008-08-07 Dan Williams <dcbw@redhat.com> · 881370ab
      Dan Williams authored
      	* include/NetworkManager.h
      		- Add the DHCP4Config D-Bus interface
      
      	* libnm-glib/Makefile.am
      	  libnm-glib/nm-dhcp4-config.c
      	  libnm-glib/nm-dhcp4-config.h
      		- Handle DHCP4 config objects exported by NM over D-Bus
      
      	* libnm-glib/nm-device.c
      	  libnm-glib/nm-device.h
      		- Add a 'dhcp4-config' property
      
      	* libnm-glib/libnm-glib-test.c
      		- Print out DHCP4 config for devices
      		- Fix some crashes when no connections are active
      
      	* src/nm-device-interface.c
      	  src/nm-device.c
      	  src/nm-dhcp4-config.c
      	  src/nm-dhcp4-config.h
      		- Treat dhcp4-config object as an object path at the D-Bus interface so
      			that when it doesn't exist we can proxy it as "/" which dbus-glib
      			doesn't let us do when the property type is G_TYPE_OBJECT
      
      
      
      git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3905 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
      881370ab