Top | ![]() |
![]() |
![]() |
![]() |
GQuark | nm_setting_error_quark () |
gboolean | (*NMSettingClearSecretsWithFlagsFn) () |
void | (*NMSettingValueIterFn) () |
GHashTable * | nm_setting_to_hash () |
NMSetting * | nm_setting_new_from_hash () |
NMSetting * | nm_setting_duplicate () |
const char * | nm_setting_get_name () |
gboolean | nm_setting_verify () |
gboolean | nm_setting_compare () |
gboolean | nm_setting_diff () |
void | nm_setting_enumerate_values () |
char * | nm_setting_to_string () |
void | nm_setting_clear_secrets () |
void | nm_setting_clear_secrets_with_flags () |
GPtrArray * | nm_setting_need_secrets () |
gboolean | nm_setting_update_secrets () |
gboolean | nm_setting_get_secret_flags () |
gboolean | nm_setting_set_secret_flags () |
const char * | nm_setting_get_virtual_iface_name () |
enum | NMSettingError |
#define | NM_SETTING_ERROR |
#define | NM_SETTING_PARAM_SERIALIZE |
#define | NM_SETTING_PARAM_REQUIRED |
#define | NM_SETTING_PARAM_SECRET |
#define | NM_SETTING_PARAM_FUZZY_IGNORE |
#define | NM_SETTING_NAME |
enum | NMSettingSecretFlags |
enum | NMSettingCompareFlags |
NMSetting | |
enum | NMSettingHashFlags |
enum | NMSettingDiffResult |
GEnum ├── NMSettingCompareFlags ├── NMSettingDiffResult ├── NMSettingError ├── NMSettingHashFlags ╰── NMSettingSecretFlags GObject ╰── NMSetting ├── NMSettingVPN ├── NMSettingVlan ├── NMSettingWirelessSecurity ├── NMSettingWireless ├── NMSettingWired ├── NMSettingWimax ├── NMSettingTeamPort ├── NMSettingTeam ├── NMSettingSerial ├── NMSettingPPPOE ├── NMSettingPPP ├── NMSettingOlpcMesh ├── NMSettingIP6Config ├── NMSettingIP4Config ├── NMSettingInfiniband ├── NMSettingGsm ├── NMSettingGeneric ├── NMSettingDcb ├── NMSettingConnection ├── NMSettingCdma ├── NMSettingBond ├── NMSettingBridgePort ├── NMSettingBridge ├── NMSettingBluetooth ├── NMSettingAdsl ╰── NMSetting8021x
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.
GQuark
nm_setting_error_quark (void
);
Registers an error quark for NMSetting if necessary.
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 |
GHashTable * nm_setting_to_hash (NMSetting *setting
,NMSettingHashFlags flags
);
Converts the NMSetting into a GHashTable mapping each setting property name to a GValue describing that property, suitable for marshalling over D-Bus or serializing. The mapping is string to GValue.
a new GHashTable describing the setting's properties.
[transfer full][element-type utf8 GObject.Value]
NMSetting * nm_setting_new_from_hash (GType setting_type
,GHashTable *hash
);
Creates a new NMSetting object and populates that object with the properties contained in the hash table, using each hash key as the property to set, and each hash value as the value to set that property to. Setting properties are strongly typed, thus the GValue type of the hash value must be correct. See the documentation on each NMSetting object subclass for the correct property names and value types.
setting_type |
the NMSetting type which the hash contains properties for |
|
hash |
the GHashTable containing a string to GValue mapping of properties that apply to the setting. |
[element-type utf8 GObject.Value] |
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
,GSList *all_settings
,GError **error
);
Validates the setting. Each setting's properties have allowed values, and
some are dependent on other values (hence the need for all_settings
). The
returned GError contains information about which property of the setting
failed validation, and in what way that property failed validation.
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-util 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 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 (including secrets!), which the caller should
free with g_free()
void
nm_setting_clear_secrets (NMSetting *setting
);
Resets and clears any secrets in the setting. Secrets should be added to the setting only when needed, and cleared immediately after use to prevent leakage of information.
void nm_setting_clear_secrets_with_flags (NMSetting *setting
,NMSettingClearSecretsWithFlagsFn func
,gpointer user_data
);
Clears and frees secrets determined by func
.
setting |
the NMSetting |
|
func |
function to be called to determine whether a specific secret should be cleared or not. |
[scope call] |
user_data |
caller-supplied data passed to |
GPtrArray *
nm_setting_need_secrets (NMSetting *setting
);
Returns an array of property names for each secret which may be required to make a successful connection. The returned hints are only intended as a guide to what secrets may be required, because in some circumstances, there is no way to conclusively determine exactly which secrets are needed.
a GPtrArray containing
the property names of secrets of the NMSetting which may be required; the
caller owns the array and must free it with g_ptr_array_free()
, but must not
free the elements.
[transfer container][element-type utf8]
gboolean nm_setting_update_secrets (NMSetting *setting
,GHashTable *secrets
,GError **error
);
Update the setting's secrets, given a hash table of secrets intended for that setting (deserialized from D-Bus for example).
setting |
the NMSetting |
|
secrets |
a GHashTable mapping string to GValue of setting property names and secrets. |
[element-type utf8 GObject.Value] |
error |
location to store error, or |
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 |
const char *
nm_setting_get_virtual_iface_name (NMSetting *setting
);
Returns the name of the virtual kernel interface which the connection needs to use if specified in the settings.
Describes errors that may result from operations involving a NMSetting.
unknown or unclassified error |
||
a property required by the operation was not found; for example, an attempt to update an invalid secret |
||
an operation which requires a secret was attempted on a non-secret property |
||
the operation requires a property of a specific type, or the value couldn't be transformed to the same type as the property being acted upon |
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,
|
typedef struct _NMSetting NMSetting;
The NMSetting struct contains only private data. It should only be accessed through the functions described below.
These flags determine which properties are added to the resulting hash
when calling nm_setting_to_hash()
.
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 |
“name”
property“name” gchar *
The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired".
Flags: Read / Write
Default value: NULL