projects
/
platform
/
upstream
/
connman.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix dereference after null check
[platform/upstream/connman.git]
/
vpn
/
vpn-provider.h
diff --git
a/vpn/vpn-provider.h
b/vpn/vpn-provider.h
old mode 100644
(file)
new mode 100755
(executable)
index
2889428
..
0275d51
--- a/
vpn/vpn-provider.h
+++ b/
vpn/vpn-provider.h
@@
-2,7
+2,8
@@
*
* ConnMan VPN daemon
*
*
* ConnMan VPN daemon
*
- * Copyright (C) 2007-2012 Intel Corporation. All rights reserved.
+ * Copyright (C) 2007-2013 Intel Corporation. All rights reserved.
+ * Copyright (C) 2019 Jolla Ltd. 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
*
* 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
@@
-22,8
+23,9
@@
#ifndef __VPN_PROVIDER_H
#define __VPN_PROVIDER_H
#ifndef __VPN_PROVIDER_H
#define __VPN_PROVIDER_H
+#include <stdbool.h>
+
#include <glib.h>
#include <glib.h>
-#include <connman/types.h>
#ifdef __cplusplus
extern "C" {
#ifdef __cplusplus
extern "C" {
@@
-35,11
+37,6
@@
extern "C" {
* @short_description: Functions for handling providers
*/
* @short_description: Functions for handling providers
*/
-enum vpn_provider_type {
- VPN_PROVIDER_TYPE_UNKNOWN = 0,
- VPN_PROVIDER_TYPE_VPN = 1,
-};
-
enum vpn_provider_state {
VPN_PROVIDER_STATE_UNKNOWN = 0,
VPN_PROVIDER_STATE_IDLE = 1,
enum vpn_provider_state {
VPN_PROVIDER_STATE_UNKNOWN = 0,
VPN_PROVIDER_STATE_IDLE = 1,
@@
-56,6
+53,13
@@
enum vpn_provider_error {
VPN_PROVIDER_ERROR_AUTH_FAILED = 3,
};
VPN_PROVIDER_ERROR_AUTH_FAILED = 3,
};
+enum vpn_provider_route_type {
+ VPN_PROVIDER_ROUTE_TYPE_NONE = 0,
+ VPN_PROVIDER_ROUTE_TYPE_MASK = 1,
+ VPN_PROVIDER_ROUTE_TYPE_ADDR = 2,
+ VPN_PROVIDER_ROUTE_TYPE_GW = 3,
+};
+
struct vpn_provider;
struct connman_ipaddress;
struct vpn_provider;
struct connman_ipaddress;
@@
-73,12
+77,20
@@
void vpn_provider_unref_debug(struct vpn_provider *provider,
int vpn_provider_set_string(struct vpn_provider *provider,
const char *key, const char *value);
int vpn_provider_set_string(struct vpn_provider *provider,
const char *key, const char *value);
+int vpn_provider_set_string_hide_value(struct vpn_provider *provider,
+ const char *key, const char *value);
const char *vpn_provider_get_string(struct vpn_provider *provider,
const char *key);
const char *vpn_provider_get_string(struct vpn_provider *provider,
const char *key);
+bool vpn_provider_get_string_immutable(struct vpn_provider *provider,
+ const char *key);
+bool vpn_provider_get_boolean(struct vpn_provider *provider, const char *key,
+ bool default_value);
int vpn_provider_set_state(struct vpn_provider *provider,
enum vpn_provider_state state);
int vpn_provider_set_state(struct vpn_provider *provider,
enum vpn_provider_state state);
+void vpn_provider_add_error(struct vpn_provider *provider,
+ enum vpn_provider_error error);
int vpn_provider_indicate_error(struct vpn_provider *provider,
enum vpn_provider_error error);
int vpn_provider_indicate_error(struct vpn_provider *provider,
enum vpn_provider_error error);
@@
-87,6
+99,8
@@
int vpn_provider_get_index(struct vpn_provider *provider);
void vpn_provider_set_data(struct vpn_provider *provider, void *data);
void *vpn_provider_get_data(struct vpn_provider *provider);
void vpn_provider_set_data(struct vpn_provider *provider, void *data);
void *vpn_provider_get_data(struct vpn_provider *provider);
+void vpn_provider_set_plugin_data(struct vpn_provider *provider, void *data);
+void *vpn_provider_get_plugin_data(struct vpn_provider *provider);
int vpn_provider_set_ipaddress(struct vpn_provider *provider,
struct connman_ipaddress *ipaddress);
int vpn_provider_set_pac(struct vpn_provider *provider,
int vpn_provider_set_ipaddress(struct vpn_provider *provider,
struct connman_ipaddress *ipaddress);
int vpn_provider_set_pac(struct vpn_provider *provider,
@@
-105,6
+119,14
@@
const char *vpn_provider_get_name(struct vpn_provider *provider);
const char *vpn_provider_get_host(struct vpn_provider *provider);
const char *vpn_provider_get_path(struct vpn_provider *provider);
const char *vpn_provider_get_host(struct vpn_provider *provider);
const char *vpn_provider_get_path(struct vpn_provider *provider);
+unsigned int vpn_provider_get_authentication_errors(
+ struct vpn_provider *provider);
+unsigned int vpn_provider_get_connection_errors(
+ struct vpn_provider *provider);
+
+void vpn_provider_change_address(struct vpn_provider *provider);
+void vpn_provider_clear_address(struct vpn_provider *provider, int family);
+
typedef void (* vpn_provider_connect_cb_t) (struct vpn_provider *provider,
void *user_data, int error);
typedef void (* vpn_provider_connect_cb_t) (struct vpn_provider *provider,
void *user_data, int error);
@@
-119,13
+141,18
@@
typedef void (* vpn_provider_password_cb_t) (struct vpn_provider *provider,
struct vpn_provider_driver {
const char *name;
struct vpn_provider_driver {
const char *name;
- enum vpn_provider_type type;
int (*probe) (struct vpn_provider *provider);
int (*remove) (struct vpn_provider *provider);
int (*connect) (struct vpn_provider *provider,
int (*probe) (struct vpn_provider *provider);
int (*remove) (struct vpn_provider *provider);
int (*connect) (struct vpn_provider *provider,
- vpn_provider_connect_cb_t cb, void *user_data);
+ vpn_provider_connect_cb_t cb, const char *dbus_sender,
+ void *user_data);
int (*disconnect) (struct vpn_provider *provider);
int (*save) (struct vpn_provider *provider, GKeyFile *keyfile);
int (*disconnect) (struct vpn_provider *provider);
int (*save) (struct vpn_provider *provider, GKeyFile *keyfile);
+ int (*set_state)(struct vpn_provider *provider,
+ enum vpn_provider_state state);
+ int (*route_env_parse) (struct vpn_provider *provider, const char *key,
+ int *family, unsigned long *idx,
+ enum vpn_provider_route_type *type);
};
int vpn_provider_driver_register(struct vpn_provider_driver *driver);
};
int vpn_provider_driver_register(struct vpn_provider_driver *driver);