Commit graph

22 commits

Author SHA1 Message Date
Fernando Fernandez Mancera 5426bdf4a1 HSR: add support to HSR/PRP interface
This patch add support to HSR/PRP interface. Please notice that PRP
driver is represented as HSR too. They are different drivers but on
kernel they are integrated together.

HSR/PRP is a network protocol standard for Ethernet that provides
seamless failover against failure of any network component. It intends
to be transparent to the application. These protocols are useful for
applications that request high availability and short switchover time
e.g electrical substation or high power inverters.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1791
2023-12-05 08:05:56 +01:00
Wen Liang e8618f03d7
support loopback interface
Support managing the loopback interface through NM as the users want to
set the proper mtu for loopback interface when forwarding the packets.
Additionally, the IP addresses, DNS, route and routing rules are also
allowed to configure for the loopback connection profiles.

https://bugzilla.redhat.com/show_bug.cgi?id=2060905
2022-11-23 20:51:22 +01:00
Thomas Haller 8bfe1ebcec
build/introspection: cleanup dependencies for libnmdbus in meson 2021-02-24 12:50:25 +01:00
Thomas Haller 5f9d4e23a3
meson: remove unused variables from "introspection/meson.build" 2021-01-27 16:03:42 +01:00
Thomas Haller 977ea352a0
all: update deprecated SPDX license identifiers
These SPDX license identifiers are deprecated ([1]). Update them.

[1] https://spdx.org/licenses/

  sed \
     -e '1 s%^/\* SPDX-License-Identifier: \(GPL-2.0\|LGPL-2.1\)+ \*/$%/* SPDX-License-Identifier: \1-or-later */%' \
     -e '1,2 s%^\(--\|#\|//\) SPDX-License-Identifier: \(GPL-2.0\|LGPL-2.1\)+$%\1 SPDX-License-Identifier: \2-or-later%' \
     -i \
     $(git grep -l SPDX-License-Identifier -- \
         ':(exclude)shared/c-*/' \
         ':(exclude)shared/n-*/' \
         ':(exclude)shared/systemd/src' \
         ':(exclude)src/systemd/src')
2021-01-05 09:46:21 +01:00
Thomas Haller 595c5854ad
introspection: avoid compiler warning in generated introspection files
Disable "-Wincompatible-pointer-types-discards-qualifiers" warning, as
this breaks build of the gdbus-codegen files.

