summaryrefslogtreecommitdiff
path: root/src/nmtui
Commit message (Collapse)AuthorAgeFilesLines
* tui: cleanup secrets_requested() function to use cleanup attributeThomas Haller2023-05-121-11/+5
| | | | | No explicit unref/free. Resources should be owned by somebody, like an auto variable with a cleanup attribute.
* nmtui: do not prompt for secrets if openconnect already provided themDavid Woodhouse2023-05-111-38/+25
| | | | | | While we're at it, kill the separate openconnect_authenticate() function since it barely does anything any more and it wants visibility to both 's_vpn' and 'success' variables in the caller.
* nmcli, nmtui: reduce duplication around openconnect auth helperDavid Woodhouse2023-05-111-56/+3
| | | | | | | Pull a bunch of stuff into nm_vpn_openconnect_authenticate_helper() that both callers were doing for themselves, and make its API a bit simpler. It's given the NMSettingVpn and the GPtrArray of secrets, and it simply succeeds or fails.
* nmcli, nmtui: update authentication for OpenConnectDavid Woodhouse2023-05-111-12/+18
| | | | | | | | | | | | | | | | Since OpenConnect 8.20, 'openconnect --authenticate' will return the full gateway URL, including the hostname and the path. This allows servers behind SNI-based proxies to work. To ensure we end up at the same IP address even behind round-robin DNS, there is a separate --resolve argument. Update nmcli/nmtui to use this, as NetworkManager-openconnect does. Shift some of the logic into the nm_vpn_openconnect_authenticate_helper() function instead of duplicating it in the callers. Also, pass the correct protocol in rather than only supporting Cisco AnyConnect.
* doc: replace all (allow-none) annotations by (optional) and/or (nullable)Corentin Noël2023-03-276-10/+10
| | | | | | | | The (allow-none) annotation is deprecated since a long time now, it is better to use (nullable) and/or (optional) which clarifies what it means with the (out) annotation. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1551
* bonding: add support to ns_ip6_target optionff/new_bond_optionsFernando Fernandez Mancera2023-03-061-1/+1
| | | | | | This is the IPv6 equivalent of arp_ip_target option. It requires arp_interval set and allow the user to specify up to 16 IPv6 addresses as targets. By default, the list is empty.
* nmtui: fix memory leakbg/coverityBeniamino Galvani2022-12-221-0/+2
| | | | Fixes: 3bda3fb60c10 ('nmtui: initial import of nmtui')
* all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal usesThomas Haller2022-12-1640-41/+44
| | | | | | | | | | | | | | | | | | | | G_TYPE_CHECK_INSTANCE_CAST() can trigger a "-Wcast-align": src/core/devices/nm-device-macvlan.c: In function 'parent_changed_notify': /usr/include/glib-2.0/gobject/gtype.h:2421:42: error: cast increases required alignment of target type [-Werror=cast-align] 2421 | # define _G_TYPE_CIC(ip, gt, ct) ((ct*) ip) | ^ /usr/include/glib-2.0/gobject/gtype.h:501:66: note: in expansion of macro '_G_TYPE_CIC' 501 | #define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (_G_TYPE_CIC ((instance), (g_type), c_type)) | ^~~~~~~~~~~ src/core/devices/nm-device-macvlan.h:13:6: note: in expansion of macro 'G_TYPE_CHECK_INSTANCE_CAST' 13 | (G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_DEVICE_MACVLAN, NMDeviceMacvlan)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ Avoid that by using _NM_G_TYPE_CHECK_INSTANCE_CAST(). This can only be done for our internal usages. The public headers of libnm are not changed.
* all: fix "-Wcast-align=strict" warnings for GArray castsThomas Haller2022-12-092-7/+7
| | | | | | | | | GArray.data is a char pointer. Most of the time we track other data in a GArray. Casting that pointer can trigger "-Wcast-align=strict" warnings. Avoid them. Most of the time, instead use the nm_g_array*() helpers, which also assert that the expected element size is correct.
* clang-format: reformat code with clang-format 15.0.4-1.fc37Thomas Haller2022-11-231-4/+4
| | | | | | | | | | | | | | This is the version shipped in Fedora 37. As Fedora 37 is now out, the core developers switch to it. Our gitlab-ci will also use that as base image for the check-{patch.tree} tests and to generate the pages. There is a need that everybody agrees on which clang-format version to use, and that version should be the one of the currently used Fedora release. Also update the used Fedora image in "contrib/scripts/nm-code-format-container.sh" script. The gitlab-ci still needs update in the following commit. The change in isolation will break the "check-tree" test.
* nmtui: add MACsec supportBeniamino Galvani2022-09-286-0/+237
|
* nmtui: ethernet: support wired 802.1X authenticationBeniamino Galvani2022-09-282-16/+85
|
* nmtui: wifi: support WPA EnterpriseBeniamino Galvani2022-09-283-11/+41
|
* nmtui: introduce Nmt8021xFieldsBeniamino Galvani2022-09-285-0/+778
| | | | Introduce a new widget to edit 802.1X settings.
* nmtui: add secret-flags support to NmtPasswordFieldsBeniamino Galvani2022-09-282-45/+77
| | | | | | The existing option ALWAYS_ASK is never used. Add a more generic option SHOW_SECRET_FLAGS to display a popup for choosing the secret flags.
* nmtui: add NOT_EMPTY flag to NmtPasswordFieldsBeniamino Galvani2022-09-282-1/+8
| | | | | | Add a new flag to return a NULL string when the password is empty. This is needed when creating the binding to some properties that don't accept an empty value.
* nmtui: fix property getter/setter in NmtPasswordFieldsBeniamino Galvani2022-09-281-4/+2
| | | | | The 'show_password' widget is created in _init(), which is before properties are accessed. We can assume it's always present.
* glib-aux: rename IP address related helpers from "nm-inet-utils.h"Thomas Haller2022-08-252-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - name things related to `in_addr_t`, `struct in6_addr`, `NMIPAddr` as `nm_ip4_addr_*()`, `nm_ip6_addr_*()`, `nm_ip_addr_*()`, respectively. - we have a wrapper `nm_inet_ntop()` for `inet_ntop()`. This name of our wrapper is chosen to be familiar with the libc underlying function. With this, also name functions that are about string representations of addresses `nm_inet_*()`, `nm_inet4_*()`, `nm_inet6_*()`. For example, `nm_inet_parse_str()`, `nm_inet_is_normalized()`. <<<< R() { git grep -l "$1" | xargs sed -i "s/\<$1\>/$2/g" } R NM_CMP_DIRECT_IN4ADDR_SAME_PREFIX NM_CMP_DIRECT_IP4_ADDR_SAME_PREFIX R NM_CMP_DIRECT_IN6ADDR_SAME_PREFIX NM_CMP_DIRECT_IP6_ADDR_SAME_PREFIX R NM_UTILS_INET_ADDRSTRLEN NM_INET_ADDRSTRLEN R _nm_utils_inet4_ntop nm_inet4_ntop R _nm_utils_inet6_ntop nm_inet6_ntop R _nm_utils_ip4_get_default_prefix nm_ip4_addr_get_default_prefix R _nm_utils_ip4_get_default_prefix0 nm_ip4_addr_get_default_prefix0 R _nm_utils_ip4_netmask_to_prefix nm_ip4_addr_netmask_to_prefix R _nm_utils_ip4_prefix_to_netmask nm_ip4_addr_netmask_from_prefix R nm_utils_inet4_ntop_dup nm_inet4_ntop_dup R nm_utils_inet6_ntop_dup nm_inet6_ntop_dup R nm_utils_inet_ntop nm_inet_ntop R nm_utils_inet_ntop_dup nm_inet_ntop_dup R nm_utils_ip4_address_clear_host_address nm_ip4_addr_clear_host_address R nm_utils_ip4_address_is_link_local nm_ip4_addr_is_link_local R nm_utils_ip4_address_is_loopback nm_ip4_addr_is_loopback R nm_utils_ip4_address_is_zeronet nm_ip4_addr_is_zeronet R nm_utils_ip4_address_same_prefix nm_ip4_addr_same_prefix R nm_utils_ip4_address_same_prefix_cmp nm_ip4_addr_same_prefix_cmp R nm_utils_ip6_address_clear_host_address nm_ip6_addr_clear_host_address R nm_utils_ip6_address_same_prefix nm_ip6_addr_same_prefix R nm_utils_ip6_address_same_prefix_cmp nm_ip6_addr_same_prefix_cmp R nm_utils_ip6_is_ula nm_ip6_addr_is_ula R nm_utils_ip_address_same_prefix nm_ip_addr_same_prefix R nm_utils_ip_address_same_prefix_cmp nm_ip_addr_same_prefix_cmp R nm_utils_ip_is_site_local nm_ip_addr_is_site_local R nm_utils_ipaddr_is_normalized nm_inet_is_normalized R nm_utils_ipaddr_is_valid nm_inet_is_valid R nm_utils_ipx_address_clear_host_address nm_ip_addr_clear_host_address R nm_utils_parse_inaddr nm_inet_parse_str R nm_utils_parse_inaddr_bin nm_inet_parse_bin R nm_utils_parse_inaddr_bin_full nm_inet_parse_bin_full R nm_utils_parse_inaddr_prefix nm_inet_parse_with_prefix_str R nm_utils_parse_inaddr_prefix_bin nm_inet_parse_with_prefix_bin R test_nm_utils_ip6_address_same_prefix test_nm_ip_addr_same_prefix ./contrib/scripts/nm-code-format.sh -F
* tui/wifi: remove WEP optionsLubomir Rintel2022-08-251-11/+22
| | | | | | | | WEP has been deprecated and is disabled in some distros (RHEL 9) and wpa_supplicant upstream. Let's remove the option of using it, but also keep a chicken bit in form of an environment variable for now. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1340
* newt-form: remove escape-exits propertyLubomir Rintel2022-08-256-34/+6
| | | | | | | | As far as I can tell, all forms we have should be dismissable with the Escape key. We omitted settings "escape-exits" property by accident before. Let's just remove it. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1339
* tui: allow exiting add/edit connection dialog with ESC keyLubomir Rintel2022-08-252-1/+8
| | | | | | No reason this wouldn't be allowed. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1339
* all: reformat with clang-format (clang-tools-extra-14.0.0-1.fc36) and update ↵Thomas Haller2022-07-061-12/+12
| | | | gitlab-ci to f36
* nmtui: add support for activating tun/tap connectionsOlivier Gayot2022-05-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | tun/tap connections can be created using a command such as: $ nmcli connection add type tun ifname tun0 mode tap owner 1000 They appear in nmcli connection as TYPE "tun". This patch adds the ability to activate and deactivate this type of connection using nmtui. Each connection of TYPE "tun" appears as: TUN/TAP (<ifname>) * <connection-name> Example: TUN/TAP (tap0) * bridge-slave-tap0 TUN/TAP (tap1) bridge-slave-tap1
* clients: bulk removal of g_assert*() statementslr/assertsLubomir Rintel2022-03-283-9/+10
| | | | | Assertions should be done in tests. If we detect an unexpected situation at runtime, we shall fail more gracefully than crashing right away.
* all: drop /*<skip>*/ annotations for enumsThomas Haller2022-02-081-3/+3
| | | | | | | | We don't run glib-mkenums for certain sources like "core" and "libnm-glib-aux". These annotations have no effect. Drop them. They also mess with the automated formatting.
* format: reformat source tree with clang-format 13.0Thomas Haller2021-11-2955-662/+662
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | We use clang-format for automatic formatting of our source files. Since clang-format is actively maintained software, the actual formatting depends on the used version of clang-format. That is unfortunate and painful, but really unavoidable unless clang-format would be strictly bug-compatible. So the version that we must use is from the current Fedora release, which is also tested by our gitlab-ci. Previously, we were using Fedora 34 with clang-tools-extra-12.0.1-1.fc34.x86_64. As Fedora 35 comes along, we need to update our formatting as Fedora 35 comes with version "13.0.0~rc1-1.fc35". An alternative would be to freeze on version 12, but that has different problems (like, it's cumbersome to rebuild clang 12 on Fedora 35 and it would be cumbersome for our developers which are on Fedora 35 to use a clang that they cannot easily install). The (differently painful) solution is to reformat from time to time, as we switch to a new Fedora (and thus clang) version. Usually we would expect that such a reformatting brings minor changes. But this time, the changes are huge. That is mentioned in the release notes [1] as Makes PointerAligment: Right working with AlignConsecutiveDeclarations. (Fixes https://llvm.org/PR27353) [1] https://releases.llvm.org/13.0.0/tools/clang/docs/ReleaseNotes.html#clang-format
* tui: fix order of includes in "nmt-page-bond-port.c"Thomas Haller2021-08-261-1/+2
| | | | | Headers should be included in a particular order. See the CONTRIBUTING file.
* bond: add support of queue_id of bond portGris Ge2021-08-265-1/+104
| | | | | | | | | | | | | | | | Introduced `NMSettingBondPort` to hold the new setting class with single property `NM_SETTING_BOND_PORT_QUEUE_ID`. For dbus interface, please use `bond-port` as setting name and `queue-id` as property name. Unit test cases for ifcfg reader and writer included. Signed-off-by: Gris Ge <fge@redhat.com> https://bugzilla.redhat.com/show_bug.cgi?id=1949127 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/952
* tui: fix order of includesThomas Haller2021-08-2013-18/+25
|
* libnm: Use _nm_connection_ensure_setting()Gris Ge2021-08-2014-86/+38
| | | | | | | | Use `_nm_connection_ensure_setting()` to eliminate the duplicated codes. This function will retrieve the specific setting from connection, if not found, create new one and attach to the connection. Signed-off-by: Gris Ge <fge@redhat.com>
* all: add some README.md files describing the purpose of our sourcesThomas Haller2021-08-191-0/+15
|
* tui: add WireGuard support to nmtuiJavier Sánchez Parra2021-08-1712-0/+1239
| | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/736
* all: use nm_g_idle_add() instead of g_idle_add()Thomas Haller2021-07-261-1/+1
| | | | | g_idle_add() is discouraged, because we shouldn't use guint source IDs.
* clang-format: use "IndentPPDirectives:None" instead of "BeforeHash"Thomas Haller2021-07-091-1/+1
| | | | Subjectively, I think this looks better.
* tui: use internal _nm_utils_ip4_prefix_to_netmask() helperThomas Haller2021-05-111-1/+1
| | | | | | | | | nm_utils_ip4_prefix_to_netmask() is public API of libnm. As we also want to have this function at a few places where we don't have libnm, we have an internal variant _nm_utils_ip4_prefix_to_netmask(). Use the internal variant consistently and everywhere.
* all: Replace deprecated NM_CONNECTION_SERIALIZE_* flagsAndrew Zaborowski2021-04-011-1/+1
| | | | | | | | | Review and replace usages of the two nm_connection_to_dbus() flags marked deprecated in commit 84648e562c98 ('libnm: Refactor NM_CONNECTION_SERIALIZE_* flags'): NM_CONNECTION_SERIALIZE_NO_SECRETS and NM_CONNECTION_SERIALIZE_ONLY_SECRETS.
* tui: move from "clients/tui/" to "src/nmtui/"Thomas Haller2021-03-1581-0/+13859