全部博文(230)
标题 | 阅读 | 评论 | 转发 | 发布日期 | |
---|---|---|---|---|---|
The system.map File | 1966 | 0 | 0 | 2007-07-11 | |
最近有点累,也许应该休息一下了 | 1962 | 2 | 0 | 2007-07-09 | |
Linux 做无线 AP | 5573 | 0 | 0 | 2007-07-07 | |
一直觉得刘翔和巩俐很像,可是没人认同我,难道我的眼光有问题? | 2237 | 5 | 0 | 2007-07-07 | |
ASCII 码表 | 1826 | 0 | 0 | 2007-07-06 | |
The TCP state transition table needs a few words | 2455 | 4 | 0 | 2007-07-02 |
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,
}