2.0.0中才开始支持IPv6,在此版本中改写了SNMP,但还没有IPv6的统计量。目前最新版本是2.0.2,其中SNMP也没有IPv6统计量(哪些?与IP的统计量有何区别?)

1.4.1中虽然有ip6.c,但是非常简单。

SNMP MIBs and IPv6,最初的MIB只支持IPv4地址长度,后来IPv6出现后,一开始,人们希望为IPv6增加新的OID,但后来,开始PVI(protocol-version independent)方向发展,即,新增加MIB,这些MIB是PVI的。

没去

(2.0.)

  ++ Application changes:

  * Changed netif "up" flag handling to be an administrative flag (as opposed to the previous meaning of
"ip4-address-valid", a netif will now not be used for transmission if not up) -> even a DHCP netif
has to be set "up" before starting the DHCP client
* Added IPv6 support (dual-stack or IPv4/IPv6 only)
* Changed ip_addr_t to be a union in dual-stack mode (use ip4_addr_t where referring to IPv4 only).
* Major rewrite of SNMP (added MIB parser that creates code stubs for custom MIBs);
supports SNMPv2c (experimental v3 support)
* Moved some core applications from contrib repository to src/apps (and include/lwip/apps)

两个版本netif结构体的对比:IPv6每个接口可以配置多个地址(默认3个),地址有状态区分

/** Generic data structure used for all lwIP network interfaces.
* The following fields should be filled in by the initialization
* function for the device driver: hwaddr_len, hwaddr[], mtu, flags */

struct netif {
/** pointer to next in linked list */
struct netif *next; /** IP address configuration in network byte order */
ip_addr_t ip_addr;
ip_addr_t netmask;
ip_addr_t gw; /** Generic data structure used for all lwIP network interfaces.
* The following fields should be filled in by the initialization
* function for the device driver: hwaddr_len, hwaddr[], mtu, flags */

struct netif {
/** pointer to next in linked list */
struct netif *next; #if LWIP_IPV4
/** IP address configuration in network byte order */
ip_addr_t ip_addr;
ip_addr_t netmask;
ip_addr_t gw;
#endif /* LWIP_IPV4 */
#if LWIP_IPV6
/** Array of IPv6 addresses for this netif. */
ip_addr_t ip6_addr[LWIP_IPV6_NUM_ADDRESSES];
/** The state of each IPv6 address (Tentative, Preferred, etc).
* @see ip6_addr.h */
u8_t ip6_addr_state[LWIP_IPV6_NUM_ADDRESSES];
#endif /* LWIP_IPV6 */

两个版本IPv6路由函数对比,新版本会判断是否是link local地址等等。

/* ip_route:
*
* Finds the appropriate network interface for a given IP address. It searches the
* list of network interfaces linearly. A match is found if the masked IP address of
* the network interface equals the masked IP address given to the function.
*/
struct netif *
ip_route(struct ip_addr *dest)
{
struct netif *netif; for(netif = netif_list; netif != NULL; netif = netif->next) {
if (ip_addr_netcmp(dest, &(netif->ip_addr), &(netif->netmask))) {
return netif;
}
}
return netif_default;
} /**
* Finds the appropriate network interface for a given IPv6 address. It tries to select
* a netif following a sequence of heuristics:
* 1) if there is only 1 netif, return it
* 2) if the destination is a link-local address, try to match the src address to a netif.
* this is a tricky case because with multiple netifs, link-local addresses only have
* meaning within a particular subnet/link.
* 3) tries to match the destination subnet to a configured address
* 4) tries to find a router
* 5) tries to match the source address to the netif
* 6) returns the default netif, if configured
*
* @param src the source IPv6 address, if known
* @param dest the destination IPv6 address for which to find the route
* @return the netif on which to send to reach dest
*/
struct netif *
ip6_route(const ip6_addr_t *src, const ip6_addr_t *dest)

LwIP与IPv6的更多相关文章

  1. LwIP Application Developers Manual3---链路层和网络层协议之IPV6,ICMP,IGMP

    1.前言 本文主要讲述链路层和网络层的协议IPV6,ICMP 2.IPV6 2.1 IPV6特性 IPv6是IPv4的更新.其最显著的差别在于地址空间由32位转换成128位 2.2 从应用的角度看IP ...

  2. LwIP Application Developers Manual10---LwIP IPv4/IPv6 stacks

