NMSecretAgentOld: libnm Reference Manual

## NMSecretAgentOld NMSecretAgentOld |

## Functions

void | (*NMSecretAgentOldGetSecretsFunc) ()
void | (*NMSecretAgentOldSaveSecretsFunc) ()
void | (*NMSecretAgentOldDeleteSecretsFunc) ()
GDBusConnection * | nm_secret_agent_old_get_dbus_connection ()
GMainContext * | nm_secret_agent_old_get_main_context ()
GObject * | nm_secret_agent_old_get_context_busy_watcher ()
const char * | nm_secret_agent_old_get_dbus_name_owner ()
gboolean | nm_secret_agent_old_get_registered ()
void | nm_secret_agent_old_enable ()
void | nm_secret_agent_old_register_async ()
gboolean | nm_secret_agent_old_register_finish ()
void | nm_secret_agent_old_destroy ()
gboolean | nm_secret_agent_old_register ()
gboolean | nm_secret_agent_old_unregister ()
void | nm_secret_agent_old_unregister_async ()
gboolean | nm_secret_agent_old_unregister_finish ()
void | nm_secret_agent_old_get_secrets ()
void | nm_secret_agent_old_save_secrets ()
void | nm_secret_agent_old_delete_secrets ()

## Properties

gboolean | auto-register | Read / Write / Construct
NMSecretAgentCapabilities | capabilities | Read / Write / Construct
GDBusConnection * | dbus-connection | Read / Write / Construct Only
char * | identifier | Read / Write / Construct Only
gboolean | registered | Read

## Types and Values

#define | NM_SECRET_AGENT_OLD_IDENTIFIER
#define | NM_SECRET_AGENT_OLD_AUTO_REGISTER
#define | NM_SECRET_AGENT_OLD_REGISTERED
#define | NM_SECRET_AGENT_OLD_CAPABILITIES
#define | NM_SECRET_AGENT_OLD_DBUS_CONNECTION
| NMSecretAgentOld

## Object Hierarchy

        GObject
        ╰── NMSecretAgentOld

## Implemented Interfaces

NMSecretAgentOld implements GInitable and GAsyncInitable.

## Description

## Functions

### NMSecretAgentOldGetSecretsFunc ()

    void
    (*NMSecretAgentOldGetSecretsFunc) (NMSecretAgentOld *agent,
                                       NMConnection *connection,
                                       GVariant *secrets,
                                       GError *error,
                                       gpointer user_data);

Called as a result of a request by NM to retrieve secrets. When the NMSecretAgentOld subclass has finished retrieving secrets and is ready to return them, or to return an error, this function should be called with those secrets or the error.

To easily create the dictionary to return the Wi-Fi PSK, you could do something like this:

Example 1. Creating a secrets dictionary

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    NMConnection *secrets;
    NMSettingWirelessSecurity *s_wsec;
    GVariant *secrets_dict;

    secrets = nm_simple_connection_new ();
    s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new ();
    g_object_set (G_OBJECT (s_wsec),
                  NM_SETTING_WIRELESS_SECURITY_PSK, "my really cool PSK",
                  NULL);
    nm_connection_add_setting (secrets, NM_SETTING (s_wsec));
    secrets_dict = nm_connection_to_dbus (secrets, NM_CONNECTION_SERIALIZE_ALL);

    (call the NMSecretAgentOldGetSecretsFunc with secrets_dict)

    g_object_unref (secrets);
    g_variant_unref (secrets_dict);

#### Parameters

agent | the secret agent object |
connection | the connection for which secrets were requested, note that this object will be unrefed after the callback has returned, use `g_object_ref()`/`g_object_unref()` if you want to use this object after the callback has returned. | [transfer none]
secrets | the GVariant of type `NM_VARIANT_TYPE_CONNECTION` containing the requested secrets (as created by `nm_connection_to_dbus()` for example). Each key in `secrets` should be the name of a NMSetting object (like "802-11-wireless-security") and each value should be an `NM_VARIANT_TYPE_SETTING` variant. The sub-dicts map string:value, where the string is the setting property name (like "psk") and the value is the secret |
error | if the secrets request failed, give a descriptive error here |
user_data | caller-specific data to be passed to the function |

### NMSecretAgentOldSaveSecretsFunc ()

    void
    (*NMSecretAgentOldSaveSecretsFunc) (NMSecretAgentOld *agent,
                                        NMConnection *connection,
                                        GError *error,
                                        gpointer user_data);

Called as a result of a request by NM to save secrets. When the NMSecretAgentOld subclass has finished saving the secrets, this function should be called.

#### Parameters

agent | the secret agent object |
connection | the connection for which secrets were to be saved, note that this object will be unrefed after the callback has returned, use `g_object_ref()`/`g_object_unref()` if you want to use this object after the callback has returned. | [transfer none]
error | if the saving secrets failed, give a descriptive error here |
user_data | caller-specific data to be passed to the function |

### NMSecretAgentOldDeleteSecretsFunc ()

    void
    (*NMSecretAgentOldDeleteSecretsFunc) (NMSecretAgentOld *agent,
                                          NMConnection *connection,
                                          GError *error,
                                          gpointer user_data);

Called as a result of a request by NM to delete secrets. When the NMSecretAgentOld subclass has finished deleting the secrets, this function should be called.

#### Parameters

agent | the secret agent object |
connection | the connection for which secrets were to be deleted, note that this object will be unrefed after the callback has returned, use `g_object_ref()`/`g_object_unref()` if you want to use this object after the callback has returned. | [transfer none]
error | if the deleting secrets failed, give a descriptive error here |
user_data | caller-specific data to be passed to the function |

