Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
tun
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
tun
Commits
b608bc36
Commit
b608bc36
authored
Sep 15, 2022
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new
parent
87a89fc4
Pipeline
#16669
passed with stages
in 45 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
CMakeLists.txt
CMakeLists.txt
+3
-3
src/Router.h
src/Router.h
+5
-1
src/main.cpp
src/main.cpp
+2
-6
No files found.
CMakeLists.txt
View file @
b608bc36
...
...
@@ -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
src/Router.h
View file @
b608bc36
...
...
@@ -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
src/main.cpp
View file @
b608bc36
#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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment