summaryrefslogtreecommitdiff
path: root/clients
Commit message (Collapse)AuthorAgeFilesLines
* client/tests: move "clients/tests/test-client.py" to "src/tests/client/"Thomas Haller2021-03-157-77066/+0
| | | | | | | | | | Note that "test-client.py" currently only tests nmcli. But what it does is to spawn test-networkmanager-service.py and run nmcli against it. As such, it could really be used to test any NetworkManager client against the stub service. Hence this test is not under "src/nmcli/tests", but under "src/tests/client/" where it is more general.
* tui: move from "clients/tui/" to "src/nmtui/"Thomas Haller2021-03-1582-13863/+0
|
* cli: move from "clients/cli/" to "src/nmcli/"Thomas Haller2021-03-1522-23926/+3
|
* cloud-setup: move from "clients/cloud-setup/" to "src/nm-cloud-setup/"Thomas Haller2021-03-1520-4724/+0
|
* build: move "clients/nm-online.c" to "src/nm-online/"th/move-client-libsThomas Haller2021-03-022-355/+0
|
* build: move "clients/tui/newt/" to "src/libnmt-newt/"Thomas Haller2021-03-0265-7808/+23
|
* build: move "clients/common/" to "src/libnmc-{base,setting}/"Thomas Haller2021-03-0250-17655/+40
|
* build/meson: cleanup libnm-client-aux-externThomas Haller2021-02-284-5/+8
|
* build/meson: drop libnm_nm_default_dep dependencyThomas Haller2021-02-284-7/+6
|
* build/meson: cleanup dependencies for libnm-core-aux-externThomas Haller2021-02-285-7/+6
|
* build/meson: cleanup dependencies for libnm-core-aux-internThomas Haller2021-02-284-5/+5
|
* build/meson: cleanup dependencies for libnm-baseThomas Haller2021-02-283-4/+4
|
* build/meson: cleanup libnm-glib-aux dependenciesThomas Haller2021-02-286-11/+51
| | | | | | | | | Avoid dependencies but explicitly link the static library where it is used. This also fixes that we linked libnm-log-core into libnm-settings-plugin-ifcfg-rh.so, which duplicated the symbols while it should used them from NetworkManager.
* build: move "libnm/" to "src/" and split itThomas Haller2021-02-2491-96/+96
| | | | | | Like with "libnm-core/", split "libnm/" into different directories for the public headers, for the implementation and for the helper "aux" library.
* shared: move "nm-test-utils.h" to "src/libnm-glib-aux/"Thomas Haller2021-02-243-3/+3
| | | | | | | | | "nm-test-utils.h" is a header-only, helper library for our unit tests. It was somewhat unmotivated in "shared/nm-utils", because all tests use it, but it was not part of a "module". Move it to "src/libnm-glib-aux/". It fits there very well. They both have (only) a dependency on glib.
* build: move "shared/nm-{glib-aux,log-null,log-core}" to ↵Thomas Haller2021-02-2412-20/+20
| | | | "src/libnm-{glib-aux,log-null,log-core}"
* build: move "shared/nm-{base,udev-aux}" to "src/libnm-{base,udev-aux}"Thomas Haller2021-02-241-1/+1
|
* shared: rename "libnm-systemd-logging-stub.la" to "libnm-log-null.la"Thomas Haller2021-02-243-3/+3
| | | | | | | | This is really just a different implementation of "nm-glib-aux/nm-logging-fwd.h", that parallels libnm-log-core. It's also not only useful to shared/systemd, but also share/nm-platform, which also requires linking with a logging backend.
* docs: improve manual page about ipv4.routesWen Liang2021-02-232-2/+2
| | | | | | Signed-off-by: Wen Liang <liangwen12year@gmail.com> https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/757
* all: change G_LOG_DOMAIN to "nm"th/libnm-core-splitThomas Haller2021-02-188-36/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | glib requires G_LOG_DOMAIN defined so that log messages are labeled to belong to NetworkManager or libnm. However, we don't actually want to use glib logging. Our library libnm MUST not log anything, because it spams the user's stdout/stderr. Instead, a library must report notable events via its API. Note that there is also LIBNM_CLIENT_DEBUG to explicitly enable debug logging, but that doesn't use glib logging either. Also, the daemon does not use glib logging instead it logs to syslog. When run with `--debug`. Hence, it's not useful for us to define different G_LOG_DOMAIN per library/application, because none of our libraries/applications should use glib logging. It also gets slightly confusing, because we have the static library like `src/libnm-core-impl`, which is both linked into `libnm` (the library) and `NetworkManager` (the daemon). Which logging domain should they use? Set the G_LOG_DOMAIN to "nm" everywhere. But no longer do it via `-D` arguments to the compiler. See-also: https://developer.gnome.org/glib/stable/glib-Message-Logging.html#G-LOG-DOMAIN:CAPS
* build: move "libnm-core/" to "src/" and split itThomas Haller2021-02-1817-19/+40
| | | | | | | | | | | | | | | | | | | | "libnm-core/" is rather complicated. It provides a static library that is linked into libnm.so and NetworkManager. It also contains public headers (like "nm-setting.h") which are part of public libnm API. Then we have helper libraries ("libnm-core/nm-libnm-core-*/") which only rely on public API of libnm-core, but are themself static libraries that can be used by anybody who uses libnm-core. And "libnm-core/nm-libnm-core-intern" is used by libnm-core itself. Move "libnm-core/" to "src/". But also split it in different directories so that they have a clearer purpose. The goal is to have a flat directory hierarchy. The "src/libnm-core*/" directories correspond to the different modules (static libraries and set of headers that we have). We have different kinds of such modules because of how we combine various code together. The directory layout now reflects this.
* docs: improve manual page about ipv4.addressesWen Liang2021-02-173-10/+17
| | | | | | Signed-off-by: Wen Liang <liangwen12year@gmail.com> https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/738
* build: make path to polkit-agent-helper-1 binary configurableThomas Haller2021-02-121-1/+1
| | | | | | | | | | | | Add new configure option to set the path to "polkit-agent-helper-1". The path cannot be obtained from pkg-config and `pkg-config --variable=prefix polkit-agent-1` is not good enough. On Fedora, the path is "/usr/lib/polkit-1/polkit-agent-helper-1". On Debian Buster, the path is "/usr/lib/policykit-1/polkit-agent-helper-1" On Debian Sid, the path is "/usr/libexec/polkit-agent-helper-1" (but currently it is also symlinked from "/usr/lib/policykit-1/polkit-agent-helper-1".
* cloud-setup/tests: add test for nmcs_setting_ip_replace_ipv4_addresses()Thomas Haller2021-02-101-0/+100
|
* cloud-setup/tests: add unit test for nm-cloud-setupThomas Haller2021-02-103-0/+41
|
* cloud-setup: fix replacing IPv4 addresses during updateThomas Haller2021-02-101-1/+1
| | | | | | | | | | | | | | | | If previously the profile would track two addresses ("10.116.1.130/24", "10.116.1.65/24"), and during an update the second address was removed (leaving "10.116.1.130/24"), then the addresses of the profile were wrongly not changed. The effect is that removing a secondary IP address might not take effect. Fix that. https://bugzilla.redhat.com/show_bug.cgi?id=1920838 Fixes: 69f048bf0ca3 ('cloud-setup: add tool for automatic IP configuration in cloud')
* cloud-setup: build intermediate library "libnm-cloud-setup-core.a"Thomas Haller2021-02-101-4/+25
| | | | | Next we'll add unit tests, hence we need to link against the code but we don't want to compile it twice.
* setting-8021x: Fix descriptions for phase2-auth & phase2-autheapAndrew Zaborowski2021-02-092-4/+4
| | | | | | | | | | | | | | | phase2-auth applies for EAP-TTLS and EAP-PEAP but the interpretation is different for one than for the other, clarify the difference. phase2-auth is for the non-EAP inner methods of EAP-TTLS but is also for the EAP inner methods of EAP-PEAP. EAP-PEAP doesn't use phase2-autheap and doesn't support any non-EAP methods. Given how complicated EAP configuration is it's likely that people just use example configurations rather than look at the docs. The example configuration in man/nm-settings-keyfile.xsl is correct in using PEAP together with phase2-auth=mschapv2. [thaller@redhat.com: regenerate documentation files]
* all: move shared/nm-meta-setting.[hc] to libnm-core and clientsThomas Haller2021-02-098-5/+842
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "shared/nm-meta-setting.[hc]" contains meta data about settings. As such it is similarly used by libnm-core (as internal API) and by clients (as extension of public API of libnm). However, it must be compiled twice, because while it defines in both cases a NMMetaSettingInfo type, these types are different between internal and public API. Hence, the files must also be compiled twice (and differently), once against libnm-core and once against the client helper library. Previously, the file was under "shared/", but there it's a bit odd it doesn't clearly belong anywhere. There are two goals here: - copy the file to the two places where it is used. We also have a "check-tree" unit test that ensures those files don't diverge in the future. - we no longer require CFLAGS set during built. Instead, the sources should control the build. For that we have new (simple) headers "nm-meta-setting-base.h" that define the right behavior for the impl files. There is still an ugliness (among several): the files must be named the same for libnm-core and clients/common. Preferably, all our sources have unique names, but that is not possible with this scheme (without introducing other ugliness). To mitigate that, include the files only at one exact place.
* all: add "libnm/nm-default-client.h" as replacement for "nm-default.h"Thomas Haller2021-02-0993-98/+88
|
* build/meson: cleanup clients/***/meson.buildThomas Haller2021-02-097-176/+189
|
* meson/build: fix c_args for libnmcThomas Haller2021-02-091-1/+1
| | | | | This used c_flags, which was previously defined by dispatcher/meson.build, something unrelated entirely.
* clients/tests: better explain how to configure localized testsThomas Haller2021-02-081-0/+6
|
* ethtool: add more offload features that kernel supportsThomas Haller2021-02-082-0/+12
| | | | | | | | | | | | | 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
* cloud-setup: add Documentation link to "nm-cloud-setup.service"Thomas Haller2021-02-021-0/+1
|
* cloud-setup: add comment to "nm-cloud-setup.service" about drop-in filesThomas Haller2021-02-021-0/+3
|
* libnm/docs: explain that edns0/trust-ad is automatically added to DNS optionsThomas Haller2021-01-262-4/+4
| | | | | | | Since commit f91a8ef3327a ('dns: add edns0 and trust-ad options when using local resolver') we automatically set these options. Document it.
* all: change default value of hostname.only-from-default to falsebg/hostname-from-anyBeniamino Galvani2021-01-182-2/+2
| | | | | | | | | | | | | | | | | | | Currently, is retrieved by default only from the device with the default route. This is done so that in presence of multiple connections the choice is deterministic. However, this limitation seems confusing for users, that expect to get an hostname even for non-default devices. Change the default and allow any device to obtain the hostname. Note that when there is a default route, NM still prefers that device and so the behavior doesn't change. The only change in behavior is that when there is no default route and the machine doesn't have a static hostname, NM will try to get hostname from DHCP or reverse DNS. https://bugzilla.redhat.com/show_bug.cgi?id=1766944
* libnm,shared: move nm-ethtool helper to "libnm-base"Thomas Haller2021-01-151-1/+1
| | | | | | | | | | | | | | 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.
* libnm: split ethtool option names to a new header ↵Thomas Haller2021-01-151-1/+1
| | | | | | | | | | | | | | | "libnm-core/nm-ethtool-utils.h" We want to use these defines for option names also in "shared/nm-base" (and in turn in "shared/nm-platform), which cannot include "libnm-core". However, they are also public API of libnm. To get this done, in a first step, move these defines to a new header "libnm-core/nm-ethtool-utils.h". Since now the name "nm-ethtool-utils.h" is taken, also rename nm-libnm-core-intern files.
* device: add "ipv4.dhcp-client-id=ipv6-duid" property for RFC4361Thomas Haller2021-01-112-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | RFC4361 intends to set the same IAID/DUID for both DHCPv4 and DHCPv6. Previously, we didn't have a mode for that. Of course, you could always set "ipv4.dhcp-client-id" and "ipv6.dhcp-duid" to (the same) hex string, but there was no automatic mode. Instead we had: - "ipv4.dhcp-client-id=duid" which sets the client ID to a stable, generated DUID. However, there was no option so that the same DUID/IAID would be automatically used for DHCPv6. - there are various special values for "ipv6.dhcp-duid" which generate a stable DUIDs. However, those values did not work for "ipv4.dhcp-client-id". Solve that by adding "ipv4.dhcp-client-id=ipv6-duid" which indicates to use the DUID from DHCPv6's "ipv6.dhcp-duid" setting. As IAID it will prefer "ipv4.dhcp-iaid" (if set), but fallback to "ipv6.dhcp-iaid". https://tools.ietf.org/html/rfc4361 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/618 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/718
* clients: fix compiler warning in _do_test_parse_passwd_file()Thomas Haller2021-01-081-1/+1
| | | | | | | | | Since "_i" is int type and G_N_ELEMENTS() is size_t, the compiler can warn error: comparison of unsigned expression in '< 0' is always false [-Werror=type-limits] Avoid the warning by casting.
* cloud-setup: assign incremental iface_idx for Azure,GCP get_config() resultThomas Haller2021-01-082-39/+46
| | | | | | | | | | | | We use the iface_idx for example to determine the routing table, by using table 30400+iface_idx. While the HTTP API for Azure has a index, it does not mean that we should use that index as-is for our purpose. Instead, treat those indexes separately and ensure that the iface_idx that we return is numbering the interfaces starting from zero.
* cloud-setup: fail get_config() for Azure on invalid prefixThomas Haller2021-01-081-0/+2
| | | | | | | | While it's not clear whether we should be strict or forgiving when fetching the HTTP meta data, we should be consistent. On a parse error of the IP addresses we fail. Hence also fail on a parse error for the subnet.
* cloud-setup: use nmcs_utils_ipaddr_normalize_bin() in Azure providerThomas Haller2021-01-081-9/+18
|
* cloud-setup: use nmcs_utils_ipaddr_normalize_gbytes() in GCP providerThomas Haller2021-01-081-5/+5
|
* cloud-setup: add nmcs_utils_ipaddr_normalize*() helperThomas Haller2021-01-082-0/+73
|
* cloud-setup: handle unknown interaces in get_config() for GCP/AzureThomas Haller2021-01-084-37/+92
| | | | | | | | | | The API of mcs_provider_get_config() allows to explicitly request for certain interfaces (MAC addresses), but it also allows to fetch any. That means, the result dictionary will be pre-populated with the MAC addresses that were requested, but if we encounter an unknown interface, then that is not a reason to fail.
* cloud-setup: add and use nmcs_utils_hwaddr_normalize_gbytes()Thomas Haller2021-01-084-3/+22
| | | | | | | | | | | | | | | | | | | Previously we would call nmcs_utils_hwaddr_normalize(g_bytes_get_data(response, NULL), -1); which treats the data in response as NUL terminated. That is not entirely wrong, because the HTTP request's response is guaranteed to have a NUL termination at the end. However, it doesn't seam to good either. For one, we already have the length. Use it. But also, if the response contains any NUL bytes in the middle, then this would wrongly only consider the first line. We should not accept "00:11:22:33:44:55\0bogus" as valid. While at it, reject NUL characters from nmcs_utils_hwaddr_normalize() -- except one NUL at the end.
* cloud-setup: strip whitespace from nmcs_utils_hwaddr_normalize()Thomas Haller2021-01-081-7/+15
| | | | | This function should be accepting, and not reject leading/trailing white space.