LwIP--1.4.2目录结构

|--doc 与协议使用相关的文本文档。

|    |--rawapi.txt 如何使用raw/callback API进行编程。

|    |--sys_arch.txt 规定了移植者需要实现的函数、宏定义等。

|--test 协议栈内核测试程序。

|--src 源码文件。

|    |--api sequential API和socket API两类接口函数及实现的相关代码,需要OS支持。

|    |    |--api_lib.c msg包含了squential API函数的实现,包含预留给用户的编程接口。

|    |    |--api_msg.c 包含API消息的封装和处理函数。

|    |    |--netbuf.c 包含上层数据包管理函数的实现。

|    |    |--netdb.c 包含主机名字转换相关的函数,主要在socket中被使用到。

|    |    |--netifapi.c 包含上层网络接口管理函数的实现。

|    |    |--sockets.c 包含了socket API函数的实现。

|    |    |--tcpip.c 包含了上层网络接口管理函数的实现。

|    |    |--sockets.c 包含了socket API函数的实现。

|    |    |--tcpip.c 提供上层API与协议栈内核交互的函数,整个上层API函数实现的枢纽。

|    |--include 整个协议栈使用的头文件。

|    |    |--lwip

|    |    |    |--opt.h 包含所有LwIP内核参数的默认值。

|    |    |    |--init.h 包含了与当前LwIP源代码信息相关的宏定义,如协议版本号,是否为官方版等。

|    |--core 内核源码,内核可以不需要OS支持,直接运行。

|    |    |--ipv4 包含IPv4标准中与IP层数据包处理相关的所有代码。

|    |    |    |--autoip.c 包含了IP地址自动配置相关函数,若从DHPC服务器获取IP失败,则可以选择启动AUTOIP功能配置自身的IP。将主机配置为169.254.0.0/16中的某个值,并提供一套完整的机制来避免IP地址冲突。

|    |    |    |--icmp.c 包含ICMP协议实现的相关函数,ICMP协议为IP数据包传递过程中的差错报告,差错纠正及目的地址可达性测试提供了支持,常见的ping命令就属于ICMP应用。

|    |    |    |--igmp.c 包含了网络组管理协议IGMP的实现,IGMP为网络中的多播数据提供了支持,主机加入某个多播组后,可以接收到该组的UDP多播数据。

|    |    |    |--inet.c 包含了IP层使用到的一些功能函数定义。如IP地址转换、网络字节序与主机字节序转换等。

|    |    |    |--inet_chksum.c 包含了同IP数据包校验的相关函数。

|    |    |    |--ip.c 包含了IPv4协议实现的相关函数,如数据包的接收、递交、发送等;

|    |    |    |--ip_addr.c 包含了一个判断是否为广播地址的函数。

|    |    |    |--ip_frag.c 提供了IP层数据包分片与重组相关函数。

|    |    |--ipv6 包含IPv6标准中与IP层数据包处理相关的所有代码。

|    |    |--snmp SNMP协议实现相关代码。SNMP:简单网络管理协议。基于TCP/IP协议上层应用协议,在LwIP中使用UDP来实现,为互联网上设备管理提供了框架,通过这个框架,可以使管理器实现对不同厂商生产的网络设备(如路由器)的监控、管理。

|    |    |--dhcp.c DHCP:动态主机配置协议相关代码。通常客户端通过使用UDP提供的功能来实现与DHCP服务器通信,从DHCP服务器处获得一个有效的IP地址。

|    |    |--dns.c 实现了DNS客户端的代码。DNS:域名系统。DNS也是一个上层协议,通常基于UDP来传输。

|    |    |--init.c 包含一个与LwIP协议栈初始化密切相关的函数,以及一些协议栈配置信息的检查与输出。

|    |    |--mem.c 包含了协议栈内存堆管理函数的实现。

|    |    |--memp.c 包含了协议栈内存池管理函数的实现。

|    |    |--netif.c 包含了协议栈网络接口管理相关函数的实现。如前面的以太网接口、回环接口等,协议栈内部对每个接口用一个对应的数据结构进行描述,在这里统一管理。

|    |    |--pbuf.c 包含了协议栈内核使用的数据包管理函数。采用特殊的数据包pbuf结构,可以避免数据在各个层次之间递交时的拷贝,提高递交效率,节省内存空间。

|    |    |--raw.c 为应用层提供一种直接和IP数据包交互的方式,类似socket编程中原始套接字的概念,可以直接读取IP层接收到的数据包。

|    |    |--stats.c 包含了协议栈内部数据统计与显示的相关函数,如内存使用情况,邮箱,信号量等信息。

|    |    |--sys.c 实现了对操作系统模拟层的封装,为协议栈提供统一的邮箱,信号量操作函数。是对sys_arch.c中的函数再封装。

|    |    |--tcp.c 包含了对TCP控制块操作的函数,也包含了TCP定时处理函数。

|    |    |--tcp_in.c 包含了TCP协议中数据处接收、处理相关的函数,最重要的TCP状态机函数也在这里。

|    |    |--tcp_out.c 包含了TCP数据发送的相关函数,如数据包发送,数据重传。

