tools: add dvpn
dvpn tool is a VPN based on the DHTNET stack. The tool creates a TUN interface to efficiently route traffic to the destination.
For the client side, upon establishing a connection, the tool creates a TUN interface and sets it as the default route in the routing table, excluding traffic destined for the peer. On the server side, a TUN interface is created, and NAT configuration is used to respond to client requests.
Change-Id: I43ff43982930d97502a64d15aeb2c8df283bdda9
GitLab: #13
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a2272fa..c26432e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,7 +51,8 @@
set(MSGPACK_TARGET "msgpackc-cxx")
endif()
endif()
-
+ find_package(yaml-cpp REQUIRED)
+ include_directories(${YAML_CPP_INCLUDE_DIR})
find_package(fmt)
pkg_search_module (opendht REQUIRED IMPORTED_TARGET opendht)
pkg_search_module (pjproject REQUIRED IMPORTED_TARGET libpjproject)
@@ -252,9 +253,17 @@
tools/dsh/dsh.cpp
tools/common.cpp)
target_link_libraries(dsh PRIVATE dhtnet fmt::fmt)
- target_include_directories(dnc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tools)
+ target_include_directories(dsh PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tools)
install(TARGETS dsh RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+ add_executable(dvpn
+ tools/dvpn/main.cpp
+ tools/dvpn/dvpn.cpp
+ tools/common.cpp)
+ target_link_libraries(dvpn PRIVATE dhtnet fmt::fmt yaml-cpp)
+ target_include_directories(dvpn PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tools)
+ install(TARGETS dvpn RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+
find_library(READLINE_LIBRARIES readline)
find_path(READLINE_INCLUDE_DIR readline/readline.h)
add_library(readline STATIC IMPORTED)