    1.前言 lwIP正在加入IPv6,一个实验性的版本可以通过git下载,该版本实现了一个IPv4/IPv6的双协议栈.通过在lwipopts.h定义LWIP_IPV6可以使能IPv6 2.已实现的IP ...

  3. lwip 2.0.2 snmp mib ipv6

    1.3.6.1.2.1 - SNMP MIB-2 Submitted by Harald.T.Alvestrand at uninett.no from host aun.uninett.no (12 ...

  4. LWIP总结

    介绍 Lwip,light weight IP:是由Adam Dunkels 开发的一个小型开源的TCP/IP协议栈:目前已经为全球共同开发的开源协议:支持TCPIP协议族的核心协议:包括:ARP/I ...

  5. LwIP源代码文件目录解析

    1 -- LwIP源代码文件目录 root@motadou:/home/motadou/lwip/lwip-1.4.1# tree . ├── CHANGELOG ├── COPYING ├── do ...

  6. LwIP之socket应用--WebServer和Modbus TCP

    1. 引言 LwIP是嵌入式领域一个流行的以太网协议栈, LwIP开放源码,用C写成非常方便移植,并且支持socket接口,使用者可以集中精力处理应用功能. 本文就是LwIP socket使用的一个小 ...

  7. 网络通信实验(2)TCP/IP LWIP 简介

    TCP/IP 简介 TCP/IP 中文名为传输控制协议/因特网互联协议,又名网络通讯协议,是 Internet 最基本的协议. Internet 国际互联网络的基础,由网络层的 IP 协议和传输层的 ...

  8. LwIP Application Developers Manual6---Application API layers

    1.前言 lwIP提供3种应用编程接口来跟TCP/IP内核通信,如下所示: 低水平的内核/回调或raw API 2个高水平序列API: 1) netconn API 2) socket API(为了兼 ...

  9. LwIP Application Developers Manual2---Protocols概览

    1.前言 本文是对LwIP Application Developers Manual的翻译 lwIP是模块化的并支持广泛的协议,这些大部分协议可以被裁减从而减小代码的尺寸 2.协议概览 链路层和网络 ...

随机推荐

  1. NMI计算

    NMI计算 NMI(Normalized Mutual Information)标准化互信息,常用在聚类中,度量两个聚类结果的相近程度.是社区发现(community detection)的重要衡量指 ...

  2. python 线程信号量

    线程信号量和进程信号量相似 # 线程信号量 import time from threading import Semaphore from threading import Thread def t ...

  3. python 父类方法重写

    class Bird: def isWing(self): print("鸟有翅膀") def fly(self): print("鸟会飞") class Os ...

  4. EditPlus 添加 打开文件所在文件夹 功能

    添加自定义工具: Tools -> Configure User Tools... -> Add Tool >> Menu Text: 打开所在的文件夹 Command: ex ...

  5. CTF--HTTP服务--SQL注入-X-Forwarded-For报文头

    开门见山 1. 扫描靶场ip,发现PCS 192.168.31.196 2. 扫描靶场开放服务信息 3. 扫描靶场全部信息 4. 探测敏感信息 5. 查看靶场80端口的主界面 6. 使用AVWS工具进 ...

  6. Docker底层架构之联合文件系统

    联合文件系统(UnionFS)是一种分层.轻量级并且高性能的文件系统,它支持对文件系统的 修改作为一次提交来一层层的叠加,同时可以将不同目录挂载到同一个虚拟文件系统下(unite several di ...

  7. Spring注解开发系列专栏

    这个系列主要是讲Spring注解的使用,可以为后面SpringBoot的学习带来一定的帮助.我觉得从Spring直接过度到SpringBoot还是有点快,还是得需要一个演变的过程.从Spring开发, ...

  8. 深入了解Zookeeper

    ZooKeeper是一个分布式的,开放源码的分布式应用程序协调服务,它包含一个简单的原语集,分布式应用程序可以基于它实现同步服务,配置维护和命名服务等.Zookeeper是hadoop的一个子项目,其 ...

  9. 编写一个函数,输入n为偶数时,调用方法求1/2+1/4+...+1/n,当输入n为奇数时,调用函数1/1+1/3+...+1/n

    需求:编写一个函数,输入n为偶数时,调用方法求1/2+1/4+...+1/n,当输入n为奇数时,调用函数1/1+1/3+...+1/n package com.Summer_0511.cn; impo ...

  10. High一下!

    代码: <a title="把这个链接拖到你的Chrome收藏夹工具栏中" href='javascript:(function() { function c() { var ...