Commit Graph

76 Commits

Author SHA1 Message Date
Thomas Haller
55ae69233d all: add connection.multi-connect property for wildcard profiles
Add a new option that allows to activate a profile multiple times
(at the same time). Previoulsy, all profiles were implicitly
NM_SETTING_CONNECTION_MULTI_CONNECT_SINGLE, meaning, that activating
a profile that is already active will deactivate it first.

This will make more sense, as we also add more match-options how
profiles can be restricted to particular devices. We already have
connection.type, connection.interface-name, and (ethernet|wifi).mac-address
to restrict a profile to particular devices. For example, it is however
not possible to specify a wildcard like "eth*" to match a profile to
a set of devices by interface-name. That is another missing feature,
and once we extend the matching capabilities, it makes more sense to
activate a profile multiple times.

See also https://bugzilla.redhat.com/show_bug.cgi?id=997998, which
previously changed that a connection is restricted to a single activation
at a time. This work relaxes that again.

This only adds the new property, it is not used nor implemented yet.

https://bugzilla.redhat.com/show_bug.cgi?id=1555012
2018-08-08 11:24:29 +02:00
Javier Arteaga
54df43ed52 core: introduce NMDeviceWireGuard
For now, the device only exposes partial link status (not including
peers). It cannot create new links.
2018-08-06 08:34:27 +02:00
Beniamino Galvani
53c2951f61 device: configure SR-IOV 2018-07-11 16:16:22 +02:00
Beniamino Galvani
d6483592b8 libnm: introduce NMTernary enum
Add a new enum that can be used where we need a boolean value that can
be overridden globally.
2018-07-11 16:16:22 +02:00
Beniamino Galvani
3f9f9f7fa2 ip-tunnel: add support for ip6gre and ip6gretap tunnel connections 2018-07-02 17:55:14 +02:00
Beniamino Galvani
f9199c7fb5 ip-tunnel: add support for gretap tunnel connections 2018-07-02 17:55:14 +02:00
Timothy Redaelli
9be0c3330d contrib/rpm: Use Open vSwitch instead of OpenVSwitch
The correct naming is Open vSwitch so use it instead of OpenVSwitch

[lkundrak@v3.sk: added some more cases of the same]

https://github.com/NetworkManager/NetworkManager/pull/150

Fixes: 830a5a14cb
2018-06-28 20:31:32 +02:00
Lubomir Rintel
b7173ad7a7 devices: add NMDevice6Lowpan 2018-06-26 16:21:55 +02:00
Lubomir Rintel
56a6c53de0 introspection: add o.fd.NM.Device.Lowpan interface
It's for 6LoWPAN devices. "o.fd.NM.Device.6Lowpan" wouldn't be a valid
interface name -- just skip the leading numeral, that's what kernel also
does on similiar occassions.
2018-06-26 16:21:55 +02:00
Lubomir Rintel
179909a4f2 devices: add NMDeviceWpan 2018-06-26 16:21:54 +02:00
Lubomir Rintel
9a92468ac2 introspection: add o.fd.NM.Device.Wpan interface 2018-06-26 16:21:54 +02:00
Beniamino Galvani
1b5925ce88 all: remove consecutive empty lines
Normalize coding style by removing consecutive empty lines from C
sources and headers.

https://github.com/NetworkManager/NetworkManager/pull/108
2018-04-30 16:24:52 +02:00
Thomas Haller
aae483c0a9 settings: add NMSettingsConnectionFlags flags
Up to now, it was not visible on D-Bus whether a connection
was generated by NetworkManager and/or volatile.

That is for example interesting for firewalld, which aims
to store persistant configuration in NetworkManager's profile.
However, that doesn't make sense for external connections
(which are nm-generated & volatile). In fact, it probably
makes no sense for volatile connections in general, because
modifying them, likely makes them non-volatile (depending on
how the profile is modified).

Also, the Update2() D-Bus operation allows to carefully
make connections volatile and unsaved. As we have public
API to set these flags, we should also expose them on D-Bus.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1460295
2018-04-16 15:30:07 +02:00
Thomas Haller
acc8244ca2 all: add D-Bus property "Flags" for Settings.Connection interface
The D-Bus interface already has a boolean property "Unsaved".

