全部博文(230)
| 标题 | 阅读 | 评论 | 转发 | 发布日期 | |
|---|---|---|---|---|---|
| linux kernel 2.6.35中RFS特性详解 | 5609 | 0 | 0 | 2015-04-21 | |
| Linux RPS RFS | 5465 | 0 | 0 | 2015-04-21 | |
| 鼠眼再看Linux调度器[2] | 3684 | 0 | 0 | 2015-04-09 | |
| 鼠眼再看Linux调度器[1] | 3473 | 0 | 0 | 2015-04-09 | |
| 鼠眼看Linux调度器 | 2693 | 0 | 0 | 2015-04-09 | |
| 让 Linux 实现交换机的端口镜像功能 | 8042 | 4 | 2 | 2012-09-16 | |
| High Memory In The Linux Kernel | 3130 | 0 | 1 | 2009-08-03 | |
| Interfaces in the Linux kernel | 2479 | 0 | 0 | 2008-11-06 | |
| skb 的分配细节 | 8579 | 1 | 1 | 2008-05-14 | |
| 网络中每帧的数据在 skbuff 中是线性的吗? | 2961 | 0 | 0 | 2008-01-13 | |
| VMware 对 Linux 内核协议栈有干扰 | 2789 | 0 | 0 | 2007-09-04 | |
| 开始接触 2.6 内核了 | 2256 | 2 | 0 | 2007-08-13 | |
| 让内核菜单显示出自己编的模块 | 2365 | 0 | 0 | 2007-03-22 | |
| 安装 bootsplash 心得 | 4160 | 0 | 0 | 2007-02-05 |
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,
}