* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- * Copyright 2013 Red Hat, Inc.
+ * Copyright 2013 - 2015 Red Hat, Inc.
*/
/**
- * SECTION:vpn-helpers
+ * SECTION:nm-vpn-helpers
* @short_description: VPN-related utilities
*
- * This is copied directly from libnm-gtk and should probably
- * eventually move into libnm.
- *
- * It is also currently unused in nmtui.
- *
- * FIXME.
+ * Some functions should probably eventually move into libnm.
*/
#include "config.h"
#include <gmodule.h>
#include "nm-default.h"
-#include "vpn-helpers.h"
+#include "nm-vpn-helpers.h"
#include "nm-macros-internal.h"
static GSList *plugins = NULL;
NMVpnEditorPlugin *
-vpn_get_plugin_by_service (const char *service)
+nm_vpn_get_plugin_by_service (const char *service)
{
NMVpnEditorPlugin *plugin = NULL;
NMVpnPluginInfo *plugin_info;
g_return_val_if_fail (service != NULL, NULL);
if (G_UNLIKELY (!plugins_loaded))
- vpn_get_plugins ();
+ nm_vpn_get_plugins ();
plugin_info = nm_vpn_plugin_info_list_find_by_service (plugins, service);
if (plugin_info) {
}
GSList *
-vpn_get_plugins ()
+nm_vpn_get_plugins (void)
{
if (G_LIKELY (plugins_loaded))
return plugins;
#endif
gboolean
-vpn_supports_ipv6 (NMConnection *connection)
+nm_vpn_supports_ipv6 (NMConnection *connection)
{
NMSettingVpn *s_vpn;
const char *service_type;
service_type = nm_setting_vpn_get_service_type (s_vpn);
g_return_val_if_fail (service_type != NULL, FALSE);
- plugin = vpn_get_plugin_by_service (service_type);
+ plugin = nm_vpn_get_plugin_by_service (service_type);
g_return_val_if_fail (plugin != NULL, FALSE);
capabilities = nm_vpn_editor_plugin_get_capabilities (plugin);
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- * Copyright 2013 Red Hat, Inc.
+ * Copyright 2013 - 2015 Red Hat, Inc.
*/
-#ifndef _VPN_HELPERS_H_
-#define _VPN_HELPERS_H_
+#ifndef __NM_VPN_HELPERS_H__
+#define __NM_VPN_HELPERS_H__
#include <NetworkManager.h>
#include "nm-default.h"
-GSList *vpn_get_plugins (void);
+GSList *nm_vpn_get_plugins (void);
-NMVpnEditorPlugin *vpn_get_plugin_by_service (const char *service);
+NMVpnEditorPlugin *nm_vpn_get_plugin_by_service (const char *service);
typedef void (*VpnImportSuccessCallback) (NMConnection *connection, gpointer user_data);
-void vpn_import (VpnImportSuccessCallback callback, gpointer user_data);
+void nm_vpn_import (VpnImportSuccessCallback callback, gpointer user_data);
-void vpn_export (NMConnection *connection);
+void nm_vpn_export (NMConnection *connection);
-gboolean vpn_supports_ipv6 (NMConnection *connection);
+gboolean nm_vpn_supports_ipv6 (NMConnection *connection);
-#endif /* _VPN_HELPERS_H_ */
+#endif /* __NM_VPN_HELPERS_H__ */
#include "nm-default.h"
#include "nm-editor-utils.h"
#if 0
-#include "vpn-helpers.h"
+#include "nm-vpn-helpers.h"
static GSList *vpn_plugins;
static gint
sort_vpn_plugins (gconstpointer a, gconstpointer b)
{
- NMVpnPluginUiInterface *aa = NM_VPN_PLUGIN_UI_INTERFACE (a);
- NMVpnPluginUiInterface *bb = NM_VPN_PLUGIN_UI_INTERFACE (b);
+ NMVpnEditorPlugin *aa = NM_VPN_EDITOR_PLUGIN (a);
+ NMVpnEditorPlugin *bb = NM_VPN_EDITOR_PLUGIN (b);
char *aa_desc = NULL, *bb_desc = NULL;
int ret;
- g_object_get (aa, NM_VPN_PLUGIN_UI_INTERFACE_NAME, &aa_desc, NULL);
- g_object_get (bb, NM_VPN_PLUGIN_UI_INTERFACE_NAME, &bb_desc, NULL);
+ g_object_get (aa, NM_VPN_EDITOR_PLUGIN_NAME, &aa_desc, NULL);
+ g_object_get (bb, NM_VPN_EDITOR_PLUGIN_NAME, &bb_desc, NULL);
ret = g_strcmp0 (aa_desc, bb_desc);
#if 0
/* Add "VPN" only if there are plugins */
- vpn_plugins_hash = vpn_get_plugins (NULL);
+ vpn_plugins_hash = nm_vpn_get_plugins ();
have_vpn_plugins = vpn_plugins_hash && g_hash_table_size (vpn_plugins_hash);
if (have_vpn_plugins) {
GHashTableIter iter;
-clients/tui/vpn-helpers.c
examples/python/NetworkManager.py
examples/python/systray/eggtrayicon.c
policy/org.freedesktop.NetworkManager.policy.in