NM.VpnEditorPlugin¶
- Implementations:
None
Methods¶
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
|||
r |
|||
r |
Signals¶
None
Fields¶
None
Class Details¶
- class NM.VpnEditorPlugin¶
- Bases:
- Structure:
- classmethod load(plugin_name, check_service)¶
- Parameters:
- Raises:
- Returns:
a new plugin instance or
None
on error.- Return type:
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.
- Raises:
- Returns:
a new plugin instance or
None
on error.- Return type:
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:
path (
str
) –connection (
NM.Connection
) –
- Raises:
- Return type:
- get_capabilities()¶
- Return type:
- get_editor(connection)¶
- Parameters:
connection (
NM.Connection
) – theNM.Connection
to be edited- Raises:
- Returns:
a new
NM.VpnEditor
orNone
on error- Return type:
- get_plugin_info()¶
- Returns:
if set, return the
NM.VpnPluginInfo
instance.- Return type:
New in version 1.4.
- get_suggested_filename(connection)¶
- Parameters:
connection (
NM.Connection
) –- Return type:
- 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 newNM.Connection
- Raises:
- Returns:
a new
NM.Connection
imported from path, orNone
on error or if the file at path was not recognized by this plugin- Return type:
- set_plugin_info(plugin_info)¶
- Parameters:
plugin_info (
NM.VpnPluginInfo
orNone
) – aNM.VpnPluginInfo
instance orNone
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:
path (
str
) –connection (
NM.Connection
) –
- Return type:
Export the given connection to the specified path. Return
True
on success. On error, returnFalse
and set error with additional error information. Note that error can beNone
, in which case no additional error information should be provided.
- do_get_capabilities() virtual¶
- Return type:
returns a bitmask of capabilities.
- do_get_editor(connection) virtual¶
- Parameters:
connection (
NM.Connection
) – theNM.Connection
to be edited- Returns:
a new
NM.VpnEditor
orNone
on error- Return type:
returns an
NM.VpnEditor
, pre-filled with values from connection if non-None
.
- do_get_suggested_filename(connection) virtual¶
- Parameters:
connection (
NM.Connection
) –- Return type:
For a given connection, return a suggested file name. Returned value will be
None
or a suggested file name to be freed by the caller.
- do_get_vt(out_vt_size) virtual¶
- Parameters:
out_vt_size (
int
) –- Return type:
return a virtual function table to implement further functions in the plugin, without requiring to update libnm. Used by
NM.VpnEditorPlugin.get_vt
().
- do_notify_plugin_info_set(plugin_info) virtual¶
- Parameters:
plugin_info (
NM.VpnPluginInfo
) –
A callback to be called when the plugin info is set.
Property Details¶
- NM.VpnEditorPlugin.props.description¶
-
Longer description of the VPN plugin.
- NM.VpnEditorPlugin.props.name¶
-
Short display name of the VPN plugin.