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,
56 struct connman_provider;
58 struct connman_provider *connman_provider_ref(struct connman_provider *provider);
59 void connman_provider_unref(struct connman_provider *provider);
61 int connman_provider_set_string(struct connman_provider *provider,
62 const char *key, const char *value);
63 const char *connman_provider_get_string(struct connman_provider *provider,
66 int connman_provider_set_connected(struct connman_provider *provider,
67 connman_bool_t connected);
69 void connman_provider_set_index(struct connman_provider *provider, int index);
70 int connman_provider_get_index(struct connman_provider *provider);
72 void connman_provider_set_data(struct connman_provider *provider, void *data);
73 void *connman_provider_get_data(struct connman_provider *provider);
75 void connman_provider_set_gateway(struct connman_provider *provider,
77 void connman_provider_set_address(struct connman_provider *provider,
79 void connman_provider_set_netmask(struct connman_provider *provider,
81 void connman_provider_set_dns(struct connman_provider *provider,
83 void connman_provider_set_domain(struct connman_provider *provider,
86 struct connman_provider_driver {
88 enum connman_provider_type type;
89 int (*probe) (struct connman_provider *provider);
90 int (*remove) (struct connman_provider *provider);
91 int (*connect) (struct connman_provider *provider);
92 int (*disconnect) (struct connman_provider *provider);
95 int connman_provider_driver_register(struct connman_provider_driver *driver);
96 void connman_provider_driver_unregister(struct connman_provider_driver *driver);
102 #endif /* __CONNMAN_PROVIDER_H */