diff options
author | Ismo Puustinen <ismo.puustinen@intel.com> | 2017-11-10 14:49:27 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-01-09 14:24:53 +0100 |
commit | 2e2ff6f27aa1bfa7a27d49980b319873240ec84b (patch) | |
tree | 4f7e8a6dbe08390df71db4626a1491965128c8f0 /libnm-core/nm-setting-connection.c | |
parent | 6dd69990c04b8a4e1bc439f6f717de48f4f8d9be (diff) | |
download | NetworkManager-2e2ff6f27aa1bfa7a27d49980b319873240ec84b.tar.gz |
mdns: add new connection property.
Add support for mDNS as a connection-level property. Update ifcfg-rh and
keyfile plugins to support it.
Diffstat (limited to 'libnm-core/nm-setting-connection.c')
-rw-r--r-- | libnm-core/nm-setting-connection.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/libnm-core/nm-setting-connection.c b/libnm-core/nm-setting-connection.c index 24c65e7c5e..ba5bf8bf55 100644 --- a/libnm-core/nm-setting-connection.c +++ b/libnm-core/nm-setting-connection.c @@ -81,6 +81,7 @@ typedef struct { NMMetered metered; NMSettingConnectionLldp lldp; gint auth_retries; + NMSettingConnectionMdns mdns; } NMSettingConnectionPrivate; enum { @@ -103,6 +104,7 @@ enum { PROP_GATEWAY_PING_TIMEOUT, PROP_METERED, PROP_LLDP, + PROP_MDNS, PROP_STABLE_ID, PROP_AUTH_RETRIES, @@ -862,6 +864,23 @@ nm_setting_connection_get_lldp (NMSettingConnection *setting) return NM_SETTING_CONNECTION_GET_PRIVATE (setting)->lldp; } +/** + * nm_setting_connection_get_mdns: + * @setting: the #NMSettingConnection + * + * Returns: the #NMSettingConnection:mdns property of the setting. + * + * Since: 1.12 + **/ +NMSettingConnectionMdns +nm_setting_connection_get_mdns (NMSettingConnection *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_CONNECTION (setting), + NM_SETTING_CONNECTION_MDNS_UNKNOWN); + + return NM_SETTING_CONNECTION_GET_PRIVATE (setting)->mdns; +} + static void _set_error_missing_base_setting (GError **error, const char *type) { @@ -1332,6 +1351,9 @@ set_property (GObject *object, guint prop_id, case PROP_AUTH_RETRIES: priv->auth_retries = g_value_get_int (value); break; + case PROP_MDNS: + priv->mdns = g_value_get_int (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1420,6 +1442,9 @@ get_property (GObject *object, guint prop_id, case PROP_AUTH_RETRIES: g_value_set_int (value, priv->auth_retries); break; + case PROP_MDNS: + g_value_set_int (value, priv->mdns); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1982,4 +2007,38 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class) G_PARAM_CONSTRUCT | NM_SETTING_PARAM_FUZZY_IGNORE | G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingConnection:mdns: + * + * Whether mDNS is enabled for the connection. + * + * The permitted values are: yes: register hostname and resolving + * for the connection, no: disable mDNS for the interface, resolve: + * do not register hostname but allow resolving of mDNS host names. + * When updating this property on a currently activated connection, + * the change takes effect immediately. + * + * This feature requires a plugin which supports mDNS. One such + * plugin is dns-systemd-resolved. + * + * Since: 1.12 + **/ + /* ---ifcfg-rh--- + * property: mdns + * variable: CONNECTION_MDNS(+) + * values: yes,no,resolve + * default: missing variable means global default + * description: Whether or not mDNS is enabled for the connection + * example: CONNECTION_MDNS=yes + * ---end--- + */ + g_object_class_install_property + (object_class, PROP_MDNS, + g_param_spec_int (NM_SETTING_CONNECTION_MDNS, "", "", + G_MININT32, G_MAXINT32, + NM_SETTING_CONNECTION_MDNS_UNKNOWN, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); } |