摘要: if (!(a_tcp = find_stream(this_tcphdr, this_iphdr, &from_client))) {//没有找到 if ((this_tcphdr->th_flags & TH_SYN) && //报文头SYN为1!(this_tcphdr->th_flags & TH_ACK) &&//报文头ACK为0!(this_tcphdr->th_flags & TH_RST))//报文头RST为0 add_new_tcp(this_tcphdr, this_iphdr);//加入新包 阅读全文
posted @ 2011-08-26 14:38 戴安澜式编程 阅读(428) 评论(0) 推荐(0) 编辑
摘要: [1] IP四元组hashu_intmkhash (u_int src, u_short sport, u_int dest, u_short dport){ u_int res = 0; int i; u_char data[12]; u_int *stupid_strict_aliasing_warnings=(u_int*)data; *stupid_strict_aliasing_warnings = src; *(u_int *) (data + 4) = dest; *(u_short *) (data + 8) = sport; *(u_short *) (data + 10) 阅读全文
posted @ 2011-08-26 11:46 戴安澜式编程 阅读(767) 评论(0) 推荐(0) 编辑