全部博文(230)
标题 | 阅读 | 评论 | 转发 | 发布日期 | |
---|---|---|---|---|---|
Automake 及交叉编译的使用 | 5416 | 0 | 1 | 2010-06-22 | |
解决 vmware 报告 libstdc++ 和 libgio 错误无法启动的问题 | 1163 | 0 | 0 | 2010-06-19 | |
tar + gzip/bzip2/lzma | 2542 | 0 | 0 | 2010-06-19 | |
gcc 4.3.2, 4.4.2 都有 BUG | 2272 | 1 | 0 | 2009-12-02 | |
bwtest | 2428 | 0 | 0 | 2009-11-01 | |
oprofile | 2317 | 0 | 0 | 2009-10-31 | |
packit | 1943 | 0 | 0 | 2009-10-31 | |
netconsole | 2201 | 0 | 0 | 2009-10-31 | |
替换内核 LOGO | 2128 | 0 | 1 | 2009-10-31 | |
强制类型转换、三目灵活运用、字节序调整 | 2383 | 0 | 0 | 2007-09-14 | |
Linux 下查看源码的利器 vim + ctags + cscope | 2785 | 1 | 0 | 2007-09-10 | |
git 是个好东西! | 2046 | 0 | 0 | 2007-09-06 | |
ssh 公钥认证文件名(总忘,记下来!) | 2443 | 2 | 0 | 2007-08-18 | |
用 readline 实现了自定义命令补全功能 | 2466 | 0 | 0 | 2007-08-16 | |
关于 date 命令的用法(总忘!) | 2952 | 1 | 1 | 2007-06-10 | |
研究 readline 的好对象 | 2186 | 0 | 0 | 2007-04-10 | |
修改 MSN 密码的 WEB 地址 | 2679 | 0 | 0 | 2006-09-08 |
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,
}