gnunet_socks.h (2353B)
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 SPDX-License-Identifier: AGPL3.0-or-later 19 */ 20 21 /** 22 * @addtogroup libgnunetutil 23 * @{ 24 * 25 * @author Jeffrey Burdges 26 * 27 * @file 28 * SOCKS proxy for connections 29 * 30 * @defgroup socks SOCKS proxy 31 * SOCKS proxy for connections. 32 * @{ 33 */ 34 35 #ifndef GNUNET_SOCKS_H 36 #define GNUNET_SOCKS_H 37 38 #ifdef __cplusplus 39 extern "C" 40 { 41 #if 0 /* keep Emacsens' auto-indent happy */ 42 } 43 #endif 44 #endif 45 46 47 #include "gnunet_common.h" 48 49 50 /** 51 * Check if a SOCKS proxy is required by a service. Do not use local service 52 * if a SOCKS proxy port is configured as this could deanonymize a user. 53 * 54 * @param service_name name of service to connect to 55 * @param cfg configuration to use 56 * @return GNUNET_YES if so, GNUNET_NO if not 57 */ 58 int 59 GNUNET_SOCKS_check_service (const char *service_name, 60 const struct GNUNET_CONFIGURATION_Handle *cfg); 61 62 63 /** 64 * Try to connect to a service configured to use a SOCKS5 proxy. 65 * 66 * @param service_name name of service to connect to 67 * @param cfg configuration to use 68 * @return Connection handle that becomes usable when the handshake completes. 69 * NULL if SOCKS not configured or not configured properly 70 */ 71 struct GNUNET_CONNECTION_Handle * 72 GNUNET_SOCKS_do_connect (const char *service_name, 73 const struct GNUNET_CONFIGURATION_Handle *cfg); 74 75 76 #if 0 /* keep Emacsens' auto-indent happy */ 77 { 78 #endif 79 #ifdef __cplusplus 80 } 81 #endif 82 83 /* ifndef GNUNET_SOCKS_H */ 84 #endif 85 86 /** @} */ /* end of group */ 87 88 /** @} */ /* end of group addition to libgnunetutil */ 89 90 /* end of gnunet_socks.h */