1 /*
2  * Copyright (c) 2019 Antmicro Ltd
3  *
4  * Copyright (c) 2019 Intel Corporation
5  *
6  * SPDX-License-Identifier: Apache-2.0
7  */
8 
9 #ifndef ZEPHYR_INCLUDE_NET_SOCKS_H_
10 #define ZEPHYR_INCLUDE_NET_SOCKS_H_
11 
12 #include <zephyr/net/socket.h>
13 
14 /**@brief Connects to destination through a SOCKS5 proxy server.
15  *
16  * @param[in] ctx Network context.
17  * @param[in] dest Address of the destination server.
18  * @param[in] dest_len Address length of the destination server.
19  *
20  * @retval 0 or an error code if it was unsuccessful.
21  */
22 #if defined(CONFIG_SOCKS)
23 int net_socks5_connect(struct net_context *ctx,
24 		       const struct sockaddr *dest,
25 		       socklen_t dest_len);
26 #else
net_socks5_connect(struct net_context * ctx,const struct sockaddr * dest,socklen_t dest_len)27 inline int net_socks5_connect(struct net_context *ctx,
28 			      const struct sockaddr *dest,
29 			      socklen_t dest_len)
30 {
31 	ARG_UNUSED(ctx);
32 	ARG_UNUSED(dest);
33 	ARG_UNUSED(dest_len);
34 
35 	return -ENOTSUP;
36 }
37 #endif
38 
39 #endif /* ZEPHYR_INCLUDE_NET_SOCKS_H_ */
40