全部博文(230)
标题 | 阅读 | 评论 | 转发 | 发布日期 | |
---|---|---|---|---|---|
替换内核 LOGO | 2120 | 0 | 1 | 2009-10-31 | |
计算机中的单位、进制关系 | 1946 | 0 | 0 | 2009-08-27 | |
High Memory In The Linux Kernel | 3069 | 0 | 1 | 2009-08-03 | |
64byte 的数据包(最小包)的个数计算方法 | 6444 | 0 | 2 | 2009-06-18 | |
bash [ -flag ] CONDITIONAL EXPRESSIONS | 2719 | 0 | 0 | 2008-11-06 | |
Interfaces in the Linux kernel | 2365 | 0 | 0 | 2008-11-06 | |
赤壁?IVM? | 2531 | 1 | 0 | 2008-08-14 | |
劣根性? | 2165 | 0 | 0 | 2008-08-14 | |
FireFox 插件介绍 - Forecastfox | 2287 | 0 | 0 | 2008-08-14 | |
老了 | 1869 | 0 | 0 | 2008-08-14 | |
金科玉律 | 2072 | 0 | 0 | 2008-07-25 | |
成熟 | 2212 | 0 | 0 | 2008-05-30 | |
你知道如何爱一个女人吗? | 2156 | 1 | 0 | 2008-05-29 | |
坦然看人生 | 1811 | 0 | 0 | 2008-05-27 | |
skb 的分配细节 | 8452 | 1 | 1 | 2008-05-14 | |
Redhat 官方对于 Linux 内存使用的解释 | 3475 | 1 | 0 | 2008-04-17 | |
ipp2p VS. l7-filter | 7101 | 3 | 3 | 2008-01-14 | |
网络中每帧的数据在 skbuff 中是线性的吗? | 2907 | 0 | 0 | 2008-01-13 | |
how to write netfilter connection tracking helper | 3916 | 0 | 3 | 2007-12-15 | |
C Hash Table | 3615 | 0 | 2 | 2007-12-03 |
phoenixcsl2015-05-26 09:57
hi,platinum,请问netfilter能够过滤arp的东西吗?我写了一些代码,在NF_ARP_IN和OUT捕获一些信息,但是为什么什么都抓不到?
代码:
static unsigned int hook_func_in(unsigned int hooknum,
struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out,
int (*okfn)(struct sk_buff*))
{
sb = skb;
ethh = eth_hdr(skb);
printk(" in skb ethh dest %s\n",ethh->h_dest);
printk("in skb ethh source %s\n",ethh->h_source);
return NF_ACCEPT;
}
static struct nf_hook_ops nfho_ops[]=
{
.hook = hook_func_in,
.owner = THIS_MODULE,
.pf =NF_ARP,
.hooknum = NF_ARP_IN,
.priority = NF_IP_PRI_FIRST,
}
static struct nf_hook_ops nfho_ops[]=
{
.hook = hook_func_in,
.owner = THIS_MODULE,
.pf =NF_ARP,
.hooknum = NF_ARP_IN,
.priority = NF_IP_PRI_FIRST,
}