## NMVpnServicePlugin

NMVpnServicePlugin

## Functions

GDBusConnection * | nm_vpn_service_plugin_get_connection ()
void | nm_vpn_service_plugin_secrets_required ()
void | nm_vpn_service_plugin_set_login_banner ()
void | nm_vpn_service_plugin_failure ()
void | nm_vpn_service_plugin_set_config ()
void | nm_vpn_service_plugin_set_ip4_config ()
void | nm_vpn_service_plugin_set_ip6_config ()
gboolean | nm_vpn_service_plugin_disconnect ()
void | nm_vpn_service_plugin_shutdown ()
gboolean | nm_vpn_service_plugin_read_vpn_details ()
gboolean | nm_vpn_service_plugin_get_secret_flags ()

## Properties

gchar * | service-name | Read / Write / Construct Only
NMVpnServiceState | state | Read / Write
gboolean | watch-peer | Read / Write / Construct Only

## Signals

void | config | Run First
void | failure | Run First
void | ip4-config | Run First
void | ip6-config | Run First
void | login-banner | Run First
void | quit | Run First
void | secrets-required | Run First
void | state-changed | Run First

## Types and Values

#define | NM_VPN_SERVICE_PLUGIN_DBUS_SERVICE_NAME
#define | NM_VPN_SERVICE_PLUGIN_DBUS_WATCH_PEER
#define | NM_VPN_SERVICE_PLUGIN_STATE
| NMVpnServicePlugin

## Object Hierarchy

        GObject
        ╰── NMVpnServicePlugin

## Implemented Interfaces

NMVpnServicePlugin implements GInitable.

## Description

## Functions

### nm_vpn_service_plugin_get_connection ()

    GDBusConnection *
    nm_vpn_service_plugin_get_connection (NMVpnServicePlugin *plugin);

#### Returns

.

[transfer full]

Since: 1.2

### nm_vpn_service_plugin_secrets_required ()

    void
    nm_vpn_service_plugin_secrets_required
                                   (NMVpnServicePlugin *plugin,
                                    const char *message,
                                    const char **hints);

Called by VPN plugin implementations to signal to NetworkManager that secrets are required during the connection process. This signal may be used to request new secrets when the secrets originally provided by NetworkManager are insufficient, or the VPN process indicates that it needs additional information to complete the request.

#### Parameters

plugin | the NMVpnServicePlugin |
message | an information message about why secrets are required, if any |
hints | VPN specific secret names for required new secrets |

Since: 1.2

### nm_vpn_service_plugin_set_login_banner ()

    void
    nm_vpn_service_plugin_set_login_banner
                                   (NMVpnServicePlugin *plugin,
                                    const char *banner);

### nm_vpn_service_plugin_failure ()

    void
    nm_vpn_service_plugin_failure (NMVpnServicePlugin *plugin,
                                   NMVpnPluginFailure reason);

### nm_vpn_service_plugin_set_config ()

    void
    nm_vpn_service_plugin_set_config (NMVpnServicePlugin *plugin,
                                      GVariant *config);

### nm_vpn_service_plugin_set_ip4_config ()

    void
    nm_vpn_service_plugin_set_ip4_config (NMVpnServicePlugin *plugin,
                                          GVariant *ip4_config);

### nm_vpn_service_plugin_set_ip6_config ()

    void
    nm_vpn_service_plugin_set_ip6_config (NMVpnServicePlugin *plugin,
                                          GVariant *ip6_config);

### nm_vpn_service_plugin_disconnect ()

    gboolean
    nm_vpn_service_plugin_disconnect (NMVpnServicePlugin *plugin,
                                      GError **err);

### nm_vpn_service_plugin_shutdown ()

    void
    nm_vpn_service_plugin_shutdown (NMVpnServicePlugin *plugin);

Shutdown the `plugin` and disconnect from D-Bus. After this, the plugin instance is dead and should no longer be used. It ensures to get no more requests from D-Bus. In principle, you don't need to shutdown the plugin, disposing the instance has the same effect. However, this gives a way to deactivate the plugin before giving up the last reference.

#### Parameters

plugin | the NMVpnServicePlugin instance |

Since: 1.12

### nm_vpn_service_plugin_read_vpn_details ()

    gboolean
    nm_vpn_service_plugin_read_vpn_details
                                   (int fd,
                                    GHashTable **out_data,
                                    GHashTable **out_secrets);

