2019-09-10 11:19:01 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2019-09-25 13:13:40 +02:00
|
|
|
/*
|
2014-07-11 17:57:20 +02:00
|
|
|
* Copyright (C) 2014 Red Hat, Inc.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef NM_CONFIG_DATA_H
|
|
|
|
|
#define NM_CONFIG_DATA_H
|
|
|
|
|
|
2019-12-10 08:51:03 +01:00
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
|
|
|
|
|
/* an invalid mode. */
|
|
|
|
|
NM_AUTH_POLKIT_MODE_UNKNOWN,
|
|
|
|
|
|
|
|
|
|
/* don't use PolicyKit, but only allow root user (uid 0). */
|
|
|
|
|
NM_AUTH_POLKIT_MODE_ROOT_ONLY,
|
|
|
|
|
|
|
|
|
|
/* don't use PolicyKit, but allow all requests. */
|
|
|
|
|
NM_AUTH_POLKIT_MODE_ALLOW_ALL,
|
|
|
|
|
|
|
|
|
|
/* use PolicyKit to authorize requests. Root user (uid 0) always
|
|
|
|
|
* gets a free pass, without consulting PolicyKit. If PolicyKit is not
|
|
|
|
|
* running, authorization will fail for non root users. */
|
|
|
|
|
NM_AUTH_POLKIT_MODE_USE_POLKIT,
|
|
|
|
|
|
|
|
|
|
} NMAuthPolkitMode;
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2014-07-11 17:57:20 +02:00
|
|
|
#define NM_TYPE_CONFIG_DATA (nm_config_data_get_type ())
|
|
|
|
|
#define NM_CONFIG_DATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_CONFIG_DATA, NMConfigData))
|
|
|
|
|
#define NM_CONFIG_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_CONFIG_DATA, NMConfigDataClass))
|
|
|
|
|
#define NM_IS_CONFIG_DATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_CONFIG_DATA))
|
|
|
|
|
#define NM_IS_CONFIG_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_CONFIG_DATA))
|
|
|
|
|
#define NM_CONFIG_DATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_CONFIG_DATA, NMConfigDataClass))
|
|
|
|
|
|
2015-01-06 20:16:10 +01:00
|
|
|
#define NM_CONFIG_DATA_CONFIG_MAIN_FILE "config-main-file"
|
|
|
|
|
#define NM_CONFIG_DATA_CONFIG_DESCRIPTION "config-description"
|
2015-06-24 20:11:42 +02:00
|
|
|
#define NM_CONFIG_DATA_KEYFILE_USER "keyfile-user"
|
|
|
|
|
#define NM_CONFIG_DATA_KEYFILE_INTERN "keyfile-intern"
|
2017-08-09 15:19:54 +08:00
|
|
|
#define NM_CONFIG_DATA_CONNECTIVITY_ENABLED "connectivity-enabled"
|
2014-07-11 17:57:20 +02:00
|
|
|
#define NM_CONFIG_DATA_CONNECTIVITY_URI "connectivity-uri"
|
|
|
|
|
#define NM_CONFIG_DATA_CONNECTIVITY_INTERVAL "connectivity-interval"
|
|
|
|
|
#define NM_CONFIG_DATA_CONNECTIVITY_RESPONSE "connectivity-response"
|
2015-01-07 17:09:52 +01:00
|
|
|
#define NM_CONFIG_DATA_NO_AUTO_DEFAULT "no-auto-default"
|
2015-02-12 17:35:14 +01:00
|
|
|
#define NM_CONFIG_DATA_DNS_MODE "dns"
|
2014-07-11 17:57:20 +02:00
|
|
|
|
2016-05-30 16:43:39 +02:00
|
|
|
typedef enum { /*< flags >*/
|
2015-06-16 15:13:26 +02:00
|
|
|
NM_CONFIG_GET_VALUE_NONE = 0,
|
|
|
|
|
|
|
|
|
|
/* use g_key_file_get_value() instead of g_key_file_get_string(). */
|
|
|
|
|
NM_CONFIG_GET_VALUE_RAW = (1LL << 0),
|
|
|
|
|
|
|
|
|
|
/* strip whitespaces */
|
|
|
|
|
NM_CONFIG_GET_VALUE_STRIP = (1LL << 1),
|
|
|
|
|
|
|
|
|
|
/* if the returned string would be the empty word, return NULL. */
|
|
|
|
|
NM_CONFIG_GET_VALUE_NO_EMPTY = (1LL << 2),
|
|
|
|
|
|
|
|
|
|
/* special flag to read device spec. You want to use this before passing the
|
|
|
|
|
* value to nm_match_spec_split(). */
|
|
|
|
|
NM_CONFIG_GET_VALUE_TYPE_SPEC = NM_CONFIG_GET_VALUE_RAW,
|
|
|
|
|
} NMConfigGetValueFlags;
|
|
|
|
|
|
2015-01-21 12:58:32 +01:00
|
|
|
typedef enum { /*< flags >*/
|
|
|
|
|
NM_CONFIG_CHANGE_NONE = 0,
|
2015-06-25 21:10:32 +02:00
|
|
|
|
config: refactor change-flags to be a cause/reason which triggered the change
For the most part, this patch just renames some change-flags, but
doesn't change much about them. The new name should better express
what they are.
A config-change signal can be emitted for different reasons:
when we receive a signal (SIGHUP, SIGUSR1, SIGUSR2) or for internal
reasons like resetting of no-auto-default or setting internal
values.
Depending on the reason, we want to perform different actions.
For example:
- we reload the configuration from disk on SIGHUP, but not for
SIGUSR1.
- For SIGUSR1 and SIGHUP, we want to update-dns, but not for SIGUSR2.
Another part of the change-flags encodes which part of the configuration
actually changed. Often, these parts can only change when re-reading
from disk (e.g. a SIGUSR1 will not change any configuration inside
NMConfig).
Later, we will have more causes, and accordingly more fine-grained
effects of what should be done on reload.
2016-05-30 14:53:27 +02:00
|
|
|
/**************************************************************************
|
|
|
|
|
* The external cause which triggered the reload/configuration-change
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
NM_CONFIG_CHANGE_CAUSE_SIGHUP = (1L << 0),
|
|
|
|
|
NM_CONFIG_CHANGE_CAUSE_SIGUSR1 = (1L << 1),
|
|
|
|
|
NM_CONFIG_CHANGE_CAUSE_SIGUSR2 = (1L << 2),
|
|
|
|
|
NM_CONFIG_CHANGE_CAUSE_NO_AUTO_DEFAULT = (1L << 3),
|
|
|
|
|
NM_CONFIG_CHANGE_CAUSE_SET_VALUES = (1L << 4),
|
2016-05-30 16:43:39 +02:00
|
|
|
NM_CONFIG_CHANGE_CAUSE_CONF = (1L << 5),
|
|
|
|
|
NM_CONFIG_CHANGE_CAUSE_DNS_RC = (1L << 6),
|
|
|
|
|
NM_CONFIG_CHANGE_CAUSE_DNS_FULL = (1L << 7),
|
config: refactor change-flags to be a cause/reason which triggered the change
For the most part, this patch just renames some change-flags, but
doesn't change much about them. The new name should better express
what they are.
A config-change signal can be emitted for different reasons:
when we receive a signal (SIGHUP, SIGUSR1, SIGUSR2) or for internal
reasons like resetting of no-auto-default or setting internal
values.
Depending on the reason, we want to perform different actions.
For example:
- we reload the configuration from disk on SIGHUP, but not for
SIGUSR1.
- For SIGUSR1 and SIGHUP, we want to update-dns, but not for SIGUSR2.
Another part of the change-flags encodes which part of the configuration
actually changed. Often, these parts can only change when re-reading
from disk (e.g. a SIGUSR1 will not change any configuration inside
NMConfig).
Later, we will have more causes, and accordingly more fine-grained
effects of what should be done on reload.
2016-05-30 14:53:27 +02:00
|
|
|
|
2016-05-30 16:43:39 +02:00
|
|
|
NM_CONFIG_CHANGE_CAUSES = ((1L << 8) - 1),
|
config: refactor change-flags to be a cause/reason which triggered the change
For the most part, this patch just renames some change-flags, but
doesn't change much about them. The new name should better express
what they are.
A config-change signal can be emitted for different reasons:
when we receive a signal (SIGHUP, SIGUSR1, SIGUSR2) or for internal
reasons like resetting of no-auto-default or setting internal
values.
Depending on the reason, we want to perform different actions.
For example:
- we reload the configuration from disk on SIGHUP, but not for
SIGUSR1.
- For SIGUSR1 and SIGHUP, we want to update-dns, but not for SIGUSR2.
Another part of the change-flags encodes which part of the configuration
actually changed. Often, these parts can only change when re-reading
from disk (e.g. a SIGUSR1 will not change any configuration inside
NMConfig).
Later, we will have more causes, and accordingly more fine-grained
effects of what should be done on reload.
2016-05-30 14:53:27 +02:00
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
|
* Following flags describe which property of the configuration changed:
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
/* main-file or config-description changed */
|
|
|
|
|
NM_CONFIG_CHANGE_CONFIG_FILES = (1L << 10),
|
|
|
|
|
|
|
|
|
|
/* any configuration on disk changed */
|
|
|
|
|
NM_CONFIG_CHANGE_VALUES = (1L << 11),
|
|
|
|
|
|
|
|
|
|
/* any user configuration on disk changed (NetworkManager.conf) */
|
|
|
|
|
NM_CONFIG_CHANGE_VALUES_USER = (1L << 12),
|
|
|
|
|
|
|
|
|
|
/* any internal configuration on disk changed (NetworkManager-intern.conf) */
|
|
|
|
|
NM_CONFIG_CHANGE_VALUES_INTERN = (1L << 13),
|
|
|
|
|
|
|
|
|
|
/* configuration regarding connectivity changed */
|
|
|
|
|
NM_CONFIG_CHANGE_CONNECTIVITY = (1L << 14),
|
|
|
|
|
|
|
|
|
|
/* configuration regarding no-auto-default changed */
|
|
|
|
|
NM_CONFIG_CHANGE_NO_AUTO_DEFAULT = (1L << 15),
|
|
|
|
|
|
|
|
|
|
/* configuration regarding dns-mode changed */
|
|
|
|
|
NM_CONFIG_CHANGE_DNS_MODE = (1L << 16),
|
|
|
|
|
|
|
|
|
|
/* configuration regarding rc-manager changed */
|
|
|
|
|
NM_CONFIG_CHANGE_RC_MANAGER = (1L << 17),
|
|
|
|
|
|
|
|
|
|
/* configuration regarding global dns-config changed */
|
|
|
|
|
NM_CONFIG_CHANGE_GLOBAL_DNS_CONFIG = (1L << 18),
|
|
|
|
|
|
2015-01-21 12:58:32 +01:00
|
|
|
} NMConfigChangeFlags;
|
|
|
|
|
|
2016-09-29 13:49:01 +02:00
|
|
|
typedef struct _NMConfigDataClass NMConfigDataClass;
|
2014-07-11 17:57:20 +02:00
|
|
|
|
2015-06-15 09:01:42 +02:00
|
|
|
typedef struct _NMGlobalDnsConfig NMGlobalDnsConfig;
|
|
|
|
|
typedef struct _NMGlobalDnsDomain NMGlobalDnsDomain;
|
|
|
|
|
|
2014-07-11 17:57:20 +02:00
|
|
|
GType nm_config_data_get_type (void);
|
|
|
|
|
|
2015-01-06 20:16:10 +01:00
|
|
|
NMConfigData *nm_config_data_new (const char *config_main_file,
|
|
|
|
|
const char *config_description,
|
2015-01-07 17:09:52 +01:00
|
|
|
const char *const*no_auto_default,
|
2015-06-24 20:11:42 +02:00
|
|
|
GKeyFile *keyfile_user,
|
|
|
|
|
GKeyFile *keyfile_intern);
|
|
|
|
|
NMConfigData *nm_config_data_new_update_keyfile_intern (const NMConfigData *base, GKeyFile *keyfile_intern);
|
2015-01-07 17:09:52 +01:00
|
|
|
NMConfigData *nm_config_data_new_update_no_auto_default (const NMConfigData *base, const char *const*no_auto_default);
|
2015-01-06 20:16:10 +01:00
|
|
|
|
2015-01-21 12:58:32 +01:00
|
|
|
NMConfigChangeFlags nm_config_data_diff (NMConfigData *old_data, NMConfigData *new_data);
|
2015-01-07 14:30:14 +01:00
|
|
|
|
2015-11-20 17:52:54 +01:00
|
|
|
void nm_config_data_log (const NMConfigData *self,
|
2019-09-26 09:52:23 +02:00
|
|
|
const char *prefix,
|
|
|
|
|
const char *key_prefix,
|
|
|
|
|
const char *no_auto_default_file,
|
|
|
|
|
/* FILE* */ gpointer print_stream);
|
2015-06-09 09:59:18 +02:00
|
|
|
|
2015-01-06 20:16:10 +01:00
|
|
|
const char *nm_config_data_get_config_main_file (const NMConfigData *config_data);
|
|
|
|
|
const char *nm_config_data_get_config_description (const NMConfigData *config_data);
|
2014-12-16 16:52:34 +01:00
|
|
|
|
2015-06-11 23:43:29 +02:00
|
|
|
gboolean nm_config_data_has_group (const NMConfigData *self, const char *group);
|
2015-06-16 15:13:26 +02:00
|
|
|
gboolean nm_config_data_has_value (const NMConfigData *self, const char *group, const char *key, NMConfigGetValueFlags flags);
|
|
|
|
|
char *nm_config_data_get_value (const NMConfigData *config_data, const char *group, const char *key, NMConfigGetValueFlags flags);
|
all: don't use gchar/gshort/gint/glong but C types
We commonly don't use the glib typedefs for char/short/int/long,
but their C types directly.
$ git grep '\<g\(char\|short\|int\|long\|float\|double\)\>' | wc -l
587
$ git grep '\<\(char\|short\|int\|long\|float\|double\)\>' | wc -l
21114
One could argue that using the glib typedefs is preferable in
public API (of our glib based libnm library) or where it clearly
is related to glib, like during
g_object_set (obj, PROPERTY, (gint) value, NULL);
However, that argument does not seem strong, because in practice we don't
follow that argument today, and seldomly use the glib typedefs.
Also, the style guide for this would be hard to formalize, because
"using them where clearly related to a glib" is a very loose suggestion.
Also note that glib typedefs will always just be typedefs of the
underlying C types. There is no danger of glib changing the meaning
of these typedefs (because that would be a major API break of glib).
A simple style guide is instead: don't use these typedefs.
No manual actions, I only ran the bash script:
FILES=($(git ls-files '*.[hc]'))
sed -i \
-e 's/\<g\(char\|short\|int\|long\|float\|double\)\>\( [^ ]\)/\1\2/g' \
-e 's/\<g\(char\|short\|int\|long\|float\|double\)\> /\1 /g' \
-e 's/\<g\(char\|short\|int\|long\|float\|double\)\>/\1/g' \
"${FILES[@]}"
2018-07-11 07:40:19 +02:00
|
|
|
int nm_config_data_get_value_boolean (const NMConfigData *self, const char *group, const char *key, int default_value);
|
2017-10-24 08:44:46 +02:00
|
|
|
gint64 nm_config_data_get_value_int64 (const NMConfigData *self, const char *group, const char *key, guint base, gint64 min, gint64 max, gint64 fallback);
|
2015-01-07 13:25:41 +01:00
|
|
|
|
2016-11-25 13:54:42 +01:00
|
|
|
char **nm_config_data_get_plugins (const NMConfigData *config_data, gboolean allow_default);
|
2017-08-09 15:19:54 +08:00
|
|
|
gboolean nm_config_data_get_connectivity_enabled (const NMConfigData *config_data);
|
2014-07-11 17:57:20 +02:00
|
|
|
const char *nm_config_data_get_connectivity_uri (const NMConfigData *config_data);
|
2017-02-06 18:28:56 +01:00
|
|
|
guint nm_config_data_get_connectivity_interval (const NMConfigData *config_data);
|
2014-07-11 17:57:20 +02:00
|
|
|
const char *nm_config_data_get_connectivity_response (const NMConfigData *config_data);
|
|
|
|
|
|
2017-11-22 21:19:40 +01:00
|
|
|
int nm_config_data_get_autoconnect_retries_default (const NMConfigData *config_data);
|
|
|
|
|
|
2019-12-10 08:51:03 +01:00
|
|
|
NMAuthPolkitMode nm_config_data_get_main_auth_polkit (const NMConfigData *config_data);
|
|
|
|
|
|
2015-01-07 17:09:52 +01:00
|
|
|
const char *const*nm_config_data_get_no_auto_default (const NMConfigData *config_data);
|
2015-06-07 23:27:01 +02:00
|
|
|
gboolean nm_config_data_get_no_auto_default_for_device (const NMConfigData *self, NMDevice *device);
|
2015-01-07 17:09:52 +01:00
|
|
|
|
2015-02-12 17:35:14 +01:00
|
|
|
const char *nm_config_data_get_dns_mode (const NMConfigData *self);
|
2015-04-20 11:11:32 +02:00
|
|
|
const char *nm_config_data_get_rc_manager (const NMConfigData *self);
|
2018-07-03 14:35:32 +02:00
|
|
|
gboolean nm_config_data_get_systemd_resolved (const NMConfigData *self);
|
2015-02-12 17:35:14 +01:00
|
|
|
|
2015-04-17 13:54:32 +02:00
|
|
|
gboolean nm_config_data_get_ignore_carrier (const NMConfigData *self, NMDevice *device);
|
2015-05-20 11:36:37 +02:00
|
|
|
gboolean nm_config_data_get_assume_ipv6ll_only (const NMConfigData *self, NMDevice *device);
|
2017-04-14 23:33:14 +02:00
|
|
|
int nm_config_data_get_sriov_num_vfs (const NMConfigData *self, NMDevice *device);
|
|
|
|
|
|
2015-06-15 09:01:42 +02:00
|
|
|
NMGlobalDnsConfig *nm_config_data_get_global_dns_config (const NMConfigData *self);
|
2015-04-17 13:54:32 +02:00
|
|
|
|
2018-11-14 14:52:21 +01:00
|
|
|
extern const char *__start_connection_defaults[];
|
|
|
|
|
extern const char *__stop_connection_defaults[];
|
|
|
|
|
|
|
|
|
|
#define NM_CON_DEFAULT_NOP(name) \
|
|
|
|
|
static const char *NM_UNIQ_T (connection_default, NM_UNIQ) \
|
|
|
|
|
_nm_used _nm_section ("connection_defaults") = "" name
|
|
|
|
|
|
|
|
|
|
#define NM_CON_DEFAULT(name) \
|
|
|
|
|
({ \
|
|
|
|
|
static const char *__con_default_prop \
|
|
|
|
|
_nm_used _nm_section ("connection_defaults") = "" name; \
|
|
|
|
|
\
|
|
|
|
|
name; \
|
|
|
|
|
})
|
|
|
|
|
|
2015-05-15 11:36:28 +02:00
|
|
|
char *nm_config_data_get_connection_default (const NMConfigData *self,
|
|
|
|
|
const char *property,
|
|
|
|
|
NMDevice *device);
|
|
|
|
|
|
2018-09-05 09:24:33 +02:00
|
|
|
gint64 nm_config_data_get_connection_default_int64 (const NMConfigData *self,
|
|
|
|
|
const char *property,
|
|
|
|
|
NMDevice *device,
|
|
|
|
|
gint64 min,
|
|
|
|
|
gint64 max,
|
|
|
|
|
gint64 fallback);
|
|
|
|
|
|
2016-06-22 13:14:10 +02:00
|
|
|
char *nm_config_data_get_device_config (const NMConfigData *self,
|
|
|
|
|
const char *property,
|
|
|
|
|
NMDevice *device,
|
|
|
|
|
gboolean *has_match);
|
|
|
|
|
|
2017-12-13 15:33:33 +01:00
|
|
|
char *nm_config_data_get_device_config_by_pllink (const NMConfigData *self,
|
|
|
|
|
const char *property,
|
|
|
|
|
const NMPlatformLink *pllink,
|
2017-12-27 09:30:49 +01:00
|
|
|
const char *match_device_type,
|
2017-12-13 15:33:33 +01:00
|
|
|
gboolean *has_match);
|
|
|
|
|
|
2016-06-22 13:14:10 +02:00
|
|
|
gboolean nm_config_data_get_device_config_boolean (const NMConfigData *self,
|
|
|
|
|
const char *property,
|
|
|
|
|
NMDevice *device,
|
all: don't use gchar/gshort/gint/glong but C types
We commonly don't use the glib typedefs for char/short/int/long,
but their C types directly.
$ git grep '\<g\(char\|short\|int\|long\|float\|double\)\>' | wc -l
587
$ git grep '\<\(char\|short\|int\|long\|float\|double\)\>' | wc -l
21114
One could argue that using the glib typedefs is preferable in
public API (of our glib based libnm library) or where it clearly
is related to glib, like during
g_object_set (obj, PROPERTY, (gint) value, NULL);
However, that argument does not seem strong, because in practice we don't
follow that argument today, and seldomly use the glib typedefs.
Also, the style guide for this would be hard to formalize, because
"using them where clearly related to a glib" is a very loose suggestion.
Also note that glib typedefs will always just be typedefs of the
underlying C types. There is no danger of glib changing the meaning
of these typedefs (because that would be a major API break of glib).
A simple style guide is instead: don't use these typedefs.
No manual actions, I only ran the bash script:
FILES=($(git ls-files '*.[hc]'))
sed -i \
-e 's/\<g\(char\|short\|int\|long\|float\|double\)\>\( [^ ]\)/\1\2/g' \
-e 's/\<g\(char\|short\|int\|long\|float\|double\)\> /\1 /g' \
-e 's/\<g\(char\|short\|int\|long\|float\|double\)\>/\1/g' \
"${FILES[@]}"
2018-07-11 07:40:19 +02:00
|
|
|
int val_no_match,
|
|
|
|
|
int val_invalid);
|
2016-06-22 13:14:10 +02:00
|
|
|
|
2015-06-11 23:43:29 +02:00
|
|
|
char **nm_config_data_get_groups (const NMConfigData *self);
|
|
|
|
|
char **nm_config_data_get_keys (const NMConfigData *self, const char *group);
|
2015-06-10 11:59:46 +02:00
|
|
|
gboolean nm_config_data_is_intern_atomic_group (const NMConfigData *self, const char *group);
|
2015-06-11 23:43:29 +02:00
|
|
|
|
2015-06-24 20:11:42 +02:00
|
|
|
GKeyFile *nm_config_data_clone_keyfile_intern (const NMConfigData *self);
|
|
|
|
|
|
2018-03-26 08:17:11 +02:00
|
|
|
const char *const *nm_global_dns_config_get_searches (const NMGlobalDnsConfig *dns_config);
|
|
|
|
|
const char *const *nm_global_dns_config_get_options (const NMGlobalDnsConfig *dns_config);
|
|
|
|
|
guint nm_global_dns_config_get_num_domains (const NMGlobalDnsConfig *dns_config);
|
|
|
|
|
NMGlobalDnsDomain *nm_global_dns_config_get_domain (const NMGlobalDnsConfig *dns_config, guint i);
|
|
|
|
|
NMGlobalDnsDomain *nm_global_dns_config_lookup_domain (const NMGlobalDnsConfig *dns_config, const char *name);
|
2015-06-15 09:01:42 +02:00
|
|
|
const char *nm_global_dns_domain_get_name (const NMGlobalDnsDomain *domain);
|
|
|
|
|
const char *const *nm_global_dns_domain_get_servers (const NMGlobalDnsDomain *domain);
|
|
|
|
|
const char *const *nm_global_dns_domain_get_options (const NMGlobalDnsDomain *domain);
|
2018-03-26 08:17:11 +02:00
|
|
|
gboolean nm_global_dns_config_is_internal (const NMGlobalDnsConfig *dns_config);
|
|
|
|
|
gboolean nm_global_dns_config_is_empty (const NMGlobalDnsConfig *dns_config);
|
|
|
|
|
void nm_global_dns_config_update_checksum (const NMGlobalDnsConfig *dns_config, GChecksum *sum);
|
|
|
|
|
void nm_global_dns_config_free (NMGlobalDnsConfig *dns_config);
|
2015-06-15 09:01:42 +02:00
|
|
|
|
2015-07-03 11:06:39 +02:00
|
|
|
NMGlobalDnsConfig *nm_global_dns_config_from_dbus (const GValue *value, GError **error);
|
|
|
|
|
void nm_global_dns_config_to_dbus (const NMGlobalDnsConfig *dns_config, GValue *value);
|
|
|
|
|
|
2019-12-11 11:35:11 +01:00
|
|
|
void nm_config_data_get_warnings (const NMConfigData *self,
|
|
|
|
|
GPtrArray *warnings);
|
|
|
|
|
|
2015-06-24 20:11:42 +02:00
|
|
|
/* private accessors */
|
|
|
|
|
GKeyFile *_nm_config_data_get_keyfile (const NMConfigData *self);
|
|
|
|
|
GKeyFile *_nm_config_data_get_keyfile_user (const NMConfigData *self);
|
|
|
|
|
GKeyFile *_nm_config_data_get_keyfile_intern (const NMConfigData *self);
|
|
|
|
|
|
device: add "dhcp-plugin" match spec for device
The need for this is the following:
"ipv4.dhcp-client-id" can be specified via global connection defaults.
In absence of any configuration in NetworkManager, the default depends
on the DHCP client plugin. In case of "dhclient", the default further
depends on /etc/dhcp.
For "internal" plugin, we may very well want to change the default
client-id to "mac" by universally installing a configuration
snippet
[connection-use-mac-client-id]
ipv4.dhcp-client-id=mac
However, if we the user happens to enable "dhclient" plugin, this also
forces the client-id and overrules configuration from /etc/dhcp. The real
problem is, that dhclient can be configured via means outside of NetworkManager,
so our defaults shall not overwrite defaults from /etc/dhcp.
With the new device spec, we can avoid this issue:
[connection-dhcp-client-id]
match-device=except:dhcp-plugin:dhclient
ipv4.dhcp-client-id=mac
This will be part of the solution for rh#1640494. Note that merely
dropping a configuration snippet is not yet enough. More fixes for
DHCP will follow. Also, bug rh#1640494 may have alternative solutions
as well. The nice part of this new feature is that it is generally
useful for configuring connection defaults and not specifically for
the client-id issue.
Note that this match spec is per-device, although the plugin is selected
globally. That makes some sense, because in the future we may or may not
configure the DHCP plugin per-device or per address family.
https://bugzilla.redhat.com/show_bug.cgi?id=1640494
2018-10-24 08:43:45 +02:00
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
/* nm-config-data.c requires getting the DHCP manager's configuration. That is a bit
|
|
|
|
|
* ugly, and optimally, NMConfig* is independent of NMDhcpManager. Instead of
|
|
|
|
|
* including the header, forward declare the two functions that we need. */
|
|
|
|
|
struct _NMDhcpManager;
|
|
|
|
|
struct _NMDhcpManager *nm_dhcp_manager_get (void);
|
|
|
|
|
const char *nm_dhcp_manager_get_config (struct _NMDhcpManager *self);
|
|
|
|
|
|
2014-07-11 17:57:20 +02:00
|
|
|
#endif /* NM_CONFIG_DATA_H */
|
|
|
|
|
|