全部博文(230)
标题 | 阅读 | 评论 | 转发 | 发布日期 | |
---|---|---|---|---|---|
使用open vswitch构建虚拟网络 | 6363 | 0 | 0 | 2015-04-21 | |
OpenvSwitch完全使用手册 | 5805 | 0 | 0 | 2015-04-21 | |
linux kernel 2.6.35中RFS特性详解 | 5488 | 0 | 0 | 2015-04-21 | |
Linux RPS RFS | 5308 | 0 | 0 | 2015-04-21 | |
Linux网络编程:原始套接字的魔力【续】 | 3906 | 0 | 0 | 2015-04-10 | |
Linux网络编程:原始套接字的魔力【下】 | 3622 | 0 | 0 | 2015-04-10 | |
Linux网络编程:原始套接字的魔力【上】 | 3435 | 0 | 0 | 2015-04-10 | |
鼠眼再看Linux调度器[2] | 3635 | 0 | 0 | 2015-04-09 | |
鼠眼再看Linux调度器[1] | 3418 | 0 | 0 | 2015-04-09 | |
鼠眼看Linux调度器 | 2588 | 0 | 0 | 2015-04-09 | |
200行C代码实现简单线程池 | 1454 | 0 | 0 | 2015-04-09 | |
右移运算符的诡计 | 1358 | 0 | 0 | 2015-04-09 | |
spinlock在多核处理器上的性能比较 | 2458 | 0 | 0 | 2015-04-09 | |
Pthreads复习备忘 | 1153 | 0 | 0 | 2015-04-09 | |
怎样反汇编bzImage | 1989 | 0 | 0 | 2015-04-09 | |
splice()系统调用族探秘 | 3171 | 0 | 0 | 2015-04-09 | |
理解epoll的实现 | 1293 | 0 | 0 | 2015-04-09 | |
别用TCP的紧急数据 | 3398 | 0 | 0 | 2015-04-09 | |
Inside TCP:显式拥塞控制 | 1373 | 0 | 0 | 2015-04-09 | |
Inside TCP: Spurious RTO 问题 | 2043 | 0 | 0 | 2015-04-09 |
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,
}