|    |    |--udp.c 包含了实现UDP协议相关函数,包括UDP控制块管理、UDP数据包发送、UDP数据包接收。

|    |--netif 包含与底层网络接口相关文件。

|    |    |--PPP PPP点对点协议代码。

|    |    |--etharp.c ARP协议实现代码,以太网物理地址到IP地址的映射。

|    |    |--ethernetif.c 包含与以太网网卡相关的初始化,发送,接收等函数的实现。但其中的函数不能直接使用,他们都是一个框架性结构,需要根据自己的网卡特性移植。

|    |    |--loopif.c 为协议栈提供一种环回网络接口功能,可以实现本地两个进程之间的数据传递(一个为客户端,一个为服务器),使得在没有网络硬件的情况下调试协议栈。

|    |    |--slipif.c SLIP:串行链路IP,提供一种在串行链路上传送IP数据包的函数定义,移植者需要根据自己使用的串行特性(如串口)来实现这些函数,这些函数比较简单,只定义了一些字符实现对链路上的IP数据包封包和发送,不提供任何寻址、错误校验、包类型识别机制。(如果不通过网卡实现,可以通过串口实现)

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
INTRODUCTION lwIP is a small independent implementation of the TCP/IP protocol suite. The focus of the lwIP TCP/IP implementation is to reduce the RAM usage while still having a full scale TCP. This making lwIP suitable for use in embedded systems with tens of kilobytes of free RAM and room for around 40 kilobytes of code ROM. lwIP was originally developed by Adam Dunkels at the Computer and Networks Architectures (CNA) lab at the Swedish Institute of Computer Science (SICS) and is now developed and maintained by a worldwide network of developers. FEATURES * IP (Internet Protocol, IPv4 and IPv6) including packet forwarding over multiple network interfaces * ICMP (Internet Control Message Protocol) for network maintenance and debugging * IGMP (Internet Group Management Protocol) for multicast traffic management * MLD (Multicast listener discovery for IPv6). Aims to be compliant with RFC 2710. No support for MLDv2 * ND (Neighbor discovery and stateless address autoconfiguration for IPv6). Aims to be compliant with RFC 4861 (Neighbor discovery) and RFC 4862 (Address autoconfiguration) * DHCP, AutoIP/APIPA (Zeroconf), ACD (Address Conflict Detection) and (stateless) DHCPv6 * UDP (User Datagram Protocol) including experimental UDP-lite extensions * TCP (Transmission Control Protocol) with congestion control, RTT estimation fast recovery/fast retransmit and sending SACKs * raw/native API for enhanced performance * Optional Berkeley-like socket API * TLS: optional layered TCP ("altcp") for nearly transparent TLS for any TCP-based protocol (ported to mbedTLS) (see changelog for more info) * PPPoS and PPPoE (Point-to-point protocol over Serial/Ethernet) * DNS (Domain name resolver incl. mDNS) * 6LoWPAN (via IEEE 802.15.4, BLE or ZEP) APPLICATIONS * HTTP server with SSI and CGI (HTTPS via altcp) * SNMPv2c agent with MIB compiler (Simple Network Management Protocol), v3 via altcp * SNTP (Simple network time protocol) * NetBIOS name service responder * MDNS (Multicast DNS) responder * iPerf server implementation * MQTT client (TLS support via altcp) LICENSE lwIP is freely available under a BSD license. DEVELOPMENT lwIP has grown into an excellent TCP/IP stack for embedded devices, and developers using the stack often submit bug fixes, improvements, and additions to the stack to further increase its usefulness. Development of lwIP is hosted on Savannah, a central point for software development, maintenance and distribution. Everyone can help improve lwIP by use of Savannah's interface, Git and the mailing list. A core team of developers will commit changes to the Git source tree. The lwIP TCP/IP stack is maintained in the 'lwip' Git module and contributions (such as platform ports) are in the 'contrib' Git module. See doc/savannah.txt for details on Git server access for users and developers. The current Git trees are web-browsable: http://git.savannah.gnu.org/cgit/lwip.git http://git.savannah.gnu.org/cgit/lwip/lwip-contrib.git Submit patches and bugs via the lwIP project page: http://savannah.nongnu.org/projects/lwip/ Continuous integration builds (GCC, clang): https://travis-ci.org/lwip-tcpip/lwip DOCUMENTATION Self documentation of the source code is regularly extracted from the current Git sources and is available from this web page: http://www.nongnu.org/lwip/ Also, there are mailing lists you can subscribe at http://savannah.nongnu.org/mail/?group=lwip plus searchable archives: http://lists.nongnu.org/archive/html/lwip-users/ http://lists.nongnu.org/archive/html/lwip-devel/ There is a wiki about lwIP at http://lwip.wikia.com/wiki/LwIP_Wiki You might get questions answered there, but unfortunately, it is not as well maintained as it should be. lwIP was originally written by Adam Dunkels: http://dunkels.com/adam/ Reading Adam's papers, the files in docs/, browsing the source code documentation and browsing the mailing list archives is a good way to become familiar with the design of lwIP. Adam Dunkels Leon Woestenberg
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值