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

103 篇文章 0 订阅
29 篇文章 0 订阅

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拷贝到目标板中,测试是否移植成功。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值