Commit graph

54 commits

Author SHA1 Message Date
Dan Winship cb7e1893e7 libnm-util, libnm-glib: standardize copyright/license headers
- 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.
2014-07-15 09:44:54 -04:00
Dan Winship 8487a4490c libnm-util, libnm-glib: be consistent about "Wi-Fi", "Ethernet", "InfiniBand" in docs
We made the UIs consistent last year, but missed the documentation.
Fix the docs to also consistently use "Wi-Fi" rather than "WiFi",
"Wifi", "wifi", or "WiFI"; "Ethernet" rather than "ethernet"; and
"InfiniBand" rather than "Infiniband".
2014-06-19 17:45:01 -04:00
Dan Winship 9c4d86ee80 libnm-util, libnm-glib: add versioned deprecation/availability macros
Add versioned NM_DEPRECATED_IN_* and NM_AVAILABLE_IN_* macros, and tag
new/deprecated functions accordingly. (All currently-deprecated
functions are assumed to have been deprecated in 0.9.10.)

Add NM_VERSION_MIN_REQUIRED and NM_VERSION_MAX_ALLOWED macros which
can be set to determine which versions will cause warnings.

With the current settings, external consumers of the
libnm-util/libnm-glib APIs will have MIN_REQUIRED and MAX_ALLOWED both
set to NM_VERSION_0_9_8 by default, meaning they will get warnings
about functions added in 0.9.10. NM internally sets
NM_VERSION_MAX_ALLOWED to NM_VERSION_NEXT_STABLE to ensure that it is
always allowed to use all APIs.
2014-02-13 11:24:37 -05:00
Dan Williams 1878a5e4c9 libnm-glib: convert NMClient Devices to a real property 2014-01-23 17:34:12 -06:00
Dan Winship f668423832 libnm-glib: Add NMClient:primary-connection and :activating-connection
https://bugzilla.gnome.org/show_bug.cgi?id=704841
2013-08-28 11:01:43 -04:00
Dan Winship 84919405e1 libnm-glib: support new connectivity property/methods 2013-08-28 10:54:09 -04:00
Dan Winship 4d8063cd78 libnm-glib: add NMClient:startup, nm_client_get_startup()
Expose the new NMManager:startup property on NMClient.
2013-08-16 17:27:34 -04:00
Dan Williams 7d12ede07b libnm-glib: fix documentation C&P error 2013-05-15 13:44:51 -05:00
Dan Williams 110a40358d libnm-glib: never call NM D-Bus methods if NM isn't running
Though the client shouldn't be calling anything when NM isn't running
(because clients have nm_client_get_manager_running()), make sure
that NMClient never calls a NetworkManager method when NM isn't
on the bus.

Next, ensure NMObject doesn't try to refresh properties when NM isn't
running.  Creating an NMClient may trigger a property refresh request,
but if NM isn't running, defer that until NM starts, to ensure that
we don't D-Bus autostart NM.

Third, ensure NMRemoteSettings doesn't attempt to list connections
unless NM is running.

