Commit Graph

15047 Commits

Author SHA1 Message Date
Dan Williams
95b0b72211 core: move device creation into the manager
Consolidate device creation in the manager object; bluetooth and
modem devices were already handled by it, so it makes sense to do
it all from one place.  Furthermore we'll be creating virtual devices
in the manager too.  It also reduces indirection (no need to send
device_creator() in the DEVICE_ADDED signal) and makes the code
flow clearer.
2012-02-05 23:18:32 -06:00
Dan Williams
925d5e016b docs: reference NMRemoteSettings from NMClient creators
It can be a bit confusing that one object doesn't do both
control and configuration.  So throw users a bone and tell
them how.
2012-02-03 10:38:38 -06:00
Dan Winship
c619365ee3 libnm-glib: asyncify NMRemoteSettings
Add nm_remote_settings_new_async/_finish, and misc other fixes
2012-02-03 10:33:44 -06: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
9fd98ef91b libnm-glib: implement GInitable/GAsyncInitable in NMObject
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.
2012-02-03 10:33:43 -06:00
Dan Winship
ad5daa098c libnm-glib: add "pseudoproperties" for things like Client.GetDevices
Add generic handling for "properties" that consist of a "Get" method,
an "Added" signal, and a "Removed" signal, reusing some of the code
for handling object-array-valued properties. And load the values of
pseudo properties from _nm_object_reload/ensure_properties as well.
2012-02-03 10:33:43 -06:00
Dan Winship
cc90f1010e libnm-glib: simplify handling of object and object array properties
Add an "object_type" field to NMPropertiesInfo, and use that with
DBUS_TYPE_G_OBJECT_PATH and DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH
properties so that we don't need custom marshallers for each one.

When creating an NMDevice or NMActiveConnection, we need to fetch an
extra property first to figure out the exact subclass to use, so add a
bit of infrastructure for that as well. Also, do that preprocessing
asynchronously when processing a property change notification, so that
it doesn't block the main loop.
2012-02-03 10:33:43 -06:00
Dan Winship
5afcee4693 libnm-glib: simplify property getter methods
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.
2012-02-03 10:33:43 -06:00
Dan Winship
2e48cc092c libnm-glib: simplify and genericize property declaration
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.
2012-02-03 10:33:43 -06:00
Jiří Klimeš
38382770aa examples: add C examples for monitoring whether NM runs
- the first uses dbus-glib and D-Bus "NameOwnerChanged" signal directly
- the second uses GIO's g_bus_watch_name()
- the third uses Qt and QDBusServiceWatcher class
2012-02-03 11:55:46 +01:00
Dan Winship
8ad3ff24ad libnm-glib: don't use client-side generated dbus-glib bindings
Most of the code was using dbus_g_proxy_call() directly, but there
were some leftover uses of the generated bindings. Make things more
consistent by using dbus_g_proxy_call() everywhere, and stop building
the -bindings.h files.
2012-02-02 12:30:44 -06:00
Dan Winship
ba4731dafd libnm-glib: remove nm-dbus-utils.[ch]
The code hasn't been used in a very long time.
2012-02-02 12:30:38 -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
Dan Winship
f32032694f libnm-glib: implement NMActiveConnection uuid property
This property existed as a #define and a get method, but the actual
GObject property itself was accidentally never implemented.
2012-02-02 12:30:32 -06:00
Dan Winship
e74d729f17 libnm-glib: fix _nm_string_array_demarshal
dbus-glib returns 'as' results as G_TYPE_STRV (NULL-terminated
char**), not DBUS_TYPE_G_ARRAY_OF_STRING (GPtrArray of char*).
2012-02-02 12:28:56 -06:00
Dan Winship
c79b8085ee ifcfg-rh: belatedly add writer support for infiniband (and tests) 2012-02-02 12:24:03 -06:00
Dan Winship
ec35d47253 introspection: add missing error description for INFINIBAND_MODE 2012-02-02 12:02:11 -06:00
Evan Broder
8b107e9ee8 dns: make caching DNS server config files readable by everyone
All of the information in the configuration files for local caching
dnsmasq or BIND servers are accessible already over the D-Bus
interface, so there's no sensitive information here.
2012-02-02 12:02:11 -06:00
Thomas Bechtold
775ec828b9 core: add device property "StateReason"
Allows clients to retrieve the reason a device changed to
the given state along with the state itself, preventing
race conditions if the state were retrieved separately
from the reason.  Reason codes were not previously
accessible without listening to the StateChanged signal.
2012-02-02 12:02:11 -06:00
Thomas Bechtold
3dc965a2cb libnm-util: allow empty number for gsm settings
The documentation said they were allowed, and that's clearly the
correct behavior.
2012-02-02 12:02:10 -06:00
Dan Williams
f900522308 build: easier selection of session tracking
Using --with-session-tracking=xxx you can select the backend
you want from among CK, systemd, or none.
2012-02-01 16:50:44 -06:00
Dan Williams
20035ad443 core: add NULL session monitor
Allows all access; used when neither ConsoleKit or systemd are
selected.
2012-02-01 16:50:44 -06:00
Dan Williams
e133405a29 core: combine common session management utility code
And reformat the systemd session manager for NM code style.
2012-02-01 16:50:44 -06:00
Matthias Clasen
3b75a97ab0 core: optionally use systemd for session tracking instead of ConsoleKit
When configured with --enable-systemd, this patch makes
NetworkManager use systemd for session tracking instead
of ConsoleKit.
2012-02-01 15:09:46 -06:00
Dan Williams
c09a59da4b docs: update some VPN docs in libnm-util 2012-02-01 15:09:10 -06:00
Jiří Klimeš
8e22a535cc cli: add 'transport-mode' property of infiniband setting 2012-02-01 11:47:19 +01:00
Jiří Klimeš
3a6c69d576 cli: add 'pac-file' property of 802-1x setting 2012-02-01 10:50:56 +01:00
Jiří Klimeš
b127fda19f supplicant: fix crash when connecting without both 'password' and 'password-raw'
It is the case e.g. for EAP-TLS. This regression was caused by commit
b08e2b8932.
2012-01-30 18:29:13 +01:00
Jiří Klimeš
2c52303f59 supplicant: fix checking config for EAP-FAST authentication
We do not want to break other methods, when EAP-FAST specific error condition
is detected: no PAC file provided and automatic PAC provisioning is disabled.
2012-01-30 18:07:35 +01:00
Jiří Klimeš
ba977b6a91 supplicant: use connection UUID instead of D-Bus path for config purposes 2012-01-27 13:04:10 +01:00
Jiří Klimeš
847edde23a ifcfg-rh: add read/write support for EAP-FAST 2012-01-27 12:54:20 +01:00
Jiří Klimeš
5cb75feee0 supplicant: handle parameters for EAP-FAST authentication 2012-01-27 12:54:12 +01:00
Jiří Klimeš
0ba66f8272 libnm-util: add 'pac-file' property for 8021x setting (used in EAP-FAST) 2012-01-27 11:46:36 +01:00
Dan Williams
e281d09805 docs: update NMSecretAgent example code 2012-01-26 12:23:05 -06:00
Dan Williams
724df841a2 docs: update docs for NMSecretAgent callbacks 2012-01-26 12:21:27 -06:00
Jiří Klimeš
0558159c6b docs: fix 'connection' parameter name for nm_access_point_connection_valid() 2012-01-26 18:16:14 +01:00
Dan Winship
b860c7be4a infiniband: add transport-mode property
Add transport-mode property to NMSettingInfiniband (and parse it
correctly in ifcfg-rh), and set it up properly on the device in
NMDeviceInfiniband.
2012-01-26 09:58:48 -06:00
Thomas Bechtold
fe5392ccd9 core: add missing device state reasons
Some NMDeviceStateReason 's are not available in
introspection/nm-device.xml

