1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301 USA.
19 * Copyright 2007 - 2013 Red Hat, Inc.
20 * Copyright 2007 - 2008 Novell, Inc.
23 #ifndef NM_SETTING_VPN_H
24 #define NM_SETTING_VPN_H
26 #include <nm-setting.h>
30 #define NM_TYPE_SETTING_VPN (nm_setting_vpn_get_type ())
31 #define NM_SETTING_VPN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_VPN, NMSettingVPN))
32 #define NM_SETTING_VPN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_VPN, NMSettingVPNClass))
33 #define NM_IS_SETTING_VPN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_VPN))
34 #define NM_IS_SETTING_VPN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_VPN))
35 #define NM_SETTING_VPN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_VPN, NMSettingVPNClass))
37 #define NM_SETTING_VPN_SETTING_NAME "vpn"
41 * @NM_SETTING_VPN_ERROR_UNKNOWN: unknown or unclassified error
42 * @NM_SETTING_VPN_ERROR_INVALID_PROPERTY: the property was invalid
43 * @NM_SETTING_VPN_ERROR_MISSING_PROPERTY: the property was missing and is
47 NM_SETTING_VPN_ERROR_UNKNOWN = 0, /*< nick=UnknownError >*/
48 NM_SETTING_VPN_ERROR_INVALID_PROPERTY, /*< nick=InvalidProperty >*/
49 NM_SETTING_VPN_ERROR_MISSING_PROPERTY, /*< nick=MissingProperty >*/
52 #define NM_SETTING_VPN_ERROR nm_setting_vpn_error_quark ()
53 GQuark nm_setting_vpn_error_quark (void);
55 #define NM_SETTING_VPN_SERVICE_TYPE "service-type"
56 #define NM_SETTING_VPN_USER_NAME "user-name"
57 #define NM_SETTING_VPN_PERSISTENT "persistent"
58 #define NM_SETTING_VPN_DATA "data"
59 #define NM_SETTING_VPN_SECRETS "secrets"
66 NMSettingClass parent;
68 /* Padding for future expansion */
69 void (*_reserved1) (void);
70 void (*_reserved2) (void);
71 void (*_reserved3) (void);
72 void (*_reserved4) (void);
77 * @key: the name of the data or secret item
78 * @value: the value of the data or secret item
79 * @user_data: User data passed to nm_setting_vpn_foreach_data_item() or
80 * nm_setting_vpn_foreach_secret()
82 typedef void (*NMVPNIterFunc) (const char *key, const char *value, gpointer user_data);
84 GType nm_setting_vpn_get_type (void);
86 NMSetting *nm_setting_vpn_new (void);
87 const char *nm_setting_vpn_get_service_type (NMSettingVPN *setting);
88 const char *nm_setting_vpn_get_user_name (NMSettingVPN *setting);
89 gboolean nm_setting_vpn_get_persistent (NMSettingVPN *setting);
91 guint32 nm_setting_vpn_get_num_data_items (NMSettingVPN *setting);
92 void nm_setting_vpn_add_data_item (NMSettingVPN *setting,
95 const char * nm_setting_vpn_get_data_item (NMSettingVPN *setting,
97 gboolean nm_setting_vpn_remove_data_item (NMSettingVPN *setting,
99 void nm_setting_vpn_foreach_data_item (NMSettingVPN *setting,
103 guint32 nm_setting_vpn_get_num_secrets (NMSettingVPN *setting);
104 void nm_setting_vpn_add_secret (NMSettingVPN *setting,
107 const char * nm_setting_vpn_get_secret (NMSettingVPN *setting,
109 gboolean nm_setting_vpn_remove_secret (NMSettingVPN *setting,
111 void nm_setting_vpn_foreach_secret (NMSettingVPN *setting,
115 #ifdef NM_VPN_LIBNM_COMPAT
116 #define NMSettingVpn NMSettingVPN
121 #endif /* NM_SETTING_VPN_H */