Commit Graph

133 Commits

Author SHA1 Message Date
Dan Williams
5ee1039067 libnm-glib: fix crash calling activation callback
Duh, need to zero the memory before reading from it.  It was
crashing in recheck_pending_activations() because the info->active_path
was random memory.
2011-03-24 23:20:32 -05:00
Dan Williams
4390865bc0 libnm-glib: clarify usage of specific_object for activation calls 2011-03-17 11:27:30 -05:00
Dan Williams
ab9af2277f libnm-glib: clarify some documentation 2011-03-17 11:18:35 -05:00
Dan Williams
efc51d51e5 libnm-glib: more introspection annotation fixes
No connection is required for nm_client_add_and_activate_connection(),
it can be NULL.
2011-03-17 11:17:08 -05:00
Giovanni Campagna
4480365db7 libnm-glib: introspection annotation fixes (bgo #643011) 2011-03-16 15:25:37 -05:00
Jiří Klimeš
6b2e8664a7 libnm-glib: update nm_client_activate_connection()'s description 2011-03-16 13:50:09 +01:00
Jiří Klimeš
d91c68235d libnm-glib: fix calling callback when activating connection
Connections were not added to pending_activations resulting in callback
not being called.
2011-03-16 13:03:15 +01: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
Dan Williams
47a7f30682 libnm-glib: move some code around
Move the GObject boilerplate stuff to the bottom.
2011-03-15 17:16:52 -05:00
Dan Williams
d4f8c43f40 libnm-glib: allow NULL device for nm_client_activate_connection() 2011-03-15 17:04:50 -05:00
Dan Williams
2140dad5e0 core: consolidate mobile broadband device types
These days more and more devices are showing up that support a
number of different access technology families in the same hardware,
like Qualcomm Gobi (CDMA and GSM), Pantech UM190 (CDMA and GSM),
Pantech UML290 (CDMA and LTE), LG VL600 (CDMA and LTE), Sierra
320U (GSM and LTE), etc.  The previous scheme of having device
classes based on access technology family simply cannot handle
this hardware and attempting to add LTE to both the CDMA and GSM
device classes would result in a bunch of code duplication that
we don't want.  There's a better way...

Instead, combine both CDMA and GSM device classes into a generic
"Modem" device class that provides capabilities indicating what
access technology families a modem supports, and what families
it supports immediately without a firmware reload.  (Gobi devices
for example require a firmware reload before they can switch
between GSM and CDMA).  This provides the necessary flexibility
to the client and allows us to keep the API stable when the
same consolidation change is made in ModemManager.

The current code doesn't yet allow multi-mode operation internally,
but the API is now what we want it to be and won't need to be
changed.
2011-02-25 10:16:17 -06:00
Giovanni Campagna
bd933b27a1 libnm-glib: never propagate garbage values to async callbacks (bgo #642819)
When a DBus error is received, the values of the other parameters
may be undefined, but bindings will assume they're valid and fail.
Capture this case and pass NULL to the callbacks.
Also, allow passing NULL instead of a callback, for bindings that
don't support the argument types.
2011-02-23 12:02:37 -06:00
Dan Williams
eab5851145 libnm-util: remove nm_warning/nm_info/nm_error macros
Clients need to do their own logging using glib or whatever; these
macros while somewhat helpful were not flexible and are not a
substitute for actual logging in the client.  g_warning, g_message,
and g_error are more suitable anyway.
2011-02-23 11:42:04 -06:00
Giovanni Campagna
e77acd43b6 libnm-glib: more GObject introspection fixes (bgo #181415)
Fix some annotations and add the necessary ones for new functions.
2011-02-21 18:11:21 -06:00
Dan Williams
ccfc034a0d libnm-glib: make _nm_object_cache_get() return a referenced object 2011-02-16 15:04:39 -06:00
Jiří Klimeš
e7d2eb43f7 libnm-glib: add code to get "Version" property 2011-02-16 14:34:19 +01:00
Jiří Klimeš
d6905a8d66 libnm-glib: add GError parameter to _nm_object_get_... functions
It allows us to get the error back and have control over printing
the error.
2011-02-15 17:34:11 +01:00
Dan Williams
ec115ed442 api: add additional NM daemon states
DISCONNECTING: the only active network connection is now being disconnected
LOCAL, SITE, GLOBAL: one-stop items for level of connectivity, which
we'll use to show when we think we're actually connected to the internet
or behind a captive portal or something
2011-02-14 17:55:27 -06:00
Jiří Klimeš
ec4d126d5a libnm-glib/build: make WiMAX support optional 2011-02-14 16:08:00 +01:00
Dan Williams
6d344a43e9 Merge remote-tracking branch 'origin/rm-userset'
There; it's merged.  Yay!
2011-02-12 22:51:12 -06: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
Jiří Klimeš
83dc4032b7 libnm-glib: fix comment/doc for nm_client_networking_get_enabled() 2011-02-10 15:20:56 +01:00
Dan Williams
e68e27aa75 libnm-util: add 'flags' argument to nm_connection_to_hash() and nm_setting_to_hash()
Simplifies code internally, and makes it easier for clients as well in
some cases where they want to control what ends up in the resulting
hash and what does not.
2011-01-26 14:14:37 -06:00
Giovanni Campagna
3ebecd2a29 introspection: add GObject introspection support (bgo #637032)
Add the necessary annotations (the mininum required, that is those
on return values. NULL parameters or container types may require
more), and the Autotools stuff to get a NetworkManager GIR for
libnm-util and a NMClient for libnm-glib.
2011-01-21 14:46:09 -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
ad80a58c15 libnm-glib: add testcases and testing infrastructure
Tests for addition and removal of connections.
2010-12-28 17:11:27 -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
Dan Williams
022d8e665c Merge remote branch 'origin/master' into gsoc 2010-08-26 09:18:37 -05:00
Dan Williams
d3b26a9c57 libnm-glib: get permissions synchronously at startup
Many clients using libnm-glib (often command-line ones like nm-tool
or nmcli) aren't long-lived enough for NM to get their UID from
the bus daemon and validate their permissions via PolicyKit.  So
when the NMClient object is created, get the permissions synchronously
(with a very low timeout to prevent unecessary blocking) to ensure
that the client is still on the bus when NM asks for it's credentials.

Avoids a ton of messages like:

NetworkManager[10274]: <warn> error requesting auth for org.freedesktop.NetworkManager.enable-disable-wwan: (6) Remote Exception invoking org.freedesktop.PolicyKit1.Authority.CheckAuthorization() on /org/freedesktop/PolicyKit1/Authority at name org.freedesktop.PolicyKit1: org.freedesktop.DBus.Error.NameHasNoOwner: Remote Exception invoking org.freedesktop.DBus.GetConnectionUnixUser() on / at name org.freedesktop.DBus: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get UID of name ':1.95': no such name
2010-08-10 00:47:26 -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
6221afc790 libnm-glib: add nm_client_networking_get_enabled() (rh #589108) (bgo #346615)
Forgot this in the last commit.
2010-05-22 11:27:05 -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
5405a26b40 libnm-glib: use correct D-Bus interface for getting ActiveConnections (bgo #569933) 2009-02-03 06:09:23 -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
f44da15bdf 2008-09-05 Dan Williams <dcbw@redhat.com>
* libnm-glib/nm-client.c
		- (constructor): get initial state after we know whether NM is running
			or not



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4039 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-09-05 15:11:34 +00:00
Michael Biebl
d7940bcb9b Rename private nm_* functions to _nm_*
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4012 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-08-26 09:34:31 +00:00
Tambet Ingo
0f534a9f8f 2008-08-12 Tambet Ingo <tambet@gmail.com>
Start documenting libnm-glib public API using gtk-doc.

	* libnm-glib/nm-serial-device.c:
	* libnm-glib/nm-object.c:
	* libnm-glib/nm-gsm-device.c:
	* libnm-glib/nm-device.c:
	* libnm-glib/nm-device-wifi.c:
	* libnm-glib/nm-device-ethernet.c:
	* libnm-glib/nm-client.c:
	* libnm-glib/nm-cdma-device.c: Document the public API.

	* docs/libnm-glib/libnm-glib.types: Implement.

	* docs/libnm-glib/Makefile.am: Implement.

	* autogen.sh:
	* configure.in:
	* Makefile.am: Add gtk-doc support.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3932 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-08-12 08:05:21 +00:00
Dan Williams
3246f24248 Don't try to get active connections when NM isn't running
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3921 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-08-11 13:49:09 +00:00
Dan Williams
0fdb07ca3d 2008-06-10 Dan Williams <dcbw@redhat.com>
The grand 802-11-wireless rename.  Get rid of the 802-11/80211/802_11 bits
	and use "wifi" everwhere instead.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3742 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-06-10 16:32:39 +00:00
Dan Williams
2b00116361 2008-06-10 Dan Williams <dcbw@redhat.com>
The grand 802-3-ethernet rename.  Get rid of the 802-3/8023/802_3 bits.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3741 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-06-10 15:54:23 +00:00