diff options
| author | Michael Biebl <biebl@debian.org> | 2024-01-25 09:46:18 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2024-01-25 09:46:18 +0100 |
| commit | 70e18d99b8e3e77bb37e218d7ac582130156f8ef (patch) | |
| tree | d40c587e6d3f0e094ff558e415f1bb9803643214 /src/libnm-core-impl/nm-setting-8021x.c | |
| parent | d4d8b2b91f7ba000d97a8b2aab48c85000c11314 (diff) | |
New upstream version 1.45.90 upstream/1.45.90
Diffstat (limited to 'src/libnm-core-impl/nm-setting-8021x.c')
| -rw-r--r-- | src/libnm-core-impl/nm-setting-8021x.c | 118 |
1 files changed, 68 insertions, 50 deletions
diff --git a/src/libnm-core-impl/nm-setting-8021x.c b/src/libnm-core-impl/nm-setting-8021x.c index 626673e8..945fd6d3 100644 --- a/src/libnm-core-impl/nm-setting-8021x.c +++ b/src/libnm-core-impl/nm-setting-8021x.c @@ -189,20 +189,18 @@ typedef struct { * IEEE 802.1x Authentication Settings */ struct _NMSetting8021x { - NMSetting parent; - /* In the past, this struct was public API. Preserve ABI! */ + NMSetting parent; + NMSetting8021xPrivate _priv; }; struct _NMSetting8021xClass { NMSettingClass parent; - /* In the past, this struct was public API. Preserve ABI! */ - gpointer padding[4]; }; G_DEFINE_TYPE(NMSetting8021x, nm_setting_802_1x, NM_TYPE_SETTING) #define NM_SETTING_802_1X_GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_802_1X, NMSetting8021xPrivate)) + _NM_GET_PRIVATE(o, NMSetting8021x, NM_IS_SETTING_802_1X, NMSetting) /*****************************************************************************/ @@ -3199,9 +3197,7 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS(klass); NMSettingClass *setting_class = NM_SETTING_CLASS(klass); - GArray *properties_override = _nm_sett_info_property_override_create_array(); - - g_type_class_add_private(klass, sizeof(NMSetting8021xPrivate)); + GArray *properties_override = _nm_sett_info_property_override_create_array_sized(55); object_class->get_property = get_property; object_class->set_property = set_property; @@ -3227,11 +3223,11 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) * example: IEEE_8021X_EAP_METHODS=PEAP * ---end--- */ - obj_properties[PROP_EAP] = g_param_spec_boxed(NM_SETTING_802_1X_EAP, - "", - "", - G_TYPE_STRV, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); + _nm_setting_property_define_gprop_strv_oldstyle(properties_override, + obj_properties, + NM_SETTING_802_1X_EAP, + PROP_EAP, + NM_SETTING_PARAM_NONE); /** * NMSetting8021x:identity: @@ -3252,7 +3248,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) PROP_IDENTITY, NM_SETTING_PARAM_NONE, NMSetting8021xPrivate, - identity); + identity, + .direct_string_allow_empty = TRUE); /** * NMSetting8021x:anonymous-identity: @@ -3273,7 +3270,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) PROP_ANONYMOUS_IDENTITY, NM_SETTING_PARAM_NONE, NMSetting8021xPrivate, - anonymous_identity); + anonymous_identity, + .direct_string_allow_empty = TRUE); /** * NMSetting8021x:pac-file: @@ -3293,7 +3291,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) PROP_PAC_FILE, NM_SETTING_PARAM_NONE, NMSetting8021xPrivate, - pac_file); + pac_file, + .direct_string_allow_empty = TRUE); /** * NMSetting8021x:ca-cert: @@ -3346,7 +3345,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) PROP_CA_CERT_PASSWORD, NM_SETTING_PARAM_SECRET, NMSetting8021xPrivate, - ca_cert_password); + ca_cert_password, + .direct_string_allow_empty = TRUE); /** * NMSetting8021x:ca-cert-password-flags: @@ -3384,7 +3384,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) PROP_CA_PATH, NM_SETTING_PARAM_NONE, NMSetting8021xPrivate, - ca_path); + ca_path, + .direct_string_allow_empty = TRUE); /** * NMSetting8021x:subject-match: @@ -3410,7 +3411,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) NM_SETTING_PARAM_NONE, NMSetting8021xPrivate, subject_match, - .is_deprecated = TRUE, ); + .is_deprecated = TRUE, + .direct_string_allow_empty = TRUE); /** * NMSetting8021x:altsubject-matches: @@ -3426,12 +3428,11 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) * example: IEEE_8021X_ALTSUBJECT_MATCHES="s1.domain.cc" * ---end--- */ - obj_properties[PROP_ALTSUBJECT_MATCHES] = - g_param_spec_boxed(NM_SETTING_802_1X_ALTSUBJECT_MATCHES, - "", - "", - G_TYPE_STRV, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); + _nm_setting_property_define_gprop_strv_oldstyle(properties_override, + obj_properties, + NM_SETTING_802_1X_ALTSUBJECT_MATCHES, + PROP_ALTSUBJECT_MATCHES, + NM_SETTING_PARAM_NONE); /** * NMSetting8021x:domain-suffix-match: @@ -3458,7 +3459,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) PROP_DOMAIN_SUFFIX_MATCH, NM_SETTING_PARAM_NONE, NMSetting8021xPrivate, - domain_suffix_match); + domain_suffix_match, + .direct_string_allow_empty = TRUE); /** * NMSetting8021x:domain-match: @@ -3484,7 +3486,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) PROP_DOMAIN_MATCH, NM_SETTING_PARAM_NONE, NMSetting8021xPrivate, - domain_match); + domain_match, + .direct_string_allow_empty = TRUE); /** * NMSetting8021x:client-cert: @@ -3532,7 +3535,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) PROP_CLIENT_CERT_PASSWORD, NM_SETTING_PARAM_SECRET, NMSetting8021xPrivate, - client_cert_password); + client_cert_password, + .direct_string_allow_empty = TRUE); /** * NMSetting8021x:client-cert-password-flags: @@ -3571,7 +3575,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) PROP_PHASE1_PEAPVER, NM_SETTING_PARAM_NONE, NMSetting8021xPrivate, - phase1_peapver); + phase1_peapver, + .direct_string_allow_empty = TRUE); /** * NMSetting8021x:phase1-peaplabel: @@ -3595,7 +3600,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) PROP_PHASE1_PEAPLABEL, NM_SETTING_PARAM_NONE, NMSetting8021xPrivate, - phase1_peaplabel); + phase1_peaplabel, + .direct_string_allow_empty = TRUE); /** * NMSetting8021x:phase1-fast-provisioning: @@ -3621,7 +3627,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) PROP_PHASE1_FAST_PROVISIONING, NM_SETTING_PARAM_NONE, NMSetting8021xPrivate, - phase1_fast_provisioning); + phase1_fast_provisioning, + .direct_string_allow_empty = TRUE); /** * NMSetting8021x:phase1-auth-flags: @@ -3685,7 +3692,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) PROP_PHASE2_AUTH, NM_SETTING_PARAM_NONE, NMSetting8021xPrivate, - phase2_auth); + phase2_auth, + .direct_string_allow_empty = TRUE); /** * NMSetting8021x:phase2-autheap: @@ -3712,7 +3720,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) PROP_PHASE2_AUTHEAP, NM_SETTING_PARAM_NONE, NMSetting8021xPrivate, - phase2_autheap); + phase2_autheap, + .direct_string_allow_empty = TRUE); /** * NMSetting8021x:phase2-ca-cert: @@ -3759,7 +3768,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) PROP_PHASE2_CA_CERT_PASSWORD, NM_SETTING_PARAM_SECRET, NMSetting8021xPrivate, - phase2_ca_cert_password); + phase2_ca_cert_password, + .direct_string_allow_empty = TRUE); /** * NMSetting8021x:phase2-ca-cert-password-flags: @@ -3797,7 +3807,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) PROP_PHASE2_CA_PATH, NM_SETTING_PARAM_NONE, NMSetting8021xPrivate, - phase2_ca_path); + phase2_ca_path, + .direct_string_allow_empty = TRUE); /** * NMSetting8021x:phase2-subject-match: @@ -3824,7 +3835,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) NM_SETTING_PARAM_NONE, NMSetting8021xPrivate, phase2_subject_match, - .is_deprecated = TRUE, ); + .is_deprecated = TRUE, + .direct_string_allow_empty = TRUE); /** * NMSetting8021x:phase2-altsubject-matches: @@ -3839,12 +3851,11 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) * variable: IEEE_8021X_PHASE2_ALTSUBJECT_MATCHES(+) * ---end--- */ - obj_properties[PROP_PHASE2_ALTSUBJECT_MATCHES] = - g_param_spec_boxed(NM_SETTING_802_1X_PHASE2_ALTSUBJECT_MATCHES, - "", - "", - G_TYPE_STRV, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); + _nm_setting_property_define_gprop_strv_oldstyle(properties_override, + obj_properties, + NM_SETTING_802_1X_PHASE2_ALTSUBJECT_MATCHES, + PROP_PHASE2_ALTSUBJECT_MATCHES, + NM_SETTING_PARAM_NONE); /** * NMSetting8021x:phase2-domain-suffix-match: @@ -3872,7 +3883,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) PROP_PHASE2_DOMAIN_SUFFIX_MATCH, NM_SETTING_PARAM_NONE, NMSetting8021xPrivate, - phase2_domain_suffix_match); + phase2_domain_suffix_match, + .direct_string_allow_empty = TRUE); /** * NMSetting8021x:phase2-domain-match: @@ -3899,7 +3911,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) PROP_PHASE2_DOMAIN_MATCH, NM_SETTING_PARAM_NONE, NMSetting8021xPrivate, - phase2_domain_match); + phase2_domain_match, + .direct_string_allow_empty = TRUE); /** * NMSetting8021x:phase2-client-cert: @@ -3950,7 +3963,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) PROP_PHASE2_CLIENT_CERT_PASSWORD, NM_SETTING_PARAM_SECRET, NMSetting8021xPrivate, - phase2_client_cert_password); + phase2_client_cert_password, + .direct_string_allow_empty = TRUE); /** * NMSetting8021x:phase2-client-cert-password-flags: @@ -3987,7 +4001,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) PROP_PASSWORD, NM_SETTING_PARAM_SECRET, NMSetting8021xPrivate, - password); + password, + .direct_string_allow_empty = TRUE); /** * NMSetting8021x:password-flags: @@ -4119,7 +4134,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) PROP_PRIVATE_KEY_PASSWORD, NM_SETTING_PARAM_SECRET, NMSetting8021xPrivate, - private_key_password); + private_key_password, + .direct_string_allow_empty = TRUE); /** * NMSetting8021x:private-key-password-flags: @@ -4205,7 +4221,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) PROP_PHASE2_PRIVATE_KEY_PASSWORD, NM_SETTING_PARAM_SECRET, NMSetting8021xPrivate, - phase2_private_key_password); + phase2_private_key_password, + .direct_string_allow_empty = TRUE); /** * NMSetting8021x:phase2-private-key-password-flags: @@ -4245,7 +4262,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) PROP_PIN, NM_SETTING_PARAM_SECRET, NMSetting8021xPrivate, - pin); + pin, + .direct_string_allow_empty = TRUE); /** * NMSetting8021x:pin-flags: @@ -4352,5 +4370,5 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass) NM_META_SETTING_TYPE_802_1X, NULL, properties_override, - NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS); + G_STRUCT_OFFSET(NMSetting8021x, _priv)); } |