Commit b608bc36 authored by 神楽坂玲奈's avatar 神楽坂玲奈

new

parent 87a89fc4
Pipeline #16669 passed with stages
in 45 seconds
......@@ -3,7 +3,7 @@ project(tun)
set(CMAKE_CXX_STANDARD 23)
add_executable(tun src/main.cpp)
add_executable(tun src/Config.h src/Router.h src/checksum.h src/main.cpp)
set(CMAKE_CXX_FLAGS_DEBUG -ggdb)
......@@ -13,5 +13,5 @@ target_link_libraries(tun Threads::Threads)
find_package(nlohmann_json REQUIRED)
target_link_libraries(tun nlohmann_json::nlohmann_json)
find_package(Boost REQUIRED)
target_link_libraries(tun Boost)
\ No newline at end of file
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost REQUIRED)
\ No newline at end of file
......@@ -3,12 +3,12 @@
#include "Config.h"
#include <boost/core/noncopyable.hpp>
#include <netdb.h>
#include <linux/if.h>
#include <linux/if_tun.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <boost/beast/core/detail/base64.hpp>
#include <netdb.h>
class Router : private boost::noncopyable {
public:
......@@ -92,4 +92,8 @@ public:
}
};
std::map<int, Router *> Router::all = {};
std::map<std::pair<unsigned char, unsigned char>, int> Router::raws = {};
unsigned char Router::local_secret[Router::secret_length] = {};
#endif
#include <iostream>
#include <thread>
#include <sys/socket.h>
#include <linux/ip.h>
#include <linux/if_tun.h>
#include <unistd.h>
#include <cstring>
#include <nlohmann/json.hpp>
#include <linux/ipv6.h>
#include <vector>
#include <linux/ip.h>
#include "checksum.h"
#include "Config.h"
#include "Router.h"
#include <linux/ipv6.h>
using json = nlohmann::json;
struct Meta {
unsigned char src_id;
unsigned char dst_id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment