NMSetting: libnm Reference Manual

## NMSetting NMSetting |

## Functions

gboolean | (*NMSettingClearSecretsWithFlagsFn) ()
void | (*NMSettingValueIterFn) ()
gboolean | (*_NMConnectionForEachSecretFunc) ()
GType | nm_setting_lookup_type ()
NMSetting * | nm_setting_duplicate ()
const char * | nm_setting_get_name ()
gboolean | nm_setting_verify ()
gboolean | nm_setting_verify_secrets ()
gboolean | nm_setting_compare ()
gboolean | nm_setting_diff ()
void | nm_setting_enumerate_values ()
char * | nm_setting_to_string ()
gboolean | nm_setting_get_secret_flags ()
gboolean | nm_setting_set_secret_flags ()
GVariant * | nm_setting_option_get ()
gboolean | nm_setting_option_get_boolean ()
gboolean | nm_setting_option_get_uint32 ()
void | nm_setting_option_set ()
void | nm_setting_option_set_uint32 ()
void | nm_setting_option_set_boolean ()
const char *const * | nm_setting_option_get_all_names ()
void | nm_setting_option_clear_by_name ()
const GVariantType * | nm_setting_get_dbus_property_type ()
NMRange * | nm_range_new ()
NMRange * | nm_range_ref ()
void | nm_range_unref ()
int | nm_range_cmp ()
gboolean | nm_range_get_range ()
char * | nm_range_to_str ()
NMRange * | nm_range_from_str ()

## Types and Values

#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

## Object Hierarchy

        GBoxed
        ╰── NMRange
        GEnum
        ├── NMSettingCompareFlags
        ├── NMSettingDiffResult
        ╰── NMSettingMacRandomization
        GFlags
        ╰── NMSettingSecretFlags

## Description

## Functions

### NMSettingClearSecretsWithFlagsFn ()

    gboolean
    (*NMSettingClearSecretsWithFlagsFn) (NMSetting *setting,
                                         const char *secret,
                                         NMSettingSecretFlags flags,
                                         gpointer user_data);

#### Parameters

setting | The setting for which secrets are being iterated |
secret | The secret's name |
flags | The secret's flags, eg `NM_SETTING_SECRET_FLAG_AGENT_OWNED` |
user_data | User data passed to `nm_connection_clear_secrets_with_flags()` |

#### Returns

`TRUE` to clear the secret, `FALSE` to not clear the secret

### NMSettingValueIterFn ()

    void
    (*NMSettingValueIterFn) (NMSetting *setting,
                             const char *key,
                             const GValue *value,
                             GParamFlags flags,
                             gpointer user_data);

#### Parameters

setting | The setting for which properties are being iterated, given to `nm_setting_enumerate_values()` |
key | The value/property name |
value | The property's value |
flags | The property's flags, like `NM_SETTING_PARAM_SECRET` |
user_data | User data passed to `nm_setting_enumerate_values()` |

### _NMConnectionForEachSecretFunc ()

    gboolean
    (*_NMConnectionForEachSecretFunc) (NMSettingSecretFlags flags,
                                       gpointer user_data);

### nm_setting_lookup_type ()

    GType
    nm_setting_lookup_type (const char *name);

### nm_setting_duplicate ()

    NMSetting *
    nm_setting_duplicate (NMSetting *setting);

### nm_setting_get_name ()

    const char *
    nm_setting_get_name (NMSetting *setting);

### nm_setting_verify ()

    gboolean
    nm_setting_verify (NMSetting *setting,
                       NMConnection *connection,
                       GError **error);

### nm_setting_verify_secrets ()

    gboolean
    nm_setting_verify_secrets (NMSetting *setting,
                               NMConnection *connection,
                               GError **error);

### nm_setting_compare ()

    gboolean
    nm_setting_compare (NMSetting *a,
                        NMSetting *b,
                        NMSettingCompareFlags flags);

