全部博文(230)
| 标题 | 阅读 | 评论 | 转发 | 发布日期 | |
|---|---|---|---|---|---|
| QoS 原理介绍 | 3516 | 0 | 2 | 2007-09-09 | |
| 让 Linux 支持 UPnP(实战) | 10672 | 0 | 2 | 2007-08-28 | |
| Linux 做无线 AP | 5637 | 0 | 0 | 2007-07-07 | |
| iptables 里 recent 模块的用法 | 3952 | 0 | 1 | 2007-06-10 | |
| 最小帧 64 字节和最大帧 1518 字节是怎么来的 | 3804 | 0 | 0 | 2007-05-21 | |
| 谈一下如何利用iptables限制速度(不用tc) | 4456 | 0 | 0 | 2006-01-26 | |
| 解决多链路总掉线的问题 | 2726 | 0 | 0 | 2006-01-26 | |
| 如何查找网络中其他非法 DHCP 服务器 | 2968 | 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,
}