### nm_secret_agent_old_get_dbus_connection ()

    GDBusConnection *
    nm_secret_agent_old_get_dbus_connection
                                   (NMSecretAgentOld *self);

### nm_secret_agent_old_get_main_context ()

    GMainContext *
    nm_secret_agent_old_get_main_context (NMSecretAgentOld *self);

### nm_secret_agent_old_get_context_busy_watcher ()

    GObject *
    nm_secret_agent_old_get_context_busy_watcher
                                   (NMSecretAgentOld *self);

### nm_secret_agent_old_get_dbus_name_owner ()

    const char *
    nm_secret_agent_old_get_dbus_name_owner
                                   (NMSecretAgentOld *self);

### nm_secret_agent_old_get_registered ()

    gboolean
    nm_secret_agent_old_get_registered (NMSecretAgentOld *self);

### nm_secret_agent_old_enable ()

    void
    nm_secret_agent_old_enable (NMSecretAgentOld *self,
                                gboolean enable);

### nm_secret_agent_old_register_async ()

    void
    nm_secret_agent_old_register_async (NMSecretAgentOld *self,
                                        GCancellable *cancellable,
                                        GAsyncReadyCallback callback,
                                        gpointer user_data);

### nm_secret_agent_old_register_finish ()

    gboolean
    nm_secret_agent_old_register_finish (NMSecretAgentOld *self,
                                         GAsyncResult *result,
                                         GError **error);

### nm_secret_agent_old_destroy ()

    void
    nm_secret_agent_old_destroy (NMSecretAgentOld *self);

### nm_secret_agent_old_register ()

    gboolean
    nm_secret_agent_old_register (NMSecretAgentOld *self,
                                  GCancellable *cancellable,
                                  GError **error);

`nm_secret_agent_old_register` is deprecated and should not be used in newly-written code.

### nm_secret_agent_old_unregister ()

    gboolean
    nm_secret_agent_old_unregister (NMSecretAgentOld *self,
                                    GCancellable *cancellable,
                                    GError **error);

`nm_secret_agent_old_unregister` is deprecated and should not be used in newly-written code.

### nm_secret_agent_old_unregister_async ()

    void
    nm_secret_agent_old_unregister_async (NMSecretAgentOld *self,
                                          GCancellable *cancellable,
                                          GAsyncReadyCallback callback,
                                          gpointer user_data);

`nm_secret_agent_old_unregister_async` is deprecated and should not be used in newly-written code.

### nm_secret_agent_old_unregister_finish ()

    gboolean
    nm_secret_agent_old_unregister_finish (NMSecretAgentOld *self,
                                           GAsyncResult *result,
                                           GError **error);

`nm_secret_agent_old_unregister_finish` is deprecated and should not be used in newly-written code.

### nm_secret_agent_old_get_secrets ()

    void
    nm_secret_agent_old_get_secrets (NMSecretAgentOld *self,
                                     NMConnection *connection,
                                     const char *setting_name,
                                     const char **hints,
                                     NMSecretAgentGetSecretsFlags flags,
                                     NMSecretAgentOldGetSecretsFunc callback,
                                     gpointer user_data);

### nm_secret_agent_old_save_secrets ()

    void
    nm_secret_agent_old_save_secrets (NMSecretAgentOld *self,
                                      NMConnection *connection,
                                      NMSecretAgentOldSaveSecretsFunc callback,
                                      gpointer user_data);

### nm_secret_agent_old_delete_secrets ()

    void
    nm_secret_agent_old_delete_secrets (NMSecretAgentOld *self,
                                        NMConnection *connection,
                                        NMSecretAgentOldDeleteSecretsFunc callback,
                                        gpointer user_data);

## Types and Values

### NM_SECRET_AGENT_OLD_IDENTIFIER

    #define NM_SECRET_AGENT_OLD_IDENTIFIER      "identifier"

### NM_SECRET_AGENT_OLD_AUTO_REGISTER

    #define NM_SECRET_AGENT_OLD_AUTO_REGISTER   "auto-register"

### NM_SECRET_AGENT_OLD_REGISTERED

    #define NM_SECRET_AGENT_OLD_REGISTERED      "registered"

### NM_SECRET_AGENT_OLD_CAPABILITIES

    #define NM_SECRET_AGENT_OLD_CAPABILITIES    "capabilities"

### NM_SECRET_AGENT_OLD_DBUS_CONNECTION

    #define NM_SECRET_AGENT_OLD_DBUS_CONNECTION "dbus-connection"

### NMSecretAgentOld

    typedef struct _NMSecretAgentOld NMSecretAgentOld;

## Property Details

### The `“auto-register”` property

      “auto-register”            gboolean

Owner: NMSecretAgentOld

Flags: Read / Write / Construct

Default value: TRUE

### The `“capabilities”` property

      “capabilities”             NMSecretAgentCapabilities

Owner: NMSecretAgentOld

Flags: Read / Write / Construct

### The `“dbus-connection”` property

      “dbus-connection”          GDBusConnection *

Owner: NMSecretAgentOld

Flags: Read / Write / Construct Only

### The `“identifier”` property

      “identifier”               char *

Owner: NMSecretAgentOld

Flags: Read / Write / Construct Only

Default value: NULL

### The `“registered”` property

      “registered”               gboolean

Owner: NMSecretAgentOld

Flags: Read

Default value: FALSE