Commit Graph

69 Commits

Author SHA1 Message Date
Beniamino Galvani
8b9ea0b7c6 checkpoint: consider all devices when an empty list is passed
First, consider all devices and not only realized and managed ones
when an empty list is passed. Also, move the list evaluation to the
checkpoint manager, since the check for device conflicts is done
there.

Fixes: 3e09aed2a0
2016-09-26 15:10:39 +02:00
Thomas Haller
93a753e311 capabilities: add comment about capability range 2016-09-23 16:09:06 +02:00
Thomas Haller
4a6c07d4e5 capabilities: fix data type to "u" / uint32
The property NM_MANAGER_CAPABILITIES was already "au".
The types must be used consistently.
2016-09-23 15:49:52 +02:00
Marius Vollmer
1bb00ae66a manager: Add "Capabilities" property 2016-09-23 15:49:52 +02:00
Thomas Haller
6fb917178a dbus: deprecated NM specific PropertiesChanged signals
Nowadays, users should use the standard "PropertiesChanged" signal
on "org.freedesktop.DBus.Properties" interface.
2016-09-02 20:13:36 +02:00
Thomas Haller
e54b6c2bd5 doc: fix mistake in documenting Reload D-Bus call 2016-09-01 16:53:54 +02:00
Beniamino Galvani
3e09aed2a0 checkpoint: add create, rollback and destroy D-Bus API
Co-authored-by: Thomas Haller <thaller@redhat.com>
2016-08-17 14:55:34 +02:00
Thomas Haller
0acee97220 config,dns: support Reload flags to specify that only parts should be reloaded
Support 3 new flags for Reload:

  - 0x01 (CONF): reload the configuration from disk
  - 0x02 (DNS_RC): write DNS configuration to resolv.conf
  - 0x04 (DNS_FULL): restart DNS plugin

Omitting all flags is the same as reloading everything, thus SIGHUP.
2016-06-01 19:06:34 +02:00
Thomas Haller
1d0e0eeffd manager: add Reload() D-Bus command
Add new Reload D-Bus command to reload NetworkManager configuration.

For now, this is like sending SIGHUP to the process. There are several
advantages here:

  - it is guarded via PolicyKit authentication while signals
    can only be sent by root.

  - the user can wait for the reload to be complete instead of sending
    an asynchronous signal. For now, we operation completes after
    nm_config_reload() returns, but later we could delay the response
    further until specific parts are fully reloaded.

  - SIGHUP reloads everything including re-reading configuration from
    disk while SIGUSR1 reloads just certain parts such as writing out DNS
    configuration anew.
    Now, the Reload command has a flags argument which is more granular
    in selecting parts which are to be reloaded. For example, via
    signals the user can:

      1) send SIGUSR1: this writes out the DNS configuration to
         resolv.conf and possibly reloads other parts without
         re-reading configuration and without restarting the DNS plugin.
      2) send SIGHUP: this reloads configuration from disk,
         writes out resolv.conf and restarts the DNS plugin.

    There is no way, to only restart the DNS plugin without also reloading
    everything else.
2016-06-01 19:06:34 +02:00
Lubomir Rintel
a8e8e76641 dbus: fix up the XML formatting
The conversion script didn't do a very good job. It got fired.
2016-04-05 14:37:51 +02:00
Lubomir Rintel
2ae34aef9f dbus: correct the links to types
gdbus-codegen is not smart enough to understand #Type, include raw
docbook directly.
2016-04-05 14:37:51 +02:00
Lubomir Rintel
6e2b188361 dbus: convert the annotations to gtk-doc blocks 2016-04-05 14:37:51 +02:00
Lubomir Rintel
618373a14f dbus: use the annotations for documentation
gdbus only understands those (and gtk docstrings, which we should eventually
use) when generating the documentation.
2016-03-26 11:28:19 +01:00
Dan Williams
5da37a129c api/manager: add GetAllDevices() method and AllDevices property
Returns both realized and un-realized devices.
2015-12-04 12:16:41 +01:00
Thomas Haller
fd87ce503c logging: add special logging level "KEEP"
Without this, the user cannot configure only certain logging domains
without touching them all.

E.g.

  # nmcli general logging level DEBUG domains PLATFORM

