diff options
Diffstat (limited to 'src/libnm-core-impl/nm-setting-ip-config.c')
| -rw-r--r-- | src/libnm-core-impl/nm-setting-ip-config.c | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/src/libnm-core-impl/nm-setting-ip-config.c b/src/libnm-core-impl/nm-setting-ip-config.c index 02334b54..e79f25a8 100644 --- a/src/libnm-core-impl/nm-setting-ip-config.c +++ b/src/libnm-core-impl/nm-setting-ip-config.c @@ -4004,7 +4004,8 @@ NM_GOBJECT_PROPERTIES_DEFINE(NMSettingIPConfig, PROP_DHCP_IAID, PROP_DHCP_REJECT_SERVERS, PROP_AUTO_ROUTE_EXT_GW, - PROP_REPLACE_LOCAL_RULE, ); + PROP_REPLACE_LOCAL_RULE, + PROP_DHCP_SEND_RELEASE, ); G_DEFINE_ABSTRACT_TYPE(NMSettingIPConfig, nm_setting_ip_config, NM_TYPE_SETTING) @@ -5463,6 +5464,22 @@ nm_setting_ip_config_get_replace_local_rule(NMSettingIPConfig *setting) return NM_SETTING_IP_CONFIG_GET_PRIVATE(setting)->replace_local_rule; } +/** + * nm_setting_ip_config_get_dhcp_send_release: + * @setting: the #NMSettingIPConfig + * + * Returns: the #NMSettingIPConfig:dhcp-send-release property of the setting + * + * Since: 1.48 + **/ +NMTernary +nm_setting_ip_config_get_dhcp_send_release(NMSettingIPConfig *setting) +{ + g_return_val_if_fail(NM_IS_SETTING_IP_CONFIG(setting), NM_TERNARY_DEFAULT); + + return NM_SETTING_IP_CONFIG_GET_PRIVATE(setting)->dhcp_send_release; +} + static gboolean verify_label(const char *label) { @@ -6152,6 +6169,14 @@ _nm_sett_info_property_override_create_array_ip_config(int addr_family) _nm_properties_override_gobj( properties_override, + obj_properties[PROP_DHCP_SEND_RELEASE], + &nm_sett_info_propert_type_direct_enum, + .direct_offset = + NM_STRUCT_OFFSET_ENSURE_TYPE(int, NMSettingIPConfigPrivate, dhcp_send_release), + .direct_data.enum_gtype = NM_TYPE_TERNARY); + + _nm_properties_override_gobj( + properties_override, obj_properties[PROP_DNS_SEARCH], &nm_sett_info_propert_type_direct_strv, .direct_offset = @@ -6903,5 +6928,23 @@ nm_setting_ip_config_class_init(NMSettingIPConfigClass *klass) NM_TERNARY_DEFAULT, G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS); + /** + * NMSettingIPConfig:dhcp-send-release: + * + * Whether the DHCP client will send RELEASE message when + * bringing the connection down. The default value is %NM_TERNARY_DEFAULT. + * When the default value is specified, then the global value from NetworkManager + * configuration is looked up, if not set, it is considered as %FALSE. + * + * Since: 1.48 + */ + obj_properties[PROP_DHCP_SEND_RELEASE] = + g_param_spec_enum(NM_SETTING_IP_CONFIG_DHCP_SEND_RELEASE, + "", + "", + NM_TYPE_TERNARY, + NM_TERNARY_DEFAULT, + G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS); + g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties); } |