mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-06 12:00:17 +01:00
libnm: add and use NM_SETT_INFO_PROPERT_TYPE_DBUS() macro
(cherry picked from commit 69597a67c1)
This commit is contained in:
parent
db9ae06cfd
commit
0d95b3c300
12 changed files with 74 additions and 67 deletions
|
|
@ -2182,8 +2182,8 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
obj_properties[PROP_TIMESTAMP],
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_UINT64,
|
||||
.to_dbus_fcn = _to_dbus_fcn_timestamp, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(G_VARIANT_TYPE_UINT64,
|
||||
.to_dbus_fcn = _to_dbus_fcn_timestamp, ));
|
||||
|
||||
/**
|
||||
* NMSettingConnection:read-only:
|
||||
|
|
|
|||
|
|
@ -5774,9 +5774,9 @@ _nm_sett_info_property_override_create_array_ip_config(void)
|
|||
_nm_properties_override_dbus(
|
||||
properties_override,
|
||||
NM_SETTING_IP_CONFIG_ROUTING_RULES,
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = _routing_rules_dbus_only_synth,
|
||||
.from_dbus_fcn = _routing_rules_dbus_only_set, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = _routing_rules_dbus_only_synth,
|
||||
.from_dbus_fcn = _routing_rules_dbus_only_set, ));
|
||||
|
||||
return properties_override;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -972,14 +972,14 @@ nm_setting_ip4_config_class_init(NMSettingIP4ConfigClass *klass)
|
|||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
g_object_class_find_property(G_OBJECT_CLASS(setting_class), NM_SETTING_IP_CONFIG_ADDRESSES),
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("aau"),
|
||||
.to_dbus_fcn = ip4_addresses_get,
|
||||
.from_dbus_fcn = ip4_addresses_set, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aau"),
|
||||
.to_dbus_fcn = ip4_addresses_get,
|
||||
.from_dbus_fcn = ip4_addresses_set, ));
|
||||
_nm_properties_override_dbus(
|
||||
properties_override,
|
||||
"address-labels",
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_STRING_ARRAY,
|
||||
.to_dbus_fcn = ip4_address_labels_get, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(G_VARIANT_TYPE_STRING_ARRAY,
|
||||
.to_dbus_fcn = ip4_address_labels_get, ));
|
||||
|
||||
/* ---dbus---
|
||||
* property: address-data
|
||||
|
|
@ -993,9 +993,9 @@ nm_setting_ip4_config_class_init(NMSettingIP4ConfigClass *klass)
|
|||
_nm_properties_override_dbus(
|
||||
properties_override,
|
||||
"address-data",
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = ip4_address_data_get,
|
||||
.from_dbus_fcn = ip4_address_data_set, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = ip4_address_data_get,
|
||||
.from_dbus_fcn = ip4_address_data_set, ));
|
||||
|
||||
/* ---dbus---
|
||||
* property: routes
|
||||
|
|
@ -1026,9 +1026,9 @@ nm_setting_ip4_config_class_init(NMSettingIP4ConfigClass *klass)
|
|||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
g_object_class_find_property(G_OBJECT_CLASS(setting_class), NM_SETTING_IP_CONFIG_ROUTES),
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("aau"),
|
||||
.to_dbus_fcn = ip4_routes_get,
|
||||
.from_dbus_fcn = ip4_routes_set, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aau"),
|
||||
.to_dbus_fcn = ip4_routes_get,
|
||||
.from_dbus_fcn = ip4_routes_set, ));
|
||||
|
||||
/* ---dbus---
|
||||
* property: route-data
|
||||
|
|
@ -1043,11 +1043,12 @@ nm_setting_ip4_config_class_init(NMSettingIP4ConfigClass *klass)
|
|||
* also exist on some routes.
|
||||
* ---end---
|
||||
*/
|
||||
_nm_properties_override_dbus(properties_override,
|
||||
"route-data",
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = ip4_route_data_get,
|
||||
.from_dbus_fcn = ip4_route_data_set, ));
|
||||
_nm_properties_override_dbus(
|
||||
properties_override,
|
||||
"route-data",
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = ip4_route_data_get,
|
||||
.from_dbus_fcn = ip4_route_data_set, ));
|
||||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
|
|
|
|||
|
|
@ -1033,9 +1033,9 @@ nm_setting_ip6_config_class_init(NMSettingIP6ConfigClass *klass)
|
|||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
g_object_class_find_property(G_OBJECT_CLASS(setting_class), NM_SETTING_IP_CONFIG_ADDRESSES),
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("a(ayuay)"),
|
||||
.to_dbus_fcn = ip6_addresses_get,
|
||||
.from_dbus_fcn = ip6_addresses_set, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("a(ayuay)"),
|
||||
.to_dbus_fcn = ip6_addresses_get,
|
||||
.from_dbus_fcn = ip6_addresses_set, ));
|
||||
|
||||
/* ---dbus---
|
||||
* property: address-data
|
||||
|
|
@ -1049,9 +1049,9 @@ nm_setting_ip6_config_class_init(NMSettingIP6ConfigClass *klass)
|
|||
_nm_properties_override_dbus(
|
||||
properties_override,
|
||||
"address-data",
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = ip6_address_data_get,
|
||||
.from_dbus_fcn = ip6_address_data_set, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = ip6_address_data_get,
|
||||
.from_dbus_fcn = ip6_address_data_set, ));
|
||||
|
||||
/* ---dbus---
|
||||
* property: routes
|
||||
|
|
@ -1070,9 +1070,9 @@ nm_setting_ip6_config_class_init(NMSettingIP6ConfigClass *klass)
|
|||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
g_object_class_find_property(G_OBJECT_CLASS(setting_class), NM_SETTING_IP_CONFIG_ROUTES),
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("a(ayuayu)"),
|
||||
.to_dbus_fcn = ip6_routes_get,
|
||||
.from_dbus_fcn = ip6_routes_set, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("a(ayuayu)"),
|
||||
.to_dbus_fcn = ip6_routes_get,
|
||||
.from_dbus_fcn = ip6_routes_set, ));
|
||||
|
||||
/* ---dbus---
|
||||
* property: route-data
|
||||
|
|
@ -1087,11 +1087,12 @@ nm_setting_ip6_config_class_init(NMSettingIP6ConfigClass *klass)
|
|||
* also exist on some routes.
|
||||
* ---end---
|
||||
*/
|
||||
_nm_properties_override_dbus(properties_override,
|
||||
"route-data",
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = ip6_route_data_get,
|
||||
.from_dbus_fcn = ip6_route_data_set, ));
|
||||
_nm_properties_override_dbus(
|
||||
properties_override,
|
||||
"route-data",
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = ip6_route_data_get,
|
||||
.from_dbus_fcn = ip6_route_data_set, ));
|
||||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
|
|
|
|||
|
|
@ -324,10 +324,13 @@ _nm_setting_class_commit(NMSettingClass *setting_class, NMMetaSettingType meta_t
|
|||
&_g; \
|
||||
})
|
||||
|
||||
#define NM_SETT_INFO_PROPERT_TYPE_GPROP(_dbus_type, ...) \
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = _dbus_type, \
|
||||
.to_dbus_fcn = _nm_setting_property_to_dbus_fcn_gprop, \
|
||||
__VA_ARGS__)
|
||||
#define NM_SETT_INFO_PROPERT_TYPE_DBUS(_dbus_type, ...) \
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = _dbus_type, __VA_ARGS__)
|
||||
|
||||
#define NM_SETT_INFO_PROPERT_TYPE_GPROP(_dbus_type, ...) \
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(_dbus_type, \
|
||||
.to_dbus_fcn = _nm_setting_property_to_dbus_fcn_gprop, \
|
||||
__VA_ARGS__)
|
||||
|
||||
#define NM_SETT_INFO_PROPERTY(...) (&((const NMSettInfoProperty){__VA_ARGS__}))
|
||||
|
||||
|
|
|
|||
|
|
@ -1325,9 +1325,9 @@ nm_setting_sriov_class_init(NMSettingSriovClass *klass)
|
|||
| G_PARAM_STATIC_STRINGS);
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[PROP_VFS],
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = vfs_to_dbus,
|
||||
.from_dbus_fcn = vfs_from_dbus, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = vfs_to_dbus,
|
||||
.from_dbus_fcn = vfs_from_dbus, ));
|
||||
|
||||
/**
|
||||
* NMSettingSriov:autoprobe-drivers
|
||||
|
|
|
|||
|
|
@ -1838,9 +1838,9 @@ nm_setting_tc_config_class_init(NMSettingTCConfigClass *klass)
|
|||
| G_PARAM_STATIC_STRINGS);
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[PROP_QDISCS],
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = tc_qdiscs_get,
|
||||
.from_dbus_fcn = tc_qdiscs_set, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = tc_qdiscs_get,
|
||||
.from_dbus_fcn = tc_qdiscs_set, ));
|
||||
|
||||
/**
|
||||
* NMSettingTCConfig:tfilters: (type GPtrArray(NMTCTfilter))
|
||||
|
|
@ -1870,11 +1870,12 @@ nm_setting_tc_config_class_init(NMSettingTCConfigClass *klass)
|
|||
"",
|
||||
G_TYPE_PTR_ARRAY,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[PROP_TFILTERS],
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = tc_tfilters_get,
|
||||
.from_dbus_fcn = tc_tfilters_set, ));
|
||||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
obj_properties[PROP_TFILTERS],
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = tc_tfilters_get,
|
||||
.from_dbus_fcn = tc_tfilters_set, ));
|
||||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
|
|
|
|||
|
|
@ -926,9 +926,9 @@ nm_setting_vlan_class_init(NMSettingVlanClass *klass)
|
|||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
obj_properties[PROP_FLAGS],
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_UINT32,
|
||||
.to_dbus_fcn = _override_flags_get,
|
||||
.missing_from_dbus_fcn = _override_flags_not_set, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(G_VARIANT_TYPE_UINT32,
|
||||
.to_dbus_fcn = _override_flags_get,
|
||||
.missing_from_dbus_fcn = _override_flags_not_set, ));
|
||||
|
||||
/**
|
||||
* NMSettingVlan:ingress-priority-map:
|
||||
|
|
|
|||
|
|
@ -1226,9 +1226,9 @@ nm_setting_vpn_class_init(NMSettingVpnClass *klass)
|
|||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
obj_properties[PROP_SECRETS],
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("a{ss}"),
|
||||
.to_dbus_fcn = vpn_secrets_to_dbus,
|
||||
.from_dbus_fcn = vpn_secrets_from_dbus, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("a{ss}"),
|
||||
.to_dbus_fcn = vpn_secrets_to_dbus,
|
||||
.from_dbus_fcn = vpn_secrets_from_dbus, ));
|
||||
|
||||
/**
|
||||
* NMSettingVpn:timeout:
|
||||
|
|
|
|||
|
|
@ -1395,10 +1395,11 @@ nm_setting_wired_class_init(NMSettingWiredClass *klass)
|
|||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[PROP_AUTO_NEGOTIATE],
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_BOOLEAN,
|
||||
.to_dbus_fcn = _override_autoneg_get, ));
|
||||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
obj_properties[PROP_AUTO_NEGOTIATE],
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(G_VARIANT_TYPE_BOOLEAN,
|
||||
.to_dbus_fcn = _override_autoneg_get, ));
|
||||
|
||||
/**
|
||||
* NMSettingWired:mac-address:
|
||||
|
|
|
|||
|
|
@ -2594,9 +2594,9 @@ nm_setting_wireguard_class_init(NMSettingWireGuardClass *klass)
|
|||
_nm_properties_override_dbus(
|
||||
properties_override,
|
||||
NM_SETTING_WIREGUARD_PEERS,
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = _peers_dbus_only_synth,
|
||||
.from_dbus_fcn = _peers_dbus_only_set, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = _peers_dbus_only_synth,
|
||||
.from_dbus_fcn = _peers_dbus_only_set, ));
|
||||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
|
|
|
|||
|
|
@ -1743,8 +1743,8 @@ nm_setting_wireless_class_init(NMSettingWirelessClass *klass)
|
|||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
obj_properties[PROP_SEEN_BSSIDS],
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_STRING_ARRAY,
|
||||
.to_dbus_fcn = _to_dbus_fcn_seen_bssids, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(G_VARIANT_TYPE_STRING_ARRAY,
|
||||
.to_dbus_fcn = _to_dbus_fcn_seen_bssids, ));
|
||||
|
||||
/**
|
||||
* NMSettingWireless:mtu:
|
||||
|
|
@ -1871,8 +1871,8 @@ nm_setting_wireless_class_init(NMSettingWirelessClass *klass)
|
|||
_nm_properties_override_dbus(
|
||||
properties_override,
|
||||
"security",
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_STRING,
|
||||
.to_dbus_fcn = nm_setting_wireless_get_security, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(G_VARIANT_TYPE_STRING,
|
||||
.to_dbus_fcn = nm_setting_wireless_get_security, ));
|
||||
|
||||
/**
|
||||
* NMSettingWireless:wake-on-wlan:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue