摘要: 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 戴安澜式编程 阅读(424) 评论(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) 编辑
摘要: 1、主页地址:http://www.pcre.org/ 下载pcre-7.8.tar.bz22、解压缩: tar xjpf pcre-7.8.tar.bz23、配置: cd pcre-7.8 ./configure --prefix=/usr/local/pcre-7.8 --libdir=/usr/local/lib/pcre --includedir=/usr/local/include/pcre configure有许多参数可配,具体参见./configure --help及手册4、编译: make5、安装: make install6、检查: ls /usr/local 检查是否有pc 阅读全文
posted @ 2011-08-17 16:26 戴安澜式编程 阅读(24281) 评论(0) 推荐(1) 编辑
摘要: #include <stdio.h>void f(int a){printf("number is:%d\n",a);}typedef void(*k)();k getfunc(){return f;}int main(){k k1;k1=getfunc();k1(4);} 阅读全文
posted @ 2011-07-20 15:17 戴安澜式编程 阅读(212) 评论(0) 推荐(0) 编辑