5 * Copyright (C) 2007-2010 Intel Corporation. All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #ifndef __CONNMAN_PROVIDER_H
23 #define __CONNMAN_PROVIDER_H
25 #include <connman/types.h>
33 * @title: Provider premitives
34 * @short_description: Functions for handling providers
37 enum connman_provider_type {
38 CONNMAN_PROVIDER_TYPE_UNKNOWN = 0,
39 CONNMAN_PROVIDER_TYPE_VPN = 1,
42 enum connman_provider_state {
43 CONNMAN_PROVIDER_STATE_UNKNOWN = 0,
44 CONNMAN_PROVIDER_STATE_IDLE = 1,
45 CONNMAN_PROVIDER_STATE_CONNECT = 2,
46 CONNMAN_PROVIDER_STATE_READY = 3,
47 CONNMAN_PROVIDER_STATE_DISCONNECT = 4,
48 CONNMAN_PROVIDER_STATE_FAILURE = 5,
51 enum connman_provider_error {
52 CONNMAN_PROVIDER_ERROR_UNKNOWN = 0,
53 CONNMAN_PROVIDER_ERROR_CONNECT_FAILED = 1,
54 CONNMAN_PROVIDER_ERROR_LOGIN_FAILED = 2,
55 CONNMAN_PROVIDER_ERROR_AUTH_FAILED = 3,
58 struct connman_provider;
59 struct connman_ipaddress;
61 struct connman_provider *connman_provider_ref(struct connman_provider *provider);
62 void connman_provider_unref(struct connman_provider *provider);
64 int connman_provider_set_string(struct connman_provider *provider,
65 const char *key, const char *value);
66 const char *connman_provider_get_string(struct connman_provider *provider,
69 int connman_provider_set_state(struct connman_provider *provider,
70 enum connman_provider_state state);
72 int connman_provider_indicate_error(struct connman_provider *provider,
73 enum connman_provider_error error);
75 void connman_provider_set_index(struct connman_provider *provider, int index);
76 int connman_provider_get_index(struct connman_provider *provider);
78 void connman_provider_set_data(struct connman_provider *provider, void *data);
79 void *connman_provider_get_data(struct connman_provider *provider);
80 int connman_provider_set_ipaddress(struct connman_provider *provider,
81 struct connman_ipaddress *ipaddress);
82 int connman_provider_set_pac(struct connman_provider *provider,
84 int connman_provider_set_domain(struct connman_provider *provider,
86 int connman_provider_set_nameservers(struct connman_provider *provider,
87 const char *nameservers);
88 int connman_provider_append_route(struct connman_provider *provider,
89 const char *key, const char *value);
91 const char *connman_provider_get_driver_name(struct connman_provider *provider);
93 struct connman_provider_driver {
95 enum connman_provider_type type;
96 int (*probe) (struct connman_provider *provider);
97 int (*remove) (struct connman_provider *provider);
98 int (*connect) (struct connman_provider *provider);
99 int (*disconnect) (struct connman_provider *provider);
102 int connman_provider_driver_register(struct connman_provider_driver *driver);
103 void connman_provider_driver_unregister(struct connman_provider_driver *driver);
109 #endif /* __CONNMAN_PROVIDER_H */