全部博文(230)
| 标题 | 阅读 | 评论 | 转发 | 发布日期 | |
|---|---|---|---|---|---|
| DNS 记录类型 | 4244 | 0 | 0 | 2014-03-28 | |
| Cache 替换算法【转】 | 3269 | 0 | 1 | 2011-07-11 | |
| LVM HOWTO tips | 4282 | 0 | 0 | 2010-09-07 | |
| glib 官方在线文档 | 2745 | 0 | 0 | 2010-06-29 | |
| dedup util 数据块零碰撞算法 | 2435 | 0 | 0 | 2010-06-20 | |
| Linux下的 C/C++ 开发与调试工具 | 2672 | 0 | 2 | 2010-06-20 | |
| 基于 Dedup 的数据打包技术 | 1445 | 0 | 0 | 2010-06-20 | |
| 重复数据删除技术 | 3022 | 0 | 1 | 2010-06-20 | |
| 计算机中的单位、进制关系 | 2015 | 0 | 0 | 2009-08-27 | |
| how to write netfilter connection tracking helper | 3993 | 0 | 3 | 2007-12-15 | |
| C Hash Table | 3670 | 0 | 2 | 2007-12-03 | |
| A packet through the linux 2.4 network stack | 2919 | 1 | 2 | 2007-09-08 | |
| 看懂DVD文件格式 | 3131 | 0 | 0 | 2007-09-04 | |
| Linux TCP/IP 协议栈的关键数据结构Socket Buffer(sk_buff ) | 3195 | 0 | 2 | 2007-08-30 | |
| 什么是 LPI? | 3814 | 0 | 0 | 2007-08-24 | |
| DMIScope-BIOS 刷写 BIOS 来安装 OEM 系统 | 6338 | 0 | 0 | 2007-08-21 | |
| ipt_account 的用法 | 3802 | 0 | 0 | 2007-08-11 | |
| The system.map File | 2041 | 0 | 0 | 2007-07-11 | |
| ASCII 码表 | 1946 | 0 | 0 | 2007-07-06 | |
| The TCP state transition table needs a few words | 2497 | 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,
}