curl: reschedule uses GNUNET_CURL_perform2.
[oweals/gnunet.git] / src / include / gnunet_socks.h
1 /*
2      This file is part of GNUnet.
3      Copyright (C) 2001-2013 GNUnet e.V.
4
5      GNUnet is free software: you can redistribute it and/or modify it
6      under the terms of the GNU Affero General Public License as published
7      by the Free Software Foundation, either version 3 of the License,
8      or (at your option) any later version.
9
10      GNUnet is distributed in the hope that it will be useful, but
11      WITHOUT ANY WARRANTY; without even the implied warranty of
12      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13      Affero General Public License for more details.
14     
15      You should have received a copy of the GNU Affero General Public License
16      along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 /**
20  * @author Jeffrey Burdges
21  *
22  * @file
23  * SOCKS proxy for connections
24  *
25  * @defgroup socks  SOCKS proxy
26  * SOCKS proxy for connections.
27  * @{
28  */
29
30 #ifndef GNUNET_SOCKS_H
31 #define GNUNET_SOCKS_H
32
33 #ifdef __cplusplus
34 extern "C"
35 {
36 #if 0                           /* keep Emacsens' auto-indent happy */
37 }
38 #endif
39 #endif
40
41 #include "gnunet_common.h"
42
43
44 /**
45  * Check if a SOCKS proxy is required by a service.  Do not use local service
46  * if a SOCKS proxy port is configured as this could deanonymize a user.
47  *
48  * @param service_name name of service to connect to
49  * @param cfg configuration to use
50  * @return GNUNET_YES if so, GNUNET_NO if not
51  */
52 int
53 GNUNET_SOCKS_check_service (const char *service_name,
54                             const struct GNUNET_CONFIGURATION_Handle *cfg);
55
56
57 /**
58  * Try to connect to a service configured to use a SOCKS5 proxy.
59  *
60  * @param service_name name of service to connect to
61  * @param cfg configuration to use
62  * @return Connection handle that becomes usable when the handshake completes.
63  *         NULL if SOCKS not configured or not configured properly
64  */
65 struct GNUNET_CONNECTION_Handle *
66 GNUNET_SOCKS_do_connect (const char *service_name,
67                           const struct GNUNET_CONFIGURATION_Handle *cfg);
68
69
70 #if 0                           /* keep Emacsens' auto-indent happy */
71 {
72 #endif
73 #ifdef __cplusplus
74 }
75 #endif
76
77 /* ifndef GNUNET_SOCKS_H */
78 #endif
79
80 /** @} */  /* end of group */
81
82 /* end of gnunet_socks.h */