mirror of
https://github.com/wangyu-/udp2raw.git
synced 2025-02-26 08:59:34 +08:00
port fd64 to udp2raw
This commit is contained in:
parent
c3e1dab838
commit
6515d428e9
16
common.cpp
16
common.cpp
@ -593,7 +593,21 @@ int create_fifo(char * file)
|
||||
return fifo_fd;
|
||||
}
|
||||
|
||||
|
||||
void ip_port_t::from_u64(u64_t u64)
|
||||
{
|
||||
ip=get_u64_h(u64);
|
||||
port=get_u64_l(u64);
|
||||
}
|
||||
u64_t ip_port_t::to_u64()
|
||||
{
|
||||
return pack_u64(ip,port);
|
||||
}
|
||||
char * ip_port_t::to_s()
|
||||
{
|
||||
static char res[40];
|
||||
sprintf(res,"%s:%d",my_ntoa(ip),port);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
18
common.h
18
common.h
@ -70,6 +70,24 @@ typedef u64_t padding_t;
|
||||
|
||||
typedef u64_t anti_replay_seq_t;
|
||||
|
||||
|
||||
struct ip_port_t
|
||||
{
|
||||
u32_t ip;
|
||||
int port;
|
||||
void from_u64(u64_t u64);
|
||||
u64_t to_u64();
|
||||
char * to_s();
|
||||
};
|
||||
|
||||
struct fd_info_t
|
||||
{
|
||||
ip_port_t ip_port;
|
||||
};
|
||||
|
||||
|
||||
typedef u64_t fd64_t;
|
||||
|
||||
const int max_data_len=1600;
|
||||
const int buf_len=max_data_len+400;
|
||||
|
||||
|
2
makefile
2
makefile
@ -8,7 +8,7 @@ cc_arm= /toolchains/arm-2014.05/bin/arm-none-linux-gnueabi-g++
|
||||
#cc_bcm2708=/home/wangyu/raspberry/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++
|
||||
FLAGS= -std=c++11 -Wall -Wextra -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers
|
||||
|
||||
COMMON=main.cpp lib/md5.c encrypt.cpp log.cpp network.cpp common.cpp connection.cpp misc.cpp -lpthread
|
||||
COMMON=main.cpp lib/md5.c encrypt.cpp log.cpp network.cpp common.cpp connection.cpp misc.cpp fd_manager.cpp -lpthread
|
||||
SOURCES= $(COMMON) lib/aes_faster_c/aes.c lib/aes_faster_c/wrapper.c
|
||||
SOURCES_TINY_AES= $(COMMON) lib/aes.c
|
||||
SOURCES_AES_ACC=$(COMMON) $(wildcard lib/aes_acc/aes*.c)
|
||||
|
Loading…
x
Reference in New Issue
Block a user