### nm_setting_diff ()

    gboolean
    nm_setting_diff (NMSetting *a,
                     NMSetting *b,
                     NMSettingCompareFlags flags,
                     gboolean invert_results,
                     GHashTable **results);

### nm_setting_enumerate_values ()

    void
    nm_setting_enumerate_values (NMSetting *setting,
                                 NMSettingValueIterFn func,
                                 gpointer user_data);

### nm_setting_to_string ()

    char *
    nm_setting_to_string (NMSetting *setting);

### nm_setting_get_secret_flags ()

    gboolean
    nm_setting_get_secret_flags (NMSetting *setting,
                                 const char *secret_name,
                                 NMSettingSecretFlags *out_flags,
                                 GError **error);

### nm_setting_set_secret_flags ()

    gboolean
    nm_setting_set_secret_flags (NMSetting *setting,
                                 const char *secret_name,
                                 NMSettingSecretFlags flags,
                                 GError **error);

### nm_setting_option_get ()

    GVariant *
    nm_setting_option_get (NMSetting *setting,
                           const char *opt_name);

### nm_setting_option_get_boolean ()

    gboolean
    nm_setting_option_get_boolean (NMSetting *setting,
                                   const char *opt_name,
                                   gboolean *out_value);

### nm_setting_option_get_uint32 ()

    gboolean
    nm_setting_option_get_uint32 (NMSetting *setting,
                                  const char *opt_name,
                                  guint32 *out_value);

### nm_setting_option_set ()

    void
    nm_setting_option_set (NMSetting *setting,
                           const char *opt_name,
                           GVariant *variant);

### nm_setting_option_set_uint32 ()

    void
    nm_setting_option_set_uint32 (NMSetting *setting,
                                  const char *opt_name,
                                  guint32 value);

### nm_setting_option_set_boolean ()

    void
    nm_setting_option_set_boolean (NMSetting *setting,
                                   const char *opt_name,
                                   gboolean value);

### nm_setting_option_get_all_names ()

    const char *const *
    nm_setting_option_get_all_names (NMSetting *setting,
                                     guint *out_len);

### nm_setting_option_clear_by_name ()

    void
    nm_setting_option_clear_by_name (NMSetting *setting,
                                     NMUtilsPredicateStr predicate);

### nm_setting_get_dbus_property_type ()

    const GVariantType *
    nm_setting_get_dbus_property_type (NMSetting *setting,
                                       const char *property_name);

### nm_range_new ()

    NMRange *
    nm_range_new (guint64 start,
                  guint64 end);

### nm_range_ref ()

    NMRange *
    nm_range_ref (const NMRange *range);

### nm_range_unref ()

    void
    nm_range_unref (const NMRange *range);

### nm_range_cmp ()

    int
    nm_range_cmp (const NMRange *a,
                  const NMRange *b);

### nm_range_get_range ()

    gboolean
    nm_range_get_range (const NMRange *range,
                        guint64 *start,
                        guint64 *end);

### nm_range_to_str ()

    char *
    nm_range_to_str (const NMRange *range);

### nm_range_from_str ()

    NMRange *
    nm_range_from_str (const char *str,
                       GError **error);

## Types and Values

### NM_SETTING_PARAM_REQUIRED

    #define NM_SETTING_PARAM_REQUIRED 0x200

### NM_SETTING_PARAM_SECRET

    #define NM_SETTING_PARAM_SECRET 0x400

### NM_SETTING_PARAM_FUZZY_IGNORE

    #define NM_SETTING_PARAM_FUZZY_IGNORE 0x800

### NM_SETTING_NAME

    #define NM_SETTING_NAME "name"

### enum NMSettingSecretFlags

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.

#### Members

NM_SETTING_SECRET_FLAG_NONE | the system is responsible for providing and storing this secret (default) |
NM_SETTING_SECRET_FLAG_AGENT_OWNED | a user secret agent is responsible for providing and storing this secret; when it is required agents will be asked to retrieve it |
NM_SETTING_SECRET_FLAG_NOT_SAVED | this secret should not be saved, but should be requested from the user each time it is needed |
NM_SETTING_SECRET_FLAG_NOT_REQUIRED | 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 |

