NetworkManager/libnm
Thomas Haller 9655dff5cb
libnm: add API for setting gendata options to NMSetting (nm_setting_option_get())
NMSettingEthtool is implemented using "gendata", meaning a hash
of GVariant. This is different from most other settings that have
properties implemented as GObject properties. There are two reasons
for this approach:

  - The setting is transferred via D-Bus as "a{sv}" dictionary.
    By unpacking the dictionary into GObject properties, the setting
    cannot handle unknown properties. To be forward compatible (and
    due to sloppy programming), unknown dictionary keys are silently
    ignored when parsing a NMSetting. That is error prone and also
    prevents settings to be treated loss-less.
    Instead, we should at first accept all values from the dictionary.
    Only in a second step, nm_connection_verify() rejects invalid settings
    with an error reason. This way, the user can create a NMSetting,
    but in a separate step handle if the setting doesn't verify.
    "gendata" solves this by tracking the full GVariant dictionary.
    This is still not entirely lossless, because multiple keys are
    combined.
    This is for example interesting if an libnm client fetches a connection
    from a newer NetworkManager version. Now the user can modify the
    properties that she knows about, while leaving all unknown
    properties (from newer versions) in place.

  - the approach aims to reduce the necessary boiler plate to create
    GObject properties. Adding a new property should require less new code.

This approach was always be intended to be suitable for all settings, not only
NMSettingEthtool. We should not once again try to add API like
nm_setting_ethtool_set_feature(), nm_setting_ethtool_set_coalesce(), etc.
Note that the option name already fully encodes whether it is a feature,
a coalesce option, or whatever. We should not have
"nm_setting_set_$SUB_GROUP (setting, $ONE_NAME_FROM_GROUP)" API, but
simply "nm_setting_option_set (setting, $OPTION)" accessors.

Also, when parsing a NMSettingEthtool from a GVariant, then a feature
option can be any kind of variant. Only nm_setting_verify() rejects
variants of the wrong type. As such, nm_setting_option_set*() also
doesn't validate whether the variant type matches the option. Of course,
if you set a value of wrong type, verify() will reject the setting.

