2019-02-04 23:09:30 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2019 Antmicro Ltd
|
|
|
|
*
|
2019-08-01 21:04:54 +08:00
|
|
|
* Copyright (c) 2019 Intel Corporation
|
|
|
|
*
|
2019-02-04 23:09:30 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ZEPHYR_INCLUDE_NET_SOCKS_H_
|
|
|
|
#define ZEPHYR_INCLUDE_NET_SOCKS_H_
|
|
|
|
|
|
|
|
#include <net/socket.h>
|
|
|
|
|
|
|
|
/**@brief Connects to destination through a SOCKS5 proxy server.
|
|
|
|
*
|
2019-08-01 21:04:54 +08:00
|
|
|
* @param[in] ctx Network context.
|
|
|
|
* @param[in] dest Address of the destination server.
|
|
|
|
* @param[in] dest_len Address length of the destination server.
|
2019-02-04 23:09:30 +08:00
|
|
|
*
|
2019-08-01 21:04:54 +08:00
|
|
|
* @retval 0 or an error code if it was unsuccessful.
|
2019-02-04 23:09:30 +08:00
|
|
|
*/
|
|
|
|
#if defined(CONFIG_SOCKS)
|
2019-08-01 21:04:54 +08:00
|
|
|
int net_socks5_connect(struct net_context *ctx,
|
|
|
|
const struct sockaddr *dest,
|
|
|
|
socklen_t dest_len);
|
2019-02-04 23:09:30 +08:00
|
|
|
#else
|
2019-08-01 21:04:54 +08:00
|
|
|
inline int net_socks5_connect(struct net_context *ctx,
|
|
|
|
const struct sockaddr *dest,
|
|
|
|
socklen_t dest_len)
|
2019-02-04 23:09:30 +08:00
|
|
|
{
|
2019-08-01 21:04:54 +08:00
|
|
|
ARG_UNUSED(ctx);
|
|
|
|
ARG_UNUSED(dest);
|
|
|
|
ARG_UNUSED(dest_len);
|
2019-02-04 23:09:30 +08:00
|
|
|
|
2019-08-01 21:04:54 +08:00
|
|
|
return -ENOTSUP;
|
2019-02-04 23:09:30 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* ZEPHYR_INCLUDE_NET_SOCKS_H_ */
|