فهرست منبع

simplified protocal

wangyu 8 سال پیش
والد
کامیت
cf47d0a7a8
3فایلهای تغییر یافته به همراه397 افزوده شده و 363 حذف شده
  1. 4 0
      common.h
  2. 390 363
      main.cpp
  3. 3 0
      network.cpp

+ 4 - 0
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;
 
 
 
 

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 390 - 363
main.cpp


+ 3 - 0
network.cpp

@@ -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;
 	}
 	}
 
 

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است