Tom
2012-01-25 11:26:57 -06:00
Thomas Graf
471fef2ad5 cli: print NMActiveConnection master property as MASTER-PATH
This is a proposal to include the NMActiveConnection master property in
nmcli con status.

Feel free to suggest a more user friendly method of printing this
information.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-01-25 11:24:50 -06:00
Thomas Graf
1ba50e2f1b bonding: export path of master device property over DBUS
Adds a new "master" property to NMActiveConnection containing the path
of the master NMDevice if the connection has a master.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-01-25 11:12:43 -06:00
Dan Williams
93f289bc13 ifcfg-rh: use correct location of wireless.h
We used to require wireless-tools.  We no longer do, so use the
kernel includes header here that we checked for at configure time.
2012-01-23 12:08:32 -06:00
Jiří Klimeš
f4da4f5523 trivial: fix spelling 2012-01-17 16:26:30 +01:00
Jiří Klimeš
87a2030a43 core: fix translations - use NULL instead of "" (else odd translation appears) 2012-01-17 16:18:43 +01:00
Gabor Kelemen
3b00919b7a core: mark strings for translation (bgo #666652) 2012-01-17 15:53:16 +01:00
Gabor Kelemen
d3c1383b4e core: fix domain for g_option_context_set_translation_domain() (bgo #666652) 2012-01-17 15:51:28 +01:00
Gabor Kelemen
48852e112e core: setlocale(), so that locale's env variables are honored (bgo #666516) 2012-01-17 15:17:06 +01:00
Jiří Klimeš
617af3b49d trivial: use proper return type in g_return_val_if_fail() 2012-01-17 14:45:27 +01:00
Jiří Klimeš
9b84ef9acd core: add nm-logging.h when compiling with DEBUG 2012-01-17 14:43:03 +01:00
Jiří Klimeš
9f75f91f3a wired: emit Speed value in PropertiesChanged signal, when changed (bgo #667091)
Speed is gotten via ethtool on 'carrier on' event. If there is a more suitable
netlink event we should use it instead. Nonetheless, it appears to be working
fine with carrier change, because interface speed change does emit carrier offi
and on events.
2012-01-17 14:30:45 +01:00
Muhammet Kara
f12c326ff2 po: add Turkish translation (bgo #667213) 2012-01-17 11:00:30 +01:00