From 01609e485803fa250413385ae209660fb7b30a2e Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Mon, 17 Nov 2025 17:43:34 +0100 Subject: New upstream version 1.54.2 --- .../gen-metadata-nm-settings-libnm-core.xml.in | 8 ++ src/libnm-core-impl/nm-setting-hsr.c | 90 +++++++++++++++++++++- 2 files changed, 97 insertions(+), 1 deletion(-) (limited to 'src/libnm-core-impl') diff --git a/src/libnm-core-impl/gen-metadata-nm-settings-libnm-core.xml.in b/src/libnm-core-impl/gen-metadata-nm-settings-libnm-core.xml.in index c764f535..ce4832dc 100644 --- a/src/libnm-core-impl/gen-metadata-nm-settings-libnm-core.xml.in +++ b/src/libnm-core-impl/gen-metadata-nm-settings-libnm-core.xml.in @@ -1516,6 +1516,10 @@ + + prp; } +/** + * nm_setting_hsr_get_protocol_version: + * @setting: the #NMSettingHsr + * + * Returns: the #NMSettingHsr:protocol-version property of the setting + * + * Since: 1.56, 1.54.2 + **/ +NMSettingHsrProtocolVersion +nm_setting_hsr_get_protocol_version(NMSettingHsr *setting) +{ + g_return_val_if_fail(NM_IS_SETTING_HSR(setting), NM_SETTING_HSR_PROTOCOL_VERSION_DEFAULT); + + return NM_SETTING_HSR_GET_PRIVATE(setting)->protocol_version; +} + +/** + * nm_setting_hsr_get_interlink: + * @setting: the #NMSettingHsr + * + * Returns: the #NMSettingHsr:interlink property of the setting + * + * Since: 1.56, 1.54.2 + **/ +const char * +nm_setting_hsr_get_interlink(NMSettingHsr *setting) +{ + g_return_val_if_fail(NM_IS_SETTING_HSR(setting), NULL); + + return NM_SETTING_HSR_GET_PRIVATE(setting)->interlink; +} + /*****************************************************************************/ static gboolean @@ -160,6 +200,18 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) return FALSE; } + if (priv->prp && priv->protocol_version != NM_SETTING_HSR_PROTOCOL_VERSION_DEFAULT) { + g_set_error(error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("HSR protocol cannot be configured for PRP interfaces")); + g_prefix_error(error, + "%s.%s: ", + NM_SETTING_HSR_SETTING_NAME, + NM_SETTING_HSR_PROTOCOL_VERSION); + return FALSE; + } + return TRUE; } @@ -260,6 +312,42 @@ nm_setting_hsr_class_init(NMSettingHsrClass *klass) NMSettingHsr, _priv.prp); + /** + * NMSettingHsr:protocol-version: + * + * Configures the protocol version to be used for the HSR/PRP interface. + * %NM_SETTING_HSR_PROTOCOL_VERSION_DEFAULT sets the protocol version to the default version for the protocol. + * %NM_SETTING_HSR_PROTOCOL_VERSION_HSR_2010 sets the protocol version to HSRv0 (IEC 62439-3:2010). + * %NM_SETTING_HSR_PROTOCOL_VERSION_HSR_2012 sets the protocol version to HSRv1 (IEC 62439-3:2012). + * + * Since: 1.56, 1.54.2 + **/ + _nm_setting_property_define_direct_enum(properties_override, + obj_properties, + NM_SETTING_HSR_PROTOCOL_VERSION, + PROP_PROTOCOL_VERSION, + NM_TYPE_SETTING_HSR_PROTOCOL_VERSION, + NM_SETTING_HSR_PROTOCOL_VERSION_DEFAULT, + NM_SETTING_PARAM_NONE, + NULL, + NMSettingHsr, + _priv.protocol_version); + + /** + * NMSettingHsr:interlink: + * + * The optional interlink port name of the HSR interface. + * + * Since: 1.56, 1.54.2 + **/ + _nm_setting_property_define_direct_string(properties_override, + obj_properties, + NM_SETTING_HSR_INTERLINK, + PROP_INTERLINK, + NM_SETTING_PARAM_INFERRABLE, + NMSettingHsr, + _priv.interlink); + g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties); _nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_HSR, NULL, properties_override, 0); -- cgit 1.3.0-6-gf8a5