blob: 956b5b0cf019ca2a25c39d855d7e3eaa7191be17 [file] [log] [blame]
/*
*
* Connection Manager
*
* Copyright (C) 2010 BMW Car IT GmbH. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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 St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#define VPN_FLAG_NO_TUN 1
enum vpn_state {
VPN_STATE_UNKNOWN = 0,
VPN_STATE_IDLE = 1,
VPN_STATE_CONNECT = 2,
VPN_STATE_READY = 3,
VPN_STATE_DISCONNECT = 4,
VPN_STATE_FAILURE = 5,
VPN_STATE_RECONNECT = 6,
};
struct vpn_driver {
int flags;
int (*notify) (DBusMessage *msg, struct connman_provider *provider);
void (*append_props) (struct connman_provider *provider,
DBusMessageIter *, connman_bool_t isprivileged);
int (*connect) (struct connman_provider *provider,
struct connman_task *task, const char *if_name);
void (*disconnect) (void);
void (*save_props) (struct connman_provider *, GKeyFile *);
void (*load_props) (struct connman_provider *, GKeyFile *);
};
int vpn_register(const char *name, struct vpn_driver *driver,
const char *program);
void vpn_unregister(const char *provider_name);
void vpn_died(struct connman_task *task, void *user_data,
enum connman_provider_error error);
int vpn_set_ifname(struct connman_provider *provider, const char *ifname);
void *vpn_get_specific_data(struct connman_provider *vpn);
void vpn_set_specific_data(struct connman_provider *provider,
void *specific_data);
void vpn_reconnect(struct connman_provider *vpn);