全部博文(230)
| 标题 | 阅读 | 评论 | 转发 | 发布日期 | |
|---|---|---|---|---|---|
| 什么是白皮书,蓝皮书,绿皮书,红皮书 | 2735 | 0 | 0 | 2007-06-30 | |
| RFC1025 - TCP AND IP BAKE OFF | 3047 | 0 | 0 | 2007-06-28 | |
| 存储入门:光纤网卡和 HBA 卡的区别 | 3449 | 0 | 0 | 2007-06-10 | |
| Creating a shared and static library [gcc] | 3371 | 0 | 0 | 2007-06-08 | |
| Linux内核中FTP跟踪中的序列号处理漏洞 | 2167 | 0 | 0 | 2007-06-07 | |
| About getopt | 1928 | 0 | 0 | 2007-06-06 | |
| WebFilter - ExeBlock (cut from ISA SDK) | 1686 | 0 | 0 | 2007-06-06 | |
| CHANGING THE NORMAL ROOT FILE SYSTEM | 2070 | 0 | 0 | 2007-06-03 | |
| FastNAT | 2539 | 0 | 0 | 2007-06-02 | |
| Double Play Packet | 1137 | 0 | 0 | 2007-06-02 | |
| Multiple Routes to Same Destination | 1480 | 0 | 0 | 2007-06-02 | |
| tc filter about u32 | 3683 | 0 | 0 | 2007-06-02 | |
| printf 格式化输出 | 4760 | 0 | 1 | 2007-03-15 | |
| Clock in a Linux Guest Runs More Slowly or Quickly | 3286 | 0 | 0 | 2006-11-22 | |
| shell入门基础必备 | 2263 | 0 | 2 | 2006-01-26 | |
| 正则表达式基本语法 | 1814 | 0 | 2 | 2006-01-26 | |
| Kernel Packet Traveling Diagram | 2656 | 0 | 0 | 2006-01-26 | |
| Resolution in pixels | 2587 | 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,
}