Add new general purpose API for this and expose it for NMSetting.
2020-05-22 15:58:08 +02:00
..
tests libnm: remove early return statement in test_nm_auth_permissions() 2020-05-07 10:01:59 +02:00
generate-plugin-docs.pl all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
generate-setting-docs.py libnm: remove unused import from "generate-setting-docs.py" 2020-05-07 13:58:11 +02:00
libnm.pc.in libnm,pkg-config: provide a variable with VPN service directory 2015-08-19 15:13:11 +02:00
libnm.ver libnm: add API for setting gendata options to NMSetting (nm_setting_option_get()) 2020-05-22 15:58:08 +02:00
meson.build libnm/meson.build: stop using env -i (just env) 2020-04-26 11:32:57 +02:00
NetworkManager.h libnm-core,cli: add VRF setting 2020-01-14 09:49:01 +01:00
nm-access-point.c libnm/doc: fix gtk-doc for deprecated markers in libnm 2020-03-23 09:32:04 +01:00
nm-access-point.h libnm: hide GObject structs from public API and embed private data 2019-10-22 10:58:52 +02:00
nm-active-connection.c libnm: hide NMActiveConnection until NMRemoteConnection is ready 2020-02-10 19:02:42 +01:00
nm-active-connection.h libnm: hide GObject structs from public API and embed private data 2019-10-22 10:58:52 +02:00
nm-autoptr.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-checkpoint.c libnm: refactor caching of D-Bus objects in NMClient 2019-11-25 15:08:00 +01:00
nm-checkpoint.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-client.c libnm: fix documentation for value argument of nm_client_dbus_call() 2020-05-22 08:51:21 +02:00
nm-client.h libnm: add nm_client_dbus_set_property() API 2020-03-23 09:33:01 +01:00
nm-dbus-helpers.c libnm: refactor caching of D-Bus objects in NMClient 2019-11-25 15:08:00 +01:00
nm-dbus-helpers.h libnm: refactor caching of D-Bus objects in NMClient 2019-11-25 15:08:00 +01:00
nm-device-6lowpan.c libnm/doc: fix gtk-doc for deprecated markers in libnm 2020-03-23 09:32:04 +01:00
nm-device-6lowpan.h nm-device: expose via D-Bus the 'hw-address' property 2020-03-13 10:22:21 +01:00
nm-device-adsl.c libnm: refactor caching of D-Bus objects in NMClient 2019-11-25 15:08:00 +01:00
nm-device-adsl.h libnm: hide GObject structs from public API and embed private data 2019-10-22 10:58:52 +02:00
nm-device-bond.c libnm/doc: fix gtk-doc for deprecated markers in libnm 2020-03-23 09:32:04 +01:00
nm-device-bond.h nm-device: expose via D-Bus the 'hw-address' property 2020-03-13 10:22:21 +01:00
nm-device-bridge.c libnm/doc: fix gtk-doc for deprecated markers in libnm 2020-03-23 09:32:04 +01:00
nm-device-bridge.h nm-device: expose via D-Bus the 'hw-address' property 2020-03-13 10:22:21 +01:00
nm-device-bt.c libnm/doc: fix gtk-doc for deprecated markers in libnm 2020-03-23 09:32:04 +01:00
nm-device-bt.h nm-device: expose via D-Bus the 'hw-address' property 2020-03-13 10:22:21 +01:00
nm-device-dummy.c libnm/doc: fix gtk-doc for deprecated markers in libnm 2020-03-23 09:32:04 +01:00
nm-device-dummy.h nm-device: expose via D-Bus the 'hw-address' property 2020-03-13 10:22:21 +01:00
nm-device-ethernet.c libnm: ignore "Peer" property on Device.Veth interface 2020-03-30 18:08:59 +02:00
nm-device-ethernet.h nm-device: expose via D-Bus the 'hw-address' property 2020-03-13 10:22:21 +01:00
nm-device-generic.c libnm/doc: fix gtk-doc for deprecated markers in libnm 2020-03-23 09:32:04 +01:00
nm-device-generic.h nm-device: expose via D-Bus the 'hw-address' property 2020-03-13 10:22:21 +01:00
nm-device-infiniband.c libnm/doc: fix gtk-doc for deprecated markers in libnm 2020-03-23 09:32:04 +01:00
nm-device-infiniband.h nm-device: expose via D-Bus the 'hw-address' property 2020-03-13 10:22:21 +01:00
nm-device-ip-tunnel.c libnm: refactor caching of D-Bus objects in NMClient 2019-11-25 15:08:00 +01:00
nm-device-ip-tunnel.h libnm: hide GObject structs from public API and embed private data 2019-10-22 10:58:52 +02:00
nm-device-macsec.c libnm/doc: fix gtk-doc for deprecated markers in libnm 2020-03-23 09:32:04 +01:00
nm-device-macsec.h nm-device: expose via D-Bus the 'hw-address' property 2020-03-13 10:22:21 +01:00
nm-device-macvlan.c libnm/doc: fix gtk-doc for deprecated markers in libnm 2020-03-23 09:32:04 +01:00
nm-device-macvlan.h nm-device: expose via D-Bus the 'hw-address' property 2020-03-13 10:22:21 +01:00
nm-device-modem.c libnm: refactor caching of D-Bus objects in NMClient 2019-11-25 15:08:00 +01:00
nm-device-modem.h libnm: hide GObject structs from public API and embed private data 2019-10-22 10:58:52 +02:00
nm-device-olpc-mesh.c libnm/doc: fix gtk-doc for deprecated markers in libnm 2020-03-23 09:32:04 +01:00
nm-device-olpc-mesh.h nm-device: expose via D-Bus the 'hw-address' property 2020-03-13 10:22:21 +01:00
nm-device-ovs-bridge.c libnm: refactor caching of D-Bus objects in NMClient 2019-11-25 15:08:00 +01:00
nm-device-ovs-bridge.h libnm: hide GObject structs from public API and embed private data 2019-10-22 10:58:52 +02:00
nm-device-ovs-interface.c libnm: refactor caching of D-Bus objects in NMClient 2019-11-25 15:08:00 +01:00
nm-device-ovs-interface.h libnm: hide GObject structs from public API and embed private data 2019-10-22 10:58:52 +02:00
nm-device-ovs-port.c libnm: refactor caching of D-Bus objects in NMClient 2019-11-25 15:08:00 +01:00
nm-device-ovs-port.h libnm: hide GObject structs from public API and embed private data 2019-10-22 10:58:52 +02:00
nm-device-ppp.c libnm: refactor caching of D-Bus objects in NMClient 2019-11-25 15:08:00 +01:00
nm-device-ppp.h libnm: hide GObject structs from public API and embed private data 2019-10-22 10:58:52 +02:00
nm-device-private.h libnm: use the o.fd.DBus.ObjectManager API for object management 2016-11-10 16:48:48 +01:00
nm-device-team.c libnm/doc: fix gtk-doc for deprecated markers in libnm 2020-03-23 09:32:04 +01:00
nm-device-team.h nm-device: expose via D-Bus the 'hw-address' property 2020-03-13 10:22:21 +01:00
nm-device-tun.c libnm/doc: fix gtk-doc for deprecated markers in libnm 2020-03-23 09:32:04 +01:00
nm-device-tun.h nm-device: expose via D-Bus the 'hw-address' property 2020-03-13 10:22:21 +01:00
nm-device-vlan.c libnm/doc: fix gtk-doc for deprecated markers in libnm 2020-03-23 09:32:04 +01:00
nm-device-vlan.h nm-device: expose via D-Bus the 'hw-address' property 2020-03-13 10:22:21 +01:00
nm-device-vrf.c core,libnm: add VRF support 2020-01-14 09:51:56 +01:00
nm-device-vrf.h core,libnm: add VRF support 2020-01-14 09:51:56 +01:00
nm-device-vxlan.c libnm/doc: fix gtk-doc for deprecated markers in libnm 2020-03-23 09:32:04 +01:00
nm-device-vxlan.h nm-device: expose via D-Bus the 'hw-address' property 2020-03-13 10:22:21 +01:00
nm-device-wifi-p2p.c libnm/doc: fix gtk-doc for deprecated markers in libnm 2020-03-23 09:32:04 +01:00
nm-device-wifi-p2p.h nm-device: expose via D-Bus the 'hw-address' property 2020-03-13 10:22:21 +01:00
nm-device-wifi.c libnm/doc: fix gtk-doc for deprecated markers in libnm 2020-03-23 09:32:04 +01:00
nm-device-wifi.h nm-device: expose via D-Bus the 'hw-address' property 2020-03-13 10:22:21 +01:00
nm-device-wimax.c libnm: retire deprecated WiMAX NMObject types 2019-10-23 15:31:51 +02:00
nm-device-wimax.h libnm/doc: fix gtk-doc for deprecated markers in libnm 2020-03-23 09:32:04 +01:00
nm-device-wireguard.c libnm: refactor caching of D-Bus objects in NMClient 2019-11-25 15:08:00 +01:00
nm-device-wireguard.h libnm: hide GObject structs from public API and embed private data 2019-10-22 10:58:52 +02:00
nm-device-wpan.c libnm/doc: fix gtk-doc for deprecated markers in libnm 2020-03-23 09:32:04 +01:00
nm-device-wpan.h nm-device: expose via D-Bus the 'hw-address' property 2020-03-13 10:22:21 +01:00
nm-device.c all: use nm_clear_pointer() instead of g_clear_pointer() 2020-03-23 11:22:38 +01:00
nm-device.h nm-device: expose via D-Bus the 'hw-address' property 2020-03-13 10:22:21 +01:00
nm-dhcp-config.c libnm: refactor caching of D-Bus objects in NMClient 2019-11-25 15:08:00 +01:00
nm-dhcp-config.h libnm: hide GObject structs from public API and embed private data 2019-10-22 10:58:52 +02:00
nm-dhcp4-config.c libnm: hide GObject structs from public API and embed private data 2019-10-22 10:58:52 +02:00
nm-dhcp4-config.h libnm: hide GObject structs from public API and embed private data 2019-10-22 10:58:52 +02:00
nm-dhcp6-config.c libnm: hide GObject structs from public API and embed private data 2019-10-22 10:58:52 +02:00
nm-dhcp6-config.h libnm: hide GObject structs from public API and embed private data 2019-10-22 10:58:52 +02:00
nm-dns-manager.c libnm: refactor caching of D-Bus objects in NMClient 2019-11-25 15:08:00 +01:00
nm-dns-manager.h libnm: refactor caching of D-Bus objects in NMClient 2019-11-25 15:08:00 +01:00
nm-enum-types.c.template build: use template files for enum types' sources generation 2017-12-18 11:25:06 +01:00
nm-enum-types.h.template build: use template files for enum types' sources generation 2017-12-18 11:25:06 +01:00
nm-ip-config.c libnm: refactor caching of D-Bus objects in NMClient 2019-11-25 15:08:00 +01:00
nm-ip-config.h libnm: hide GObject structs from public API and embed private data 2019-10-22 10:58:52 +02:00
nm-ip4-config.c libnm: hide GObject structs from public API and embed private data 2019-10-22 10:58:52 +02:00
nm-ip4-config.h libnm: hide GObject structs from public API and embed private data 2019-10-22 10:58:52 +02:00
nm-ip6-config.c libnm: hide GObject structs from public API and embed private data 2019-10-22 10:58:52 +02:00
nm-ip6-config.h libnm: hide GObject structs from public API and embed private data 2019-10-22 10:58:52 +02:00
nm-libnm-utils.c shared: support stripping whitespace from nm_utils_buf_utf8safe_unescape() 2020-05-13 10:28:04 +02:00
nm-libnm-utils.h libnm: fix assertion in NML_IS_DBUS_OBJECT() 2020-05-07 10:01:56 +02:00
nm-object-private.h libnm: refactor caching of D-Bus objects in NMClient 2019-11-25 15:08:00 +01:00
nm-object.c client: add nm_client_get_object_by_path() and nm_object_get_client() API 2020-01-08 18:33:10 +01:00
nm-object.h client: add nm_client_get_object_by_path() and nm_object_get_client() API 2020-01-08 18:33:10 +01:00
nm-remote-connection-private.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-remote-connection.c libnm/doc: fix gtk-doc for deprecated markers in libnm 2020-03-23 09:32:04 +01:00
nm-remote-connection.h libnm: hide GObject structs from public API and embed private data 2019-10-22 10:58:52 +02:00
nm-secret-agent-old.c libnm/doc: fix gtk-doc for deprecated markers in libnm 2020-03-23 09:32:04 +01:00
nm-secret-agent-old.h libnm/secret-agent: rework NMSecretAgentOld 2020-01-28 10:54:14 +01:00
nm-types.h core,libnm: add VRF support 2020-01-14 09:51:56 +01:00
nm-vpn-connection.c libnm: refactor caching of D-Bus objects in NMClient 2019-11-25 15:08:00 +01:00
nm-vpn-connection.h libnm: hide GObject structs from public API and embed private data 2019-10-22 10:58:52 +02:00
nm-vpn-editor.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-vpn-editor.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-vpn-plugin-old.c all: use nm_clear_pointer() instead of g_clear_pointer() 2020-03-23 11:22:38 +01:00
nm-vpn-plugin-old.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-vpn-service-plugin.c all: use nm_clear_pointer() instead of g_clear_pointer() 2020-03-23 11:22:38 +01:00
nm-vpn-service-plugin.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-wifi-p2p-peer.c libnm: ignore "Groups" property of WifiP2PPeer 2020-01-15 13:53:57 +01:00
nm-wifi-p2p-peer.h libnm: hide GObject structs from public API and embed private data 2019-10-22 10:58:52 +02:00
nm-wimax-nsp.c libnm/doc: fix gtk-doc for deprecated markers in libnm 2020-03-23 09:32:04 +01:00
nm-wimax-nsp.h libnm/doc: fix gtk-doc for deprecated markers in libnm 2020-03-23 09:32:04 +01:00