While that is nicer too look at (in the API), adding a new flag
is very cumbersome, and also has more overhead. For example,
it requires extending the D-Bus API, all the way down to libnm.

Add a flags argument, that will allow to add future boolean
flags easier.
2018-04-16 15:30:07 +02:00
Thomas Haller
ab8312a18e checkpoint: generate GIR information for NMCheckpointCreateFlags
Note that this changes API for checkpoint_create_async() in Python
via GIR. Previously it would require an integer argument, now a flags
argument. But this API is still unstable, it will be introduced with
1.12.
2018-04-04 14:02:13 +02:00
Thomas Haller
5c283356a1 checkpoint: allow overlapping checkpoints
Introduce a new flag NM_CHECKPOINT_CREATE_FLAG_ALLOW_OVERLAPPING
that allows the creation of overlapping checkpoints. Before, and
by default, checkpoints that reference a same device conflict,
and creating such a checkpoint failed.

Now, allow this. But during rollback automatically destroy all
overlapping checkpoints that were created after the checkpoint
that is about to rollback.

With this, you can create a series of checkpoints, and rollback them
individually. With the restriction, that if you once rolled back to an
older checkpoint, you no longer can roll"forward" to a younger one.

What this implies and what is new here, is that the checkpoint might be
automatically destroyed by NetworkManager before the timeout expires. When
the user later would try to manually destroy/rollback such a checkpoint, it
would fail because the checkpoint no longer exists.
2018-04-04 14:02:13 +02:00
Beniamino Galvani
aa820e9386 all: add more meaningful error code for unsupported IP method
Add a new device state reason code for unsupported IP method. It is
returned, for example, when users select manual IP configuration for
WWAN connections:

 # nmcli connection mod Gsm ipv4.method manual ipv4.address 1.2.3.4/32
 # nmcli connection up Gsm
 Error: Connection activation failed: The selected IP method is not
 supported

compared to the old:

 Error: Connection activation failed: IP configuration could not be
 reserved (no available address, timeout, etc.)

Note that we could instead fail the connection validation if the
method is not supported by the connection type, but adding such
limitation now could make existing connections invalid.

https://bugzilla.redhat.com/show_bug.cgi?id=1459529
2017-12-21 10:02:07 +01:00
Thomas Haller
35dc6421de settings: support setting a connection as volatile via Update2()
Extend the Update2 flags to allow marking a connection as volatile.
Making a connection as volatile means that the connection stays alive
as long as an active connection references it.

It is correct that Update2() returns before the connection is actually
deleted. It might take an arbitrary long time until the volatile
mechanism cleans up the connection.

Also add two more IN_MEMORY flags: "detached" and "only".

The existing NM_SETTINGS_UPDATE2_FLAG_IN_MEMORY would not detach nor
delete the possible file on disk. That is, the mode only changes what NM
thinks is the current content of the connection profile. It would not delete
the file on disk nor would it detach the profile in-memory from the file.
As such, later persisting the connection again to disk would overwrite
the file, and deleting the profile, would delete the file.

Now add two new IN_MEMORY modes.

NM_SETTINGS_UPDATE2_FLAG_IN_MEMORY_DETACH is like making the connection
in-memory only, but forgetting that there might be any profile on disk.
That means, a later Delete() would not delete the file. Similarly, a
later Update2() that persists the connection again, would not overwrite
the existing file on disk, instead it would choose a new file name.

On the other hand, NM_SETTINGS_UPDATE2_FLAG_IN_MEMORY_ONLY would delete
a potential file from disk right away.

It's clear that "volatile" only makes sense with either "in-memory-detached"
or "in-memory-only". That is, the file on disk should be deleted right away
(before the in-memory part is garbage collected) or the file on disk should
be forgotten.
2017-12-05 20:18:10 +01:00
Thomas Haller
8bb95a8365 settings: add NM_SETTINGS_UPDATE2_FLAG_BLOCK_AUTOCONNECT flag 2017-12-05 19:57:24 +01:00
Thomas Haller
98ee18d888 all: add new D-Bus API org.freedesktop.NetworkManager.Settings.Connection.Update2()
We already have Update(), UpdateUnsaved() and Save(), which serve
similar purposes. We will need a form of update with another argument.

Most notably, to block autoconnect while doing the update.

Other use cases could be to prevent reapplying connection.zone and
connection.metered, to to reapply all changes.

Instead of adding a specific update function that only serves that
new use-case, add a extensible Update2() function. It can be extended
to cope with future variants of update.
2017-12-05 11:50:52 +01:00
Beniamino Galvani
12a49cbdc7 device: add a new state-reason for DAD failures 2017-11-09 22:26:17 +01:00
Beniamino Galvani
c3efedf54b libnm: add checkpoint support 2017-11-09 10:12:30 +01:00
Lubomir Rintel
d0cb2050f3 all: add OVSDB connection failure device state reason 2017-10-30 17:40:09 +01:00
Lubomir Rintel
b5925d693c introspection: add o.fd.NM.Device.OvsBridge interface 2017-10-30 17:40:08 +01:00
Lubomir Rintel
6748c44cb6 introspection: add o.fd.NM.Device.OvsPort interface 2017-10-30 17:40:08 +01:00
Lubomir Rintel
b0f3dc0add introspection: add o.fd.NM.Device.OvsInterface interface 2017-10-30 17:40:08 +01:00
Thomas Haller
cc1ee1d286 all: rework configuring route table support by adding "route-table" setting
We added "ipv4.route-table-sync" and "ipv6.route-table-sync" to not change
behavior for users that configured policy routing outside of NetworkManager,
for example, via a dispatcher script. Users had to explicitly opt-in
for NetworkManager to fully manage all routing tables.

These settings were awkward. Replace them with new settings "ipv4.route-table"
and "ipv6.route-table". Note that this commit breaks API/ABI on the unstable
development branch by removing recently added API.

As before, a connection will have no route-table set by default. This
has the meaning that policy-routing is not enabled and only the main table
will be fully synced. Once the user sets a table, we recognize that and
NetworkManager manages all routing tables.

The new route-table setting has other important uses: analog to
"ipv4.route-metric", it is the default that applies to all routes.
Currently it only works for static routes, not DHCP, SLAAC,
default-route, etc. That will be implemented later.

For static routes, each route still can explicitly set a table, and
overwrite the per-connection setting in "ipv4.route-table" and
"ipv6.route-table".
2017-10-09 22:05:36 +02:00
Thomas Haller
2f1ab058f1 core: add NMActivationStateFlags "master-has-slaves" 2017-10-05 11:50:31 +02:00
Thomas Haller
50c62edccb core: add NMActivationStateFlags "layer2-ready", "ip4-ready", and "ip6-ready" 2017-10-05 11:50:31 +02:00
Thomas Haller
e96df2c927 core: add NMActivationStateFlags "is-master" and "is-slave" 2017-10-05 11:50:31 +02:00
Thomas Haller
817a45bfe6 libnm: add NMActivationStateFlags
No flags yet implemented.

https://bugzilla.redhat.com/show_bug.cgi?id=1454883
2017-10-05 11:50:31 +02:00
Thomas Haller
c71f26bf92 libnm,cli: add IP setting "route-table-sync" 2017-09-26 19:39:36 +02:00
Beniamino Galvani
df72cad107 device: add NMDevicePPP
The new device type represents a PPP interface, and will implement the
activation of new-style PPPoE connections, i.e. the ones that don't
claim the parent device.
2017-08-05 08:03:15 +02:00
Beniamino Galvani
7382441433 checkpoint: document flags availability
Flags DELETE_NEW_CONNECTIONS and DISCONNECT_NEW_DEVICES were added in
1.6, document that.