Parses key/value pairs from a file descriptor (normally stdin) passed by an applet when the applet calls the authentication dialog of the VPN plugin.

#### Parameters

fd | file descriptor to read from, usually stdin (0) |
out_data | on successful return, a hash table (mapping char*:char*) containing the key/value pairs of VPN data items. | [out][transfer full]
out_secrets | on successful return, a hash table (mapping char*:char*) containing the key/value pairsof VPN secrets. | [out][transfer full]

#### Returns

`TRUE` if reading values was successful, `FALSE` if not

Since: 1.2

### nm_vpn_service_plugin_get_secret_flags ()

    gboolean
    nm_vpn_service_plugin_get_secret_flags
                                   (GHashTable *data,
                                    const char *secret_name,
                                    NMSettingSecretFlags *out_flags);

Given a VPN secret key name, attempts to find the corresponding flags data item in `data` . If found, converts the flags data item to NMSettingSecretFlags and returns it.

#### Parameters

data | hash table containing VPN key/value pair data items |
secret_name | VPN secret key name for which to retrieve flags for |
out_flags | on success, the flags associated with `secret_name` . | [out]

#### Returns

`TRUE` if the flag data item was found and successfully converted to flags, `FALSE` if not

Since: 1.2

## Types and Values

### NM_VPN_SERVICE_PLUGIN_DBUS_SERVICE_NAME

    #define NM_VPN_SERVICE_PLUGIN_DBUS_SERVICE_NAME "service-name"

### NM_VPN_SERVICE_PLUGIN_DBUS_WATCH_PEER

    #define NM_VPN_SERVICE_PLUGIN_DBUS_WATCH_PEER   "watch-peer"

### NM_VPN_SERVICE_PLUGIN_STATE

    #define NM_VPN_SERVICE_PLUGIN_STATE             "state"

### NMVpnServicePlugin

    typedef struct _NMVpnServicePlugin NMVpnServicePlugin;

## Property Details

### The `“service-name”` property

      “service-name”             gchar *

The D-Bus service name of this plugin.

Owner: NMVpnServicePlugin

Flags: Read / Write / Construct Only

Default value: NULL

Since: 1.2

### The `“state”` property

      “state”                    NMVpnServiceState

The state of the plugin.

Owner: NMVpnServicePlugin

Flags: Read / Write

Default value: NM_VPN_SERVICE_STATE_INIT

Since: 1.2

### The `“watch-peer”` property

      “watch-peer”               gboolean

Whether to watch for D-Bus peer's changes.

Owner: NMVpnServicePlugin

Flags: Read / Write / Construct Only

Default value: FALSE

Since: 1.2

## Signal Details

### The `“config”` signal

    void
    user_function (NMVpnServicePlugin *nmvpnserviceplugin,
                   GVariant           *arg1,
                   gpointer            user_data)

Flags: Run First

### The `“failure”` signal

    void
    user_function (NMVpnServicePlugin *nmvpnserviceplugin,
                   guint               arg1,
                   gpointer            user_data)

Flags: Run First

### The `“ip4-config”` signal

    void
    user_function (NMVpnServicePlugin *nmvpnserviceplugin,
                   GVariant           *arg1,
                   gpointer            user_data)

Flags: Run First

### The `“ip6-config”` signal

    void
    user_function (NMVpnServicePlugin *nmvpnserviceplugin,
                   GVariant           *arg1,
                   gpointer            user_data)

Flags: Run First

### The `“login-banner”` signal

    void
    user_function (NMVpnServicePlugin *nmvpnserviceplugin,
                   gchar              *arg1,
                   gpointer            user_data)

Flags: Run First

### The `“quit”` signal

    void
    user_function (NMVpnServicePlugin *nmvpnserviceplugin,
                   gpointer            user_data)

Flags: Run First

### The `“secrets-required”` signal

    void
    user_function (NMVpnServicePlugin *nmvpnserviceplugin,
                   gchar              *arg1,
                   GStrv               arg2,
                   gpointer            user_data)

Flags: Run First

### The `“state-changed”` signal

    void
    user_function (NMVpnServicePlugin *nmvpnserviceplugin,
                   guint               arg1,
                   gpointer            user_data)

Flags: Run First