device: renew dhcp leases on awake for software devices
[NetworkManager.git] / libnm / nm-vpn-plugin-old.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 2007 - 2008 Novell, Inc.
19  * Copyright 2007 - 2015 Red Hat, Inc.
20  */
21
22 #ifndef __NM_VPN_PLUGIN_OLD_H__
23 #define __NM_VPN_PLUGIN_OLD_H__
24
25 #include <gio/gio.h>
26 #include <nm-vpn-dbus-interface.h>
27 #include <nm-connection.h>
28
29 G_BEGIN_DECLS
30
31 #define NM_TYPE_VPN_PLUGIN_OLD            (nm_vpn_plugin_old_get_type ())
32 #define NM_VPN_PLUGIN_OLD(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_VPN_PLUGIN_OLD, NMVpnPluginOld))
33 #define NM_VPN_PLUGIN_OLD_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_VPN_PLUGIN_OLD, NMVpnPluginOldClass))
34 #define NM_IS_VPN_PLUGIN_OLD(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_VPN_PLUGIN_OLD))
35 #define NM_IS_VPN_PLUGIN_OLD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_VPN_PLUGIN_OLD))
36 #define NM_VPN_PLUGIN_OLD_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_VPN_PLUGIN_OLD, NMVpnPluginOldClass))
37
38 #define NM_VPN_PLUGIN_OLD_DBUS_SERVICE_NAME "service-name"
39 #define NM_VPN_PLUGIN_OLD_STATE             "state"
40
41 typedef struct {
42         NM_DEPRECATED_IN_1_2
43         GObject parent;
44 } NMVpnPluginOld NM_DEPRECATED_IN_1_2;
45
46 typedef struct {
47         NM_DEPRECATED_IN_1_2
48         GObjectClass parent;
49
50         /* Signals */
51         NM_DEPRECATED_IN_1_2
52         void (*state_changed)  (NMVpnPluginOld *plugin,
53                                 NMVpnServiceState state);
54
55         NM_DEPRECATED_IN_1_2
56         void (*ip4_config)     (NMVpnPluginOld *plugin,
57                                 GVariant  *ip4_config);
58
59         NM_DEPRECATED_IN_1_2
60         void (*login_banner)   (NMVpnPluginOld *plugin,
61                                 const char *banner);
62
63         NM_DEPRECATED_IN_1_2
64         void (*failure)        (NMVpnPluginOld *plugin,
65                                 NMVpnPluginFailure reason);
66
67         NM_DEPRECATED_IN_1_2
68         void (*quit)           (NMVpnPluginOld *plugin);
69
70         NM_DEPRECATED_IN_1_2
71         void (*config)         (NMVpnPluginOld *plugin,
72                                 GVariant  *config);
73
74         NM_DEPRECATED_IN_1_2
75         void (*ip6_config)     (NMVpnPluginOld *plugin,
76                                 GVariant  *config);
77
78         /* virtual methods */
79         NM_DEPRECATED_IN_1_2
80         gboolean (*connect)      (NMVpnPluginOld   *plugin,
81                                   NMConnection  *connection,
82                                   GError       **err);
83
84         NM_DEPRECATED_IN_1_2
85         gboolean (*need_secrets) (NMVpnPluginOld *plugin,
86                                   NMConnection *connection,
87                                   const char **setting_name,
88                                   GError **error);
89
90         NM_DEPRECATED_IN_1_2
91         gboolean (*disconnect)   (NMVpnPluginOld   *plugin,
92                                   GError       **err);
93
94         NM_DEPRECATED_IN_1_2
95         gboolean (*new_secrets)  (NMVpnPluginOld *plugin,
96                                   NMConnection *connection,
97                                   GError **error);
98
99         NM_DEPRECATED_IN_1_2
100         gboolean (*connect_interactive) (NMVpnPluginOld *plugin,
101                                          NMConnection *connection,
102                                          GVariant *details,
103                                          GError **error);
104
105         /*< private >*/
106         NM_DEPRECATED_IN_1_2
107         gpointer padding[8];
108 } NMVpnPluginOldClass NM_DEPRECATED_IN_1_2;
109
110 NM_DEPRECATED_IN_1_2
111 GType  nm_vpn_plugin_old_get_type       (void);
112
113 NM_DEPRECATED_IN_1_2
114 GDBusConnection   *nm_vpn_plugin_old_get_connection (NMVpnPluginOld *plugin);
115 NM_DEPRECATED_IN_1_2
116 NMVpnServiceState  nm_vpn_plugin_old_get_state      (NMVpnPluginOld *plugin);
117 NM_DEPRECATED_IN_1_2
118 void               nm_vpn_plugin_old_set_state      (NMVpnPluginOld *plugin,
119                                                      NMVpnServiceState state);
120
121 NM_DEPRECATED_IN_1_2
122 void               nm_vpn_plugin_old_secrets_required (NMVpnPluginOld *plugin,
123                                                        const char *message,
124                                                        const char **hints);
125
126 NM_DEPRECATED_IN_1_2
127 void               nm_vpn_plugin_old_set_login_banner (NMVpnPluginOld *plugin,
128                                                        const char *banner);
129
130 NM_DEPRECATED_IN_1_2
131 void               nm_vpn_plugin_old_failure        (NMVpnPluginOld *plugin,
132                                                      NMVpnPluginFailure reason);
133
134 NM_DEPRECATED_IN_1_2
135 void               nm_vpn_plugin_old_set_config     (NMVpnPluginOld *plugin,
136                                                      GVariant *config);
137
138 NM_DEPRECATED_IN_1_2
139 void               nm_vpn_plugin_old_set_ip4_config (NMVpnPluginOld *plugin,
140                                                      GVariant *ip4_config);
141
142 NM_DEPRECATED_IN_1_2
143 void               nm_vpn_plugin_old_set_ip6_config (NMVpnPluginOld *plugin,
144                                                      GVariant *ip6_config);
145
146 NM_DEPRECATED_IN_1_2
147 gboolean           nm_vpn_plugin_old_disconnect     (NMVpnPluginOld *plugin,
148                                                      GError **err);
149
150 /* Utility functions */
151
152 NM_DEPRECATED_IN_1_2
153 gboolean nm_vpn_plugin_old_read_vpn_details (int fd,
154                                              GHashTable **out_data,
155                                              GHashTable **out_secrets);
156
157 NM_DEPRECATED_IN_1_2
158 gboolean nm_vpn_plugin_old_get_secret_flags (GHashTable *data,
159                                              const char *secret_name,
160                                              NMSettingSecretFlags *out_flags);
161
162 G_END_DECLS
163
164 #endif /* __NM_VPN_PLUGIN_OLD_H__ */