Interface

NM-1.0NMVpnEditorPluginNamespace

interface VpnEditorPluginNamespace {
    $gtype: GType<NM.VpnEditorPlugin>;
    prototype: NM.VpnEditorPlugin;
    load(plugin_name: string, check_service: string): NM.VpnEditorPlugin;
    load_from_file(
        plugin_name: string,
        check_service: string,
        check_owner: number,
        check_file: UtilsCheckFilePredicate,
    ): NM.VpnEditorPlugin;
}
Index

Properties

prototype: NM.VpnEditorPlugin

Methods

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

    This is similar to nm_vpn_editor_plugin_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_vpn_editor_plugin_load_from_file() is preferred.

    Parameters

    • plugin_name: string

      The name of the shared library to load. This path will be directly passed to dlopen() without further checks.

    • check_service: string

      if not-null, check that the loaded plugin advertises the given service.

    Returns 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_vpn_editor_plugin_load().

    Parameters

    • plugin_name: string

      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: string

      if not-null, check that the loaded plugin advertises the given service.

    • check_owner: number

      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: UtilsCheckFilePredicate

      optional callback to validate the file prior to loading the shared library.

    Returns NM.VpnEditorPlugin