Aodv路由协议——将aodv-uu-0.9.3移植到ARM-LINUX中

来源:互联网 发布:电脑检测二手软件 编辑:程序博客网 时间:2024/04/30 07:58
<SCRIPT type=text/javascript><!--google_ad_client = "pub-2132256014190581";/* 160x600, 创建于 09-1-4 */google_ad_slot = "4461398019";google_ad_width = 160;google_ad_height = 600;//--></SCRIPT><SCRIPT src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type=text/javascript></SCRIPT>

kernel 2.6.21.1
aodv aodv-uu-0.9.3

1 内核的配置要求
  我的内核为linux-2.6.21.1
  Networking  --->  
      Networking options  ---> 
           [*] Network packet filtering framework (Netfilter)  ---> 
                 IP: Netfilter Configuration  --->    
                      <*> IP Userspace queueing via NETLINK (OBSOLETE)  
  我是直接编译到内核中的,也可以编译成模块ip_queue.ko,然后挂载。
 
2 修改Makefile

  line20 修改内核的版本号,我的内核为linux-2.6.21.1
  KERNEL=$(shell uname -r)改为:
  KERNEL= 2.6.21.1
  line22 为内核的源码路径,我的内核源码路径为/home/zht/redhatzht/sources/mykernel/21/linux-2.6.21.1
  KERNEL_DIR=/lib/modules/$(KERNEL)/build改为:
  KERNEL_DIR=/home/zht/redhatzht/sources/mykernel/21/linux-2.6.21.1
 
  line125  $(MAKE) -C $(AODVDIR)/lnx kaodv-arm.o KERNEL_DIR=$(KERNEL_DIR) KCC=$(ARM_CC) LD=$(ARM_LD)
  修改如下:
      $(MAKE) -C $(KERNEL_DIR) M=$(AODVDIR)/lnx

3 错误修改:
  a /home/zht/redhat/linuxhome/zht/sources/warelesscard/aodv-uu-0.9.3/lnx/kaodv-mod.c:22:26: error: linux/config.h: No such     file or directory
    将lnx/kaodv-mod.c line22的linux/config.h 改为 linux/autoconf.h

  b /home/zht/redhat/linuxhome/zht/sources/warelesscard/aodv-uu-0.9.3/lnx/kaodv-mod.c:261: error: too few arguments to            function ip_route_me_harder
    在linux2.6的内核中该函数ip_route_me_harder多了一个参数,所以在调用的时候要增加一个参数,具体传递什么数,不知道。暂            时改为如下 :
    lnx/kaodv-mod.c line261 ip_route_me_harder(skb);该为:ip_route_me_harder(skb,RTN_UNSPEC);
  c /home/zht/redhat/linuxhome/zht/sources/warelesscard/aodv-uu-0.9.3/lnx/kaodv-netlink.c:287: error: too few arguments to        function security_netlink_recv
    在linux2.6的内核中该函数security_netlink_recv多了一个参数,所以在调用的时候要增加一个参数,具体增加什么参数,不知道。         暂时改为如下 :
    lnx/kaodv-netlink.c line287 的if (security_netlink_recv(skb))修改为:if (security_netlink_recv(skb,10))
 
if (security_netlink_recv(skb,CAP_NET_ADMIN))
 
  d /home/zht/redhat/linuxhome/zht/sources/warelesscard/aodv-uu-0.9.3/lnx/kaodv-queue.c:249: error: too few arguments to         function ip_route_me_harder该错误与b相同 ,修改如下 :
   lnx/kaodv-queue.c line249 ip_route_me_harder(&entry->skb); 改为:ip_route_me_harder(&entry->skb,RTN_UNSPEC);

4 编译过后将在当前目录下生成aodvd的可执行文件,在lnx目录中将生成kaodv.ko模块。 

5 然后将aodvd  kaodv.ko拷贝到目标板中,测试是否移植成功。

<SCRIPT type=text/javascript><!--google_ad_client = "pub-2132256014190581";/* 160x600, 创建于 09-1-4 */google_ad_slot = "4461398019";google_ad_width = 160;google_ad_height = 600;//--></SCRIPT><SCRIPT src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type=text/javascript></SCRIPT>
原创粉丝点击