net: socks: Prefer setsockopt() API instead of legacy proxy api

Applications should use setsockopt() to setup the SOCKS5 proxy,
so the old API file, which is using net_context directly, is
moved SOCKS5 directory.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2019-10-24 13:00:36 +03:00
commit f6f4467098
4 changed files with 10 additions and 2 deletions

View file

@ -21,4 +21,8 @@ if(CONFIG_NET_SOCKETS_NET_MGMT)
zephyr_include_directories(${ZEPHYR_BASE}/subsys/net/ip) zephyr_include_directories(${ZEPHYR_BASE}/subsys/net/ip)
endif() endif()
if(CONFIG_SOCKS)
zephyr_include_directories(${ZEPHYR_BASE}/subsys/net/lib/socks)
endif()
zephyr_link_libraries_ifdef(CONFIG_MBEDTLS mbedTLS) zephyr_link_libraries_ifdef(CONFIG_MBEDTLS mbedTLS)

View file

@ -18,7 +18,11 @@ LOG_MODULE_REGISTER(net_sock, CONFIG_NET_SOCKETS_LOG_LEVEL);
#include <syscall_handler.h> #include <syscall_handler.h>
#include <sys/fdtable.h> #include <sys/fdtable.h>
#include <sys/math_extras.h> #include <sys/math_extras.h>
#include <net/socks.h>
#if defined(CONFIG_SOCKS)
#include "socks.h"
#endif
#include "../../ip/net_stats.h" #include "../../ip/net_stats.h"
#include "sockets_internal.h" #include "sockets_internal.h"

View file

@ -11,9 +11,9 @@ LOG_MODULE_REGISTER(net_socks, CONFIG_SOCKS_LOG_LEVEL);
#include <zephyr.h> #include <zephyr.h>
#include <net/socket.h> #include <net/socket.h>
#include <net/socks.h>
#include <net/net_pkt.h> #include <net/net_pkt.h>
#include "socks.h"
#include "socks_internal.h" #include "socks_internal.h"
static void socks5_method_rsp_cb(struct net_context *ctx, static void socks5_method_rsp_cb(struct net_context *ctx,