With glib2-2.67.0-1.fc34.x86_64.rpm, clang-11.0.0-2.fc34.x86_64.rpm, we
get a failure to build generated code:

    introspection/org.freedesktop.NetworkManager.AccessPoint.c:438:1: error: passing 'typeof (*(&g_define_type_id__volatile)) *' (aka 'volatile unsigned long *') to parameter of type 'gsize *' (aka 'unsigned long *') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    G_DEFINE_INTERFACE (NMDBusAccessPoint, nmdbus_access_point, G_TYPE_OBJECT)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/gobject/gtype.h:1784:47: note: expanded from macro 'G_DEFINE_INTERFACE'
    #define G_DEFINE_INTERFACE(TN, t_n, T_P)                    G_DEFINE_INTERFACE_WITH_CODE(TN, t_n, T_P, ;)
                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/gobject/gtype.h:1803:61: note: expanded from macro 'G_DEFINE_INTERFACE_WITH_CODE'
    #define G_DEFINE_INTERFACE_WITH_CODE(TN, t_n, T_P, _C_)     _G_DEFINE_INTERFACE_EXTENDED_BEGIN(TN, t_n, T_P) {_C_;} _G_DEFINE_INTERFACE_EXTENDED_END()
                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/gobject/gtype.h:2042:7: note: expanded from macro '_G_DEFINE_INTERFACE_EXTENDED_BEGIN'
      if (g_once_init_enter (&g_define_type_id__volatile))  \
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/glib/gthread.h:260:7: note: expanded from macro 'g_once_init_enter'
        (!g_atomic_pointer_get (location) &&                             \
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/glib/gatomic.h:112:38: note: expanded from macro 'g_atomic_pointer_get'
        __atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \
                                         ^~~~~~~~~~~~~~~~~
    introspection/org.freedesktop.NetworkManager.AccessPoint.c:944:1: error: passing 'typeof (*(&g_define_type_id__volatile)) *' (aka 'volatile unsigned long *') to parameter of type 'gsize *' (aka 'unsigned long *') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    G_DEFINE_TYPE_WITH_CODE (NMDBusAccessPointProxy, nmdbus_access_point_proxy, G_TYPE_DBUS_PROXY,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/gobject/gtype.h:1615:56: note: expanded from macro 'G_DEFINE_TYPE_WITH_CODE'
    #define G_DEFINE_TYPE_WITH_CODE(TN, t_n, T_P, _C_)          _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, 0) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/gobject/gtype.h:2032:3: note: expanded from macro '_G_DEFINE_TYPE_EXTENDED_BEGIN'
      _G_DEFINE_TYPE_EXTENDED_BEGIN_REGISTER(TypeName, type_name, TYPE_PARENT, flags) \
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/gobject/gtype.h:2000:7: note: expanded from macro '_G_DEFINE_TYPE_EXTENDED_BEGIN_REGISTER'
      if (g_once_init_enter (&g_define_type_id__volatile))  \
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/glib/gthread.h:260:7: note: expanded from macro 'g_once_init_enter'
        (!g_atomic_pointer_get (location) &&                             \
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/glib/gatomic.h:112:38: note: expanded from macro 'g_atomic_pointer_get'
        __atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \
                                         ^~~~~~~~~~~~~~~~~
    introspection/org.freedesktop.NetworkManager.AccessPoint.c:1729:1: error: passing 'typeof (*(&g_define_type_id__volatile)) *' (aka 'volatile unsigned long *') to parameter of type 'gsize *' (aka 'unsigned long *') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    G_DEFINE_TYPE_WITH_CODE (NMDBusAccessPointSkeleton, nmdbus_access_point_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/gobject/gtype.h:1615:56: note: expanded from macro 'G_DEFINE_TYPE_WITH_CODE'
    #define G_DEFINE_TYPE_WITH_CODE(TN, t_n, T_P, _C_)          _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, 0) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/gobject/gtype.h:2032:3: note: expanded from macro '_G_DEFINE_TYPE_EXTENDED_BEGIN'
      _G_DEFINE_TYPE_EXTENDED_BEGIN_REGISTER(TypeName, type_name, TYPE_PARENT, flags) \
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/gobject/gtype.h:2000:7: note: expanded from macro '_G_DEFINE_TYPE_EXTENDED_BEGIN_REGISTER'
      if (g_once_init_enter (&g_define_type_id__volatile))  \
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/glib/gthread.h:260:7: note: expanded from macro 'g_once_init_enter'
        (!g_atomic_pointer_get (location) &&                             \
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/glib/gatomic.h:112:38: note: expanded from macro 'g_atomic_pointer_get'
        __atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \
                                         ^~~~~~~~~~~~~~~~~

(cherry picked from commit 03d9ec27fa)
2020-11-23 15:26:47 +01:00
Iñigo Martínez 648155e4a1 license: Add license using SPDX identifiers to meson build files
License is missing in meson build files. This has been added using
SPDX identifiers and licensed under LGPL-2.1+.
2020-02-17 13:16:57 +01:00
Beniamino Galvani 667568d1b2 core,libnm: add VRF support
Add VRF support to the daemon. When the device we are activating is a
VRF or a VRF's slave, put routes in the table specified by the VRF
connection.

Also, introduce a VRF device type in libnm.
2020-01-14 09:51:56 +01:00
Beniamino Galvani a59a8aa033 build: meson: fix dependency to gdbus generated headers
libnm has a dependency on 'libnmdbus_dep', which contains 'link_with:
libnmdbus'. This however only enforces that libnm is linked after the
libnmdbus static library is built; it doesn't give any guarantees
about the compilation phase.

We need to make libnm compilation depend on the generated header
files. The output of 'gnome.gdbus_codegen' is an array with the header
file in the second position; use it to add a proper
dependency. Unfortunately this works only with meson >= 0.46.

In the future libnm will no longer use gdbus generated code and this
dependency will not be needed anymore.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/286
2019-11-20 10:21:22 +01:00
Iñigo Martínez 23b4dc5f77 meson: Rename variables related to pkg-config variables
Some variables belong to variables in their correspondent pkg-config
file.

These variables have been renamed to `dependency_variable` to
reflect the dependency and variables from pkg-config files they are
related to.

Some of these has also been fixed to use paths relative to
installation prefix.
2019-10-01 09:49:33 +02:00
Iñigo Martínez 82e79e40a5 meson: Avoid the use of source_root and build_root methods
The way some directory paths are defined has also been changed to
avoid the use of the `source_root` and `build_root` functions
because they are discouraged[0]

[0] https://wiki.gnome.org/Initiatives/GnomeGoals/MesonPorting
2019-10-01 09:49:33 +02:00
Thomas Haller 69b8036f37 build/meson: fix location of introspection files
With glib < 2.51.3, gdbus-codegen does not understand "--output-directory" [1].
Hence, the generated files are like

    "build/dbus-org.freedesktop.NetworkManager.Device.WifiP2P.xml"

instead of

    "build/introspection/dbus-org.freedesktop.NetworkManager.Device.WifiP2P.xml"

But gnome.gdbus_codegen() returns a path as if it would be inside
"build/introspection". Hack around that, by patching the correct path
otherwise. This is still ugly, because repeated "ninja -C build" calls
will always try to rebuild this target (because the wrong file name
is considered).

See also [2].

[1] ee09bb704f
[2] 2e93ed58c3/mesonbuild/modules/gnome.py (L1170)

(cherry picked from commit ad9e5995e1)
2019-04-18 20:20:46 +02:00
Thomas Haller 09090f2669 wifi-p2p: rename Wi-Fi P2P
After renaming the files, also rename all the content
to follow the "Wi-Fi P2P" naming scheme.
2019-02-01 17:02:57 +01:00
Benjamin Berg 00e64d1332 core/devices: Add P2P Wifi device and peer tracking
This only adds the new device type and simple peer list handling.
2019-01-27 23:45:12 +01:00
Iñigo Martínez 35171b3c3f build: meson: Add trailing commas
Add missing trailing commas that avoids getting noise when another
file/parameter is added and eases reviewing changes[0].

[0] https://gitlab.gnome.org/GNOME/dconf/merge_requests/11#note_291585
2018-12-20 13:50:34 +01:00
Beniamino Galvani dcfddeef7a build: meson: fix generation of api docs
We need to copy all introspection files to the same directory when
building the documentation.

Note that we only require Meson 0.44, but for the documentation at
least 0.46 is needed because of a new functionality of
gnome.gdbus_codegen(). In this way we can still build on Travis CI
(without documentation).
2018-09-28 17:25:46 +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
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 9a92468ac2 introspection: add o.fd.NM.Device.Wpan interface 2018-06-26 16:21:54 +02:00
Thomas Haller 997cce7c90 build: fix glib dependency to require at least 2.40
Fixes: 8a46b25cfa
2018-02-16 13:26:07 +01:00
Iñigo Martínez 5e16bcf268 meson: Improve dependency system
Some targets are missing dependencies on some generated sources in
the meson port. These makes the build to fail due to missing source
files on a highly parallelized build.

These dependencies have been resolved by taking advantage of meson's
internal dependencies which can be used to pass source files,
include directories, libraries and compiler flags.

One of such internal dependencies called `core_dep` was already in
use. However, in order to avoid any confusion with another new
internal dependency called `nm_core_dep`, which is used to include
directories and source files from the `libnm-core` directory, the
`core_dep` dependency has been renamed to `nm_dep`.

These changes have allowed minimizing the build details which are
inherited by using those dependencies. The parallelized build has
also been improved.
2018-01-10 12:20:17 +01:00
Iñigo Martínez 03637ad8b5 build: add initial support for meson build system
meson is a build system focused on speed an ease of use, which
helps speeding up the software development. This patch adds meson
support along autotools.

[thaller@redhat.com: rebased patch and adjusted for iwd support]

https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00022.html
2017-12-13 15:48:50 +01:00