NM.VpnEditorPlugin

g GObject.GInterface GObject.GInterface NM.VpnEditorPlugin NM.VpnEditorPlugin GObject.GInterface->NM.VpnEditorPlugin

Implementations:

None

Methods

class

load (plugin_name, check_service)

class

load_from_file (plugin_name, check_service, check_owner, check_file, *user_data)

export (path, connection)

get_capabilities ()

get_editor (connection)

get_plugin_info ()

get_suggested_filename (connection)

get_vt (vt_size)

import_ (path)

set_plugin_info (plugin_info)

Virtual Methods

do_export_to_file (path, connection)

do_get_capabilities ()

do_get_editor (connection)

do_get_suggested_filename (connection)

do_get_vt (out_vt_size)

do_notify_plugin_info_set (plugin_info)

Properties

Name

Type

Flags

Short Description

description

str

r

name

str

r

service

str

r

Signals

None

Fields

None

Class Details

class NM.VpnEditorPlugin
Bases:

GObject.GInterface

Structure:

NM.VpnEditorPluginInterface

classmethod load(plugin_name, check_service)
Parameters:
  • plugin_name (str) – The name of the shared library to load. This path will be directly passed to dlopen() without further checks.

  • check_service (str) – if not-null, check that the loaded plugin advertises the given service.

Raises:

GLib.Error

Returns:

a new plugin instance or None on error.

Return type:

NM.VpnEditorPlugin

Load the shared library plugin_name and create a new NM.VpnEditorPlugin instance via the #NMVpnEditorPluginFactory function.

This is similar to NM.VpnEditorPlugin.load_from_file(), but it does no validation of the plugin name, instead passes it directly to dlopen(). If you have the full path to a plugin file, NM.VpnEditorPlugin.load_from_file() is preferred.

New in version 1.4.

classmethod load_from_file(plugin_name, check_service, check_owner, check_file, *user_data)
Parameters:
  • plugin_name (str) – The path or name of the shared library to load. The path must either be an absolute filename to an existing file. Alternatively, it can be the name (without path) of a library in the plugin directory of NetworkManager.

  • check_service (str) – if not-null, check that the loaded plugin advertises the given service.

  • check_owner (int) – if non-negative, check whether the file is owned by UID check_owner or by root. In this case also check that the file is not writable by anybody else.

  • check_file (NM.UtilsCheckFilePredicate) – optional callback to validate the file prior to loading the shared library.

  • user_data (object or None) – user data for check_file

Raises:

GLib.Error

Returns:

a new plugin instance or None on error.

Return type:

NM.VpnEditorPlugin

Load the shared library plugin_name and create a new NM.VpnEditorPlugin instance via the #NMVpnEditorPluginFactory function.

If plugin_name is not an absolute path name, it assumes the file is in the plugin directory of NetworkManager. In any case, the call will do certain checks on the file before passing it to dlopen. A consequence for that is, that you cannot omit the “.so” suffix as you could for NM.VpnEditorPlugin.load().

New in version 1.2.

export(path, connection)
Parameters:
Raises:

GLib.Error

Return type:

bool

get_capabilities()
Return type:

NM.VpnEditorPluginCapability

get_editor(connection)
Parameters:

connection (NM.Connection) – the NM.Connection to be edited

Raises:

GLib.Error

Returns:

a new NM.VpnEditor or None on error

Return type:

NM.VpnEditor

get_plugin_info()
Returns:

if set, return the NM.VpnPluginInfo instance.

Return type:

NM.VpnPluginInfo

New in version 1.4.

get_suggested_filename(connection)
Parameters:

connection (NM.Connection) –

Return type:

str

get_vt(vt_size)
Parameters:

vt_size (int) – the size of the buffer. Can be 0 to only query the size of plugin’s VT.

Returns:

the actual size of the self's virtual function table.

vt:

buffer to be filled with the VT table of the plugin

Return type:

(int, vt: NM.VpnEditorPluginVT)

Returns an opaque VT function table for the plugin to extend functionality. The actual meaning of NM.VpnEditorPluginVT is not defined in public API of libnm, instead it must be agreed by both the plugin and the caller. See the header-only file ‘nm-vpn-editor-plugin-call.h’ which defines the meaning.

New in version 1.4.

import_(path)
Parameters:

path (str) – full path to the file to attempt to read into a new NM.Connection

Raises:

GLib.Error

Returns:

a new NM.Connection imported from path, or None on error or if the file at path was not recognized by this plugin

Return type:

NM.Connection

set_plugin_info(plugin_info)
Parameters:

plugin_info (NM.VpnPluginInfo or None) – a NM.VpnPluginInfo instance or None

Set or clear the plugin-info instance. This takes a weak reference on plugin_info, to avoid circular reference as the plugin-info might also reference the editor-plugin.

New in version 1.4.

do_export_to_file(path, connection) virtual
Parameters:
Return type:

bool

do_get_capabilities() virtual
Return type:

NM.VpnEditorPluginCapability

do_get_editor(connection) virtual
Parameters:

connection (NM.Connection) – the NM.Connection to be edited

Returns:

a new NM.VpnEditor or None on error

Return type:

NM.VpnEditor

do_get_suggested_filename(connection) virtual
Parameters:

connection (NM.Connection) –

Return type:

str

do_get_vt(out_vt_size) virtual
Parameters:

out_vt_size (int) –

Return type:

NM.VpnEditorPluginVT

do_notify_plugin_info_set(plugin_info) virtual
Parameters:

plugin_info (NM.VpnPluginInfo) –

Property Details

NM.VpnEditorPlugin.props.description
Name:

description

Type:

str

Default Value:

None

Flags:

READABLE

Longer description of the VPN plugin.

NM.VpnEditorPlugin.props.name
Name:

name

Type:

str

Default Value:

None

Flags:

READABLE

Short display name of the VPN plugin.

NM.VpnEditorPlugin.props.service
Name:

service

Type:

str

Default Value:

None

Flags:

READABLE

D-Bus service name of the plugin’s VPN service.