diff --git a/src/libnm-core-impl/nm-setting-8021x.c b/src/libnm-core-impl/nm-setting-8021x.c index 940bf951e..f5592c97a 100644 --- a/src/libnm-core-impl/nm-setting-8021x.c +++ b/src/libnm-core-impl/nm-setting-8021x.c @@ -176,8 +176,8 @@ typedef struct { NMSettingSecretFlags pin_flags; NMSettingSecretFlags private_key_password_flags; NMSettingSecretFlags phase2_private_key_password_flags; - bool optional : 1; - bool system_ca_certs : 1; + bool optional; + bool system_ca_certs; } NMSetting8021xPrivate; /** @@ -4588,13 +4588,14 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) * description: a boolean value. * ---end--- */ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_802_1X_SYSTEM_CA_CERTS, - PROP_SYSTEM_CA_CERTS, - FALSE, - NM_SETTING_PARAM_NONE, - nm_setting_802_1x_get_system_ca_certs); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_802_1X_SYSTEM_CA_CERTS, + PROP_SYSTEM_CA_CERTS, + FALSE, + NM_SETTING_PARAM_NONE, + NMSetting8021xPrivate, + system_ca_certs); /** * NMSetting8021x:auth-timeout: @@ -4638,13 +4639,14 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) * description: whether the 802.1X authentication is optional * ---end--- */ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_802_1X_OPTIONAL, - PROP_OPTIONAL, - FALSE, - NM_SETTING_PARAM_NONE, - nm_setting_802_1x_get_optional); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_802_1X_OPTIONAL, + PROP_OPTIONAL, + FALSE, + NM_SETTING_PARAM_NONE, + NMSetting8021xPrivate, + optional); g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties); diff --git a/src/libnm-core-impl/nm-setting-bridge-port.c b/src/libnm-core-impl/nm-setting-bridge-port.c index aefefe6f1..50be8452d 100644 --- a/src/libnm-core-impl/nm-setting-bridge-port.c +++ b/src/libnm-core-impl/nm-setting-bridge-port.c @@ -36,7 +36,7 @@ typedef struct { GPtrArray *vlans; guint16 priority; guint16 path_cost; - bool hairpin_mode : 1; + bool hairpin_mode; } NMSettingBridgePortPrivate; /** @@ -564,13 +564,14 @@ nm_setting_bridge_port_class_init(NMSettingBridgePortClass *klass) * description: Hairpin mode of the bridge port. * ---end--- */ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_BRIDGE_PORT_HAIRPIN_MODE, - PROP_HAIRPIN_MODE, - FALSE, - NM_SETTING_PARAM_INFERRABLE, - nm_setting_bridge_port_get_hairpin_mode); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_BRIDGE_PORT_HAIRPIN_MODE, + PROP_HAIRPIN_MODE, + FALSE, + NM_SETTING_PARAM_INFERRABLE, + NMSettingBridgePortPrivate, + hairpin_mode); /** * NMSettingBridgePort:vlans: (type GPtrArray(NMBridgeVlan)) diff --git a/src/libnm-core-impl/nm-setting-bridge.c b/src/libnm-core-impl/nm-setting-bridge.c index 54df6480b..2624a4e3e 100644 --- a/src/libnm-core-impl/nm-setting-bridge.c +++ b/src/libnm-core-impl/nm-setting-bridge.c @@ -77,12 +77,12 @@ typedef struct { guint16 max_age; guint16 vlan_default_pvid; guint16 group_forward_mask; - bool multicast_snooping : 1; - bool vlan_filtering : 1; - bool stp : 1; - bool vlan_stats_enabled : 1; - bool multicast_query_use_ifaddr : 1; - bool multicast_querier : 1; + bool stp; + bool multicast_snooping; + bool vlan_filtering; + bool vlan_stats_enabled; + bool multicast_query_use_ifaddr; + bool multicast_querier; } NMSettingBridgePrivate; /** @@ -1672,13 +1672,14 @@ nm_setting_bridge_class_init(NMSettingBridgeClass *klass) * description: Span tree protocol participation. * ---end--- */ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_BRIDGE_STP, - PROP_STP, - NM_BRIDGE_STP_DEF, - NM_SETTING_PARAM_INFERRABLE, - nm_setting_bridge_get_stp); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_BRIDGE_STP, + PROP_STP, + NM_BRIDGE_STP_DEF, + NM_SETTING_PARAM_INFERRABLE, + NMSettingBridgePrivate, + stp); /** * NMSettingBridge:priority: @@ -1831,13 +1832,14 @@ nm_setting_bridge_class_init(NMSettingBridgeClass *klass) * description: IGMP snooping support. * ---end--- */ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_BRIDGE_MULTICAST_SNOOPING, - PROP_MULTICAST_SNOOPING, - NM_BRIDGE_MULTICAST_SNOOPING_DEF, - NM_SETTING_PARAM_INFERRABLE, - nm_setting_bridge_get_multicast_snooping); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_BRIDGE_MULTICAST_SNOOPING, + PROP_MULTICAST_SNOOPING, + NM_BRIDGE_MULTICAST_SNOOPING_DEF, + NM_SETTING_PARAM_INFERRABLE, + NMSettingBridgePrivate, + multicast_snooping); /** * NMSettingBridge:vlan-filtering: @@ -1854,13 +1856,14 @@ nm_setting_bridge_class_init(NMSettingBridgeClass *klass) * description: VLAN filtering support. * ---end--- */ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_BRIDGE_VLAN_FILTERING, - PROP_VLAN_FILTERING, - FALSE, - NM_SETTING_PARAM_INFERRABLE, - nm_setting_bridge_get_vlan_filtering); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_BRIDGE_VLAN_FILTERING, + PROP_VLAN_FILTERING, + FALSE, + NM_SETTING_PARAM_INFERRABLE, + NMSettingBridgePrivate, + vlan_filtering); /** * NMSettingBridge:vlan-default-pvid: @@ -2001,13 +2004,14 @@ nm_setting_bridge_class_init(NMSettingBridgeClass *klass) * * Since: 1.24 */ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_BRIDGE_VLAN_STATS_ENABLED, - PROP_VLAN_STATS_ENABLED, - NM_BRIDGE_VLAN_STATS_ENABLED_DEF, - NM_SETTING_PARAM_INFERRABLE, - nm_setting_bridge_get_vlan_stats_enabled); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_BRIDGE_VLAN_STATS_ENABLED, + PROP_VLAN_STATS_ENABLED, + NM_BRIDGE_VLAN_STATS_ENABLED_DEF, + NM_SETTING_PARAM_INFERRABLE, + NMSettingBridgePrivate, + vlan_stats_enabled); /** * NMSettingBridge:multicast-router: @@ -2052,13 +2056,14 @@ nm_setting_bridge_class_init(NMSettingBridgeClass *klass) * * Since: 1.24 */ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_BRIDGE_MULTICAST_QUERY_USE_IFADDR, - PROP_MULTICAST_QUERY_USE_IFADDR, - NM_BRIDGE_MULTICAST_QUERY_USE_IFADDR_DEF, - NM_SETTING_PARAM_INFERRABLE, - nm_setting_bridge_get_multicast_query_use_ifaddr); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_BRIDGE_MULTICAST_QUERY_USE_IFADDR, + PROP_MULTICAST_QUERY_USE_IFADDR, + NM_BRIDGE_MULTICAST_QUERY_USE_IFADDR_DEF, + NM_SETTING_PARAM_INFERRABLE, + NMSettingBridgePrivate, + multicast_query_use_ifaddr); /** * NMSettingBridge:multicast-querier: @@ -2075,13 +2080,14 @@ nm_setting_bridge_class_init(NMSettingBridgeClass *klass) * * Since: 1.24 */ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_BRIDGE_MULTICAST_QUERIER, - PROP_MULTICAST_QUERIER, - NM_BRIDGE_MULTICAST_QUERIER_DEF, - NM_SETTING_PARAM_INFERRABLE, - nm_setting_bridge_get_multicast_querier); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_BRIDGE_MULTICAST_QUERIER, + PROP_MULTICAST_QUERIER, + NM_BRIDGE_MULTICAST_QUERIER_DEF, + NM_SETTING_PARAM_INFERRABLE, + NMSettingBridgePrivate, + multicast_querier); /** * NMSettingBridge:multicast-hash-max: diff --git a/src/libnm-core-impl/nm-setting-connection.c b/src/libnm-core-impl/nm-setting-connection.c index 4f51da5ab..f833aea7c 100644 --- a/src/libnm-core-impl/nm-setting-connection.c +++ b/src/libnm-core-impl/nm-setting-connection.c @@ -94,7 +94,7 @@ typedef struct { NMMetered metered; NMSettingConnectionLldp lldp; bool autoconnect; - bool read_only : 1; + bool read_only; } NMSettingConnectionPrivate; /** @@ -2200,13 +2200,14 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass) * service's D-Bus interface with the right privileges, or %TRUE if the * connection is read-only and cannot be modified. **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_CONNECTION_READ_ONLY, - PROP_READ_ONLY, - FALSE, - NM_SETTING_PARAM_FUZZY_IGNORE, - nm_setting_connection_get_read_only); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_CONNECTION_READ_ONLY, + PROP_READ_ONLY, + FALSE, + NM_SETTING_PARAM_FUZZY_IGNORE, + NMSettingConnectionPrivate, + read_only); /** * NMSettingConnection:zone: diff --git a/src/libnm-core-impl/nm-setting-gsm.c b/src/libnm-core-impl/nm-setting-gsm.c index d7d8457d0..8b2749d9a 100644 --- a/src/libnm-core-impl/nm-setting-gsm.c +++ b/src/libnm-core-impl/nm-setting-gsm.c @@ -51,8 +51,8 @@ typedef struct { NMSettingSecretFlags password_flags; NMSettingSecretFlags pin_flags; guint32 mtu; - bool auto_config : 1; - bool home_only : 1; + bool auto_config; + bool home_only; } NMSettingGsmPrivate; /** @@ -667,13 +667,14 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass) * * Since: 1.22 **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_GSM_AUTO_CONFIG, - PROP_AUTO_CONFIG, - FALSE, - NM_SETTING_PARAM_NONE, - nm_setting_gsm_get_auto_config); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_GSM_AUTO_CONFIG, + PROP_AUTO_CONFIG, + FALSE, + NM_SETTING_PARAM_NONE, + NMSettingGsmPrivate, + auto_config); /** * NMSettingGsm:number: @@ -794,13 +795,14 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass) * When %TRUE, only connections to the home network will be allowed. * Connections to roaming networks will not be made. **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_GSM_HOME_ONLY, - PROP_HOME_ONLY, - FALSE, - NM_SETTING_PARAM_NONE, - nm_setting_gsm_get_home_only); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_GSM_HOME_ONLY, + PROP_HOME_ONLY, + FALSE, + NM_SETTING_PARAM_NONE, + NMSettingGsmPrivate, + home_only); /** * NMSettingGsm:device-id: diff --git a/src/libnm-core-impl/nm-setting-ip-config.c b/src/libnm-core-impl/nm-setting-ip-config.c index ddd1cc8d5..70807f7c4 100644 --- a/src/libnm-core-impl/nm-setting-ip-config.c +++ b/src/libnm-core-impl/nm-setting-ip-config.c @@ -5816,35 +5816,39 @@ _nm_sett_info_property_override_create_array_ip_config(void) .to_dbus_fcn = _routing_rules_dbus_only_synth, .from_dbus_fcn = _routing_rules_dbus_only_set, )); - _nm_properties_override_gobj(properties_override, - obj_properties[PROP_IGNORE_AUTO_ROUTES], - &nm_sett_info_propert_type_boolean, - .to_dbus_data.get_boolean = (gboolean(*)( - NMSetting *)) nm_setting_ip_config_get_ignore_auto_routes); + _nm_properties_override_gobj( + properties_override, + obj_properties[PROP_IGNORE_AUTO_ROUTES], + &nm_sett_info_propert_type_direct_boolean, + .direct_offset = + NM_STRUCT_OFFSET_ENSURE_TYPE(bool, NMSettingIPConfigPrivate, ignore_auto_routes)); - _nm_properties_override_gobj(properties_override, - obj_properties[PROP_IGNORE_AUTO_DNS], - &nm_sett_info_propert_type_boolean, - .to_dbus_data.get_boolean = (gboolean(*)( - NMSetting *)) nm_setting_ip_config_get_ignore_auto_dns); + _nm_properties_override_gobj( + properties_override, + obj_properties[PROP_IGNORE_AUTO_DNS], + &nm_sett_info_propert_type_direct_boolean, + .direct_offset = + NM_STRUCT_OFFSET_ENSURE_TYPE(bool, NMSettingIPConfigPrivate, ignore_auto_dns)); - _nm_properties_override_gobj(properties_override, - obj_properties[PROP_DHCP_SEND_HOSTNAME], - &nm_sett_info_propert_type_boolean, - .to_dbus_data.get_boolean = (gboolean(*)( - NMSetting *)) nm_setting_ip_config_get_dhcp_send_hostname); + _nm_properties_override_gobj( + properties_override, + obj_properties[PROP_DHCP_SEND_HOSTNAME], + &nm_sett_info_propert_type_direct_boolean, + .direct_offset = + NM_STRUCT_OFFSET_ENSURE_TYPE(bool, NMSettingIPConfigPrivate, dhcp_send_hostname)); - _nm_properties_override_gobj(properties_override, - obj_properties[PROP_NEVER_DEFAULT], - &nm_sett_info_propert_type_boolean, - .to_dbus_data.get_boolean = (gboolean(*)( - NMSetting *)) nm_setting_ip_config_get_never_default); + _nm_properties_override_gobj( + properties_override, + obj_properties[PROP_NEVER_DEFAULT], + &nm_sett_info_propert_type_direct_boolean, + .direct_offset = + NM_STRUCT_OFFSET_ENSURE_TYPE(bool, NMSettingIPConfigPrivate, never_default)); - _nm_properties_override_gobj(properties_override, - obj_properties[PROP_MAY_FAIL], - &nm_sett_info_propert_type_boolean, - .to_dbus_data.get_boolean = - (gboolean(*)(NMSetting *)) nm_setting_ip_config_get_may_fail); + _nm_properties_override_gobj( + properties_override, + obj_properties[PROP_MAY_FAIL], + &nm_sett_info_propert_type_direct_boolean, + .direct_offset = NM_STRUCT_OFFSET_ENSURE_TYPE(bool, NMSettingIPConfigPrivate, may_fail)); return properties_override; } diff --git a/src/libnm-core-impl/nm-setting-ip-tunnel.c b/src/libnm-core-impl/nm-setting-ip-tunnel.c index e5a34f0c4..50adc73ee 100644 --- a/src/libnm-core-impl/nm-setting-ip-tunnel.c +++ b/src/libnm-core-impl/nm-setting-ip-tunnel.c @@ -44,7 +44,7 @@ typedef struct { NMIPTunnelMode mode; guint32 mtu; guint32 flags; - bool path_mtu_discovery : 1; + bool path_mtu_discovery; } NMSettingIPTunnelPrivate; /** @@ -770,13 +770,14 @@ nm_setting_ip_tunnel_class_init(NMSettingIPTunnelClass *klass) * * Since: 1.2 **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_IP_TUNNEL_PATH_MTU_DISCOVERY, - PROP_PATH_MTU_DISCOVERY, - TRUE, - NM_SETTING_PARAM_INFERRABLE, - nm_setting_ip_tunnel_get_path_mtu_discovery); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_IP_TUNNEL_PATH_MTU_DISCOVERY, + PROP_PATH_MTU_DISCOVERY, + TRUE, + NM_SETTING_PARAM_INFERRABLE, + NMSettingIPTunnelPrivate, + path_mtu_discovery); /** * NMSettingIPTunnel:input-key: diff --git a/src/libnm-core-impl/nm-setting-macsec.c b/src/libnm-core-impl/nm-setting-macsec.c index c18080250..1802ba6d2 100644 --- a/src/libnm-core-impl/nm-setting-macsec.c +++ b/src/libnm-core-impl/nm-setting-macsec.c @@ -45,8 +45,8 @@ typedef struct { NMSettingMacsecMode mode; NMSettingSecretFlags mka_cak_flags; NMSettingMacsecValidation validation; - bool encrypt : 1; - bool send_sci : 1; + bool encrypt; + bool send_sci; } NMSettingMacsecPrivate; /** @@ -583,13 +583,14 @@ nm_setting_macsec_class_init(NMSettingMacsecClass *klass) * * Since: 1.6 **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_MACSEC_ENCRYPT, - PROP_ENCRYPT, - TRUE, - NM_SETTING_PARAM_NONE, - nm_setting_macsec_get_encrypt); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_MACSEC_ENCRYPT, + PROP_ENCRYPT, + TRUE, + NM_SETTING_PARAM_NONE, + NMSettingMacsecPrivate, + encrypt); /** * NMSettingMacsec:mka-cak: @@ -676,13 +677,14 @@ nm_setting_macsec_class_init(NMSettingMacsecClass *klass) * * Since: 1.12 **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_MACSEC_SEND_SCI, - PROP_SEND_SCI, - TRUE, - NM_SETTING_PARAM_NONE, - nm_setting_macsec_get_send_sci); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_MACSEC_SEND_SCI, + PROP_SEND_SCI, + TRUE, + NM_SETTING_PARAM_NONE, + NMSettingMacsecPrivate, + send_sci); g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties); diff --git a/src/libnm-core-impl/nm-setting-macvlan.c b/src/libnm-core-impl/nm-setting-macvlan.c index 070a53064..255ec7d59 100644 --- a/src/libnm-core-impl/nm-setting-macvlan.c +++ b/src/libnm-core-impl/nm-setting-macvlan.c @@ -30,8 +30,8 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE(PROP_PARENT, PROP_MODE, PROP_PROMISCUOUS, PROP typedef struct { char * parent; NMSettingMacvlanMode mode; - bool promiscuous : 1; - bool tap : 1; + bool promiscuous; + bool tap; } NMSettingMacvlanPrivate; /** @@ -322,13 +322,14 @@ nm_setting_macvlan_class_init(NMSettingMacvlanClass *klass) * * Since: 1.2 **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_MACVLAN_PROMISCUOUS, - PROP_PROMISCUOUS, - TRUE, - NM_SETTING_PARAM_INFERRABLE, - nm_setting_macvlan_get_promiscuous); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_MACVLAN_PROMISCUOUS, + PROP_PROMISCUOUS, + TRUE, + NM_SETTING_PARAM_INFERRABLE, + NMSettingMacvlanPrivate, + promiscuous); /** * NMSettingMacvlan:tap: @@ -337,13 +338,14 @@ nm_setting_macvlan_class_init(NMSettingMacvlanClass *klass) * * Since: 1.2 **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_MACVLAN_TAP, - PROP_TAP, - FALSE, - NM_SETTING_PARAM_INFERRABLE, - nm_setting_macvlan_get_tap); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_MACVLAN_TAP, + PROP_TAP, + FALSE, + NM_SETTING_PARAM_INFERRABLE, + NMSettingMacvlanPrivate, + tap); g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties); diff --git a/src/libnm-core-impl/nm-setting-ovs-bridge.c b/src/libnm-core-impl/nm-setting-ovs-bridge.c index f4a46c6e3..711d5461c 100644 --- a/src/libnm-core-impl/nm-setting-ovs-bridge.c +++ b/src/libnm-core-impl/nm-setting-ovs-bridge.c @@ -37,9 +37,9 @@ struct _NMSettingOvsBridge { char *fail_mode; char *datapath_type; - bool mcast_snooping_enable : 1; - bool rstp_enable : 1; - bool stp_enable : 1; + bool mcast_snooping_enable; + bool rstp_enable; + bool stp_enable; }; struct _NMSettingOvsBridgeClass { @@ -320,13 +320,14 @@ nm_setting_ovs_bridge_class_init(NMSettingOvsBridgeClass *klass) * * Since: 1.10 **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_OVS_BRIDGE_MCAST_SNOOPING_ENABLE, - PROP_MCAST_SNOOPING_ENABLE, - FALSE, - NM_SETTING_PARAM_NONE, - nm_setting_ovs_bridge_get_mcast_snooping_enable); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_OVS_BRIDGE_MCAST_SNOOPING_ENABLE, + PROP_MCAST_SNOOPING_ENABLE, + FALSE, + NM_SETTING_PARAM_NONE, + NMSettingOvsBridge, + mcast_snooping_enable); /** * NMSettingOvsBridge:rstp-enable: @@ -335,13 +336,14 @@ nm_setting_ovs_bridge_class_init(NMSettingOvsBridgeClass *klass) * * Since: 1.10 **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_OVS_BRIDGE_RSTP_ENABLE, - PROP_RSTP_ENABLE, - FALSE, - NM_SETTING_PARAM_NONE, - nm_setting_ovs_bridge_get_rstp_enable); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_OVS_BRIDGE_RSTP_ENABLE, + PROP_RSTP_ENABLE, + FALSE, + NM_SETTING_PARAM_NONE, + NMSettingOvsBridge, + rstp_enable); /** * NMSettingOvsBridge:stp-enable: @@ -350,13 +352,14 @@ nm_setting_ovs_bridge_class_init(NMSettingOvsBridgeClass *klass) * * Since: 1.10 **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_OVS_BRIDGE_STP_ENABLE, - PROP_STP_ENABLE, - FALSE, - NM_SETTING_PARAM_NONE, - nm_setting_ovs_bridge_get_stp_enable); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_OVS_BRIDGE_STP_ENABLE, + PROP_STP_ENABLE, + FALSE, + NM_SETTING_PARAM_NONE, + NMSettingOvsBridge, + stp_enable); /** * NMSettingOvsBridge:datapath-type: diff --git a/src/libnm-core-impl/nm-setting-ppp.c b/src/libnm-core-impl/nm-setting-ppp.c index 77713feb9..7e62ec656 100644 --- a/src/libnm-core-impl/nm-setting-ppp.c +++ b/src/libnm-core-impl/nm-setting-ppp.c @@ -47,19 +47,19 @@ typedef struct { guint32 mtu; guint32 lcp_echo_failure; guint32 lcp_echo_interval; - bool noauth : 1; - bool refuse_eap : 1; - bool refuse_pap : 1; - bool refuse_chap : 1; - bool refuse_mschap : 1; - bool refuse_mschapv2 : 1; - bool nobsdcomp : 1; - bool nodeflate : 1; - bool no_vj_comp : 1; - bool require_mppe : 1; - bool require_mppe_128 : 1; - bool mppe_stateful : 1; - bool crtscts : 1; + bool noauth; + bool refuse_eap; + bool refuse_pap; + bool refuse_chap; + bool refuse_mschap; + bool refuse_mschapv2; + bool nobsdcomp; + bool nodeflate; + bool no_vj_comp; + bool require_mppe; + bool require_mppe_128; + bool mppe_stateful; + bool crtscts; } NMSettingPppPrivate; /** @@ -552,117 +552,126 @@ nm_setting_ppp_class_init(NMSettingPppClass *klass) * authenticate itself to the client. If %FALSE, require authentication * from the remote side. In almost all cases, this should be %TRUE. **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_PPP_NOAUTH, - PROP_NOAUTH, - TRUE, - NM_SETTING_PARAM_NONE, - nm_setting_ppp_get_noauth); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_PPP_NOAUTH, + PROP_NOAUTH, + TRUE, + NM_SETTING_PARAM_NONE, + NMSettingPppPrivate, + noauth); /** * NMSettingPpp:refuse-eap: * * If %TRUE, the EAP authentication method will not be used. **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_PPP_REFUSE_EAP, - PROP_REFUSE_EAP, - FALSE, - NM_SETTING_PARAM_NONE, - nm_setting_ppp_get_refuse_eap); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_PPP_REFUSE_EAP, + PROP_REFUSE_EAP, + FALSE, + NM_SETTING_PARAM_NONE, + NMSettingPppPrivate, + refuse_eap); /** * NMSettingPpp:refuse-pap: * * If %TRUE, the PAP authentication method will not be used. **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_PPP_REFUSE_PAP, - PROP_REFUSE_PAP, - FALSE, - NM_SETTING_PARAM_NONE, - nm_setting_ppp_get_refuse_pap); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_PPP_REFUSE_PAP, + PROP_REFUSE_PAP, + FALSE, + NM_SETTING_PARAM_NONE, + NMSettingPppPrivate, + refuse_pap); /** * NMSettingPpp:refuse-chap: * * If %TRUE, the CHAP authentication method will not be used. **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_PPP_REFUSE_CHAP, - PROP_REFUSE_CHAP, - FALSE, - NM_SETTING_PARAM_NONE, - nm_setting_ppp_get_refuse_chap); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_PPP_REFUSE_CHAP, + PROP_REFUSE_CHAP, + FALSE, + NM_SETTING_PARAM_NONE, + NMSettingPppPrivate, + refuse_chap); /** * NMSettingPpp:refuse-mschap: * * If %TRUE, the MSCHAP authentication method will not be used. **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_PPP_REFUSE_MSCHAP, - PROP_REFUSE_MSCHAP, - FALSE, - NM_SETTING_PARAM_NONE, - nm_setting_ppp_get_refuse_mschap); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_PPP_REFUSE_MSCHAP, + PROP_REFUSE_MSCHAP, + FALSE, + NM_SETTING_PARAM_NONE, + NMSettingPppPrivate, + refuse_mschap); /** * NMSettingPpp:refuse-mschapv2: * * If %TRUE, the MSCHAPv2 authentication method will not be used. **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_PPP_REFUSE_MSCHAPV2, - PROP_REFUSE_MSCHAPV2, - FALSE, - NM_SETTING_PARAM_NONE, - nm_setting_ppp_get_refuse_mschapv2); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_PPP_REFUSE_MSCHAPV2, + PROP_REFUSE_MSCHAPV2, + FALSE, + NM_SETTING_PARAM_NONE, + NMSettingPppPrivate, + refuse_mschapv2); /** * NMSettingPpp:nobsdcomp: * * If %TRUE, BSD compression will not be requested. **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_PPP_NOBSDCOMP, - PROP_NOBSDCOMP, - FALSE, - NM_SETTING_PARAM_FUZZY_IGNORE, - nm_setting_ppp_get_nobsdcomp); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_PPP_NOBSDCOMP, + PROP_NOBSDCOMP, + FALSE, + NM_SETTING_PARAM_FUZZY_IGNORE, + NMSettingPppPrivate, + nobsdcomp); /** * NMSettingPpp:nodeflate: * * If %TRUE, "deflate" compression will not be requested. **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_PPP_NODEFLATE, - PROP_NODEFLATE, - FALSE, - NM_SETTING_PARAM_FUZZY_IGNORE, - nm_setting_ppp_get_nodeflate); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_PPP_NODEFLATE, + PROP_NODEFLATE, + FALSE, + NM_SETTING_PARAM_FUZZY_IGNORE, + NMSettingPppPrivate, + nodeflate); /** * NMSettingPpp:no-vj-comp: * * If %TRUE, Van Jacobsen TCP header compression will not be requested. **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_PPP_NO_VJ_COMP, - PROP_NO_VJ_COMP, - FALSE, - NM_SETTING_PARAM_FUZZY_IGNORE, - nm_setting_ppp_get_no_vj_comp); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_PPP_NO_VJ_COMP, + PROP_NO_VJ_COMP, + FALSE, + NM_SETTING_PARAM_FUZZY_IGNORE, + NMSettingPppPrivate, + no_vj_comp); /** * NMSettingPpp:require-mppe: @@ -672,13 +681,14 @@ nm_setting_ppp_class_init(NMSettingPppClass *klass) * session will fail. Note that MPPE is not used on mobile broadband * connections. **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_PPP_REQUIRE_MPPE, - PROP_REQUIRE_MPPE, - FALSE, - NM_SETTING_PARAM_NONE, - nm_setting_ppp_get_require_mppe); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_PPP_REQUIRE_MPPE, + PROP_REQUIRE_MPPE, + FALSE, + NM_SETTING_PARAM_NONE, + NMSettingPppPrivate, + require_mppe); /** * NMSettingPpp:require-mppe-128: @@ -687,13 +697,14 @@ nm_setting_ppp_class_init(NMSettingPppClass *klass) * required for the PPP session, and the "require-mppe" property must also * be set to %TRUE. If 128-bit MPPE is not available the session will fail. **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_PPP_REQUIRE_MPPE_128, - PROP_REQUIRE_MPPE_128, - FALSE, - NM_SETTING_PARAM_NONE, - nm_setting_ppp_get_require_mppe_128); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_PPP_REQUIRE_MPPE_128, + PROP_REQUIRE_MPPE_128, + FALSE, + NM_SETTING_PARAM_NONE, + NMSettingPppPrivate, + require_mppe_128); /** * NMSettingPpp:mppe-stateful: @@ -701,13 +712,14 @@ nm_setting_ppp_class_init(NMSettingPppClass *klass) * If %TRUE, stateful MPPE is used. See pppd documentation for more * information on stateful MPPE. **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_PPP_MPPE_STATEFUL, - PROP_MPPE_STATEFUL, - FALSE, - NM_SETTING_PARAM_NONE, - nm_setting_ppp_get_mppe_stateful); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_PPP_MPPE_STATEFUL, + PROP_MPPE_STATEFUL, + FALSE, + NM_SETTING_PARAM_NONE, + NMSettingPppPrivate, + mppe_stateful); /** * NMSettingPpp:crtscts: @@ -716,13 +728,14 @@ nm_setting_ppp_class_init(NMSettingPppClass *klass) * flow control with RTS and CTS signals. This value should normally be set * to %FALSE. **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_PPP_CRTSCTS, - PROP_CRTSCTS, - FALSE, - NM_SETTING_PARAM_NONE, - nm_setting_ppp_get_crtscts); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_PPP_CRTSCTS, + PROP_CRTSCTS, + FALSE, + NM_SETTING_PARAM_NONE, + NMSettingPppPrivate, + crtscts); /** * NMSettingPpp:baud: diff --git a/src/libnm-core-impl/nm-setting-private.h b/src/libnm-core-impl/nm-setting-private.h index 656d43853..dcfd4e615 100644 --- a/src/libnm-core-impl/nm-setting-private.h +++ b/src/libnm-core-impl/nm-setting-private.h @@ -160,11 +160,11 @@ typedef struct { int dhcp_timeout; int required_timeout; guint32 route_table; - bool ignore_auto_routes : 1; - bool ignore_auto_dns : 1; - bool dhcp_send_hostname : 1; - bool never_default : 1; - bool may_fail : 1; + bool ignore_auto_routes; + bool ignore_auto_dns; + bool dhcp_send_hostname; + bool never_default; + bool may_fail; } NMSettingIPConfigPrivate; void _nm_setting_ip_config_private_init(gpointer self, NMSettingIPConfigPrivate *priv); @@ -288,7 +288,6 @@ extern const NMSettInfoPropertType nm_sett_info_propert_type_plain_u; extern const NMSettInfoPropertType nm_sett_info_propert_type_direct_boolean; -extern const NMSettInfoPropertType nm_sett_info_propert_type_boolean; extern const NMSettInfoPropertType nm_sett_info_propert_type_string; NMSettingVerifyResult @@ -317,14 +316,6 @@ GVariant *_nm_setting_property_to_dbus_fcn_direct(const NMSettInfoSetting * NMConnectionSerializationFlags flags, const NMConnectionSerializationOptions *options); -GVariant * -_nm_setting_property_to_dbus_fcn_get_boolean(const NMSettInfoSetting * sett_info, - guint property_idx, - NMConnection * connection, - NMSetting * setting, - NMConnectionSerializationFlags flags, - const NMConnectionSerializationOptions *options); - GVariant * _nm_setting_property_to_dbus_fcn_get_string(const NMSettInfoSetting * sett_info, guint property_idx, @@ -487,69 +478,6 @@ _nm_properties_override(GArray *properties_override, const NMSettInfoProperty *p /*****************************************************************************/ -#define _nm_setting_property_define_boolean_full(properties_override, \ - obj_properties, \ - prop_name, \ - prop_id, \ - default_value, \ - param_flags, \ - property_type, \ - get_fcn, \ - ...) \ - G_STMT_START \ - { \ - const gboolean _default_value = (default_value); \ - GParamSpec * _param_spec; \ - const NMSettInfoPropertType *const _property_type = (property_type); \ - \ - G_STATIC_ASSERT( \ - !NM_FLAGS_ANY((param_flags), \ - ~(NM_SETTING_PARAM_FUZZY_IGNORE | NM_SETTING_PARAM_INFERRABLE \ - | NM_SETTING_PARAM_REAPPLY_IMMEDIATELY))); \ - \ - nm_assert(_property_type); \ - nm_assert(_property_type->to_dbus_fcn == _nm_setting_property_to_dbus_fcn_get_boolean); \ - \ - nm_assert(NM_IN_SET(_default_value, 0, 1)); \ - \ - _param_spec = \ - g_param_spec_boolean("" prop_name "", \ - "", \ - "", \ - _default_value, \ - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | (param_flags)); \ - \ - (obj_properties)[(prop_id)] = _param_spec; \ - \ - _nm_properties_override_gobj((properties_override), \ - _param_spec, \ - _property_type, \ - .to_dbus_data.get_boolean = \ - (gboolean(*)(NMSetting *)) (get_fcn), \ - __VA_ARGS__); \ - } \ - G_STMT_END - -#define _nm_setting_property_define_boolean(properties_override, \ - obj_properties, \ - prop_name, \ - prop_id, \ - default_value, \ - param_flags, \ - get_fcn, \ - ...) \ - _nm_setting_property_define_boolean_full((properties_override), \ - (obj_properties), \ - prop_name, \ - (prop_id), \ - (default_value), \ - (param_flags), \ - &nm_sett_info_propert_type_boolean, \ - (get_fcn), \ - __VA_ARGS__) - -/*****************************************************************************/ - #define _nm_setting_property_define_string_full(properties_override, \ obj_properties, \ prop_name, \ diff --git a/src/libnm-core-impl/nm-setting-proxy.c b/src/libnm-core-impl/nm-setting-proxy.c index e4bd88fa7..3f888ec7d 100644 --- a/src/libnm-core-impl/nm-setting-proxy.c +++ b/src/libnm-core-impl/nm-setting-proxy.c @@ -32,7 +32,7 @@ typedef struct { char *pac_url; char *pac_script; int method; - bool browser_only : 1; + bool browser_only; } NMSettingProxyPrivate; /** @@ -345,13 +345,14 @@ nm_setting_proxy_class_init(NMSettingProxyClass *klass) * description: Whether the proxy configuration is for browser only. * ---end--- */ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_PROXY_BROWSER_ONLY, - PROP_BROWSER_ONLY, - FALSE, - NM_SETTING_PARAM_NONE, - nm_setting_proxy_get_browser_only); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_PROXY_BROWSER_ONLY, + PROP_BROWSER_ONLY, + FALSE, + NM_SETTING_PARAM_NONE, + NMSettingProxyPrivate, + browser_only); /** * NMSettingProxy:pac-url: diff --git a/src/libnm-core-impl/nm-setting-tun.c b/src/libnm-core-impl/nm-setting-tun.c index 3975d0002..99a68024e 100644 --- a/src/libnm-core-impl/nm-setting-tun.c +++ b/src/libnm-core-impl/nm-setting-tun.c @@ -35,9 +35,9 @@ typedef struct { char * owner; char * group; NMSettingTunMode mode; - bool pi : 1; - bool vnet_hdr : 1; - bool multi_queue : 1; + bool pi; + bool vnet_hdr; + bool multi_queue; } NMSettingTunPrivate; /** @@ -369,13 +369,14 @@ nm_setting_tun_class_init(NMSettingTunClass *klass) * * Since: 1.2 */ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_TUN_PI, - PROP_PI, - FALSE, - NM_SETTING_PARAM_INFERRABLE, - nm_setting_tun_get_pi); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_TUN_PI, + PROP_PI, + FALSE, + NM_SETTING_PARAM_INFERRABLE, + NMSettingTunPrivate, + pi); /** * NMSettingTun:vnet-hdr: @@ -385,13 +386,14 @@ nm_setting_tun_class_init(NMSettingTunClass *klass) * * Since: 1.2 */ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_TUN_VNET_HDR, - PROP_VNET_HDR, - FALSE, - NM_SETTING_PARAM_INFERRABLE, - nm_setting_tun_get_vnet_hdr); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_TUN_VNET_HDR, + PROP_VNET_HDR, + FALSE, + NM_SETTING_PARAM_INFERRABLE, + NMSettingTunPrivate, + vnet_hdr); /** * NMSettingTun:multi-queue: @@ -403,13 +405,14 @@ nm_setting_tun_class_init(NMSettingTunClass *klass) * * Since: 1.2 */ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_TUN_MULTI_QUEUE, - PROP_MULTI_QUEUE, - FALSE, - NM_SETTING_PARAM_INFERRABLE, - nm_setting_tun_get_multi_queue); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_TUN_MULTI_QUEUE, + PROP_MULTI_QUEUE, + FALSE, + NM_SETTING_PARAM_INFERRABLE, + NMSettingTunPrivate, + multi_queue); g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties); diff --git a/src/libnm-core-impl/nm-setting-vpn.c b/src/libnm-core-impl/nm-setting-vpn.c index c94a86e9f..1df4f6613 100644 --- a/src/libnm-core-impl/nm-setting-vpn.c +++ b/src/libnm-core-impl/nm-setting-vpn.c @@ -47,11 +47,6 @@ typedef struct { */ char *user_name; - /* Whether the VPN stays up across link changes, until the user - * explicitly disconnects it. - */ - gboolean persistent; - /* The hash table is created at setting object * init time and should not be replaced. It is * a char * -> char * mapping, and both the key @@ -72,6 +67,12 @@ typedef struct { /* Timeout for the VPN service to establish the connection */ guint32 timeout; + + /* Whether the VPN stays up across link changes, until the user + * explicitly disconnects it. + */ + bool persistent; + } NMSettingVpnPrivate; /** @@ -1172,13 +1173,14 @@ nm_setting_vpn_class_init(NMSettingVpnClass *klass) * the VPN will attempt to stay connected across link changes and outages, * until explicitly disconnected. **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_VPN_PERSISTENT, - PROP_PERSISTENT, - FALSE, - NM_SETTING_PARAM_NONE, - nm_setting_vpn_get_persistent); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_VPN_PERSISTENT, + PROP_PERSISTENT, + FALSE, + NM_SETTING_PARAM_NONE, + NMSettingVpnPrivate, + persistent); /** * NMSettingVpn:data: (type GHashTable(utf8,utf8)): diff --git a/src/libnm-core-impl/nm-setting-vxlan.c b/src/libnm-core-impl/nm-setting-vxlan.c index 845ede04c..e62503433 100644 --- a/src/libnm-core-impl/nm-setting-vxlan.c +++ b/src/libnm-core-impl/nm-setting-vxlan.c @@ -53,11 +53,11 @@ typedef struct { guint ttl; guint ageing; guint limit; - bool learning : 1; - bool proxy : 1; - bool rsc : 1; - bool l2_miss : 1; - bool l3_miss : 1; + bool proxy; + bool learning; + bool rsc; + bool l2_miss; + bool l3_miss; } NMSettingVxlanPrivate; /** @@ -595,6 +595,7 @@ nm_setting_vxlan_class_init(NMSettingVxlanClass *klass) "", NULL, G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS); + /** * NMSettingVxlan:id: * @@ -765,13 +766,14 @@ nm_setting_vxlan_class_init(NMSettingVxlanClass *klass) * * Since: 1.2 **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_VXLAN_PROXY, - PROP_PROXY, - FALSE, - NM_SETTING_PARAM_INFERRABLE, - nm_setting_vxlan_get_proxy); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_VXLAN_PROXY, + PROP_PROXY, + FALSE, + NM_SETTING_PARAM_INFERRABLE, + NMSettingVxlanPrivate, + proxy); /** * NMSettingVxlan:learning: @@ -781,13 +783,14 @@ nm_setting_vxlan_class_init(NMSettingVxlanClass *klass) * * Since: 1.2 **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_VXLAN_LEARNING, - PROP_LEARNING, - TRUE, - NM_SETTING_PARAM_INFERRABLE, - nm_setting_vxlan_get_learning); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_VXLAN_LEARNING, + PROP_LEARNING, + TRUE, + NM_SETTING_PARAM_INFERRABLE, + NMSettingVxlanPrivate, + learning); /** * NMSettingVxlan:rsc: @@ -796,13 +799,14 @@ nm_setting_vxlan_class_init(NMSettingVxlanClass *klass) * * Since: 1.2 **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_VXLAN_RSC, - PROP_RSC, - FALSE, - NM_SETTING_PARAM_INFERRABLE, - nm_setting_vxlan_get_rsc); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_VXLAN_RSC, + PROP_RSC, + FALSE, + NM_SETTING_PARAM_INFERRABLE, + NMSettingVxlanPrivate, + rsc); /** * NMSettingVxlan:l2-miss: @@ -811,13 +815,14 @@ nm_setting_vxlan_class_init(NMSettingVxlanClass *klass) * * Since: 1.2 **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_VXLAN_L2_MISS, - PROP_L2_MISS, - FALSE, - NM_SETTING_PARAM_INFERRABLE, - nm_setting_vxlan_get_l2_miss); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_VXLAN_L2_MISS, + PROP_L2_MISS, + FALSE, + NM_SETTING_PARAM_INFERRABLE, + NMSettingVxlanPrivate, + l2_miss); /** * NMSettingVxlan:l3-miss: @@ -826,13 +831,14 @@ nm_setting_vxlan_class_init(NMSettingVxlanClass *klass) * * Since: 1.2 **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_VXLAN_L3_MISS, - PROP_L3_MISS, - FALSE, - NM_SETTING_PARAM_INFERRABLE, - nm_setting_vxlan_get_l3_miss); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_VXLAN_L3_MISS, + PROP_L3_MISS, + FALSE, + NM_SETTING_PARAM_INFERRABLE, + NMSettingVxlanPrivate, + l3_miss); g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties); diff --git a/src/libnm-core-impl/nm-setting-wired.c b/src/libnm-core-impl/nm-setting-wired.c index 7e64949de..326cdc1f4 100644 --- a/src/libnm-core-impl/nm-setting-wired.c +++ b/src/libnm-core-impl/nm-setting-wired.c @@ -66,7 +66,7 @@ typedef struct { NMTernary accept_all_mac_addresses; guint32 speed; guint32 mtu; - bool auto_negotiate : 1; + bool auto_negotiate; } NMSettingWiredPrivate; /** @@ -1380,14 +1380,15 @@ nm_setting_wired_class_init(NMSettingWiredClass *klass) * "speed" and "duplex" parameters (skips link configuration). * ---end--- */ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_WIRED_AUTO_NEGOTIATE, - PROP_AUTO_NEGOTIATE, - FALSE, - NM_SETTING_PARAM_NONE, - nm_setting_wired_get_auto_negotiate, - .to_dbus_data.including_default = TRUE); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_WIRED_AUTO_NEGOTIATE, + PROP_AUTO_NEGOTIATE, + FALSE, + NM_SETTING_PARAM_NONE, + NMSettingWiredPrivate, + auto_negotiate, + .to_dbus_data.including_default = TRUE); /** * NMSettingWired:mac-address: diff --git a/src/libnm-core-impl/nm-setting-wireguard.c b/src/libnm-core-impl/nm-setting-wireguard.c index ba99ea0bf..d6fa853be 100644 --- a/src/libnm-core-impl/nm-setting-wireguard.c +++ b/src/libnm-core-impl/nm-setting-wireguard.c @@ -902,8 +902,8 @@ typedef struct { guint32 fwmark; guint32 mtu; guint16 listen_port; + bool peer_routes; bool private_key_valid : 1; - bool peer_routes : 1; } NMSettingWireGuardPrivate; /** @@ -2514,13 +2514,14 @@ nm_setting_wireguard_class_init(NMSettingWireGuardClass *klass) * * Since: 1.16 **/ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_WIREGUARD_PEER_ROUTES, - PROP_PEER_ROUTES, - TRUE, - NM_SETTING_PARAM_INFERRABLE, - nm_setting_wireguard_get_peer_routes); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_WIREGUARD_PEER_ROUTES, + PROP_PEER_ROUTES, + TRUE, + NM_SETTING_PARAM_INFERRABLE, + NMSettingWireGuardPrivate, + peer_routes); /** * NMSettingWireGuard:mtu: diff --git a/src/libnm-core-impl/nm-setting-wireless.c b/src/libnm-core-impl/nm-setting-wireless.c index a7ad9624b..83f8afc15 100644 --- a/src/libnm-core-impl/nm-setting-wireless.c +++ b/src/libnm-core-impl/nm-setting-wireless.c @@ -63,7 +63,7 @@ typedef struct { guint32 mtu; guint32 powersave; guint32 wowl; - bool hidden : 1; + bool hidden; } NMSettingWirelessPrivate; /** @@ -1833,13 +1833,14 @@ nm_setting_wireless_class_init(NMSettingWirelessClass *klass) * description: Whether the network hides the SSID. * ---end--- */ - _nm_setting_property_define_boolean(properties_override, - obj_properties, - NM_SETTING_WIRELESS_HIDDEN, - PROP_HIDDEN, - FALSE, - NM_SETTING_PARAM_NONE, - nm_setting_wireless_get_hidden); + _nm_setting_property_define_direct_boolean(properties_override, + obj_properties, + NM_SETTING_WIRELESS_HIDDEN, + PROP_HIDDEN, + FALSE, + NM_SETTING_PARAM_NONE, + NMSettingWirelessPrivate, + hidden); /** * NMSettingWireless:powersave: diff --git a/src/libnm-core-impl/nm-setting.c b/src/libnm-core-impl/nm-setting.c index 8dfdad26d..c3b324d60 100644 --- a/src/libnm-core-impl/nm-setting.c +++ b/src/libnm-core-impl/nm-setting.c @@ -570,24 +570,6 @@ _nm_setting_property_to_dbus_fcn_direct(const NMSettInfoSetting * } } -GVariant * -_nm_setting_property_to_dbus_fcn_get_boolean(const NMSettInfoSetting * sett_info, - guint property_idx, - NMConnection * connection, - NMSetting * setting, - NMConnectionSerializationFlags flags, - const NMConnectionSerializationOptions *options) -{ - const NMSettInfoProperty *property_info = &sett_info->property_infos[property_idx]; - gboolean val; - - val = !!property_info->to_dbus_data.get_boolean(setting); - if (!property_info->to_dbus_data.including_default - && val == NM_G_PARAM_SPEC_GET_DEFAULT_BOOLEAN(property_info->param_spec)) - return NULL; - return g_variant_ref(nm_g_variant_singleton_b(val)); -} - GVariant * _nm_setting_property_to_dbus_fcn_get_string(const NMSettInfoSetting * sett_info, guint property_idx, @@ -2446,10 +2428,6 @@ const NMSettInfoPropertType nm_sett_info_propert_type_direct_boolean = .direct_type = NM_VALUE_TYPE_BOOL, .to_dbus_fcn = _nm_setting_property_to_dbus_fcn_direct); -const NMSettInfoPropertType nm_sett_info_propert_type_boolean = NM_SETT_INFO_PROPERT_TYPE_DBUS_INIT( - G_VARIANT_TYPE_BOOLEAN, - .to_dbus_fcn = _nm_setting_property_to_dbus_fcn_get_boolean); - const NMSettInfoPropertType nm_sett_info_propert_type_string = NM_SETT_INFO_PROPERT_TYPE_DBUS_INIT(G_VARIANT_TYPE_STRING, .to_dbus_fcn = _nm_setting_property_to_dbus_fcn_get_string); diff --git a/src/libnm-core-impl/tests/test-setting.c b/src/libnm-core-impl/tests/test-setting.c index 41db66e90..beec0aff8 100644 --- a/src/libnm-core-impl/tests/test-setting.c +++ b/src/libnm-core-impl/tests/test-setting.c @@ -4481,12 +4481,6 @@ check_done:; != NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_DEFAULT) g_assert(!sip->to_dbus_data.gprop_to_dbus_fcn); can_set_including_default = TRUE; - } else if (sip->property_type->to_dbus_fcn - == _nm_setting_property_to_dbus_fcn_get_boolean) { - g_assert(sip->param_spec); - g_assert(sip->param_spec->value_type == G_TYPE_BOOLEAN); - g_assert(sip->to_dbus_data.get_boolean); - can_set_including_default = TRUE; } else if (sip->property_type->to_dbus_fcn == _nm_setting_property_to_dbus_fcn_get_string) { g_assert(sip->param_spec); diff --git a/src/libnm-core-intern/nm-core-internal.h b/src/libnm-core-intern/nm-core-internal.h index 2c5bb9342..4d7a4cb85 100644 --- a/src/libnm-core-intern/nm-core-internal.h +++ b/src/libnm-core-intern/nm-core-internal.h @@ -725,7 +725,6 @@ struct _NMSettInfoProperty { union { gpointer none; NMSettInfoPropGPropToDBusFcn gprop_to_dbus_fcn; - gboolean (*get_boolean)(NMSetting *); const char *(*get_string)(NMSetting *); };