Commit graph

8 commits

Author SHA1 Message Date
Thomas Haller
789347e0d6
shared: copy file instead of symlink "nm-ethtool-utils.h"
"nm-ethtool-utils.h" is part of public API in libnm(-core). It is also
used by shared/nm-base, which must have no dependency on libnm-core.

This was previously solved by symlinking the file. I find that error
prone, because the user might edit one file, without realizing that the
other file also changes.

Instead, copy the file and have it twice. Note that we have a unit test
which checks that both files are (and state) the same.

Copy+paste is a valid way of reusing code. By checking that the copy
does not diverge from the original, the downsides of copy+paste are
mitigated.
2021-02-09 12:38:19 +01:00
Thomas Haller
bbb86cc11a
all: add "nm-glib-aux/nm-default-glib-i18n-lib.h" as replacement for "nm-default.h" 2021-02-09 12:38:17 +01:00
Thomas Haller
f72278eff7
ethtool: add more offload features that kernel supports
New features:

 - ethtool.feature-macsec-hw-offload
 - ethtool.feature-rx-gro-list
 - ethtool.feature-rx-udp-gro-forwarding
 - ethtool.feature-tls-hw-rx-offload
 - ethtool.feature-tx-gso-list
 - ethtool.feature-tx-tunnel-remcsum-segmentation

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/735
2021-02-08 15:11:11 +01:00
Thomas Haller
d2464c260f
core: move NMIPConfigSource from "src/nm-types.h" to "shared/nm-base" 2021-01-15 11:32:43 +01:00
Thomas Haller
874bd8994e
libnm,shared: move nm-ethtool helper to "libnm-base"
We want to use this by "shared/nm-platform", which should have
no dependency on "libnm-core".

Move "libnm-core/nm-ethtool-utils.h" to "libnm/nm-ethtool-utils.h" so
that it is only used by libnm. This file contains the defines for
the option names.

Also, symlink "libnm/nm-ethtool-utils.h" as "shared/nm-base/nm-ethtool-utils-base.h".
We want to use the same defines also internally. Since they are both
public API (must be in libnm) and should be in "shared/nm-base", this
is the way.
2021-01-15 11:32:41 +01:00
Thomas Haller
84d67d3a4f
shared: add duplicate for NM_UTILS_HWADDR_LEN_MAX to "nm-base/nm-base.h"
We will need this in "shared/nm-platform", but we don't want
to include "libnm-core/nm-utils.h" for that.
2021-01-15 11:32:35 +01:00
Thomas Haller
2bb5c8b13b
platform: add duplicate of NMSettingWiredWakeOnLan to nm-base for platform
Currently src/platform depends on libnm-core. libnm-core is large
optimally we have a better separation between our code. That means
libnm-core does not depend on platform and vice versa.

However, nm-platform re-uses some enums from libnm-core for internal code.
To avoid that dependency, add _NMSettingWiredWakeOnLan as a duplicate to
nm-base/nm-base.h. nm-base can both be used by libnm-core, nm-platform
and src/platform.

The only problem is that NMSettingWiredWakeOnLan is also part of public
API of libnm. It means, we must duplicate the enum. But with several
static assertions in unit tests I think that is not a problem to do.
2021-01-15 11:32:33 +01:00
Thomas Haller
e5d2a05ad5
libnm: add "shared/nm-base/nm-base.h"
Our dependencies are complicated.

Currently "src/platform" uses parts of libnm-core and is relatively
strongly entangled with core. It would be nice to have that part
clearly independent from "src" and from "libnm-core".

Also, "src/platform/nm-platform-utils.h" uses NMEthtoolID enum, which
previously was defined in "libnm-core/nm-libnm-core-intern/nm-ethtool-utils.h".

Move that to a new place "shared/nm-base/nm-base.h".

Note that we have "libnm-core/nm-libnm-core-intern", which is
libnm/core related code which uses and is used by libnm-core.
There is a need for a library which is used by libnm-core, but
does not depend on libnm-core itself. Here comes "shared/nm-base".

Yes, many libraries. But the goal is to entangle the dependencies
and have a clear hierarchy of includes. And to have "shared/nm-platform"
independent of libnm-core.
2021-01-15 11:32:32 +01:00