simplified protocal

This commit is contained in:
wangyu 2017-08-02 18:57:27 +08:00 committed by wangyu
parent 0349c83254
commit cf47d0a7a8
3 changed files with 442 additions and 918 deletions

@ -66,6 +66,10 @@ const int conn_clear_ratio=10;
const int conv_clear_min=5;
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;

1353
main.cpp

File diff suppressed because it is too large Load Diff

@ -133,6 +133,7 @@ packet_info_t::packet_info_t()
protocol = IPPROTO_TCP;
ack_seq = get_true_random_number();
seq = get_true_random_number();
has_ts=0;
}
else if (raw_mode == mode_udp)
{
@ -141,6 +142,7 @@ packet_info_t::packet_info_t()
else if (raw_mode == mode_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)
{
mylog(log_debug,"icmp id mis-match,ignored\n");
return -1;
}