全部博文(230)
标题 | 阅读 | 评论 | 转发 | 发布日期 | |
---|---|---|---|---|---|
替换内核 LOGO | 2127 | 0 | 1 | 2009-10-31 | |
计算机中的单位、进制关系 | 1952 | 0 | 0 | 2009-08-27 | |
High Memory In The Linux Kernel | 3076 | 0 | 1 | 2009-08-03 | |
64byte 的数据包(最小包)的个数计算方法 | 6460 | 0 | 2 | 2009-06-18 | |
bash [ -flag ] CONDITIONAL EXPRESSIONS | 2725 | 0 | 0 | 2008-11-06 | |
Interfaces in the Linux kernel | 2375 | 0 | 0 | 2008-11-06 | |
赤壁?IVM? | 2539 | 1 | 0 | 2008-08-14 | |
劣根性? | 2173 | 0 | 0 | 2008-08-14 | |
FireFox 插件介绍 - Forecastfox | 2293 | 0 | 0 | 2008-08-14 | |
老了 | 1876 | 0 | 0 | 2008-08-14 | |
金科玉律 | 2087 | 0 | 0 | 2008-07-25 | |
成熟 | 2226 | 0 | 0 | 2008-05-30 | |
你知道如何爱一个女人吗? | 2163 | 1 | 0 | 2008-05-29 | |
坦然看人生 | 1818 | 0 | 0 | 2008-05-27 | |
skb 的分配细节 | 8468 | 1 | 1 | 2008-05-14 | |
Redhat 官方对于 Linux 内存使用的解释 | 3497 | 1 | 0 | 2008-04-17 | |
ipp2p VS. l7-filter | 7107 | 3 | 3 | 2008-01-14 | |
网络中每帧的数据在 skbuff 中是线性的吗? | 2911 | 0 | 0 | 2008-01-13 | |
how to write netfilter connection tracking helper | 3922 | 0 | 3 | 2007-12-15 | |
C Hash Table | 3625 | 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,
}