This prevents service activation of NetworkManager in lieu of dbus-glib
learning about DBUS_HEADER_FLAG_NO_AUTO_START.
2013-04-08 11:30:32 -05:00
Jiří Klimeš a9fca4aa1b libnm-glib: use the same parameter names in prototypes and definitions
to calm down warning when compiling docs.
2013-01-15 12:27:00 +01:00
Jiří Klimeš 0309bdc2e0 libnm-glib: add nm_client_set_logging() for setting debugging level and domains 2013-01-09 16:47:49 +01:00
Jiří Klimeš 4ce355022c libnm-glib: add nm_client_get_logging() function
to get current logging level and domains.
2013-01-09 16:47:49 +01:00
Dan Williams 2ecf61a29a docs: document NMClient permissions enums 2012-08-06 19:51:23 -05:00
Jiří Klimeš edb85e9720 core: fix NM_IS_*_CLASS(klass) macros
The argument is 'klass' not 'obj'.
2012-07-27 13:15:54 +02:00
Dan Winship 7844ead116 libnm-glib: nm_client_new_async, fix up NMClient asynchrony issues 2012-02-03 10:33:43 -06:00
Dan Winship efadfd8b17 libnm-glib: pre-emptively avoid some -Wshadow errors
including <gio/gio.h> will drag in some additional system headers that
result in new -Wshadow warnings. Fix those.
2012-02-02 12:30:35 -06:00
Jiří Klimeš 8d43875cbe libnm-glib: add nm_client_get_device_by_iface() for NMClient 2011-06-15 14:58:04 +02:00
Dan Williams ead5869825 libnm-glib: small activation callback rework
To make the API more consistent, instead of returning an
ActiveConnection object path, return the actual NMActiveConnection
object itself.  Suggested by Matthias Clasen.
2011-03-15 19:03:18 -05:00
Jiří Klimeš e7d2eb43f7 libnm-glib: add code to get "Version" property 2011-02-16 14:34:19 +01:00
Dan Williams 016c56078d policy: rename HOSTNAME_MODIFY -> MODIFY_HOSTNAME for consistency 2011-02-11 11:32:57 -06:00
Dan Williams ba8f562836 policy: add a "modify own" permission for single-user-visible connections
This policy will allow users to modify their personal connections (ie
maybe VPN connections, etc) distinctly from system-wide connections that
affect more than just their user.  It makes sense to be more lenient when
making changes to settings that don't affect other users.
2011-02-11 11:31:14 -06:00
Dan Williams f2c317e3d2 policy: rename "modfiy" permission to "modify system"
Meaning stays the same, but this will allow us to differentiate
in the future between personal connections (ie, just visible to
one user) and system connections (visible to more than one user).
2011-02-11 11:19:02 -06:00
Dan Williams b5f3aa7120 libnm-glib: pass NMClient as first callback argument to activation callbacks
Better matches glib style.
2011-01-13 13:03:02 -06:00
Dan Williams f9ceafd4a1 Merge remote branch 'origin/master' into rm-userset 2011-01-12 15:46:37 -06:00
Dan Williams 063859ba66 libnm-glib: add nm_client_add_and_activate_connection() 2011-01-12 00:39:34 -06:00
Dan Williams c28850ed52 wimax: fix up WiMAX radio enable/disable and add polkit permission 2011-01-02 17:34:23 -06:00
Dan Williams 0587ef1179 Merge remote branch 'origin/master' into wimax 2011-01-02 17:24:23 -06:00
Dan Williams 8bb9394e92 trivial: whitespace fixes 2010-12-24 07:02:35 -06:00
Dan Williams 77f3d6c81c libnm-glib: add signal prototype to class definition 2010-12-23 09:09:13 -06:00
Dan Williams 3945f75bda core: consolidate all permissions checking into main D-Bus interface
Moves the system settings permissions checking into the core service's
permissions checking, which at the same time enables 3-way permission
reporting (yes, no, auth) instead of the old yes/no that we had for
system settings permissions before.  This allows UI to show a lock
icon or such when the user could authenticate to gain the permission.

