易截截图软件、单文件、免安装、纯绿色、仅160KB

Linux netfilter源码分析(6)

转贴自:http://alexanderlaw.blog.hexun.com/8968944_d.html
六、 扩展的match
 
6.1 do_match函数  ip_tables.c
do_match通过IPT_MATCH_ITERATE宏来调用,
IPT_MATCH_ITERATE是在ipt_do_table函数中调用的宏
IPT_MATCH_ITERATE(e, do_match,
                                  *pskb, in, out,
                                  offset, &hotdrop)
定义如下:
#define IPT_MATCH_ITERATE(e, fn, args...)      \
({                               \
      unsigned int __i;               \
      int __ret = 0;                    \
      struct ipt_entry_match *__match;  \
                                  \
      for (__i = sizeof(struct ipt_entry);  \
           __i < (e)->target_offset;        \
           __i += __match->u.match_size) {      \
           __match = (void *)(e) + __i;    \
      &


相关文档:

实战Linux Bluetooth编程(三) HCI层编程

1. HCI层协议概述:
HCI提供一套统一的方法来访问Bluetooth底层。如图所示:
从图上可以看出,Host Controller Interface(HCI)  就是用来沟通Host和Module。Host通常就是PC, Module则是以各种物理连接形式(USB,serial,pc-card等)连接到PC上的bluetooth Dongle。
在Host这一端:application,SDP,L2cap等协议 ......

Linux环境进程间通信(三)


Linux环境进程间通信(三)
消息队列
文档选项
<tr
valign="top"><td width="8"><img alt="" height="1" width="8"
src="//www.ibm.com/i/c.gif"/></td><td width="16"><img alt="" width=" ......

Linux netfilter源码分析(4)


四、nf_hook_ops 钩子的注册
在filter表的初始化函数static int __init init(void)中除了有一个nf_register_hook函数注册一个tables外,还由nf_register_hook函数注册了3个hook
 
4.1        nf_hook_ops数据结构 netfilter.h
struct nf_hook_ops
{
      ......

Linux netfilter源码分析(5)


五、 ipt_do_table()函数,数据包的过滤
 
5.1          ipt_entry 相关结构  ip_tables.h
ipt_entry结构前面有过了,再看一遍
struct ipt_entry
{
struct ipt_ip ip;
/* 所要匹配的报文的IP头信息 */
unsigned int nfcache;
/* 位向量,标示本规则关心 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号