Top |
#define | NM_VPN_PLUGIN_INFO_NAME |
#define | NM_VPN_PLUGIN_INFO_FILENAME |
#define | NM_VPN_PLUGIN_INFO_KEYFILE |
#define | NM_VPN_PLUGIN_INFO_KF_GROUP_CONNECTION |
#define | NM_VPN_PLUGIN_INFO_KF_GROUP_LIBNM |
#define | NM_VPN_PLUGIN_INFO_KF_GROUP_GNOME |
NMVpnPluginInfo * nm_vpn_plugin_info_new_from_file (const char *filename
,GError **error
);
Read the plugin info from file filename
. Does not do
any further verification on the file. You might want to check
file permissions and ownership of the file.
Since: 1.2
NMVpnPluginInfo * nm_vpn_plugin_info_new_with_data (const char *filename
,GKeyFile *keyfile
,GError **error
);
This constructor does not read any data from file but
takes instead a keyfile
argument.
filename |
optional filename. |
|
keyfile |
inject data for the plugin info instance. |
|
error |
construction may fail if the keyfile lacks mandatory fields. In this case, return the error reason. |
Since: 1.2
NMVpnPluginInfo * nm_vpn_plugin_info_new_search_file (const char *name
,const char *service
);
This has the same effect as doing a full nm_vpn_plugin_info_list_load()
followed by a search for the first matching VPN plugin info that has the
given name
and/or service
.
name |
the name to search for. Either |
[allow-none] |
service |
the service to search for. Either |
[allow-none] |
a newly created instance of plugin info
or NULL
if no matching value was found.
[transfer full]
Since: 1.4
const char *
nm_vpn_plugin_info_get_name (NMVpnPluginInfo *self
);
Since: 1.2
const char *
nm_vpn_plugin_info_get_filename (NMVpnPluginInfo *self
);
Since: 1.2
const char *
nm_vpn_plugin_info_get_service (NMVpnPluginInfo *self
);
Since: 1.4
const char *
nm_vpn_plugin_info_get_plugin (NMVpnPluginInfo *self
);
Since: 1.2
const char *
nm_vpn_plugin_info_get_program (NMVpnPluginInfo *self
);
Since: 1.2
const char *
nm_vpn_plugin_info_get_auth_dialog (NMVpnPluginInfo *self
);
Since: 1.4
gboolean
nm_vpn_plugin_info_supports_hints (NMVpnPluginInfo *self
);
Since: 1.4
gboolean
nm_vpn_plugin_info_supports_multiple (NMVpnPluginInfo *self
);
Since: 1.42, 1.40.4
const char *const *
nm_vpn_plugin_info_get_aliases (NMVpnPluginInfo *self
);
Since: 1.4
const char * nm_vpn_plugin_info_lookup_property (NMVpnPluginInfo *self
,const char *group
,const char *key
);
Since: 1.2
gboolean
nm_vpn_plugin_info_validate_filename (const char *filename
);
Regular name files have a certain pattern. That basically means
they have the file extension "name". Check if filename
is valid according to that pattern.
Since: 1.2
GSList *
nm_vpn_plugin_info_list_load (void
);
list of plugins loaded from the default directories rejecting duplicates.
[element-type NMVpnPluginInfo][transfer full]
Since: 1.2
gboolean nm_vpn_plugin_info_list_add (GSList **list
,NMVpnPluginInfo *plugin_info
,GError **error
);
list |
list of plugins. |
[element-type NMVpnPluginInfo] |
plugin_info |
instance to add |
|
error |
failure reason |
Since: 1.2
gboolean nm_vpn_plugin_info_list_remove (GSList **list
,NMVpnPluginInfo *plugin_info
);
Remove plugin_info
from list
.
Since: 1.2
NMVpnPluginInfo * nm_vpn_plugin_info_list_find_by_name (GSList *list
,const char *name
);
Since: 1.2
NMVpnPluginInfo * nm_vpn_plugin_info_list_find_by_filename (GSList *list
,const char *filename
);
Since: 1.2
NMVpnPluginInfo * nm_vpn_plugin_info_list_find_by_service (GSList *list
,const char *service
);
list |
list of plugins. |
[element-type NMVpnPluginInfo] |
service |
service to search. This can be the main service-type or one of the provided aliases. |
Since: 1.2
char * nm_vpn_plugin_info_list_find_service_type (GSList *list
,const char *name
);
A VPN plugin provides one or several service-types, like org.freedesktop.NetworkManager.libreswan Certain plugins provide more then one service type, via aliases (org.freedesktop.NetworkManager.openswan). This function looks up a service-type (or an alias) based on a name.
Preferably, the name can be a full service-type/alias of an installed
plugin. Otherwise, it can be the name of a VPN plugin (in which case, the
primary, non-aliased service-type is returned). Otherwise, it can be
one of several well known short-names (which is a hard-coded list of
types in libnm). On success, this returns a full qualified service-type
(or an alias). It doesn't say, that such an plugin is actually available,
but it could be retrieved via nm_vpn_plugin_info_list_find_by_service()
.
list |
a possibly empty GSList of NMVpnPluginInfo instances. |
[element-type NMVpnPluginInfo] |
name |
a name to lookup the service-type. |
Since: 1.4
char ** nm_vpn_plugin_info_list_get_service_types (GSList *list
,gboolean only_existing
,gboolean with_abbreviations
);
list |
a possibly empty GSList of NMVpnPluginInfo. |
[element-type NMVpnPluginInfo] |
only_existing |
only include results that are actually in |
|
with_abbreviations |
if |
a NULL
terminated strv list of strings.
The list itself and the values must be freed with g_strfreev()
.
[transfer full]
Since: 1.4
NMVpnEditorPlugin *
nm_vpn_plugin_info_get_editor_plugin (NMVpnPluginInfo *self
);
Since: 1.2
void nm_vpn_plugin_info_set_editor_plugin (NMVpnPluginInfo *self
,NMVpnEditorPlugin *plugin
);
Set the internal plugin instance. If NULL
, only clear the previous instance.
Since: 1.2
NMVpnEditorPlugin * nm_vpn_plugin_info_load_editor_plugin (NMVpnPluginInfo *self
,GError **error
);
loads the plugin and returns the newly created
instance. The plugin is owned by self
and can be later retrieved again
via nm_vpn_plugin_info_get_editor_plugin()
. You can load the
plugin only once, unless you reset the state via
nm_vpn_plugin_info_set_editor_plugin()
.
[transfer none]
Since: 1.2