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>
|
||||
#include <lib/md5.h>
|
||||
extern "C"{
|
||||
#include "lib/aes.h"
|
||||
#include "lib/md5.h"
|
||||
}
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <encrypt.h>
|
||||
#include <common.h>
|
||||
#include "encrypt.h"
|
||||
#include "common.h"
|
||||
#include "log.h"
|
||||
|
||||
//static uint64_t seq=1;
|
||||
|
2
log.h
2
log.h
@ -44,7 +44,7 @@
|
||||
|
||||
#include <sys/timerfd.h>
|
||||
#include <set>
|
||||
#include <encrypt.h>
|
||||
#include "encrypt.h"
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
|
4
main.cpp
4
main.cpp
@ -1,7 +1,9 @@
|
||||
#include "common.h"
|
||||
#include "network.h"
|
||||
#include "log.h"
|
||||
#include "lib/md5.h"
|
||||
extern "C" {
|
||||
#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";
|
||||
u32_t local_address_uint32,remote_address_uint32,source_address_uint32;
|
||||
|
Loading…
x
Reference in New Issue
Block a user