device: renew dhcp leases on awake for software devices
[NetworkManager.git] / libnm-core / nm-vpn-plugin-info.h
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /*
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the
15  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  * Boston, MA 02110-1301 USA.
17  *
18  * Copyright 2015 Red Hat, Inc.
19  */
20
21 #ifndef __NM_VPN_PLUGIN_INFO_H__
22 #define __NM_VPN_PLUGIN_INFO_H__
23
24 #include <glib.h>
25 #include <glib-object.h>
26
27 #include "nm-utils.h"
28 #include "nm-vpn-editor-plugin.h"
29
30 G_BEGIN_DECLS
31
32 #define NM_TYPE_VPN_PLUGIN_INFO            (nm_vpn_plugin_info_get_type ())
33 #define NM_VPN_PLUGIN_INFO(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_VPN_PLUGIN_INFO, NMVpnPluginInfo))
34 #define NM_VPN_PLUGIN_INFO_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_VPN_PLUGIN_INFO, NMVpnPluginInfoClass))
35 #define NM_IS_VPN_PLUGIN_INFO(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_VPN_PLUGIN_INFO))
36 #define NM_IS_VPN_PLUGIN_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_VPN_PLUGIN_INFO))
37 #define NM_VPN_PLUGIN_INFO_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_VPN_PLUGIN_INFO, NMVpnPluginInfoClass))
38
39 #define NM_VPN_PLUGIN_INFO_NAME        "name"
40 #define NM_VPN_PLUGIN_INFO_FILENAME    "filename"
41 #define NM_VPN_PLUGIN_INFO_KEYFILE     "keyfile"
42
43 #define NM_VPN_PLUGIN_INFO_KF_GROUP_CONNECTION   "VPN Connection"
44 #define NM_VPN_PLUGIN_INFO_KF_GROUP_LIBNM        "libnm"
45 #define NM_VPN_PLUGIN_INFO_KF_GROUP_GNOME        "GNOME"
46
47 typedef struct {
48         NM_AVAILABLE_IN_1_2
49         GObject parent;
50 } NMVpnPluginInfo;
51
52 typedef struct {
53         NM_AVAILABLE_IN_1_2
54         GObjectClass parent;
55
56         /*< private >*/
57         NM_AVAILABLE_IN_1_2
58         gpointer padding[8];
59 } NMVpnPluginInfoClass NM_AVAILABLE_IN_1_2;
60
61 NM_AVAILABLE_IN_1_2
62 GType  nm_vpn_plugin_info_get_type       (void);
63
64 NM_AVAILABLE_IN_1_2
65 NMVpnPluginInfo *nm_vpn_plugin_info_new_from_file (const char *filename,
66                                                    GError **error);
67
68 NM_AVAILABLE_IN_1_2
69 NMVpnPluginInfo *nm_vpn_plugin_info_new_with_data (const char *filename,
70                                                    GKeyFile *keyfile,
71                                                    GError **error);
72
73 NM_AVAILABLE_IN_1_2
74 const char *nm_vpn_plugin_info_get_name        (NMVpnPluginInfo *self);
75 NM_AVAILABLE_IN_1_2
76 const char *nm_vpn_plugin_info_get_filename    (NMVpnPluginInfo *self);
77 NM_AVAILABLE_IN_1_2
78 const char *nm_vpn_plugin_info_get_plugin      (NMVpnPluginInfo *self);
79 NM_AVAILABLE_IN_1_2
80 const char *nm_vpn_plugin_info_get_program     (NMVpnPluginInfo *self);
81 NM_AVAILABLE_IN_1_2
82 gboolean nm_vpn_plugin_info_supports_multiple  (NMVpnPluginInfo *self);
83 NM_AVAILABLE_IN_1_2
84 const char *nm_vpn_plugin_info_lookup_property (NMVpnPluginInfo *self, const char *group, const char *key);
85
86 NM_AVAILABLE_IN_1_2
87 gboolean nm_vpn_plugin_info_validate_filename (const char *filename);
88
89 NM_AVAILABLE_IN_1_2
90 GSList          *nm_vpn_plugin_info_list_load             (void);
91 NM_AVAILABLE_IN_1_2
92 gboolean         nm_vpn_plugin_info_list_add              (GSList **list, NMVpnPluginInfo *plugin_info, GError **error);
93 NM_AVAILABLE_IN_1_2
94 gboolean         nm_vpn_plugin_info_list_remove           (GSList **list, NMVpnPluginInfo *plugin_info);
95 NM_AVAILABLE_IN_1_2
96 NMVpnPluginInfo *nm_vpn_plugin_info_list_find_by_name     (GSList *list, const char *name);
97 NM_AVAILABLE_IN_1_2
98 NMVpnPluginInfo *nm_vpn_plugin_info_list_find_by_filename (GSList *list, const char *filename);
99 NM_AVAILABLE_IN_1_2
100 NMVpnPluginInfo *nm_vpn_plugin_info_list_find_by_service  (GSList *list, const char *service);
101
102
103 NM_AVAILABLE_IN_1_2
104 NMVpnEditorPlugin *nm_vpn_plugin_info_get_editor_plugin  (NMVpnPluginInfo *self);
105 NM_AVAILABLE_IN_1_2
106 void               nm_vpn_plugin_info_set_editor_plugin  (NMVpnPluginInfo *self,
107                                                           NMVpnEditorPlugin *plugin);
108 NM_AVAILABLE_IN_1_2
109 NMVpnEditorPlugin *nm_vpn_plugin_info_load_editor_plugin (NMVpnPluginInfo *self,
110                                                           GError **error);
111
112 G_END_DECLS
113
114 #endif /* __NM_VPN_PLUGIN_INFO_H__ */