will disable all non-PLATFORM domains.
Well, the user can do:

  # nmcli general logging level INFO domains PLATFORM:DEBUG
  # nmcli general logging level DEBUG domains ALL:INFO,PLATFORM

but in this case all non-PLATFORM domains are reset explicitly.

Now the user can:

  # nmcli general logging level KEEP domains PLATFORM:DEBUG
  # nmcli general logging level DEBUG domains ALL:KEEP,PLATFORM

which will only change the platform domain.
2015-10-09 14:55:00 +02:00
Beniamino Galvani
c83ac1ed41 manager: export DNS global configuration D-Bus property 2015-10-01 09:05:08 +02:00
Jiří Klimeš
988fa1ba8c introspection: add AUDIT domain to available list in SetLogging() description
Fixes: 41e7051165
2015-08-31 08:59:31 +02:00
Dan Winship
34ba4e14b8 core: port NMManager to gdbus 2015-08-10 09:41:26 -04:00
Jiří Klimeš
036901b82e xml: (trivial) fix a typo 2015-06-10 09:34:58 +02:00
Beniamino Galvani
04d5804dd5 nm-manager: add 'metered' property
This introduces a global metered property which makes easier for
clients to obtain the metered status of the current primary
connection.
2015-06-09 18:23:19 +02:00
Ryan Lortie
07dba25404 core: add PrimaryConnectionType property to NMManager (bgo #739080)
This will provide an extremely easy way for applications to find out
what type of connection the system is currently using.  They might want
to do this to avoid using data if a phone is on a 3G connection, for
example.

Having this as a separate property provides at least two advantages:

 1) it reduces code complexity for those wanting only this one simple
    piece of information

 2) we could allow access to this property (but nothing else) to
    privilege-separated applications in the future

This patch adds the missing nm_active_connection_get_connection_type()
which was in the header file but never actually implemented.

https://bugzilla.gnome.org/show_bug.cgi?id=739080
2014-10-23 13:39:08 -05:00
Dan Winship
862d4efeac libnm-core, core: move NMManagerError to nm-errors
Move the definition of NMManagerError to nm-errors, register it with
D-Bus, and verify in the tests that it maps correctly.

NM_MANAGER_ERROR_INTERNAL gets renamed to NM_MANAGER_ERROR_FAILED for
consistency. NM_MANAGER_ERROR_UNMANAGED_DEVICE is dropped since that
name doesn't really describe the one place it was previously used in.
NM_MANAGER_ERROR_SYSTEM_CONNECTION is dropped because it was't being
used. NM_MANAGER_ERROR_UNSUPPORTED_CONNECTION_TYPE is dropped because
it can be replaced with an NM_CONNECTION_ERROR.
NM_MANAGER_ERROR_AUTOCONNECT_NOT_ALLOWED is turned into the more
generic NM_MANAGER_ERROR_CONNECTION_NOT_AVAILABLE.

Also, remove the <tp:possible-errors> sections from nm-manager.xml,
since they were completely out of date.
2014-10-22 08:29:09 -04:00
Thomas Haller
bdea7d61d0 logging: add new logging level "TRACE"
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-05 18:24:36 +02:00
Dan Winship
6793a32a8c libnm: port to GDBus
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).
2014-09-18 11:51:09 -04:00
Thomas Haller
b5ffcf46f1 doc: update documentation to show all logging domains
Also, mention the deprecated alias HW in man/NetworkManager.conf

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-12 19:12:28 +02:00
Dan Williams
a59ccc4cbb api/core: add Devices property to the Manager 2014-01-23 17:34:12 -06:00
Dan Williams
f0149b6372 core: enforce permissions for SetLogging
This was always protected by D-Bus policy permissions, but just to
be paranoid, ensure it's also protected by explicit checks on the UID.
2014-01-23 16:48:19 -06:00
Dan Winship
fc2a14d0f9 logging: allow per-domain log level overrides
Allow specifying log domains like "DEFAULT,WIFI:DEBUG" to override the
log level on a per-domain basis.
2013-12-20 10:04:10 -05:00
Dan Williams
308f2c08dd Revert "core: add Devices property to Manager"
This reverts commit c1768154c4.

