Add basic implementation for internal proxy framework
[platform/upstream/connman.git] / include / proxy.h
1 /*
2  *
3  *  Connection Manager
4  *
5  *  Copyright (C) 2007-2010  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                                 connman_proxy_lookup_cb cb, void *user_data);
41 void connman_proxy_lookup_cancel(unsigned int token);
42
43 void connman_proxy_driver_lookup_notify(struct connman_service *service,
44                                         const char *url, const char *result);
45
46 struct connman_proxy_driver {
47         const char *name;
48         int priority;
49         int (*request_lookup) (struct connman_service *service,
50                                                         const char *url);
51         void (*cancel_lookup) (struct connman_service *service,
52                                                         const char *url);
53 };
54
55 int connman_proxy_driver_register(struct connman_proxy_driver *driver);
56 void connman_proxy_driver_unregister(struct connman_proxy_driver *driver);
57
58 #ifdef __cplusplus
59 }
60 #endif
61
62 #endif /* __CONNMAN_PROXY_H */