Commit Graph

15047 Commits

Author SHA1 Message Date
Dan Williams
42c7ea85a1 cli: add support for 'nmcli con up ifname XXX'
Passes a NULL connection to nm_client_activate_connection() allowing
NetworkManager to pick the best available connection for the interface.
2013-10-31 15:45:20 -05:00
Dan Williams
4ec5f5c8e3 libnm-glib: add support for NULL connections to nm_client_activate_connection()
Pass along to NetworkManager, which picks the best available connection for the
device and activates it.
2013-10-31 15:33:58 -05: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 Williams
f4befaab00 core: also check specific object when determining available connections 2013-10-31 15:33:57 -05:00
Dan Williams
8a173e1d7a core: removal of PendingActivation object from nm-manager.c (bgo #707335)
This branch decouples NMActiveConnection creation from device activation
so that the NMActiveConnection object tracks the entire activation request
(either internally-requested by the Policy or externally via D-Bus) from
start to finish, instead of the previous situation where the PendingActivation
handled D-Bus requests separately.  This also will allow implementation of
the DEACTIVATING state in the future.  The NMActiveConnection object tracking
the activation is not actually exported to D-Bus until the device or VPN
activation is completely authorized and actually begins.

It also encapsulates all the details needed to authorize a request into
a new NMAuthSubject class, replacing various "dbus_sender" and "user_requested"
arguments throughout the code.
2013-10-31 15:25:38 -05:00
Dan Williams
b3c0756f79 trivial: add logging for ActiveConnection master-ready tracking 2013-10-31 14:55:32 -05:00
Dan Williams
ff7e47a418 core: kill PendingActivation and move authorization to NMActiveConnection
Besides killing PendingActivation, this patch decouples ActiveConnection
creation from actually activating that connection.  This allows the
ActiveConnection to complete authorization asynchronously.  This will
also be used in the future for handling the DEACTIVATING state of devices
(for "pre-down" functionality).
2013-10-31 14:55:32 -05:00
Dan Williams
625008e486 policy: track secondary activations by ActiveConnection not path
ActiveConnections will (soon) not have a D-Bus path on creation, but
only when they are exported after authorization is complete.  That
means we can't rely on their dbus path in the secondaries code.
Instead, track them directly since the path may be NULL.
2013-10-31 14:15:09 -05:00
Dan Williams
8242b79f29 policy: only clean up VPN DNS/routing configuration if the VPN got connected
It's pointless and wrong to try to clean up DNS and routing configuration
if the VPN never got to the point of retrieving that from the server.
2013-10-31 14:15:09 -05:00
Dan Williams
1b37cd0340 core: allow ActiveConnections to be created without a device
The device may not be created yet (in the case of software devices)
when the ActiveConnection is created; in that case we still want to
proceed with authorization for the connection, but we'll create the
device when authorization is complete.
2013-10-31 14:15:09 -05:00
Dan Williams
a7bab4015e core: have ActiveConnection track device state instead of subclasses
Both NMActRequest and NMVPNConnection need to track their device's state,
so instead of both subclasses having to do so, consolidate that code into
the superclass.
2013-10-31 14:15:08 -05:00
Dan Williams
1768b3abd5 core: add slave to master in stage1_prepare, not nm_device_activate()
When ActiveConnections take over authentication, it may mean that the
master active connection is still handling authentication when the
slave starts to activate.  Thus the master device may still be in
DISCONNECTED state and not ready to enslave the slave.
2013-10-31 14:15:08 -05:00
Dan Williams
f95bca2dcf core: ensure all devices chain up to parent act_stage1_prepare
We'll be moving some code into the NMDevice implementation soon, which
currently does nothing other than return success.
2013-10-31 14:15:08 -05:00
Dan Williams
087e1dfbb9 core: indicate via a property when master connections are ready for slaves
Add a 'master-ready' property to NMActiveConnection that NMDevice can
watch for to indicate that the master connection/device is ready to accept
slaves.  Since the slave device's ActiveConnection is already tracking
its master connection, and since ActiveConnections don't enter the
ACTIVATING state until their device is ready for slaves, it's pretty
trivial to implement this property.
2013-10-31 14:15:08 -05:00
Dan Williams
ae116d847e core: allow ActiveConnection connection to be changed
For the case of AddAndActivate, which needs to set the final connection
after authentication is done and NMSettings has returned the final
connection.
2013-10-31 14:15:08 -05:00
Dan Williams
8252357dd1 core: watch master ActiveConnections and follow master deactivation 2013-10-31 14:15:08 -05:00
Dan Williams
3bb2b158cd core: switch NMActiveConnection master to an NMActiveConnection instead of NMDevice
We need to track the master active connection, since it may require authentication
or other operations to complete before the device actually starts activating.
2013-10-31 14:15:08 -05:00
Dan Williams
4237df8c21 core: allow active connection 'master' to be set after object creation
We want to create the object earlier now, and figuring out the master is
a lot of code that we don't want to run before creating the object.  The
master still must be set before exporting the object over D-Bus though,
as before.
2013-10-31 14:15:08 -05:00
Dan Williams
4b8cd481dc core: add authorization code to NMActiveConnection
In preparation for killing PendingActivation; copy and rework the
PendingActivation authorization code for NMActiveConnection.
2013-10-31 14:15:08 -05:00
Dan Williams
0e595abcf3 core: pass NMAuthSubject around activation paths instead of uid + dbus sender 2013-10-31 14:15:08 -05:00
Dan Williams
bcef423174 core: use NMAuthSubject in D-Bus triggered activation paths 2013-10-31 14:15:08 -05:00
Dan Williams
1126e22572 core: remove unused auth chain creation functions
No longer used by anything.
2013-10-31 14:15:08 -05:00
Dan Williams
07b07a988a core: use NMAuthSubject in the manager for non-activation paths 2013-10-31 14:15:08 -05:00
Dan Williams
e672401315 settings: use NMAuthSubject in NMSettings 2013-10-31 14:15:07 -05:00
Dan Williams
f403e6afc0 settings: use NMAuthSubject in NMSettingsConnection 2013-10-31 14:15:07 -05:00
Dan Williams
e39435a596 agents: use NMAuthSubject 2013-10-31 14:15:07 -05:00
Dan Williams
7fe84e0ec7 core: add function to create auth chains from a subjects or contexts
The subject already contains all the information we need.
2013-10-31 14:15:07 -05:00
Dan Williams
49d098f29d core: add NMAuthSubject object to encapsulate authentication info
This object encapsulates all authentication information we need
about some entity that requests that NetworkManager perform an
action on its behalf.
2013-10-31 14:15:07 -05:00
Dan Williams
7a9d5a262a core: grab remote process id when authenticating D-Bus clients 2013-10-31 14:15:07 -05:00
Dan Williams
a007292937 core: move VPN active connection creation to the manager
Eventually the manager will create both NMActRequest and
NMVPNConnection subclasses directly, instead of leaving
NMVPNConnection creation to the VPN manager.

This also ensures that VPN connections get their user_requested
attribute set correctly, which wasn't happening before in the
case of secondary VPN connections.
2013-10-31 14:15:07 -05:00
Dan Williams
3660a80c29 core: export new active connection from the manager
When we eventually do authorization in the ActiveConnection itself,
we want to make sure the AC doesn't get exported until everything
is authorized.  Thus let the manager handle exporting the objects
since it knows when the AC will be authorized or not.
2013-10-31 14:15:07 -05:00
Dan Williams
f6f626de34 core: ensure active connection has a device before exporting it 2013-10-31 14:15:07 -05:00
Dan Williams
428ebf42b0 core: simplify NMActRequest
The 'connection' and 'device' private variables aren't needed since
they will always be available through the NMActiveConnection
superclass.
2013-10-31 14:15:07 -05:00
Dan Williams
6413241ff2 core: handle NULL object paths in NMActiveConnection
NM uses "/" to mean a NULL object path, since you can't pass
NULL object paths through D-Bus.  The AC code didn't handle that
and we'll soon be passing object paths from D-Bus into it.
2013-10-31 14:15:07 -05:00
Dan Williams
4e4e14e65c core: more flattening of PendingActivation objects
Do less authentication in the PA and make the DBusGMethodInvocation
opaque to the PA.  This pushes the responsibility for replying to
the D-Bus method call closer to the D-Bus method handler instead
of stuffing it all into the PA.  This does mean we need to get
the D-Bus sender name and the sender UID and pass that into the
pending_activation_new(), but we'll clean that up in a bit.
2013-10-31 14:15:07 -05:00
Dan Williams
f94ac164a6 core: make nm_manager_activate_connection() take a Device, not a path
Simpler; everywhere that called it has an NMDevice already anyway.
2013-10-31 14:15:07 -05:00
Dan Williams
a878cd8145 core: move connection completion code closer to callers
Move the connection completion code out of the PendingActivation
object and into the D-Bus method handler for AddAndActivate.  This is
part of simplifying PendingActivation so we can fold its functionality
into NMActiveConnection and use the AC objects to track all activation
requests from start to finish.

This also requires a bit of reorganization since the PA used to handle
some of the request validation but that now needs to be handled by
each DBus method itself.

Previously the PA tracked the connection path, but that's really
quite unecessary, we might as well just track the actual connection
object itself.  This allows us to only validate the path once, instead
of three times like the code did before.  This does require a boolean
"add_and_activate" variable though, because the PA handles the DBus
method return and it needs to know whether the request came from
ActivateConnection or AddAndActivateConnection, which was previously
handled by checking pending->connection, which only AddAndActivate set.
2013-10-31 14:15:07 -05:00
Dan Williams
df406d06b6 dcb: merge DCB/FCoE core functionality (bgo #710422) (rh #799241)
Add DCB setting and associated logic to propagate those settings to
dcbtool.  At the moment we don't use dcbnl to talk directly to the
kernel, because some devices do parts of DCB/LLDP in userland and
thus need lldpad running, which dcbtool talks to.
2013-10-31 13:39:03 -05:00
Dan Williams
2e9fde3c28 core: set up and tear down DCB/FCoE when DCB is enabled 2013-10-31 13:29:22 -05:00
Dan Williams
64a7a045b3 core: add dcbtool manipulation logic 2013-10-31 13:29:22 -05:00
Dan Williams
3e6906e773 logging: add DCB log domain 2013-10-31 13:29:21 -05:00
Dan Williams
a3bd6df05f ifcfg-rh: add DCB setting reader and writer
See 'ifcfg-test-dcb' for details on all supported options.
2013-10-31 13:29:21 -05:00
Dan Williams
77e50740a8 libnm-util: add Data Center Bridging (DCB) setting
Includes various fixes & cleanups from Thomas Haller.
2013-10-31 13:28:42 -05:00
Jiří Klimeš
229e3fbe32 man: typo fix wil -> will 2013-10-31 14:15:21 +01:00
Jiří Klimeš
20a9723c70 man: fix 'nmcli con reload' description in nmcli manual page
Pointed out by swadeley@redhat.com
2013-10-31 14:14:03 +01:00
Stephen Wadeley
52ad4ec577 man: some improvements to language and style in nmcli-examples manual page
Signed-off-by: Stephen Wadeley <swadeley@redhat.com>
2013-10-31 13:24:22 +01:00
Stephen Wadeley
b752252fc4 man: some improvements to language and style in nmcli manual page
Signed-off-by: Stephen Wadeley <swadeley@redhat.com>
2013-10-31 13:19:53 +01:00
Enrico Nicoletto
08d77ad71e po: updated Brazilian Portuguese (pt_BR) translation (bgo #711185)
https://bugzilla.gnome.org/show_bug.cgi?id=711185

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-10-31 13:17:29 +01:00
Jiří Klimeš
375220cae1 cli: TAB-complete devices for 'activate' command in the editor 2013-10-31 09:00:56 +01:00
Jiří Klimeš
8d9718bd0f cli: add 'activate' menu command for interactive editor (rh #1004883)
This command allows activating the edited connection.

Monitoring the progress of the activation is a bit complicated by the fact
that the callback activate_connection_editor_cb() is invoked in main loop
thread, and not in the editor thread itself.

https://bugzilla.redhat.com/show_bug.cgi?id=1004883
2013-10-31 08:53:56 +01:00