### enum NMSettingCompareFlags

These flags modify the comparison behavior when comparing two settings or two connections.

#### Members

NM_SETTING_COMPARE_FLAG_EXACT | match all properties exactly |
NM_SETTING_COMPARE_FLAG_FUZZY | match only important attributes, like SSID, type, security settings, etc. Does not match, for example, connection ID or UUID. |
NM_SETTING_COMPARE_FLAG_IGNORE_ID | ignore the connection's ID |
NM_SETTING_COMPARE_FLAG_IGNORE_SECRETS | ignore all secrets |
NM_SETTING_COMPARE_FLAG_IGNORE_AGENT_OWNED_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 `NM_SETTING_SECRET_FLAG_AGENT_OWNED` ) |
NM_SETTING_COMPARE_FLAG_IGNORE_NOT_SAVED_SECRETS | ignore secrets for which the secret's flags indicate the secret should not be saved to persistent storage (ie, the secret's flag includes `NM_SETTING_SECRET_FLAG_NOT_SAVED` ) |
NM_SETTING_COMPARE_FLAG_DIFF_RESULT_WITH_DEFAULT | if this flag is set, `nm_setting_diff()` and `nm_connection_diff()` will also include properties that are set to their default value. See also `NM_SETTING_COMPARE_FLAG_DIFF_RESULT_NO_DEFAULT` . |
NM_SETTING_COMPARE_FLAG_DIFF_RESULT_NO_DEFAULT | if this flag is set, `nm_setting_diff()` and `nm_connection_diff()` will not include properties that are set to their default value. This is the opposite of `NM_SETTING_COMPARE_FLAG_DIFF_RESULT_WITH_DEFAULT` . If both flags are set together, `NM_SETTING_COMPARE_FLAG_DIFF_RESULT_WITH_DEFAULT` wins. If both flags are unset, this means to exclude default properties if there is a setting to compare, but include all properties, if the setting 'b' is missing. This is the legacy behaviour of libnm-util, where `nm_setting_diff()` behaved differently depending on whether the setting 'b' was available. If `NM_SETTING_COMPARE_FLAG_DIFF_RESULT_WITH_DEFAULT` is set, `nm_setting_diff()` will also set the flags `NM_SETTING_DIFF_RESULT_IN_A_DEFAULT` and `NM_SETTING_DIFF_RESULT_IN_B_DEFAULT` , if the values are default values. |
NM_SETTING_COMPARE_FLAG_IGNORE_TIMESTAMP | ignore the connection's timestamp |

### enum NMSettingMacRandomization

Controls if and how the MAC address of a device is randomzied.

#### Members

NM_SETTING_MAC_RANDOMIZATION_DEFAULT | the default value, which unless overridden by user-controlled defaults configuration, is "never". |
NM_SETTING_MAC_RANDOMIZATION_NEVER | the device's MAC address is always used. |
NM_SETTING_MAC_RANDOMIZATION_ALWAYS | a random MAC address is used. |

Since: 1.2

### enum NMSettingDiffResult

These values indicate the result of a setting difference operation.

#### Members

NM_SETTING_DIFF_RESULT_UNKNOWN | unknown result |
NM_SETTING_DIFF_RESULT_IN_A | the property is present in setting A |
NM_SETTING_DIFF_RESULT_IN_B | the property is present in setting B |
NM_SETTING_DIFF_RESULT_IN_A_DEFAULT | the property is present in setting A but is set to the default value. This flag is only set, if you specify `NM_SETTING_COMPARE_FLAG_DIFF_RESULT_WITH_DEFAULT` . |
NM_SETTING_DIFF_RESULT_IN_B_DEFAULT | analog to `NM_SETTING_DIFF_RESULT_IN_A_DEFAULT` . |