Chinaunix首页 | 论坛 | 博客
  • 博客访问: 531002
  • 博文数量: 103
  • 博客积分: 2024
  • 博客等级: 上尉
  • 技术积分: 1294
  • 用 户 组: 普通用户
  • 注册时间: 2010-01-08 21:17
文章分类

全部博文(103)

文章存档

2012年(2)

2011年(21)

2010年(80)

分类: LINUX

2010-03-26 11:53:16

uuaodv似乎只能在小于2,6,22版本上运行,因为内核中的很多函数接口发生了变化,网络栈里添加了network namespace的概念,netlink接口也变的更简单,读procfs的get_info接口也没了,用read_proc代替,电脑是2,6,28版本,简单的制作了一个patch,能正常编译运行。
当时的一些笔记
‘NF_IP_PRE_ROUTING’未声明(在此函数内第一次使用)
 这个  不知道为什么,从netfile_ipv4.h文件中把定义拷贝过来就ok了

1,,,,391: 警告: 传递‘dev_get_by_name’的第 1 个参数时在不兼容的指针类型间转换
struct net_device *dev_get_by_name(struct net *net, const char *name)
struct net_device *dev_get_by_name(const char *name)

把&init_net作为第一个参数传入,


2,,,关于nf_hook

47 struct nf_hook_ops
 48 {
 49         struct list_head list;
 50 
 51         /* User fills in from here down. */
 52         nf_hookfn *hook;
 53         struct module *owner;
 54         int pf;
 55         int hooknum;
 56         /* Hooks are ordered in ascending priority. */
 57         int priority;
 58 };

其中  2。6。13的nf_hookfn为

 41 typedef unsigned int nf_hookfn(unsigned int hooknum,
 42                                struct sk_buff **skb,
 43                                const struct net_device *in,
 44                                const struct net_device *out,
 45                                int (*okfn)(struct sk_buff *));

2。6。28的nf_hookfn为

 90 typedef unsigned int nf_hookfn(unsigned int hooknum,
 91                                struct sk_buff *skb,           
 92                                const struct net_device *in,   
 93                                const struct net_device *out,  
 94                                int (*okfn)(struct sk_buff *));

把函数里相应的skb改了就ok了 
传递‘ip_route_me_harder’的第 1 个参数时在不兼容的指针类型间转换  这个warning也ok了。

3,,,,错误: 隐式声明函数‘proc_net_create’

#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28))
408         proc_net_create("kaodv", 0, kaodv_proc_info);
409 #else
410         create_proc_read_entry("kaodv",0,init_net.proc_net,kaodv_proc_info,NULL);
411 #endif


4,,,,,,,,,,,错误: 提供给函数‘netlink_kernel_create’的实参太少
接口又变了,详见转的那篇博客

文件:uuaodv-2-6-28.patch.tar.gz
大小:9KB
下载:下载
阅读(1298) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2010-05-08 22:41:26

您好,我们能邮件交流吗?我的邮箱是velkan.zhq@gmail.com

chinaunix网友2010-05-08 22:35:53

请问你验证过了没有,我加了这个patch编译是过了,但是就是运行不起来,不知道怎么回事?能请教一下吗? 出现的问题是: 22:35:32.044 host_init: Attaching to wlan1, override with -i . Could not set kernel options! 22:35:32.150 cleanup: CLEANING UP!