mirror of
https://github.com/wangyu-/udp2raw.git
synced 2025-09-18 21:24:27 +08:00
Compare commits
8 Commits
20170906.0
...
20170910.0
Author | SHA1 | Date | |
---|---|---|---|
|
cf5774d2f4 | ||
|
2810a72a72 | ||
|
f8e64b03de | ||
|
2a4f50a6c6 | ||
|
82771f9e39 | ||
|
9a959c2dcf | ||
|
206dd1565c | ||
|
515d4e1dd8 |
14
README.md
14
README.md
@@ -92,7 +92,7 @@ You can run udp2raw with a non-root account(for better security).Take a look at
|
|||||||
### Usage
|
### Usage
|
||||||
```
|
```
|
||||||
udp2raw-tunnel
|
udp2raw-tunnel
|
||||||
version: Aug 26 2017 08:30:48
|
git version:adbe7d110f build date:Sep 6 2017 05:37:45
|
||||||
repository: https://github.com/wangyu-/udp2raw-tunnel
|
repository: https://github.com/wangyu-/udp2raw-tunnel
|
||||||
|
|
||||||
usage:
|
usage:
|
||||||
@@ -122,10 +122,14 @@ other options:
|
|||||||
--disable-bpf disable the kernel space filter,most time its not necessary
|
--disable-bpf disable the kernel space filter,most time its not necessary
|
||||||
unless you suspect there is a bug
|
unless you suspect there is a bug
|
||||||
--sock-buf <number> buf size for socket,>=10 and <=10240,unit:kbyte,default:1024
|
--sock-buf <number> buf size for socket,>=10 and <=10240,unit:kbyte,default:1024
|
||||||
--seqmode <number> seq increase mode for faketcp:
|
--force-sock-buf bypass system limitation while setting sock-buf
|
||||||
0:dont increase
|
--seq-mode <number> seq increase mode for faketcp:
|
||||||
1:increase every packet(default)
|
0:static header,do not increase seq and ack_seq
|
||||||
2:increase randomly, about every 3 packets
|
1:increase seq for every packet,simply ack last seq
|
||||||
|
2:increase seq randomly, about every 3 packets,simply ack last seq
|
||||||
|
3:simulate an almost real seq/ack procedure(default)
|
||||||
|
4:similiar to 3,but do not consider TCP Option Window_Scale,
|
||||||
|
maybe useful when firewall doesnt support TCP Option
|
||||||
--lower-level <string> send packets at OSI level 2, format:'if_name#dest_mac_adress'
|
--lower-level <string> send packets at OSI level 2, format:'if_name#dest_mac_adress'
|
||||||
ie:'eth0#00:23:45:67:89:b9'.or try '--lower-level auto' to obtain
|
ie:'eth0#00:23:45:67:89:b9'.or try '--lower-level auto' to obtain
|
||||||
the parameter automatically,specify it manually if 'auto' failed
|
the parameter automatically,specify it manually if 'auto' failed
|
||||||
|
@@ -93,7 +93,7 @@ udp2raw可以用非root账号运行,这样更安全。具体方法见:[#26](
|
|||||||
### 命令选项
|
### 命令选项
|
||||||
```
|
```
|
||||||
udp2raw-tunnel
|
udp2raw-tunnel
|
||||||
version: Aug 26 2017 08:30:48
|
git version:adbe7d110f build date:Sep 6 2017 05:37:45
|
||||||
repository: https://github.com/wangyu-/udp2raw-tunnel
|
repository: https://github.com/wangyu-/udp2raw-tunnel
|
||||||
|
|
||||||
usage:
|
usage:
|
||||||
@@ -123,10 +123,14 @@ other options:
|
|||||||
--disable-bpf disable the kernel space filter,most time its not necessary
|
--disable-bpf disable the kernel space filter,most time its not necessary
|
||||||
unless you suspect there is a bug
|
unless you suspect there is a bug
|
||||||
--sock-buf <number> buf size for socket,>=10 and <=10240,unit:kbyte,default:1024
|
--sock-buf <number> buf size for socket,>=10 and <=10240,unit:kbyte,default:1024
|
||||||
--seqmode <number> seq increase mode for faketcp:
|
--force-sock-buf bypass system limitation while setting sock-buf
|
||||||
0:dont increase
|
--seq-mode <number> seq increase mode for faketcp:
|
||||||
1:increase every packet(default)
|
0:static header,do not increase seq and ack_seq
|
||||||
2:increase randomly, about every 3 packets
|
1:increase seq for every packet,simply ack last seq
|
||||||
|
2:increase seq randomly, about every 3 packets,simply ack last seq
|
||||||
|
3:simulate an almost real seq/ack procedure(default)
|
||||||
|
4:similiar to 3,but do not consider TCP Option Window_Scale,
|
||||||
|
maybe useful when firewall doesnt support TCP Option
|
||||||
--lower-level <string> send packets at OSI level 2, format:'if_name#dest_mac_adress'
|
--lower-level <string> send packets at OSI level 2, format:'if_name#dest_mac_adress'
|
||||||
ie:'eth0#00:23:45:67:89:b9'.or try '--lower-level auto' to obtain
|
ie:'eth0#00:23:45:67:89:b9'.or try '--lower-level auto' to obtain
|
||||||
the parameter automatically,specify it manually if 'auto' failed
|
the parameter automatically,specify it manually if 'auto' failed
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
#### run at client side
|
#### run at client side
|
||||||
assume server ip is 45.66.77.88
|
assume server ip is 45.66.77.88
|
||||||
```
|
```
|
||||||
./udp2raw_amd64 -s -l0.0.0.0:3333 -r 45.66.77.88:8855 -k "passwd" --raw-mode faketcp -a
|
./udp2raw_amd64 -c -l0.0.0.0:3333 -r 45.66.77.88:8855 -k "passwd" --raw-mode faketcp -a
|
||||||
```
|
```
|
||||||
|
|
||||||
#### hint
|
#### hint
|
||||||
|
2
main.cpp
2
main.cpp
@@ -2621,7 +2621,7 @@ void print_help()
|
|||||||
// printf("\n");
|
// printf("\n");
|
||||||
printf(" --sock-buf <number> buf size for socket,>=10 and <=10240,unit:kbyte,default:1024\n");
|
printf(" --sock-buf <number> buf size for socket,>=10 and <=10240,unit:kbyte,default:1024\n");
|
||||||
printf(" --force-sock-buf bypass system limitation while setting sock-buf\n");
|
printf(" --force-sock-buf bypass system limitation while setting sock-buf\n");
|
||||||
printf(" --seqmode <number> seq increase mode for faketcp:\n");
|
printf(" --seq-mode <number> seq increase mode for faketcp:\n");
|
||||||
printf(" 0:static header,do not increase seq and ack_seq\n");
|
printf(" 0:static header,do not increase seq and ack_seq\n");
|
||||||
printf(" 1:increase seq for every packet,simply ack last seq\n");
|
printf(" 1:increase seq for every packet,simply ack last seq\n");
|
||||||
printf(" 2:increase seq randomly, about every 3 packets,simply ack last seq\n");
|
printf(" 2:increase seq randomly, about every 3 packets,simply ack last seq\n");
|
||||||
|
18
makefile
18
makefile
@@ -1,6 +1,8 @@
|
|||||||
cc_cross=/home/wangyu/Desktop/arm-2014.05/bin/arm-none-linux-gnueabi-g++
|
cc_cross=/home/wangyu/Desktop/arm-2014.05/bin/arm-none-linux-gnueabi-g++
|
||||||
cc_local=g++
|
cc_local=g++
|
||||||
cc_mips34kc=/toolchains/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-g++
|
#cc_mips34kc=/toolchains/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-g++
|
||||||
|
cc_mips24kc_be=/toolchains/lede-sdk-17.01.2-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-5.4.0_musl-1.1.16/bin/mips-openwrt-linux-musl-g++
|
||||||
|
cc_mips24kc_le=/toolchains/lede-sdk-17.01.2-ramips-mt7621_gcc-5.4.0_musl-1.1.16.Linux-x86_64/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/bin/mipsel-openwrt-linux-musl-g++
|
||||||
#cc_arm= /toolchains/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-g++ -march=armv6 -marm
|
#cc_arm= /toolchains/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-g++ -march=armv6 -marm
|
||||||
cc_arm= /toolchains/arm-2014.05/bin/arm-none-linux-gnueabi-g++
|
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++
|
#cc_bcm2708=/home/wangyu/raspberry/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++
|
||||||
@@ -10,7 +12,7 @@ SOURCES=main.cpp lib/aes.c lib/md5.c encrypt.cpp log.cpp network.cpp common.cpp
|
|||||||
SOURCES_AES_ACC=$(filter-out lib/aes.c,$(SOURCES)) $(wildcard lib/aes_acc/aes*.c)
|
SOURCES_AES_ACC=$(filter-out lib/aes.c,$(SOURCES)) $(wildcard lib/aes_acc/aes*.c)
|
||||||
|
|
||||||
NAME=udp2raw
|
NAME=udp2raw
|
||||||
TARGETS=amd64 mips34kc arm amd64_hw_aes arm_asm_aes mips34kc_asm_aes x86 x86_asm_aes
|
TARGETS=amd64 arm amd64_hw_aes arm_asm_aes mips24kc_be mips24kc_be_asm_aes x86 x86_asm_aes mips24kc_le mips24kc_le_asm_aes
|
||||||
TAR=${NAME}_binaries.tar.gz `echo ${TARGETS}|sed -r 's/([^ ]+)/udp2raw_\1/g'`
|
TAR=${NAME}_binaries.tar.gz `echo ${TARGETS}|sed -r 's/([^ ]+)/udp2raw_\1/g'`
|
||||||
|
|
||||||
all:git_version
|
all:git_version
|
||||||
@@ -26,11 +28,15 @@ debug2: git_version
|
|||||||
rm -f ${NAME}
|
rm -f ${NAME}
|
||||||
${cc_local} -o ${NAME} -I. ${SOURCES} ${FLAGS} -lrt -Wformat-nonliteral -ggdb
|
${cc_local} -o ${NAME} -I. ${SOURCES} ${FLAGS} -lrt -Wformat-nonliteral -ggdb
|
||||||
|
|
||||||
mips34kc: git_version
|
mips24kc_be: git_version
|
||||||
${cc_mips34kc} -o ${NAME}_$@ -I. ${SOURCES} ${FLAGS} -lrt -lgcc_eh -static -O3
|
${cc_mips24kc_be} -o ${NAME}_$@ -I. ${SOURCES} ${FLAGS} -lrt -lgcc_eh -static -O3
|
||||||
|
mips24kc_be_asm_aes: git_version
|
||||||
|
${cc_mips24kc_be} -o ${NAME}_$@ -I. ${SOURCES_AES_ACC} ${FLAGS} -lrt -lgcc_eh -static -O3 lib/aes_acc/asm/mips_be.S
|
||||||
|
|
||||||
mips34kc_asm_aes: git_version
|
mips24kc_le: git_version
|
||||||
${cc_mips34kc} -o ${NAME}_$@ -I. ${SOURCES_AES_ACC} ${FLAGS} -lrt -lgcc_eh -static -O3 lib/aes_acc/asm/mips_be.S
|
${cc_mips24kc_le} -o ${NAME}_$@ -I. ${SOURCES} ${FLAGS} -lrt -lgcc_eh -static -O3
|
||||||
|
mips24kc_le_asm_aes: git_version
|
||||||
|
${cc_mips24kc_le} -o ${NAME}_$@ -I. ${SOURCES_AES_ACC} ${FLAGS} -lrt -lgcc_eh -static -O3 lib/aes_acc/asm/mips.S
|
||||||
|
|
||||||
#bcm2708:
|
#bcm2708:
|
||||||
# ${cc_bcm2708} -o ${NAME}_bcm2708 -I. ${SOURCES} ${FLAGS} -lrt -static -O3
|
# ${cc_bcm2708} -o ${NAME}_bcm2708 -I. ${SOURCES} ${FLAGS} -lrt -static -O3
|
||||||
|
@@ -1687,12 +1687,12 @@ int after_send_raw0(raw_info_t &raw_info)
|
|||||||
{
|
{
|
||||||
send_info.seq=raw_info.recv_info.ack_seq;
|
send_info.seq=raw_info.recv_info.ack_seq;
|
||||||
}
|
}
|
||||||
if(recv_info.ack_seq_counter>=3)
|
if(recv_info.ack_seq_counter>=3) //simulate tcp fast re-transmit
|
||||||
{
|
{
|
||||||
recv_info.ack_seq_counter=0;
|
recv_info.ack_seq_counter=0;
|
||||||
send_info.seq=raw_info.recv_info.ack_seq;
|
send_info.seq=raw_info.recv_info.ack_seq;
|
||||||
}
|
}
|
||||||
if(larger_than_u32(raw_info.recv_info.ack_seq,send_info.seq)) //for further use,currently not useful.
|
if(larger_than_u32(raw_info.recv_info.ack_seq,send_info.seq)) //for further use,currently no effect.
|
||||||
{
|
{
|
||||||
send_info.seq=raw_info.recv_info.ack_seq;
|
send_info.seq=raw_info.recv_info.ack_seq;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user