2008-07-27 20:03:46 +00:00
|
|
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library 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
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301 USA.
|
|
|
|
*
|
2014-07-04 17:33:18 +00:00
|
|
|
* Copyright 2007 - 2013 Red Hat, Inc.
|
|
|
|
* Copyright 2007 - 2008 Novell, Inc.
|
2008-07-27 20:03:46 +00:00
|
|
|
*/
|
2007-11-07 16:06:43 +00:00
|
|
|
|
|
|
|
#ifndef NM_SETTING_VPN_H
|
|
|
|
#define NM_SETTING_VPN_H
|
|
|
|
|
2017-03-09 12:02:20 +00:00
|
|
|
#include "nm-setting.h"
|
2007-11-07 16:06:43 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
#define NM_TYPE_SETTING_VPN (nm_setting_vpn_get_type ())
|
|
|
|
#define NM_SETTING_VPN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_VPN, NMSettingVPN))
|
|
|
|
#define NM_SETTING_VPN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_VPN, NMSettingVPNClass))
|
|
|
|
#define NM_IS_SETTING_VPN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_VPN))
|
2012-07-27 11:15:54 +00:00
|
|
|
#define NM_IS_SETTING_VPN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_VPN))
|
2007-11-07 16:06:43 +00:00
|
|
|
#define NM_SETTING_VPN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_VPN, NMSettingVPNClass))
|
|
|
|
|
|
|
|
#define NM_SETTING_VPN_SETTING_NAME "vpn"
|
|
|
|
|
2011-07-19 17:06:47 +00:00
|
|
|
/**
|
2011-07-19 17:23:19 +00:00
|
|
|
* NMSettingVpnError:
|
2011-07-19 17:06:47 +00:00
|
|
|
* @NM_SETTING_VPN_ERROR_UNKNOWN: unknown or unclassified error
|
|
|
|
* @NM_SETTING_VPN_ERROR_INVALID_PROPERTY: the property was invalid
|
|
|
|
* @NM_SETTING_VPN_ERROR_MISSING_PROPERTY: the property was missing and is
|
|
|
|
* required
|
|
|
|
*/
|
|
|
|
typedef enum {
|
2012-03-09 14:39:58 +00:00
|
|
|
NM_SETTING_VPN_ERROR_UNKNOWN = 0, /*< nick=UnknownError >*/
|
|
|
|
NM_SETTING_VPN_ERROR_INVALID_PROPERTY, /*< nick=InvalidProperty >*/
|
|
|
|
NM_SETTING_VPN_ERROR_MISSING_PROPERTY, /*< nick=MissingProperty >*/
|
2008-06-12 23:58:08 +00:00
|
|
|
} NMSettingVpnError;
|
|
|
|
|
|
|
|
#define NM_SETTING_VPN_ERROR nm_setting_vpn_error_quark ()
|
|
|
|
GQuark nm_setting_vpn_error_quark (void);
|
|
|
|
|
2007-11-07 16:06:43 +00:00
|
|
|
#define NM_SETTING_VPN_SERVICE_TYPE "service-type"
|
|
|
|
#define NM_SETTING_VPN_USER_NAME "user-name"
|
2014-10-17 01:09:38 +00:00
|
|
|
#define NM_SETTING_VPN_PERSISTENT "persistent"
|
2008-08-11 17:13:22 +00:00
|
|
|
#define NM_SETTING_VPN_DATA "data"
|
2008-09-04 14:32:14 +00:00
|
|
|
#define NM_SETTING_VPN_SECRETS "secrets"
|
2007-11-07 16:06:43 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
NMSetting parent;
|
|
|
|
} NMSettingVPN;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
NMSettingClass parent;
|
2009-09-30 16:11:54 +00:00
|
|
|
|
|
|
|
/* Padding for future expansion */
|
|
|
|
void (*_reserved1) (void);
|
|
|
|
void (*_reserved2) (void);
|
|
|
|
void (*_reserved3) (void);
|
|
|
|
void (*_reserved4) (void);
|
2007-11-07 16:06:43 +00:00
|
|
|
} NMSettingVPNClass;
|
|
|
|
|
2011-07-19 17:06:47 +00:00
|
|
|
/**
|
|
|
|
* NMVPNIterFunc:
|
|
|
|
* @key: the name of the data or secret item
|
|
|
|
* @value: the value of the data or secret item
|
|
|
|
* @user_data: User data passed to nm_setting_vpn_foreach_data_item() or
|
|
|
|
* nm_setting_vpn_foreach_secret()
|
|
|
|
**/
|
2011-01-21 20:46:09 +00:00
|
|
|
typedef void (*NMVPNIterFunc) (const char *key, const char *value, gpointer user_data);
|
2008-10-29 09:13:40 +00:00
|
|
|
|
2007-11-07 16:06:43 +00:00
|
|
|
GType nm_setting_vpn_get_type (void);
|
|
|
|
|
2008-10-29 09:13:40 +00:00
|
|
|
NMSetting *nm_setting_vpn_new (void);
|
|
|
|
const char *nm_setting_vpn_get_service_type (NMSettingVPN *setting);
|
|
|
|
const char *nm_setting_vpn_get_user_name (NMSettingVPN *setting);
|
2014-10-17 01:09:38 +00:00
|
|
|
gboolean nm_setting_vpn_get_persistent (NMSettingVPN *setting);
|
2008-10-29 09:13:40 +00:00
|
|
|
|
2012-01-05 14:44:46 +00:00
|
|
|
guint32 nm_setting_vpn_get_num_data_items (NMSettingVPN *setting);
|
2008-10-29 09:13:40 +00:00
|
|
|
void nm_setting_vpn_add_data_item (NMSettingVPN *setting,
|
|
|
|
const char *key,
|
|
|
|
const char *item);
|
|
|
|
const char * nm_setting_vpn_get_data_item (NMSettingVPN *setting,
|
|
|
|
const char *key);
|
2013-04-02 11:12:14 +00:00
|
|
|
gboolean nm_setting_vpn_remove_data_item (NMSettingVPN *setting,
|
2008-10-29 09:13:40 +00:00
|
|
|
const char *key);
|
|
|
|
void nm_setting_vpn_foreach_data_item (NMSettingVPN *setting,
|
2011-01-21 20:46:09 +00:00
|
|
|
NMVPNIterFunc func,
|
2008-10-29 09:13:40 +00:00
|
|
|
gpointer user_data);
|
|
|
|
|
2012-01-05 14:44:46 +00:00
|
|
|
guint32 nm_setting_vpn_get_num_secrets (NMSettingVPN *setting);
|
2008-10-29 09:13:40 +00:00
|
|
|
void nm_setting_vpn_add_secret (NMSettingVPN *setting,
|
|
|
|
const char *key,
|
|
|
|
const char *secret);
|
|
|
|
const char * nm_setting_vpn_get_secret (NMSettingVPN *setting,
|
|
|
|
const char *key);
|
2013-04-02 11:12:14 +00:00
|
|
|
gboolean nm_setting_vpn_remove_secret (NMSettingVPN *setting,
|
2008-10-29 09:13:40 +00:00
|
|
|
const char *key);
|
|
|
|
void nm_setting_vpn_foreach_secret (NMSettingVPN *setting,
|
2011-01-21 20:46:09 +00:00
|
|
|
NMVPNIterFunc func,
|
2008-10-29 09:13:40 +00:00
|
|
|
gpointer user_data);
|
2007-11-07 16:06:43 +00:00
|
|
|
|
2014-11-10 20:24:02 +00:00
|
|
|
#ifdef NM_VPN_LIBNM_COMPAT
|
|
|
|
#define NMSettingVpn NMSettingVPN
|
|
|
|
#endif
|
|
|
|
|
2007-11-07 16:06:43 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* NM_SETTING_VPN_H */
|