lwip协议栈移植(1)

  lwip移植分为两类:

  1,只移植内核核心,用户应用程序编写只能基于raw/callback api进行

  2,移植内核核心和上层API函数模块,用户可以使用所有三种API编程,即 raw/callback API ,sequential API ,BSD-style socket API

  第一种移植:

  1,新建工程,源文件目录arch,创建文件lwipopts.h,perf.h和cc.h三个头文件。

  2,网卡驱动

    5个函数

    1static void low_level_init(struct netif *netif)
    (2static err_t low_level_output(struct netif *netif, struct pbuf *p)
      (3static struct pbuf *low_level_input(struct netif *netif)
    (4static void ethernetif_input(struct netif *netif)
      (5err_t ethernetif_init(struct netif *netif)

  前三个和网卡功能密切相关

  后面两个为上层调用接口

 

  

posted @ 2018-07-11 16:16  字由人  阅读(828)  评论(0编辑  收藏  举报