[问题]在2.6.22的内核下,target处理函数里如何取出subuff的数据包的内容和targinfo的数�

编译打包和其他
回复
kofield
帖子: 1
注册时间: 2007-09-03 10:55

[问题]在2.6.22的内核下,target处理函数里如何取出subuff的数据包的内容和targinfo的数�

#1

帖子 kofield » 2008-04-26 9:52

我最近在做毕业设计,碰到一个问题,就是:2.6.22内核的里的sk_buff.h定义的sk_buff结构跟2.4内核的定义结构不一样,同时,2.6内核的x_tables.h中定义的xt_target结构中的
unsigned int (*target)(struct sk_buff **pskb,
const struct net_device *in,
const struct net_device *out,
unsigned int hooknum,
const struct xt_target *target,
const void *targinfo);
跟以前的
unsigned int (*target)(struct sk_buff **pskb,
unsigned int hooknum,
const struct net_device *in,
const struct net_device *out,
const void *targinfo,
void *userdata);
也不一样。

而我现在,需要定义一个自己的关于数据包内容处理target处理函数,这样,我就得在target处理函数里取出的数据包的内容和targinfo的数据的目标串,根据目标串检索数据包的内容,然后注册到ipt_target链表上。可是如何在target处理函数里取出的数据包的内容和targinfo的数据的目标串呢?
网上关于这个问题的资料都是基于旧的数据结构

希望大家能给点比较新的资料,谢谢!
回复