全部博文(230)
标题 | 阅读 | 评论 | 转发 | 发布日期 | |
---|---|---|---|---|---|
一段感觉不错的广告词 | 1737 | 0 | 0 | 2006-11-09 | |
右脚崴了就算了,左脚又来凑热闹 | 2146 | 0 | 0 | 2006-10-24 | |
摩羯到底是种什么动物? | 3392 | 0 | 0 | 2006-10-19 | |
“唵嘛呢叭弥吽”的意思 | 3125 | 0 | 0 | 2006-10-17 | |
心情不好的时候看看 | 2649 | 0 | 0 | 2006-10-15 | |
11 个笑话让你领悟人生 | 2328 | 0 | 0 | 2006-10-15 | |
有一种浪漫是思念 | 1921 | 0 | 0 | 2006-10-15 | |
屋漏偏逢连夜雨,船迟又遇打头风 | 2616 | 0 | 0 | 2006-10-15 | |
好久没写 BLOG 了,刘鹏,真心祝福你 | 1782 | 0 | 0 | 2006-09-01 | |
给自己弄了一个标志牌,呵呵~ | 1464 | 0 | 0 | 2006-01-26 |
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,
}