technology: return already enabled when tethering is enabled
[framework/connectivity/connman.git] / include / proxy.h
1 /*
2  *
3  *  Connection Manager
4  *
5  *  Copyright (C) 2007-2012  Intel Corporation. All rights reserved.
6  *
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.
10  *
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.
15  *
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
19  *
20  */
21
22 #ifndef __CONNMAN_PROXY_H
23 #define __CONNMAN_PROXY_H
24
25 #include <connman/service.h>
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 /**
32  * SECTION:proxy
33  * @title: Proxy premitives
34  * @short_description: Functions for handling proxy configuration
35  */
36
37 typedef void (*connman_proxy_lookup_cb) (const char *proxy, void *user_data);
38
39 unsigned int connman_proxy_lookup(const char *interface, const char *url,
40                                 struct connman_service *service,
41                                 connman_proxy_lookup_cb cb, void *user_data);
42 void connman_proxy_lookup_cancel(unsigned int token);
43
44 void connman_proxy_driver_lookup_notify(struct connman_service *service,
45                                         const char *url, const char *result);
46
47 #define CONNMAN_PROXY_PRIORITY_LOW      -100
48 #define CONNMAN_PROXY_PRIORITY_DEFAULT     0
49 #define CONNMAN_PROXY_PRIORITY_HIGH      100
50
51 struct connman_proxy_driver {
52         const char *name;
53         int priority;
54         int (*request_lookup) (struct connman_service *service,
55                                                         const char *url);
56         void (*cancel_lookup) (struct connman_service *service,
57                                                         const char *url);
58 };
59
60 int connman_proxy_driver_register(struct connman_proxy_driver *driver);
61 void connman_proxy_driver_unregister(struct connman_proxy_driver *driver);
62
63 #ifdef __cplusplus
64 }
65 #endif
66
67 #endif /* __CONNMAN_PROXY_H */