https://bugzilla.redhat.com/show_bug.cgi?id=1474039
2017-07-25 23:11:38 +02:00
Lubomir Rintel
1194641afe dbus/secret-agent: add a flag indicating WPS PBC is active
The agents may used this to learn that WPS PBC enrollment is active and
suggest that user pushes a button on the router instead of supplying a
network key.
2017-05-15 12:59:55 +02:00
Lubomir Rintel
36b6bbdae3 dbus: add WPS methods to AP flags
Will be used to indicate WPS method discovered to be supported by the
access point.
2017-05-15 12:59:55 +02:00
Beniamino Galvani
2409de0bb1 all: detect SR-IOV device support
(cherry picked from commit f13fd4524c)
2017-04-19 08:49:37 +02:00
Lubomir Rintel
8b649a8c84 active-connection: emit a StateChanged signal on state changes
It includes a reason code that makes it possible for the clients to be
more reasonable about error messages.

The reason code is essentially copied from the VPN, plus three more
reasons that were useful for non-VPN connections.
2017-03-17 10:21:19 +01:00
Beniamino Galvani
b42f780e04 core: add support for dummy devices
Add support for creating dummy devices. This commit adds a D-Bus
interface 'org.freedesktop.NetworkManager.Device.Dummy' which is used
primarily for determining the device type but does not carry any
properties.
2017-02-22 21:05:04 +01:00
Lubomir Rintel
568c4f3e49 dbus: improve the connectivity check and manager state documentation
This hopefully clears up the confusion between Connectivity and State
properties.
2017-02-16 15:44:28 +01:00
Beniamino Galvani
67adbda83e core,libnm: introduce NMDeviceMacsec
At the moment the device only exposes the current link status, but
cannot create new links.
2017-01-16 17:37:14 +01:00
Thomas Haller
9d2207b46d libnm: explicitly set enum values in public nm-dbus-interface.h headers
Previously, due to a bug in "tools/enums-to-docbook.pl", enum values
without explicit numeric value were wrongly parsed. That is fixed,
but still explicitly set the value in the public header.
2017-01-04 09:33:57 +01:00
Beniamino Galvani
a8d6005256 libnm: implement support for DNS manager properties 2016-12-12 22:06:24 +01:00
Beniamino Galvani
ddeef464af checkpoint: introduce new flags to better restore previous state
When a global checkpoint is created (one with empty device list) we
save the status of all devices to restore it later. After the
checkpoint new interfaces and connections may appear and they can
significantly influence the overall networking status, but we don't
consider them at the moment.

Introduce a new flag DELETE_NEW_CONNECTIONS to delete any connection
added after the checkpoint and similarly a DISCONNECT_NEW_DEVICES to
ensure that the connection active on newly appeared devices doesn't
disrupt network connectivity.

https://bugzilla.redhat.com/show_bug.cgi?id=1378393
2016-10-24 09:57:18 +02:00
Thomas Haller
e152eea218 build: fix breakage of enums-to-docbook.pl script for NMCapability enum
GEN      nm-dbus-types.xml
    Documentation for value '*' missing at ../tools/enums-to-docbook.pl line 134, <> line 95.
    Makefile:1579: recipe for target 'nm-dbus-types.xml' failed

Fixes: 93a753e311
2016-09-23 19:11:45 +02:00
Thomas Haller
93a753e311 capabilities: add comment about capability range 2016-09-23 16:09:06 +02:00
Thomas Haller
ab26248080 capabilities: fix number for NM_CAPABILITY_TEAM
The enum defines should name their numerical value explicitly,
so that it can be easily seen by looking at the code. Also,
they are public, stable API. They must not change.

Anyway, the capability 0 shall be reserved. Change NM_CAPABILITY_TEAM
to value 1.
2016-09-23 15:49:52 +02:00
Marius Vollmer
2ca1ce5d88 team: Add NM_CAPABILITY_TEAM 2016-09-23 15:49:52 +02:00
Marius Vollmer
1bb00ae66a manager: Add "Capabilities" property 2016-09-23 15:49:52 +02:00
Alfonso Sanchez-Beato
24b193ab64 device: add statistics interface
Add statistics interface to all device instances. When active, the
properties of this interface are refreshed whenever there is network
activity for the device.

Activation is performed by changing RefreshRateMs property. If set to
zero, the interface is deactivated. If set to other value, the rest of
the interface properties are refreshed whenever the related network
metric changes, being RefreshRateMs the minimum time between property
changes, in milliseconds.
2016-08-17 15:50:20 +02:00