NM.VpnServicePlugin

g GObject.GInterface GObject.GInterface Gio.Initable Gio.Initable GObject.GInterface->Gio.Initable GObject.Object GObject.Object NM.VpnServicePlugin NM.VpnServicePlugin GObject.Object->NM.VpnServicePlugin Gio.Initable->NM.VpnServicePlugin

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Gio.Initable (2)

Structs:

GObject.ObjectClass (5)

class

get_secret_flags (data, secret_name)

class

read_vpn_details (fd)

disconnect ()

failure (reason)

get_connection ()

secrets_required (message, hints)

set_config (config)

set_ip4_config (ip4_config)

set_ip6_config (ip6_config)

set_login_banner (banner)

shutdown ()

Virtual Methods

Inherited:

GObject.Object (7), Gio.Initable (1)

do_config (config)

do_connect (connection)

do_connect_interactive (connection, details)

do_disconnect ()

do_failure (reason)

do_ip4_config (ip4_config)

do_ip6_config (config)

do_login_banner (banner)

do_need_secrets (connection, setting_name)

do_new_secrets (connection)

do_quit ()

do_state_changed (state)

Properties

Name

Type

Flags

Short Description

service-name

str

r/w/co

state

NM.VpnServiceState

r/w

watch-peer

bool

r/w/co

Signals

Inherited:

GObject.Object (1)

Name

Short Description

config

failure

ip4-config

ip6-config

login-banner

quit

secrets-required

state-changed

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class NM.VpnServicePlugin(**kwargs)
Bases:

GObject.Object, Gio.Initable

Abstract:

Yes

Structure:

NM.VpnServicePluginClass

New in version 1.2.

classmethod get_secret_flags(data, secret_name)
Parameters:
  • data ({object: object}) – hash table containing VPN key/value pair data items

  • secret_name (str) – VPN secret key name for which to retrieve flags for

Returns:

True if the flag data item was found and successfully converted to flags, False if not

out_flags:

on success, the flags associated with secret_name

Return type:

(bool, out_flags: NM.SettingSecretFlags)

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

New in version 1.2.

classmethod read_vpn_details(fd)
Parameters:

fd (int) – file descriptor to read from, usually stdin (0)

Returns:

True if reading values was successful, False if not

out_data:

on successful return, a hash table (mapping str:char*) containing the key/value pairs of VPN data items

out_secrets:

on successful return, a hash table (mapping str:char*) containing the key/value pairsof VPN secrets

Return type:

(bool, out_data: {object: object}, out_secrets: {object: object})

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.

New in version 1.2.

disconnect()
Raises:

GLib.Error

Return type:

bool

New in version 1.2.

failure(reason)
Parameters:

reason (NM.VpnPluginFailure) –

New in version 1.2.

get_connection()
Return type:

Gio.DBusConnection

New in version 1.2.

secrets_required(message, hints)
Parameters:
  • message (str) – an information message about why secrets are required, if any

  • hints (str) – VPN specific secret names for required new secrets

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.

New in version 1.2.

set_config(config)
Parameters:

config (GLib.Variant) –

New in version 1.2.

set_ip4_config(ip4_config)
Parameters:

ip4_config (GLib.Variant) –

New in version 1.2.

set_ip6_config(ip6_config)
Parameters:

ip6_config (GLib.Variant) –

New in version 1.2.

set_login_banner(banner)
Parameters:

banner (str) –

New in version 1.2.

shutdown()

Shutdown the self 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.

New in version 1.12.

do_config(config) virtual
Parameters:

config (GLib.Variant) –

do_connect(connection) virtual
Parameters:

connection (NM.Connection) –

Return type:

bool

do_connect_interactive(connection, details) virtual
Parameters:
Return type:

bool

do_disconnect() virtual
Return type:

bool

New in version 1.2.

do_failure(reason) virtual
Parameters:

reason (NM.VpnPluginFailure) –

New in version 1.2.

do_ip4_config(ip4_config) virtual
Parameters:

ip4_config (GLib.Variant) –

do_ip6_config(config) virtual
Parameters:

config (GLib.Variant) –

do_login_banner(banner) virtual
Parameters:

banner (str) –

do_need_secrets(connection, setting_name) virtual
Parameters:
Return type:

bool

do_new_secrets(connection) virtual
Parameters:

connection (NM.Connection) –

Return type:

bool

do_quit() virtual
do_state_changed(state) virtual
Parameters:

state (NM.VpnServiceState) –

Signal Details

NM.VpnServicePlugin.signals.config(vpn_service_plugin, object)
Signal Name:

config

Flags:

RUN_FIRST

Parameters:
NM.VpnServicePlugin.signals.failure(vpn_service_plugin, object)
Signal Name:

failure

Flags:

RUN_FIRST

Parameters:
NM.VpnServicePlugin.signals.ip4_config(vpn_service_plugin, object)
Signal Name:

ip4-config

Flags:

RUN_FIRST

Parameters:
NM.VpnServicePlugin.signals.ip6_config(vpn_service_plugin, object)
Signal Name:

ip6-config

Flags:

RUN_FIRST

Parameters:
NM.VpnServicePlugin.signals.login_banner(vpn_service_plugin, object)
Signal Name:

login-banner

Flags:

RUN_FIRST

Parameters:
NM.VpnServicePlugin.signals.quit(vpn_service_plugin)
Signal Name:

quit

Flags:

RUN_FIRST

Parameters:

vpn_service_plugin (NM.VpnServicePlugin) – The object which received the signal

NM.VpnServicePlugin.signals.secrets_required(vpn_service_plugin, object, p0)
Signal Name:

secrets-required

Flags:

RUN_FIRST

Parameters:
NM.VpnServicePlugin.signals.state_changed(vpn_service_plugin, object)
Signal Name:

state-changed

Flags:

RUN_FIRST

Parameters:

Property Details

NM.VpnServicePlugin.props.service_name
Name:

service-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The D-Bus service name of this plugin.

New in version 1.2.

NM.VpnServicePlugin.props.state
Name:

state

Type:

NM.VpnServiceState

Default Value:

NM.VpnServiceState.INIT

Flags:

READABLE, WRITABLE

The state of the plugin.

New in version 1.2.

NM.VpnServicePlugin.props.watch_peer
Name:

watch-peer

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

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

New in version 1.2.