libnm: extend NMSettInfoSetting with an offset to the private data
NMSetting instances either have no private data, they use g_type_add_class_private(), or they embed the private data in the NMSetting struct. In all cases, we can find the private data at a fixed offset. Track that offset in the NMSettInfoSetting meta data. This will be useful, because properties really are stored in simple fields, like a boolean property can be stored in a "bool" field. We will extend the property meta data to track the offset of this property field, but we also need to know where the offset starts.
This commit is contained in:
@@ -225,8 +225,9 @@ nm_setting_6lowpan_class_init(NMSetting6LowpanClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_6LOWPAN,
|
NM_META_SETTING_TYPE_6LOWPAN,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -4648,8 +4648,9 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_802_1X,
|
NM_META_SETTING_TYPE_802_1X,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -454,8 +454,9 @@ nm_setting_adsl_class_init(NMSettingAdslClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_ADSL,
|
NM_META_SETTING_TYPE_ADSL,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -341,8 +341,9 @@ nm_setting_bluetooth_class_init(NMSettingBluetoothClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_BLUETOOTH,
|
NM_META_SETTING_TYPE_BLUETOOTH,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -1231,8 +1231,9 @@ nm_setting_bond_class_init(NMSettingBondClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_BOND,
|
NM_META_SETTING_TYPE_BOND,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -609,8 +609,9 @@ nm_setting_bridge_port_class_init(NMSettingBridgePortClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_BRIDGE_PORT,
|
NM_META_SETTING_TYPE_BRIDGE_PORT,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -2301,8 +2301,9 @@ nm_setting_bridge_class_init(NMSettingBridgeClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_BRIDGE,
|
NM_META_SETTING_TYPE_BRIDGE,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
G_STRUCT_OFFSET(NMSettingBridge, _priv));
|
||||||
}
|
}
|
||||||
|
@@ -370,5 +370,5 @@ nm_setting_cdma_class_init(NMSettingCdmaClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_CDMA);
|
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_CDMA, NULL, NULL, 0);
|
||||||
}
|
}
|
||||||
|
@@ -2568,8 +2568,9 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_CONNECTION,
|
NM_META_SETTING_TYPE_CONNECTION,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -1282,8 +1282,9 @@ nm_setting_dcb_class_init(NMSettingDcbClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_DCB,
|
NM_META_SETTING_TYPE_DCB,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -78,5 +78,5 @@ nm_setting_dummy_class_init(NMSettingDummyClass *klass)
|
|||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
|
||||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_DUMMY);
|
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_DUMMY, NULL, NULL, 0);
|
||||||
}
|
}
|
||||||
|
@@ -407,11 +407,12 @@ nm_setting_ethtool_class_init(NMSettingEthtoolClass *klass)
|
|||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
|
||||||
_nm_setting_class_commit_full(
|
_nm_setting_class_commit(
|
||||||
setting_class,
|
setting_class,
|
||||||
NM_META_SETTING_TYPE_ETHTOOL,
|
NM_META_SETTING_TYPE_ETHTOOL,
|
||||||
NM_SETT_INFO_SETT_DETAIL(.gendata_info =
|
NM_SETT_INFO_SETT_DETAIL(.gendata_info =
|
||||||
NM_SETT_INFO_SETT_GENDATA(.get_variant_type =
|
NM_SETT_INFO_SETT_GENDATA(.get_variant_type =
|
||||||
get_variant_type, ), ),
|
get_variant_type, ), ),
|
||||||
NULL);
|
NULL,
|
||||||
|
0);
|
||||||
}
|
}
|
||||||
|
@@ -74,5 +74,5 @@ nm_setting_generic_class_init(NMSettingGenericClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private(klass, sizeof(NMSettingGenericPrivate));
|
g_type_class_add_private(klass, sizeof(NMSettingGenericPrivate));
|
||||||
|
|
||||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_GENERIC);
|
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_GENERIC, NULL, NULL, 0);
|
||||||
}
|
}
|
||||||
|
@@ -879,8 +879,9 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_GSM,
|
NM_META_SETTING_TYPE_GSM,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -335,5 +335,5 @@ nm_setting_hostname_class_init(NMSettingHostnameClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_HOSTNAME);
|
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_HOSTNAME, NULL, NULL, 0);
|
||||||
}
|
}
|
||||||
|
@@ -530,8 +530,9 @@ nm_setting_infiniband_class_init(NMSettingInfinibandClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_INFINIBAND,
|
NM_META_SETTING_TYPE_INFINIBAND,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -881,8 +881,9 @@ nm_setting_ip_tunnel_class_init(NMSettingIPTunnelClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_IP_TUNNEL,
|
NM_META_SETTING_TYPE_IP_TUNNEL,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -1052,8 +1052,9 @@ nm_setting_ip4_config_class_init(NMSettingIP4ConfigClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_IP4_CONFIG,
|
NM_META_SETTING_TYPE_IP4_CONFIG,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -1096,8 +1096,9 @@ nm_setting_ip6_config_class_init(NMSettingIP6ConfigClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_IP6_CONFIG,
|
NM_META_SETTING_TYPE_IP6_CONFIG,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -686,8 +686,9 @@ nm_setting_macsec_class_init(NMSettingMacsecClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_MACSEC,
|
NM_META_SETTING_TYPE_MACSEC,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -347,8 +347,9 @@ nm_setting_macvlan_class_init(NMSettingMacvlanClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_MACVLAN,
|
NM_META_SETTING_TYPE_MACVLAN,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -901,5 +901,5 @@ nm_setting_match_class_init(NMSettingMatchClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_MATCH);
|
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_MATCH, NULL, NULL, 0);
|
||||||
}
|
}
|
||||||
|
@@ -285,8 +285,9 @@ nm_setting_olpc_mesh_class_init(NMSettingOlpcMeshClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_OLPC_MESH,
|
NM_META_SETTING_TYPE_OLPC_MESH,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -374,8 +374,9 @@ nm_setting_ovs_bridge_class_init(NMSettingOvsBridgeClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_OVS_BRIDGE,
|
NM_META_SETTING_TYPE_OVS_BRIDGE,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
0);
|
||||||
}
|
}
|
||||||
|
@@ -148,5 +148,5 @@ nm_setting_ovs_dpdk_class_init(NMSettingOvsDpdkClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_OVS_DPDK);
|
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_OVS_DPDK, NULL, NULL, 0);
|
||||||
}
|
}
|
||||||
|
@@ -544,8 +544,9 @@ nm_setting_ovs_external_ids_class_init(NMSettingOvsExternalIDsClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_OVS_EXTERNAL_IDS,
|
NM_META_SETTING_TYPE_OVS_EXTERNAL_IDS,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
G_STRUCT_OFFSET(NMSettingOvsExternalIDs, _priv));
|
||||||
}
|
}
|
||||||
|
@@ -423,5 +423,5 @@ nm_setting_ovs_interface_class_init(NMSettingOvsInterfaceClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_OVS_INTERFACE);
|
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_OVS_INTERFACE, NULL, NULL, 0);
|
||||||
}
|
}
|
||||||
|
@@ -184,5 +184,5 @@ nm_setting_ovs_patch_class_init(NMSettingOvsPatchClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_OVS_PATCH);
|
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_OVS_PATCH, NULL, NULL, 0);
|
||||||
}
|
}
|
||||||
|
@@ -463,5 +463,5 @@ nm_setting_ovs_port_class_init(NMSettingOvsPortClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_OVS_PORT);
|
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_OVS_PORT, NULL, NULL, 0);
|
||||||
}
|
}
|
||||||
|
@@ -806,8 +806,9 @@ nm_setting_ppp_class_init(NMSettingPppClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_PPP,
|
NM_META_SETTING_TYPE_PPP,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -370,5 +370,5 @@ nm_setting_pppoe_class_init(NMSettingPppoeClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_PPPOE);
|
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_PPPOE, NULL, NULL, 0);
|
||||||
}
|
}
|
||||||
|
@@ -319,22 +319,17 @@ _nm_sett_info_property_override_create_array(void)
|
|||||||
{
|
{
|
||||||
/* pre-allocate a relatively large buffer to avoid frequent re-allocations.
|
/* pre-allocate a relatively large buffer to avoid frequent re-allocations.
|
||||||
* Note that the buffer is only short-lived and will be destroyed by
|
* Note that the buffer is only short-lived and will be destroyed by
|
||||||
* _nm_setting_class_commit_full(). */
|
* _nm_setting_class_commit(). */
|
||||||
return _nm_sett_info_property_override_create_array_sized(20);
|
return _nm_sett_info_property_override_create_array_sized(20);
|
||||||
}
|
}
|
||||||
|
|
||||||
GArray *_nm_sett_info_property_override_create_array_ip_config(void);
|
GArray *_nm_sett_info_property_override_create_array_ip_config(void);
|
||||||
|
|
||||||
void _nm_setting_class_commit_full(NMSettingClass * setting_class,
|
void _nm_setting_class_commit(NMSettingClass * setting_class,
|
||||||
NMMetaSettingType meta_type,
|
NMMetaSettingType meta_type,
|
||||||
const NMSettInfoSettDetail *detail,
|
const NMSettInfoSettDetail *detail,
|
||||||
GArray * properties_override);
|
GArray * properties_override,
|
||||||
|
gint16 private_offset);
|
||||||
static inline void
|
|
||||||
_nm_setting_class_commit(NMSettingClass *setting_class, NMMetaSettingType meta_type)
|
|
||||||
{
|
|
||||||
_nm_setting_class_commit_full(setting_class, meta_type, NULL, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define NM_SETT_INFO_SETT_GENDATA(...) \
|
#define NM_SETT_INFO_SETT_GENDATA(...) \
|
||||||
({ \
|
({ \
|
||||||
|
@@ -396,8 +396,9 @@ nm_setting_proxy_class_init(NMSettingProxyClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_PROXY,
|
NM_META_SETTING_TYPE_PROXY,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -345,8 +345,9 @@ nm_setting_serial_class_init(NMSettingSerialClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_SERIAL,
|
NM_META_SETTING_TYPE_SERIAL,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -1365,8 +1365,9 @@ nm_setting_sriov_class_init(NMSettingSriovClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_SRIOV,
|
NM_META_SETTING_TYPE_SRIOV,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
0);
|
||||||
}
|
}
|
||||||
|
@@ -2258,8 +2258,9 @@ nm_setting_tc_config_class_init(NMSettingTCConfigClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_TC_CONFIG,
|
NM_META_SETTING_TYPE_TC_CONFIG,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
0);
|
||||||
}
|
}
|
||||||
|
@@ -694,8 +694,9 @@ nm_setting_team_port_class_init(NMSettingTeamPortClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, G_N_ELEMENTS(obj_properties), obj_properties);
|
g_object_class_install_properties(object_class, G_N_ELEMENTS(obj_properties), obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_TEAM_PORT,
|
NM_META_SETTING_TYPE_TEAM_PORT,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -1827,8 +1827,9 @@ nm_setting_team_class_init(NMSettingTeamClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, G_N_ELEMENTS(obj_properties), obj_properties);
|
g_object_class_install_properties(object_class, G_N_ELEMENTS(obj_properties), obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_TEAM,
|
NM_META_SETTING_TYPE_TEAM,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -413,8 +413,9 @@ nm_setting_tun_class_init(NMSettingTunClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_TUN,
|
NM_META_SETTING_TYPE_TUN,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -587,8 +587,9 @@ nm_setting_user_class_init(NMSettingUserClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_USER,
|
NM_META_SETTING_TYPE_USER,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
G_STRUCT_OFFSET(NMSettingUser, _priv));
|
||||||
}
|
}
|
||||||
|
@@ -190,5 +190,5 @@ nm_setting_veth_class_init(NMSettingVethClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_VETH);
|
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_VETH, NULL, NULL, 0);
|
||||||
}
|
}
|
||||||
|
@@ -994,8 +994,9 @@ nm_setting_vlan_class_init(NMSettingVlanClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_VLAN,
|
NM_META_SETTING_TYPE_VLAN,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -1252,8 +1252,9 @@ nm_setting_vpn_class_init(NMSettingVpnClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_VPN,
|
NM_META_SETTING_TYPE_VPN,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -160,5 +160,5 @@ nm_setting_vrf_class_init(NMSettingVrfClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_VRF);
|
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_VRF, NULL, NULL, 0);
|
||||||
}
|
}
|
||||||
|
@@ -836,8 +836,9 @@ nm_setting_vxlan_class_init(NMSettingVxlanClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_VXLAN,
|
NM_META_SETTING_TYPE_VXLAN,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -300,5 +300,5 @@ nm_setting_wifi_p2p_class_init(NMSettingWifiP2PClass *setting_wifi_p2p_class)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_WIFI_P2P);
|
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_WIFI_P2P, NULL, NULL, 0);
|
||||||
}
|
}
|
||||||
|
@@ -264,8 +264,9 @@ nm_setting_wimax_class_init(NMSettingWimaxClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_WIMAX,
|
NM_META_SETTING_TYPE_WIMAX,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -1745,8 +1745,9 @@ nm_setting_wired_class_init(NMSettingWiredClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_WIRED,
|
NM_META_SETTING_TYPE_WIRED,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -2601,8 +2601,9 @@ nm_setting_wireguard_class_init(NMSettingWireGuardClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_WIREGUARD,
|
NM_META_SETTING_TYPE_WIREGUARD,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
G_STRUCT_OFFSET(NMSettingWireGuard, _priv));
|
||||||
}
|
}
|
||||||
|
@@ -1993,8 +1993,9 @@ nm_setting_wireless_security_class_init(NMSettingWirelessSecurityClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_WIRELESS_SECURITY,
|
NM_META_SETTING_TYPE_WIRELESS_SECURITY,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -1985,8 +1985,9 @@ nm_setting_wireless_class_init(NMSettingWirelessClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full(setting_class,
|
_nm_setting_class_commit(setting_class,
|
||||||
NM_META_SETTING_TYPE_WIRELESS,
|
NM_META_SETTING_TYPE_WIRELESS,
|
||||||
NULL,
|
NULL,
|
||||||
properties_override);
|
properties_override,
|
||||||
|
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
}
|
}
|
||||||
|
@@ -389,5 +389,5 @@ nm_setting_wpan_class_init(NMSettingWpanClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_WPAN);
|
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_WPAN, NULL, NULL, 0);
|
||||||
}
|
}
|
||||||
|
@@ -264,10 +264,11 @@ _property_infos_sort(const NMSettInfoProperty *property_infos,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_nm_setting_class_commit_full(NMSettingClass * setting_class,
|
_nm_setting_class_commit(NMSettingClass * setting_class,
|
||||||
NMMetaSettingType meta_type,
|
NMMetaSettingType meta_type,
|
||||||
const NMSettInfoSettDetail *detail,
|
const NMSettInfoSettDetail *detail,
|
||||||
GArray * properties_override)
|
GArray * properties_override,
|
||||||
|
gint16 private_offset)
|
||||||
{
|
{
|
||||||
NMSettInfoSetting *sett_info;
|
NMSettInfoSetting *sett_info;
|
||||||
gs_free GParamSpec **property_specs = NULL;
|
gs_free GParamSpec **property_specs = NULL;
|
||||||
@@ -400,6 +401,18 @@ has_property_type:
|
|||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[meta_type];
|
setting_class->setting_info = &nm_meta_setting_infos[meta_type];
|
||||||
sett_info->setting_class = setting_class;
|
sett_info->setting_class = setting_class;
|
||||||
|
|
||||||
|
if (private_offset == NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS) {
|
||||||
|
int o;
|
||||||
|
|
||||||
|
o = g_type_class_get_instance_private_offset(setting_class);
|
||||||
|
nm_assert(o != NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
|
||||||
|
nm_assert(o > G_MININT16);
|
||||||
|
nm_assert(o < 0);
|
||||||
|
private_offset = o;
|
||||||
|
}
|
||||||
|
sett_info->private_offset = private_offset;
|
||||||
|
|
||||||
if (detail)
|
if (detail)
|
||||||
sett_info->detail = *detail;
|
sett_info->detail = *detail;
|
||||||
nm_assert(properties_override->len > 0);
|
nm_assert(properties_override->len > 0);
|
||||||
|
@@ -4404,6 +4404,18 @@ test_setting_metadata(void)
|
|||||||
g_assert_cmpint(sis->property_infos_len, >, 0);
|
g_assert_cmpint(sis->property_infos_len, >, 0);
|
||||||
g_assert(sis->property_infos);
|
g_assert(sis->property_infos);
|
||||||
|
|
||||||
|
{
|
||||||
|
int offset;
|
||||||
|
|
||||||
|
if (sis->private_offset < 0) {
|
||||||
|
offset = g_type_class_get_instance_private_offset(sis->setting_class);
|
||||||
|
g_assert_cmpint(sis->private_offset, ==, offset);
|
||||||
|
} else {
|
||||||
|
/* it would be nice to assert that this class has no private data.
|
||||||
|
* But we cannot. */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
h_properties = g_hash_table_new(nm_str_hash, g_str_equal);
|
h_properties = g_hash_table_new(nm_str_hash, g_str_equal);
|
||||||
|
|
||||||
for (prop_idx = 0; prop_idx < sis->property_infos_len; prop_idx++) {
|
for (prop_idx = 0; prop_idx < sis->property_infos_len; prop_idx++) {
|
||||||
|
@@ -762,10 +762,26 @@ struct _NMSettInfoSetting {
|
|||||||
*/
|
*/
|
||||||
const NMSettInfoProperty *const *property_infos_sorted;
|
const NMSettInfoProperty *const *property_infos_sorted;
|
||||||
|
|
||||||
guint property_infos_len;
|
guint property_infos_len;
|
||||||
|
|
||||||
|
/* the offset in bytes to get the private data from the @self pointer. */
|
||||||
|
gint16 private_offset;
|
||||||
|
|
||||||
NMSettInfoSettDetail detail;
|
NMSettInfoSettDetail detail;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS ((gint16) G_MININT16)
|
||||||
|
|
||||||
|
static inline gpointer
|
||||||
|
_nm_setting_get_private(NMSetting *self, const NMSettInfoSetting *sett_info, guint16 offset)
|
||||||
|
{
|
||||||
|
nm_assert(NM_IS_SETTING(self));
|
||||||
|
nm_assert(sett_info);
|
||||||
|
nm_assert(NM_SETTING_GET_CLASS(self) == sett_info->setting_class);
|
||||||
|
|
||||||
|
return ((((char *) ((gpointer) self)) + sett_info->private_offset) + offset);
|
||||||
|
}
|
||||||
|
|
||||||
static inline const NMSettInfoProperty *
|
static inline const NMSettInfoProperty *
|
||||||
_nm_sett_info_property_info_get_sorted(const NMSettInfoSetting *sett_info, guint idx)
|
_nm_sett_info_property_info_get_sorted(const NMSettInfoSetting *sett_info, guint idx)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user