mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
/************************************************************************************************************
|
||||
* include/nuttx/net/ipopt.h
|
||||
*
|
||||
* Defines values for the IP header options
|
||||
* Defines values for the IPv4 header options
|
||||
*
|
||||
* Copyright (C) 2010, 2014 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@@ -65,7 +64,7 @@
|
||||
* Pointer: 8-bits:
|
||||
* Option Data: (depends on Length)
|
||||
*
|
||||
* The IP Option Type byte consists of the following subfields:
|
||||
* The IPv4 Option Type byte consists of the following subfields:
|
||||
*/
|
||||
|
||||
#define IPOPT_TYPE_OPTION_SHIFT (0) /* Bits 0-5: Option number*/
|
||||
|
||||
+30
-5
@@ -201,7 +201,7 @@ struct mld_mcast_listen_query_s
|
||||
uint16_t chksum; /* Checksum of ICMP header and data */
|
||||
uint16_t mrc; /* Maximum response code */
|
||||
uint16_t reserved2; /* Reserved, must be zero on transmission */
|
||||
net_ipv6addr_t mcast; /* 128-bit IPv6 multicast address */
|
||||
net_ipv6addr_t grpaddr; /* 128-bit IPv6 multicast group address */
|
||||
uint8_t flags; /* See S and QRV flag definitions */
|
||||
uint8_t qqic; /* Querier's Query Interval Cod */
|
||||
uint16_t nsources; /* Number of sources that follow */
|
||||
@@ -219,12 +219,12 @@ struct mld_mcast_listen_query_s
|
||||
* routers) the current multicast listening state, or changes in the
|
||||
* multicast listening state, of their interfaces.
|
||||
*
|
||||
* Version 1 Multicast Listener Reports (RFC 2710)
|
||||
* Version 1 Multicast Listener Report (RFC 2710)
|
||||
*/
|
||||
|
||||
struct mld_mcast_listen_report_v1_s
|
||||
{
|
||||
uint8_t type; /* Message Type: ICMPV6_MCAST_LISTEN_REPORT */
|
||||
uint8_t type; /* Message Type: ICMPV6_MCAST_LISTEN_REPORT_V1 */
|
||||
uint8_t reserved1; /* Reserved, must be zero on transmission */
|
||||
uint16_t chksum; /* Checksum of ICMP header and data */
|
||||
uint16_t reserved2; /* Reserved, must be zero on transmission */
|
||||
@@ -232,7 +232,7 @@ struct mld_mcast_listen_report_v1_s
|
||||
net_ipv6addr_t mcastaddr; /* Multicast address */
|
||||
};
|
||||
|
||||
/* Version 2 Multicast Listener Reports (RFC 3810). */
|
||||
/* Version 2 Multicast Listener Report (RFC 3810). */
|
||||
/* This is the form of the address record used in the listener report */
|
||||
|
||||
struct mld_mcast_addrec_v2_s
|
||||
@@ -282,7 +282,7 @@ struct mld_mcast_listen_report_v2_s
|
||||
|
||||
struct mld_mcast_listen_done_v1_s
|
||||
{
|
||||
uint8_t type; /* Message Type: ICMPV6_MCAST_LISTEN_DONE */
|
||||
uint8_t type; /* Message Type: ICMPV6_MCAST_LISTEN_DONE_V1 */
|
||||
uint8_t reserved1; /* Reserved, must be zero on transmission */
|
||||
uint16_t chksum; /* Checksum of ICMP header and data */
|
||||
uint16_t reserved2; /* Reserved, must be zero on transmission */
|
||||
@@ -290,6 +290,31 @@ struct mld_mcast_listen_done_v1_s
|
||||
net_ipv6addr_t mcastaddr; /* Multicast address */
|
||||
};
|
||||
|
||||
#ifdef CONFIG_NET_STATISTICS
|
||||
/* MLD statistic counters */
|
||||
|
||||
struct mld_stats_s
|
||||
{
|
||||
net_stats_t joins; /* Requests to join a group */
|
||||
net_stats_t leaves; /* Requests to leave a group */
|
||||
net_stats_t report_sched; /* Version 1 REPORT packets scheduled */
|
||||
net_stats_t done_sched; /* Version 1 DONE packets scheduled */
|
||||
net_stats_t report_sent; /* Version 1 REPORT packets sent */
|
||||
net_stats_t done_sent; /* Version 1 DONE packets sent */
|
||||
net_stats_t gmq_query_received; /* General multicast QUERY received */
|
||||
net_stats_t mas_query_received; /* Multicast Address Specific QUERY received */
|
||||
net_stats_t massq_query_received; /* Multicast Address and Source Specific QUERY received */
|
||||
net_stats_t ucast_query_received; /* Unicast query received */
|
||||
net_stats_t v1report_received; /* Version 1 REPORT packets received */
|
||||
net_stats_t v2report_received; /* Version 2 REPORT packets received */
|
||||
net_stats_t done_received; /* DONE packets received */
|
||||
};
|
||||
|
||||
# define MLD_STATINCR(p) ((p)++)
|
||||
#else
|
||||
# define MLD_STATINCR(p)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
@@ -51,8 +51,12 @@
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <stdint.h>
|
||||
#include <net/if.h>
|
||||
|
||||
#ifdef CONFIG_NET_MCASTGROUP
|
||||
# include <queue.h>
|
||||
#endif
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/ethernet.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
|
||||
@@ -66,6 +66,9 @@
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
# include <nuttx/net/igmp.h>
|
||||
#endif
|
||||
#ifdef CONFIG_NET_MLD
|
||||
# include <nuttx/net/mld.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_STATISTICS
|
||||
|
||||
@@ -103,6 +106,10 @@ struct net_stats_s
|
||||
struct igmp_stats_s igmp; /* IGMP statistics */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
struct mld_stats_s mld; /* MLD statistics */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_TCP
|
||||
struct tcp_stats_s tcp; /* TCP statistics */
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user