![]() |
![]() |
![]() |
libnm-util Reference Manual | ![]() |
---|---|---|---|---|
#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 NMSetting; void (*NMSettingValueIterFn) (NMSetting *setting, const char *key, const GValue *value, GParamFlags flags, gpointer user_data); GHashTable* nm_setting_to_hash (NMSetting *setting); NMSetting* nm_setting_duplicate (NMSetting *setting); const char* nm_setting_get_name (NMSetting *setting); gboolean nm_setting_verify (NMSetting *setting, GSList *all_settings, GError **error); enum NMSettingCompareFlags; gboolean nm_setting_compare (NMSetting *setting, NMSetting *other, NMSettingCompareFlags flags); void nm_setting_enumerate_values (NMSetting *setting, NMSettingValueIterFn func, gpointer user_data); char* nm_setting_to_string (NMSetting *setting); void nm_setting_clear_secrets (NMSetting *setting); GPtrArray* nm_setting_need_secrets (NMSetting *setting); gboolean nm_setting_update_secrets (NMSetting *setting, GHashTable *secrets, GError **error);
GObject +----NMSetting +----NMSetting8021x +----NMSettingCdma +----NMSettingConnection +----NMSettingGsm +----NMSettingIP4Config +----NMSettingPPP +----NMSettingPPPOE +----NMSettingSerial +----NMSettingVPN +----NMSettingWired +----NMSettingWireless +----NMSettingWirelessSecurity
void (*NMSettingValueIterFn) (NMSetting *setting, const char *key, const GValue *value, GParamFlags flags, gpointer user_data);
|
|
|
|
|
|
|
|
|
GHashTable* nm_setting_to_hash (NMSetting *setting);
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:GValue.
|
the NMSetting |
Returns : |
a new GHashTable describing the setting's properties |
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
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.
typedef enum { /* Match all attributes exactly */ NM_SETTING_COMPARE_FLAG_EXACT = 0x00000000, /* Match only important attributes, like SSID, type, security settings, etc; * For example, does not match connection ID or UUID. */ NM_SETTING_COMPARE_FLAG_FUZZY = 0x00000001, /* Ignore the connection ID */ NM_SETTING_COMPARE_FLAG_IGNORE_ID = 0x00000002, /* Ignore connection secrets */ NM_SETTING_COMPARE_FLAG_IGNORE_SECRETS = 0x00000004 } NMSettingCompareFlags;
gboolean nm_setting_compare (NMSetting *setting, NMSetting *other, 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.
|
|
|
|
|
compare flags, e.g. NM_SETTING_COMPARE_FLAG_EXACT
|
Returns : |
TRUE if the comparison succeeds, FALSE if it does not |
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.
|
the NMSetting |
|
user-supplied function called for each property of the setting |
|
user data passed to func at each invocation
|
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.
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.
|
the NMSetting |
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.
|
the NMSetting |
Returns : |
a GPtrArray containing the property names of secrets of the
NMSetting which may be required; the caller owns the array
and must free the each array element with g_free() , as well as the array
itself with g_ptr_array_free()
|
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).
|
the NMSetting |
|
a GHashTable mapping string:GValue of setting property names and secrets |
|
location to store error, or NULL
|
Returns : |
TRUE if the secrets were successfully updated and the connection is valid, FALSE on failure or if the setting was never added to the connection |
"name"
property"name" gchararray : Read / Write
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'.
Default value: NULL