It also moves the wifi-create permissions' namespace to the main
namespace (not .settings) since they really should be checked before
starting a shared wifi connection, rather than having anything to do
with the settings service.
2010-08-26 14:26:12 -05:00
Daniel Gnoutcheff 67ba32cd29 Remove use-user-connections polkit action 2010-08-06 13:05:46 -04:00
Daniel Gnoutcheff d503c09466 DBus API: removing user settings support
Remove bits from the external DBus API that were once needed for user
settings support.
2010-08-06 13:05:46 -04:00
Dan Williams 716a9c6c0d core: add permissions framework for various operations (rh #585182) (bgo #619323) 2010-05-28 18:23:00 -07:00
Dan Williams fa70542c61 core: add networking enable/disable knob distinct from sleep/wake (rh #589108) (bgo #346615)
Since forever we've used sleep/wake as the way to implement
Networking Enabled.  When the state file was introduced to make the
networking and wifi states persistent, we ran into a bug where
a failed suspend (like if the machine ran out of power while
suspended) would result in networking being disabled on reboot
since suspend/resume used the same knob as enable/disable.

This patch adds a distinct call for enable/disable networking
which changes the state file, while sleep/wake no longer change
the state file.
2010-05-22 09:51:22 -07:00
Tambet Ingo 20a4c6c6b6 wimax: Implement RFKILL handling
Implement and export over DBus WiMAX enable/disable and hardware state query.
2009-12-29 11:27:10 +02:00
Dan Williams ec56c4d093 libnm-glib: add WWAN enable/disable support 2009-12-23 01:30:54 -08:00
Dan Williams 866d48bb9b libnm-glib: add class padding for future expansion 2009-09-30 09:21:32 -07:00
Przemysław Grzegorczyk bac45aa0d5 clean up glib includes (bgo #564376)
Only <glib.h> and <gtk/gtk.h> need to be included.
2009-01-19 00:16:40 -05:00
Dan Williams 7118676968 2008-11-14 Dan Williams <dcbw@redhat.com>
Relicense libnm-glib to LGPLv2+ with agreement from contributors



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4285 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-14 17:41:16 +00:00
Dan Williams 59731b9cbd 2008-03-31 Dan Williams <dcbw@redhat.com>
* libnm-glib/nm-client.c
	  libnm-glib/nm-client.h
		- (activate_cb): pass the new active connection to callback; fix
			message when no callback is specified



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3518 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-03-31 14:47:19 +00:00
Dan Williams c01b4c9e2e 2008-03-27 Dan Williams <dcbw@redhat.com>
* nm-object.c
		- (nm_object_queue_notify): don't notify multiple times for the same
			property

	* nm-object-private.h
		- (handle_ptr_array_return): return NULL if the given array is NULL or
			if it has zero elements

	* nm-ip4-config.c
		- (finalize): use g_ptr_array_foreach() when freeing domains
		- (nm_ip4_config_get_domains): use handle_ptr_array_return()

	* nm-active-connection.c
		- (nm_active_connection_get_devices): use handle_ptr_array_return()

	* nm-device-802-11-wireless.c
	  nm-device-802-11-wireless.h
		- (nm_device_802_11_wireless_get_access_points): return const; use
			handle_ptr_array_return()

	* nm-types.c
		- (nm_object_array_demarshal): always create an array, even of length
			zero, to distinguish between "NM returned no items" and "haven't
			asked NM yet"

	* nm-client.c
		- (dispose): free active connections too
		- (proxy_name_owner_changed): free active connections too when NM goes
			away
		- (nm_client_get_devices): return const; use handle_ptr_array_return()
		- (nm_client_get_active_connections): use handle_ptr_array_return()



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3506 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-03-27 14:10:43 +00:00
Dan Williams 007351657f 2008-03-24 Dan Williams <dcbw@redhat.com>
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
2008-03-24 15:17:30 +00:00
Dan Williams fbb5062271 2008-03-19 Dan Williams <dcbw@redhat.com>
* introspection/nm-manager.xml
	  introspection/nm-manager-client.xml
		- Rename the ActivateDevice method to ActivateConnection to better
			reflect it's usage; it's arguments get reordered a bit too
		- Convert GetActiveConnections method return from a struct to a dict

	* include/NetworkManager.h
		- Define the dict keys for return value of GetActiveConnections

	* src/nm-manager.c
		- impl_manager_activate_device -> impl_manager_activate_connection
		- (add_one_connection_element): return a populated hash table, not
			a structure

	* libnm-glib/nm-client.c
	  libnm-glib/nm-client.h
		- nm_client_activate_device -> nm_client_activate_connection
		- nm_client_free_active_connection_element -> nm_client_free_active_connections_element
		- (nm_client_get_active_connections): return a GSList of GHashTables,
			instead of the custom structures.  Each element of the returned list
			must be freed with nm_client_free_active_connections_element()



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3482 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-03-19 20:58:21 +00:00
Dan Williams bf974b6aa4 2008-03-07 Dan Williams <dcbw@redhat.com>
Change manager's StateChange signal to StateChanged for consistency.

	* introspection/nm-manager.xml
		- Add 'StateChanged' signal
		- Move 'StateChange' down to the deprecated section

	* src/nm-hal-manager.c
		- (nm_hal_manager_new): connect to 'state-changed' instead

	* src/NetworkManagerPolicy.c
		- (nm_policy_new): connect to 'state-changed' instead

	* src/nm-manager.c
	  src/nm-manager.h
		- (nm_manager_update_state): emit both 'state-changed' and 'state-change'
		- (nm_manager_class_init): add 'state-changed' and not the deprecation
			of 'state-change'

	* libnm-glib/nm-client.c
	  libnm-glib/nm-client.h
		- (constructor, nm_client_class_init, client_state_changed_proxy):
			track and proxy 'state-changed' instead of 'state-change'



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3393 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-03-07 23:17:48 +00:00
Tambet Ingo 7e2a621f0a 2007-10-15 Tambet Ingo <tambet@gmail.com>
Implement killswitch polling through HAL.

        * src/nm-manager.c: Add wireless hardware status property. Add 
        'properties-changed' signal for changes in wireless and wireless
hardware
        state changes.

        * src/nm-hal-manager.c: Poll hal for killswitch statuses in
        * every 6 seconds
        and update NMManager's wireless hardware state when it has
changed.
        (nm_hal_manager_new): Don't try to add initial devices here -
(hal_init)
        already does that.

        * libnm-glib/nm-client.c: Add wireless hardware status property.
        * Cache the
        values of wireless state and wireless hardware state. Listen for
the
        'properties-changed' signals, update the cached values and emit
notify.

        * include/NetworkManager.h: Fix a typo in a comment.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2975 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-10-15 14:46:37 +00:00
Dan Williams f9fd8667d1 2007-10-03 Dan Williams <dcbw@redhat.com>
Add a GetActiveConnections() method on the Manager object.

	* src/nm-manager.c
	  src/nm-manager.h
	  introspection/nm-manager.xml
		- (connection_get_settings_cb): keep connection type around too
		- (impl_manager_get_active_connections, add_one_connection_element):
			implement; returns all active connections and what devices they
			apply to

	* libnm-glib/nm-client.c
	  libnm-glib/nm-client.h
	  introspection/nm-manager-client.xml
		- (nm_client_get_devices): GPtrArray elements are allocated and owned
			by the caller; free here to avoid memory leak
		- (nm_client_get_active_connections): implement; return the list of
			active connections
		- (nm_client_free_active_connection_element): implement; free an element
			of the GSList returned by nm_client_get_active_connections()



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2927 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-10-03 14:48:25 +00:00
Tambet Ingo 485bcfe571 2007-09-28 Tambet Ingo <tambet@gmail.com>
* src/nm-manager.c:
        * src/nm-manager.h:
        Implement device activation through NMManager.
        Implement "pending device activation" here - If the connection
isn't found,
        we try to wait for up to 5 seconds for the connection to be
provided.
        Add NMConnectionType argument to "connection-added" and
"connection-removed"
        signals.
        (nm_manager_get): Remove. Finally.

        * src/nm-activation-request.c: 
        * src/nm-activation-request.h: 
        Remove all the deferred activation code.

        * src/nm-device.c: Remove all the deferred activation code. Once
        * the device
        activation is started, it's started. Update the activation
virtual function
        signature.

        * src/nm-device-interface.c:
        * src/nm-device-interface.h:
        Device activation now takes only NMActRequest argument.
        Don't expose device activation directly on dbus, it's supposed
to go through
        NMManager now.

        * src/NetworkManagerPolicy.c (nm_policy_device_change_check):
        * Make the code
        a bit more compact.
        Use the new device activation methods through NMManager.

        * introspection/nm-manager-client.xml: 
        * introspection/nm-manager.xml: 
        * libnm-glib/nm-client.c:
        * libnm-glib/nm-client.h:
        Add device activation method.
        
        * libnm-glib/nm-device.c: 
        * libnm-glib/nm-device.h: 
        * introspection/nm-device.xml: 
        Remove device activation method. It's done through NMManager
now.

        * src/vpn-manager/nm-vpn-manager.c (impl_vpn_manager_connect):
        * Use the shiny
        new (nm_manager_get_device_by_path) function, get rid of our own
)find_device).



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2915 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-10-01 15:38:39 +00:00
Tambet Ingo 326d1e8679 2007-09-12 Tambet Ingo <tambet@gmail.com>
* 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
2007-09-12 16:23:53 +00:00
Dan Williams e3d15a5f73 2007-08-14 Dan Williams <dcbw@redhat.com>
* 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
2007-08-14 14:09:57 +00:00
Tambet Ingo 6a68d79c08 2007-08-09 Tambet Ingo <tambet@gmail.com>
[Based on patch by Helmut Schaa <hschaa@suse.de>]

        * libnm-glib/nm-client.h:
        * libnm-glib/nm-object.h:
        * libnm-glib/nm-vpn-connection.h:
        * libnm-glib/nm-settings.h:
        * libnm-glib/nm-device.h:
        * libnm-glib/nm-ip4-config.h:
        * libnm-glib/nm-access-point.h:
        * libnm-glib/nm-device-802-3-ethernet.h:
        * libnm-util/nm-setting.h: 
        * libnm-util/nm-connection.h: Add G_BEGIN_DECLS / G_END_DECLS to
        * support C++.

        * libnm-glib/nm-object.c (nm_object_get_byte_property):
        * Implement.

        * libnm-glib/nm-access-point.c: Strength has type char.

        * gnome/vpn-properties/Makefile.am: Remove
        * GNOME_DISABLE_DEPRECTATED for now
        to fix build. GnomeDruid is deprecated in recent libgnomeui.

        * introspection/nm-access-point.xml: Strength property is char,
        * not int.

        * src/NetworkManagerAP.c (set_property): Set strength from char.
        (get_property): Handle hidden APs (with empty SSID).
        Get strength value from char.
        (nm_ap_class_init): Strength property has char type.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2659 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-08-09 09:19:57 +00:00