Update jsonapi to current specs, refactor
[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
6      it under the terms of the GNU General Public License as published
7      by the Free Software Foundation; either version 3, or (at your
8      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      General Public License for more details.
14
15      You should have received a copy of the GNU General Public License
16      along with GNUnet; see the file COPYING.  If not, write to the
17      Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18      Boston, MA 02110-1301, USA.
19 */
20
21 /**
22  * @author Jeffrey Burdges
23  *
24  * @file
25  * SOCKS proxy for connections
26  *
27  * @defgroup socks  SOCKS proxy
28  * SOCKS proxy for connections.
29  * @{
30  */
31
32 #ifndef GNUNET_SOCKS_H
33 #define GNUNET_SOCKS_H
34
35 #ifdef __cplusplus
36 extern "C"
37 {
38 #if 0                           /* keep Emacsens' auto-indent happy */
39 }
40 #endif
41 #endif
42
43 #include "gnunet_common.h"
44
45
46 /**
47  * Check if a SOCKS proxy is required by a service.  Do not use local service
48  * if a SOCKS proxy port is configured as this could deanonymize a user.
49  *
50  * @param service_name name of service to connect to
51  * @param cfg configuration to use
52  * @return GNUNET_YES if so, GNUNET_NO if not
53  */
54 int
55 GNUNET_SOCKS_check_service (const char *service_name,
56                             const struct GNUNET_CONFIGURATION_Handle *cfg);
57
58
59 /**
60  * Try to connect to a service configured to use a SOCKS5 proxy.
61  *
62  * @param service_name name of service to connect to
63  * @param cfg configuration to use
64  * @return Connection handle that becomes usable when the handshake completes.
65  *         NULL if SOCKS not configured or not configured properly
66  */
67 struct GNUNET_CONNECTION_Handle *
68 GNUNET_SOCKS_do_connect (const char *service_name,
69                           const struct GNUNET_CONFIGURATION_Handle *cfg);
70
71
72 #if 0                           /* keep Emacsens' auto-indent happy */
73 {
74 #endif
75 #ifdef __cplusplus
76 }
77 #endif
78
79 /* ifndef GNUNET_SOCKS_H */
80 #endif
81
82 /** @} */  /* end of group */
83
84 /* end of gnunet_socks.h */