We are currently experiencing downtime impacting viewing & cloning the Mesa repo, and some GitLab pages returning 503. Please see #freedesktop on IRC for more updates.

Commit b8d6bd1a authored by Jiří Klimeš's avatar Jiří Klimeš

clients: move clients/tui/vpn-helpers.c to clients/common/nm-vpn-helpers.c

The file has not been used up to now. But it is going to be used by both
nmtui and nmcli later.
parent d1a776bf
......@@ -13,19 +13,14 @@
* 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"
......@@ -34,7 +29,7 @@
#include <gmodule.h>
#include "nm-default.h"
#include "vpn-helpers.h"
#include "nm-vpn-helpers.h"
#include "nm-macros-internal.h"
......@@ -42,7 +37,7 @@ static gboolean plugins_loaded;
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;
......@@ -50,7 +45,7 @@ vpn_get_plugin_by_service (const char *service)
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) {
......@@ -62,7 +57,7 @@ vpn_get_plugin_by_service (const char *service)
}
GSList *
vpn_get_plugins ()
nm_vpn_get_plugins (void)
{
if (G_LIKELY (plugins_loaded))
return plugins;
......@@ -303,7 +298,7 @@ vpn_export (NMConnection *connection)
#endif
gboolean
vpn_supports_ipv6 (NMConnection *connection)
nm_vpn_supports_ipv6 (NMConnection *connection)
{
NMSettingVpn *s_vpn;
const char *service_type;
......@@ -316,7 +311,7 @@ vpn_supports_ipv6 (NMConnection *connection)
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);
......
......@@ -13,25 +13,25 @@
* 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__ */
......@@ -32,20 +32,20 @@
#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);
......@@ -224,7 +224,7 @@ nm_editor_utils_get_connection_type_list (void)
#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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment