mirror of
https://github.com/wangyu-/udp2raw.git
synced 2025-01-19 14:29:34 +08:00
simplified protocal
This commit is contained in:
parent
0349c83254
commit
cf47d0a7a8
4
common.h
4
common.h
@ -66,6 +66,10 @@ const int conn_clear_ratio=10;
|
|||||||
const int conv_clear_min=5;
|
const int conv_clear_min=5;
|
||||||
const int conn_clear_min=1;
|
const int conn_clear_min=1;
|
||||||
|
|
||||||
|
const uint32_t conv_clear_interval=1000;
|
||||||
|
const uint32_t conn_clear_interval=1000;
|
||||||
|
|
||||||
|
|
||||||
const int max_fail_time=100000;
|
const int max_fail_time=100000;
|
||||||
|
|
||||||
|
|
||||||
|
@ -133,6 +133,7 @@ packet_info_t::packet_info_t()
|
|||||||
protocol = IPPROTO_TCP;
|
protocol = IPPROTO_TCP;
|
||||||
ack_seq = get_true_random_number();
|
ack_seq = get_true_random_number();
|
||||||
seq = get_true_random_number();
|
seq = get_true_random_number();
|
||||||
|
has_ts=0;
|
||||||
}
|
}
|
||||||
else if (raw_mode == mode_udp)
|
else if (raw_mode == mode_udp)
|
||||||
{
|
{
|
||||||
@ -141,6 +142,7 @@ packet_info_t::packet_info_t()
|
|||||||
else if (raw_mode == mode_icmp)
|
else if (raw_mode == mode_icmp)
|
||||||
{
|
{
|
||||||
protocol = IPPROTO_ICMP;
|
protocol = IPPROTO_ICMP;
|
||||||
|
icmp_seq=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -837,6 +839,7 @@ int recv_raw_icmp(raw_info_t &raw_info, char *&payload, int &payloadlen)
|
|||||||
|
|
||||||
if(ntohs(icmph->id)!=send_info.src_port)
|
if(ntohs(icmph->id)!=send_info.src_port)
|
||||||
{
|
{
|
||||||
|
mylog(log_debug,"icmp id mis-match,ignored\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user