Not supposed to be committed yet, see dcbw/dbus-properties for the
real patch.
2013-11-25 15:19:09 -06:00
Dan Williams
c1768154c4 core: add Devices property to Manager
Helps other bindings.
2013-11-25 11:59:13 -06:00
Dan Williams
35124dbb14 core: extend ActivateConnection to allow NULL connection paths
When called with a connection path, activates that connection.

When called without a connection path, picks the best available
connection to activate for that device.

Doesn't work with VPN connections because they don't have devices.
2013-10-31 15:33:58 -05:00
Dan Winship
8267f5d198 core: add NMManager:primary-connection and :activating-connection
Add properties to track the "primary" connection (ie, the active
connection with either the default route, or the route to the VPN with
the default route), and the active connection that is currently
activating, and likely to become the :primary-connection when it
completes.

https://bugzilla.gnome.org/show_bug.cgi?id=704841
2013-08-28 11:01:13 -04:00
Dan Winship
07521da591 core: provide additional network connectivity information
NM_STATE_CONNECTED_SITE doesn't distinguish between "behind a captive
portal" and "limited network connectivity" (ie, connected to a router
that has lost its upstream connection). Add a new NMManager
:connectivity property to provide this information.

Also add a CheckConnectivity method, which can be used to force NM to
re-check the connectivity state, which could be called by a client
after it completed a portal login, or fixed a network problem.
2013-08-28 10:54:08 -04:00
Dan Winship
bc091f2f3e core: add NMManager:startup property
Add a property on NMManager indicating that it is currently starting
up and activating startup-time/boot-time network connections.

"startup" is initially TRUE, and becomes FALSE once all NMDevices
report that they have no pending activity (eg, trying to activate,
waiting for a wifi scan to complete, etc). This is tracked via a new
NMDevice:has-pending-activity property, which is maintained partially
by the device itself, and partially by other parts of the code.
2013-08-16 17:27:34 -04:00
Jiří Klimeš
eb50c69129 introspection: update logging domains description 2013-01-09 16:47:49 +01:00
Jiří Klimeš
2952c09902 core: add GetLogging() D-Bus call to org.freedesktop.NetworkManager
Returns current logging level and domains set.
2013-01-09 16:47:49 +01:00
Dan Williams
310880a104 api: fix up node names
Not sure if it really makes a difference, but...
2011-08-06 10:46:21 +02:00
Dan Williams
9ee83c18aa api: clarify usage of SetLogging 2011-05-04 17:22:05 -05:00
Dan Williams
8cce42f2a5 core: add GetDeviceByIpIface method
Allow clients to get a device by its IP interface name instead
of having to get the device list and iterate through each one,
and read the interface name to get what they want.
2011-04-22 12:29:07 -05:00
Dan Williams
62ad893a4a core: bring the state() D-Bus method back
It's a lot easier for app developers to use.
2011-03-08 12:57:35 -06: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
Dan Williams
a661f78890 api: remove deprecated methods and signals
sleep, wake, StateChange, all deprecated in 0.8, are now removed.

sleep & wake are replaced with the Sleep() method, while
StateChange is replaced with the StateChanged signal which has
the same arguments.
2011-02-14 17:33:16 -06:00
Dan Williams
f9ceafd4a1 Merge remote branch 'origin/master' into rm-userset 2011-01-12 15:46:37 -06:00
Dan Williams
215306f5a1 core: add AddAndActivate D-Bus method
Given connection details, complete the connection as well as possible
using the given specific object and device, add it to system
settings, and activate it all in one method.
2011-01-10 23:39:12 -06:00
Dan Williams
0587ef1179 Merge remote branch 'origin/master' into wimax 2011-01-02 17:24:23 -06:00
Dan Williams
8b41f70dd5 Merge remote branch 'origin/master' into rm-userset 2010-09-27 10:30:46 -05:00
Jiří Klimeš
facf6b176f core: add Version property to org.freedesktop.NetworkManager interface 2010-09-27 10:34:56 +02: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
ae4b47ca99 core: PolicyKit protect Deactivate and Disconnect 2010-06-04 00:42:10 -07:00
Dan Williams
65818d517e core: PolicyKit-protect sleep/wake
Default to 'not allowed', distros that need backwards compatibility
can flip this to 'yes' if they need to. At this point, only power
management scripts should call these functions.
2010-05-29 23:11:45 -07:00