mirror of
https://github.com/wangyu-/udp2raw.git
synced 2025-01-19 14:29:34 +08:00
add cmake support and fix compile errors
This commit is contained in:
parent
eb8567b693
commit
ed6416a30d
17
CMakeLists.txt
Normal file
17
CMakeLists.txt
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.7)
|
||||||
|
project(udp2raw_tunnel)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
|
||||||
|
set(SOURCE_FILES
|
||||||
|
lib/aes.c
|
||||||
|
lib/md5.c
|
||||||
|
common.cpp
|
||||||
|
encrypt.cpp
|
||||||
|
log.cpp
|
||||||
|
main.cpp
|
||||||
|
network.cpp
|
||||||
|
)
|
||||||
|
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-variable -Wno-unused-parameter -static")
|
||||||
|
set(CMAKE_LINK_LIBRARY_FLAG "-lrt")
|
||||||
|
add_executable(udp2raw_tunnel ${SOURCE_FILES})
|
10
encrypt.cpp
10
encrypt.cpp
@ -1,11 +1,13 @@
|
|||||||
#include <lib/aes.h>
|
extern "C"{
|
||||||
#include <lib/md5.h>
|
#include "lib/aes.h"
|
||||||
|
#include "lib/md5.h"
|
||||||
|
}
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <encrypt.h>
|
#include "encrypt.h"
|
||||||
#include <common.h>
|
#include "common.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
//static uint64_t seq=1;
|
//static uint64_t seq=1;
|
||||||
|
2
log.cpp
2
log.cpp
@ -1,4 +1,4 @@
|
|||||||
#include <log.h>
|
#include "log.h"
|
||||||
|
|
||||||
int log_level=log_info;
|
int log_level=log_info;
|
||||||
|
|
||||||
|
2
log.h
2
log.h
@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
#include <sys/timerfd.h>
|
#include <sys/timerfd.h>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <encrypt.h>
|
#include "encrypt.h"
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
2
main.cpp
2
main.cpp
@ -1,7 +1,9 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
extern "C" {
|
||||||
#include "lib/md5.h"
|
#include "lib/md5.h"
|
||||||
|
}
|
||||||
|
|
||||||
char local_address[100]="0.0.0.0", remote_address[100]="255.255.255.255",source_address[100]="0.0.0.0";
|
char local_address[100]="0.0.0.0", remote_address[100]="255.255.255.255",source_address[100]="0.0.0.0";
|
||||||
u32_t local_address_uint32,remote_address_uint32,source_address_uint32;
|
u32_t local_address_uint32,remote_address_uint32,source_address_uint32;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user