1. 01 Aug, 2014 3 commits
    • 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
  2. 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
  3. 19 Jun, 2014 1 commit
  4. 23 Jan, 2014 1 commit
  5. 08 May, 2013 1 commit
  6. 08 Apr, 2013 2 commits
    • Dan Williams's avatar
      libnm-glib: ensure VpnStateChanged signals also notify VpnState property listeners · 55cb1b74
      Dan Williams authored
      Both the VpnState property and the VpnStateChanged dbus signals update the
      NMVPNConnection's 'vpn-state' GObject property, so we should ensure that
      when either updates it due to a D-Bus event, GObject signals are sent
      out for both too.
      55cb1b74
    • 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
  7. 29 Jun, 2012 2 commits
  8. 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
  9. 15 Feb, 2012 1 commit
    • Dan Winship's avatar
      Use glib-mkenums to generate enum types · 839eab55
      Dan Winship authored
      Rather than generating enum classes by hand (and complaining in each
      file that "this should really be standard"), use glib-mkenums.
      
      Unfortunately, we need a very new version of glib-mkenums in order to
      deal with NM's naming conventions and to fix a few other bugs, so just
      import that into the source tree temporarily.
      
      Also, to simplify the use of glib-mkenums, import Makefile.glib from
      https://bugzilla.gnome.org/654395.
      
      To avoid having to run glib-mkenums for every subdirectory of src/,
      add a new "generated" directory, and put the generated enums files
      there.
      
      Finally, use Makefile.glib for marshallers too, and generate separate
      ones for libnm-glib and NetworkManager.
      839eab55
  10. 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
  11. 02 Feb, 2012 1 commit
  12. 05 Jan, 2012 2 commits
  13. 15 Mar, 2011 1 commit
  14. 10 Mar, 2011 1 commit
  15. 15 Feb, 2011 1 commit
  16. 12 Mar, 2010 1 commit
  17. 14 Nov, 2008 1 commit
  18. 26 Aug, 2008 1 commit
  19. 26 Jun, 2008 1 commit
  20. 22 Apr, 2008 1 commit
    • Dan Williams's avatar
      2008-04-21 Dan Williams <dcbw@redhat.com> · 675d1226
      Dan Williams authored
      	* include/NetworkManager.h
      		- Add NMActiveConnectionState enum
      
      	* introspection/nm-active-connection.xml
      	  introspection/nm-vpn-connection.xml
      		- Add 'State' property for overall active connection state
      		- Add 'Default' property, when True means this active connection
      			has the default route
      		- Add PropertyChanged signals so changes actually go out over the bus
      
      	* src/nm-active-connection.h
      		- Add defines for State & Default properties
      
      	* src/nm-activation-request.c
      		- Add 'state' and 'default' properties, hook up to device 'state-changed'
      			signal to determine active connection state
      
      	* src/vpn-manager/nm-vpn-connection.c
      	  src/vpn-manager/nm-vpn-connection.h
      	  src/vpn-manager/nm-vpn-manager.c
      	  src/vpn-manager/nm-vpn-service.c
      		- Rename old 'state' to 'vpn-state'
      		- Rename nm_vpn_connection_get_state() -> nm_vpn_connection_get_vpn_state()
      		- Add 'state' and 'default' properties, hook up to the vpn connection's
      			'vpn-state-changed' signal
      
      	* libnm-glib/nm-active-connection.c
      	  libnm-glib/nm-active-connection.h
      		- Add new 'state' and 'default' properties and accessors
      
      	* libnm-glib/nm-vpn-connection.c
      	  libnm-glib/nm-vpn-connection.h
      		- Rename old 'state' property to 'vpn-state'
      		- Add new 'state' and 'default' properties and accessors
      
      
      
      git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3582 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
      675d1226
  21. 26 Mar, 2008 1 commit
    • Dan Williams's avatar
      2008-03-26 Dan Williams <dcbw@redhat.com> · ec89663e
      Dan Williams authored
      	Rework VPN connection handling for a more consistent D-Bus API.  The
      	VPNManager object has been removed, and active VPN connections are now the
      	same as any other active connection.  The Manager object's ActivateConnection
      	and DeactivateConnection methods are used to start and stop a VPN connection,
      	and the VPNConnection objects are subclasses of the ActiveConnection objects.
      	When activating a VPN connection, pass the path of the active connection
      	to which the VPN connection is tied in the 'specific_object' argument.
      
      	Consequently, the libnm-glib API has been reworked to match this arrangement,
      	with the VPNManager object removed, and the NMVPNConnection objects now
      	being subclasses of NMActiveConnection.
      
      
      
      git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3504 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
      ec89663e
  22. 24 Mar, 2008 1 commit
    • Dan Williams's avatar
      2008-03-24 Dan Williams <dcbw@redhat.com> · 00735165
      Dan Williams authored
      	Massive fixup of libnm-glib to:
      	a) have all objects (with the exception of VPN) cache their properties and
      		update them asynchronously on PropertiesChanged signals from NM
      	b) return internal const data for most attributes/properties instead of
      		allocated values that the caller must free
      	c) cache wrapped objects such that a given D-Bus path will always map to the
      		same GObject returned by libnm-glib
      	d) remove a few signals and move them to GObject property notifications
      	e) match recent NM D-Bus API changes for activation/deactivation
      	f) remove some private functions from libnm-glib headers
      
      
      
      git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3491 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
      00735165
  23. 07 Dec, 2007 1 commit
  24. 01 Oct, 2007 1 commit
    • Dan Williams's avatar
      2007-10-01 Dan Williams <dcbw@redhat.com> · e5b834c1
      Dan Williams authored
      	* include/NetworkManagerVPN.h
      		- define VPN connection state change reason codes
      
      	* src/vpn-manager/Makefile.am
      	  src/vpn-manager/nm-vpn-marshal.list
      	  src/vpn-manager/nm-vpn-marshal-main.c
      		- Add marshallers for StateChanged signal
      
      	* introspection/nm-vpn-connection.xml
      		- New Banner property
      		- StateChanged signal now includes a 'reason' argument
      
      	* src/vpn-manager/nm-vpn-connection.c
      	  src/vpn-manager/nm-vpn-connection.h
      		- Add a "Banner" property that contains the returned VPN server login
      			banner (if any); valid only in the ACTIVATED state
      		- (nm_vpn_connection_set_state, nm_vpn_connection_disconnect): now takes
      			a 'reason' argument and emits that reason along with the
      			state-changed signal
      		- Fix up calls to nm_vpn_connection_set_state() to include a reason
      		- (nm_vpn_connection_ip4_config_get): save banner for later
      		- (nm_vpn_connection_get_banner, get_property,
      		   nm_vpn_connection_class_init): implement Banner property
      
      	* src/vpn-manager/nm-vpn-service.c
      		- (nm_vpn_service_connections_stop): take a reason argument; copy the
      			connection list because elements may get added/removed from it
      			while iterating over the list
      		- (connection_state_changed): signal now includes the 'reason' argument
      
      	* libnm-glib/nm-vpn-connection.c
      	  libnm-glib/nm-vpn-connection.h
      		- (nm_vpn_connection_get_banner): new function
      		- (state_changed_proxy): handle reason argument
      
      
      
      git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2916 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
      e5b834c1
  25. 29 Sep, 2007 1 commit
  26. 12 Sep, 2007 1 commit
    • Tambet Ingo's avatar
      2007-09-12 Tambet Ingo <tambet@gmail.com> · 326d1e86
      Tambet Ingo authored
              * src/vpn-manager/nm-vpn-connection.[ch]: 
              * src/vpn-manager/nm-vpn-manager.[ch]:
              * src/vpn-manager/nm-vpn-service.[ch]: Rewrite the vpn handling
              * code. Using 
              dbus-glib, GObjects, signals etc.
      
              * libnm-glib/nm-vpn-manager.[ch]: 
              * libnm-glib/nm-vpn-connection.[ch]: Now that the NM
              * implementation changed
              so much, rewrite these too.
      
              * libnm-glib/Makefile.am: Add new files to build, build new
              * binding files for
              the new introspection files.
      
              * libnm-glib/nm-client.[ch]: Remove all VPN related stuff from
              * here.
      
              * libnm-glib/nm-dbus-utils.[ch]: Renamed from nm-utils.[ch] that
              * was shadowing
              the header with the same name from libnm-utils.
      
              * libnm-glib/nm-vpn-plugin.[ch]: Implement.
      
              * libnm-util/Makefile.am: Add nm-utils.[ch] to build.
      
              * introspection/nm-vpn-plugin.xml: Implement.
      
              * introspection/nm-vpn-connection.xml: Implement.
      
              * introspection/nm-vpn-manager.xml: Implement.
      
              * src/NetworkManagerSystem.c
              * (nm_system_vpn_device_set_from_ip4_config): Remove
              the named manager argument, it can just as easily get it as the
      caller.
              (nm_system_vpn_device_unset_from_ip4_config): Ditto.
      
              * src/vpn-manager/nm-dbus-vpn.[ch]: Remove.
      
              * src/nm-dbus-manager.h: Fix up the name_owner signal signature.
      
              * src/dhcp-manager/nm-dhcp-manager.c (garray_to_string): Remove,
              * use one from
              libnm-utils.
      
              * libnm-util/nm-connection.c: Ditto.
      
              * src/NetworkManagerMain.h: Remove, it's finally empty.
      
              * configure.in: Remove utils/ from build.
      
              * include/NetworkManagerVPN.h: Add some more defines to reduce
              * the amount
              of hard-coded strings.
      
              * utils/: Move it over to libnm-util.
      
              * test/Makefile.am: Link against libnm-util now that util/ is
              * gone.
      
              * dispatcher-daemon/Makefile.am: Ditto.
      
              * src/Makefile.am: Ditto.
      
      
      
      git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2798 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
      326d1e86
  27. 14 Aug, 2007 1 commit
    • Dan Williams's avatar
      2007-08-14 Dan Williams <dcbw@redhat.com> · e3d15a5f
      Dan Williams authored
      	* include/NetworkManagerVPN.h
      	  src/vpn-manager/nm-dbus-vpn.c
      	  src/vpn-manager/nm-dbus-vpn.h
      	  src/vpn-manager/nm-vpn-act-request.c
      	  src/vpn-manager/nm-vpn-act-request.h
      	  src/vpn-manager/nm-vpn-service.c
      	  src/vpn-manager/nm-vpn-service.h
      	  libnm-glib/nm-vpn-connection.c
      	  libnm-glib/nm-vpn-connection.h
      	  libnm-glib/nm-client.h
      		- Rename NM_VPN_STATE_* -> NM_VPN_SERVICE_STATE_* and NMVPNState -> 
      			NMVPNServiceState to clarify what they apply to
      		- Rename NM_VPN_ACT_STAGE_* -> NM_VPN_CONNECTION_STATE_* and
      			NMVPNActStage -> NMVPNConnectionState for the same reason
      
      	* libnm-glib/nm-client.c
      		- Constant + type renames from above
      		- Properly handle NameOwnerChanged/manager_running signals
      			for NM service; only emit when state really changes
      		- Use hash tables correctly so that the key (which was previously owned
      			by the D-Bus message) now has the same lifetime as the value, since
      			the key is now taken from the the NMVPNConnection itself.  This
      			really fixes the double-VPN names in the applet
      
      
      
      git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2677 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
      e3d15a5f
  28. 26 Mar, 2007 1 commit