mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-21 23:38:12 +02:00
Port to NM 0.7 VPN plugin API git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3838 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
81 lines
2.3 KiB
C
81 lines
2.3 KiB
C
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
|
/***************************************************************************
|
|
*
|
|
* Copyright (C) 2008 Dan Williams, <dcbw@redhat.com>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
*
|
|
**************************************************************************/
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
#include <config.h>
|
|
#endif
|
|
|
|
#include <string.h>
|
|
#include <sys/types.h>
|
|
#include <stdlib.h>
|
|
#include <sys/stat.h>
|
|
#include <fcntl.h>
|
|
#include <unistd.h>
|
|
#include <errno.h>
|
|
#include <ctype.h>
|
|
|
|
#include <glib/gi18n-lib.h>
|
|
|
|
#include <nm-setting-vpn.h>
|
|
#include <nm-setting-vpn-properties.h>
|
|
#include <nm-setting-connection.h>
|
|
#include <nm-setting-ip4-config.h>
|
|
|
|
#include "import-export.h"
|
|
#include "nm-pptp.h"
|
|
#include "../src/nm-pptp-service.h"
|
|
|
|
NMConnection *
|
|
do_import (const char *path, char **lines, GError **error)
|
|
{
|
|
NMConnection *connection = NULL;
|
|
NMSettingConnection *s_con;
|
|
NMSettingVPN *s_vpn;
|
|
NMSettingVPNProperties *s_vpn_props;
|
|
char *last_dot;
|
|
|
|
connection = nm_connection_new ();
|
|
s_con = NM_SETTING_CONNECTION (nm_setting_connection_new ());
|
|
nm_connection_add_setting (connection, NM_SETTING (s_con));
|
|
|
|
s_vpn = NM_SETTING_VPN (nm_setting_vpn_new ());
|
|
s_vpn->service_type = g_strdup (NM_DBUS_SERVICE_PPTP);
|
|
nm_connection_add_setting (connection, NM_SETTING (s_vpn));
|
|
|
|
s_vpn_props = NM_SETTING_VPN_PROPERTIES (nm_setting_vpn_properties_new ());
|
|
nm_connection_add_setting (connection, NM_SETTING (s_vpn_props));
|
|
|
|
s_con->id = g_path_get_basename (path);
|
|
last_dot = strrchr (s_con->id, '.');
|
|
if (last_dot)
|
|
*last_dot = '\0';
|
|
|
|
return connection;
|
|
}
|
|
|
|
gboolean
|
|
do_export (const char *path, NMConnection *connection, GError **error)
|
|
{
|
|
return FALSE;
|
|
}
|
|
|
|
|
|
|