Top |
#define | NM_SETTING_PARAM_REQUIRED |
#define | NM_SETTING_PARAM_SECRET |
#define | NM_SETTING_PARAM_FUZZY_IGNORE |
#define | NM_SETTING_NAME |
enum | NMSettingSecretFlags |
enum | NMSettingCompareFlags |
enum | NMSettingMacRandomization |
enum | NMSettingDiffResult |
GBoxed ╰── NMRange GEnum ├── NMSettingCompareFlags ├── NMSettingDiffResult ╰── NMSettingMacRandomization GFlags ╰── NMSettingSecretFlags
Each NMSetting contains properties that describe configuration that applies to a specific network layer (like IPv4 or IPv6 configuration) or device type (like Ethernet, or Wi-Fi). A collection of individual settings together make up an NMConnection. Each property is strongly typed and usually has a number of allowed values. See each NMSetting subclass for a description of properties and allowed values.
gboolean (*NMSettingClearSecretsWithFlagsFn) (NMSetting *setting
,const char *secret
,NMSettingSecretFlags flags
,gpointer user_data
);
setting |
The setting for which secrets are being iterated |
|
secret |
The secret's name |
|
flags |
The secret's flags, eg |
|
user_data |
User data passed to |
void (*NMSettingValueIterFn) (NMSetting *setting
,const char *key
,const GValue *value
,GParamFlags flags
,gpointer user_data
);
setting |
The setting for which properties are being iterated, given to
|
|
key |
The value/property name |
|
value |
The property's value |
|
flags |
The property's flags, like |
|
user_data |
User data passed to |
gboolean (*_NMConnectionForEachSecretFunc) (NMSettingSecretFlags flags
,gpointer user_data
);
GType
nm_setting_lookup_type (const char *name
);
Returns the GType of the setting's class for a given setting name.
NMSetting *
nm_setting_duplicate (NMSetting *setting
);
Duplicates a NMSetting.
const char *
nm_setting_get_name (NMSetting *setting
);
Returns the type name of the NMSetting object
a string containing the type name of the NMSetting object, like 'ppp' or 'wireless' or 'wired'.
gboolean nm_setting_verify (NMSetting *setting
,NMConnection *connection
,GError **error
);
Validates the setting. Each setting's properties have allowed values, and
some are dependent on other values (hence the need for connection
). The
returned GError contains information about which property of the setting
failed validation, and in what way that property failed validation.
setting |
the NMSetting to verify |
|
connection |
the NMConnection that |
[allow-none] |
error |
location to store error, or |
gboolean nm_setting_verify_secrets (NMSetting *setting
,NMConnection *connection
,GError **error
);
Verifies the secrets in the setting. The returned GError contains information about which secret of the setting failed validation, and in what way that secret failed validation. The secret validation is done separately from main setting validation, because in some cases connection failure is not desired just for the secrets.
setting |
the NMSetting to verify secrets in |
|
connection |
the NMConnection that |
[allow-none] |
error |
location to store error, or |
Since: 1.2
gboolean nm_setting_compare (NMSetting *a
,NMSetting *b
,NMSettingCompareFlags flags
);
Compares two NMSetting objects for similarity, with comparison behavior modified by a set of flags. See the documentation for NMSettingCompareFlags for a description of each flag's behavior.
a |
||
b |
a second NMSetting to compare with the first |
|
flags |
compare flags, e.g. |
gboolean nm_setting_diff (NMSetting *a
,NMSetting *b
,NMSettingCompareFlags flags
,gboolean invert_results
,GHashTable **results
);
Compares two NMSetting objects for similarity, with comparison behavior
modified by a set of flags. See the documentation for NMSettingCompareFlags
for a description of each flag's behavior. If the settings differ, the keys
of each setting that differ from the other are added to results
, mapped to
one or more NMSettingDiffResult values.
a |
||
b |
a second NMSetting to compare with the first |
|
flags |
compare flags, e.g. |
|
invert_results |
this parameter is used internally by libnm and should
be set to |
|
results |
if the
settings differ, on return a hash table mapping the differing keys to one or
more |
[inout][transfer full][element-type utf8 guint32] |
void nm_setting_enumerate_values (NMSetting *setting
,NMSettingValueIterFn func
,gpointer user_data
);
Iterates over each property of the NMSetting object, calling the supplied user function for each property.
setting |
the NMSetting |
|
func |
user-supplied function called for each property of the setting. |
[scope call] |
user_data |
user data passed to |
char *
nm_setting_to_string (NMSetting *setting
);
Convert the setting (including secrets!) into a string. For debugging purposes ONLY, should NOT be used for serialization of the setting, or machine-parsed in any way. The output format is not guaranteed to be stable and may change at any time.
an allocated string containing a textual representation of the
setting's properties and values, which the caller should
free with g_free()
gboolean nm_setting_get_secret_flags (NMSetting *setting
,const char *secret_name
,NMSettingSecretFlags *out_flags
,GError **error
);
For a given secret, retrieves the NMSettingSecretFlags describing how to handle that secret.
setting |
the NMSetting |
|
secret_name |
the secret key name to get flags for |
|
out_flags |
on success, the NMSettingSecretFlags for the secret |
|
error |
location to store error, or |
gboolean nm_setting_set_secret_flags (NMSetting *setting
,const char *secret_name
,NMSettingSecretFlags flags
,GError **error
);
For a given secret, stores the NMSettingSecretFlags describing how to handle that secret.
setting |
the NMSetting |
|
secret_name |
the secret key name to set flags for |
|
flags |
the NMSettingSecretFlags for the secret |
|
error |
location to store error, or |
GVariant * nm_setting_option_get (NMSetting *setting
,const char *opt_name
);
Since: 1.26
gboolean nm_setting_option_get_boolean (NMSetting *setting
,const char *opt_name
,gboolean *out_value
);
Since: 1.26
gboolean nm_setting_option_get_uint32 (NMSetting *setting
,const char *opt_name
,guint32 *out_value
);
setting |
the NMSetting |
|
opt_name |
the option to get |
|
out_value |
the optional output value. If the option is unset, 0 will be returned. |
[allow-none][out] |
Since: 1.26
void nm_setting_option_set (NMSetting *setting
,const char *opt_name
,GVariant *variant
);
If variant
is NULL
, this clears the option if it is set.
Otherwise, variant
is set as the option. If variant
is
a floating reference, it will be consumed.
Note that not all setting types support options. It is a bug setting a variant to a setting that doesn't support it. Currently, only NMSettingEthtool supports it.
setting |
the NMSetting |
|
opt_name |
the option name to set |
|
variant |
the variant to set. |
[allow-none] |
Since: 1.26
void nm_setting_option_set_uint32 (NMSetting *setting
,const char *opt_name
,guint32 value
);
Like nm_setting_option_set()
to set a uint32 GVariant.
Since: 1.26
void nm_setting_option_set_boolean (NMSetting *setting
,const char *opt_name
,gboolean value
);
Like nm_setting_option_set()
to set a boolean GVariant.
Since: 1.26
const char *const * nm_setting_option_get_all_names (NMSetting *setting
,guint *out_len
);
Gives the name of all set options.
A NULL
terminated array of key names. If no names are present, this returns
NULL
. The returned array and the names are owned by NMSetting
and might be invalidated
by the next operation.
[array length=out_len zero-terminated=1][transfer none]
Since: 1.26
void nm_setting_option_clear_by_name (NMSetting *setting
,NMUtilsPredicateStr predicate
);
Since: 1.26
const GVariantType * nm_setting_get_dbus_property_type (NMSetting *setting
,const char *property_name
);
Gets the D-Bus marshalling type of a property. property_name
is a D-Bus
property name, which may not necessarily be a GObject property.
NMRange * nm_range_new (guint64 start
,guint64 end
);
Creates a new NMRange object for the given range. Setting end
equal to start
creates a single-element range.
start |
the first element of the range |
|
end |
the last element of the range, must be greater than or equal
to |
Since: 1.42
NMRange *
nm_range_ref (const NMRange *range
);
Increases the reference count of the object. This is thread-safe.
Since: 1.42
void
nm_range_unref (const NMRange *range
);
Decreases the reference count of the object. If the reference count reaches zero the object will be destroyed. This is thread-safe.
Since: 1.42
int nm_range_cmp (const NMRange *a
,const NMRange *b
);
Compare two ranges.
zero if the two instances are equivalent or a non-zero integer otherwise. This defines a total ordering over the ranges.
Since: 1.42
gboolean nm_range_get_range (const NMRange *range
,guint64 *start
,guint64 *end
);
Gets the start and end values for the range.
range |
the NMRange |
|
start |
location to store the start value. |
[out] |
end |
location to store the end value. |
[out] |
Since: 1.42
char *
nm_range_to_str (const NMRange *range
);
Convert a NMRange
to a string.
Since: 1.42
These flags indicate specific behavior related to handling of a secret. Each secret has a corresponding set of these flags which indicate how the secret is to be stored and/or requested when it is needed.
the system is responsible for providing and storing this secret (default) |
||
a user secret agent is responsible for providing and storing this secret; when it is required agents will be asked to retrieve it |
||
this secret should not be saved, but should be requested from the user each time it is needed |
||
in situations where it cannot be automatically determined that the secret is required (some VPNs and PPP providers don't require all secrets) this flag indicates that the specific secret is not required |
These flags modify the comparison behavior when comparing two settings or two connections.
match all properties exactly |
||
match only important attributes, like SSID, type, security settings, etc. Does not match, for example, connection ID or UUID. |
||
ignore the connection's ID |
||
ignore all secrets |
||
ignore secrets for which
the secret's flags indicate the secret is owned by a user secret agent
(ie, the secret's flag includes |
||
ignore secrets for which
the secret's flags indicate the secret should not be saved to persistent
storage (ie, the secret's flag includes |
||
if this flag is set,
|
||
if this flag is set,
|
||
ignore the connection's timestamp |
Controls if and how the MAC address of a device is randomzied.
Since: 1.2
These values indicate the result of a setting difference operation.
unknown result |
||
the property is present in setting A |
||
the property is present in setting B |
||
the property is present in
setting A but is set to the default value. This flag is only set,
if you specify |
||
analog to |