2014年3月27日

摘要: bpf 指令用于过滤逻辑 (filter program) 是有一个指令数组表示。只有向前跳转ret指令结束过滤每一个指令操作 bpf虚拟机的内部状态包括 累加器:accumulator, 指示器:index register, bpf内存:memory store, pc 程序指针: program counter.指令格式/** The instruction data structure.*/struct bpf_insn { u_short code; /* 16bit 这条指令做什么 */ u_char jt; /* jump if true 如果为真 跳转的位置 */ u_ch.. 阅读全文
posted @ 2014-03-27 23:10 kwingmei 阅读(1555) 评论(0) 推荐(0) 编辑
摘要: 在pcap_compile 函数中root = NULL; // root就是 struct block的指针...中间没有对root 操作,if (root == NULL) root = gen_retblk(snaplen_arg);有必要判断吗? 有必要的root 是应全局变量事实上 在结束解析函数 finish_parse 有对全局变量的赋值, 这个赋值也是对整个解析结果的保存。 而root block也就是 cfg(control flow graph的根 root即取其义)中间的***** (void)pcap_parse(); *******if (root == NULL.. 阅读全文
posted @ 2014-03-27 00:49 kwingmei 阅读(264) 评论(0) 推荐(0) 编辑

导航