Networking: (1) Copied all ICMP sources files to net/icmpv6 with proper renaming and removal of IPv4 logic, (2) remove IPv6 logic from files in net/icmp, (3) copied include/nuttx/icmp.h to icmpv6.h and removed IPv4 specific logic, (4) removed all IPv6 logic from icmp.h, (5) IP_HDRLEN became IPv4_HDRLEN and IPv6_HDRLEN, (6) ip_chksum() became ipv4_chksum() and ipv6_chksum(), and (7) added partial support for ICMPv6 statistics.

This commit is contained in:
Gregory Nutt
2015-01-14 16:10:38 -06:00
parent 4b9138eb7d
commit a7ce1279f9
25 changed files with 1326 additions and 105 deletions
+2 -2
View File
@@ -33,10 +33,10 @@
#
############################################################################
# ICMP source files
ifeq ($(CONFIG_NET_ICMP),y)
# ICMP source files
NET_CSRCS += icmp_input.c
ifeq ($(CONFIG_NET_ICMP_PING),y)
+4 -4
View File
@@ -1,6 +1,6 @@
/****************************************************************************
* net/icmp/icmp_input.c
* Handling incoming ICMP/ICMP6 input
* Handling incoming ICMP input
*
* Copyright (C) 2007-2009, 2012, 2014-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -92,10 +92,10 @@ FAR struct devif_callback_s *g_echocallback = NULL;
* Name: icmp_input
*
* Description:
* Handle incoming ICMP/ICMP6 input
* Handle incoming ICMP input
*
* Parameters:
* dev - The device driver structure containing the received ICMP/ICMP6
* dev - The device driver structure containing the received ICMP
* packet
*
* Return:
@@ -148,7 +148,7 @@ void icmp_input(FAR struct net_driver_s *dev)
/* The slow way... sum over the ICMP message */
picmp->icmpchksum = 0;
picmp->icmpchksum = ~icmp_chksum(dev, (((uint16_t)picmp->len[0] << 8) | (uint16_t)picmp->len[1]) - IP_HDRLEN);
picmp->icmpchksum = ~icmp_chksum(dev, (((uint16_t)picmp->len[0] << 8) | (uint16_t)picmp->len[1]) - IPv4_HDRLEN);
if (picmp->icmpchksum == 0)
{
picmp->icmpchksum = 0xffff;
+1 -1
View File
@@ -130,7 +130,7 @@ void icmp_send(FAR struct net_driver_s *dev, FAR net_ipaddr_t *destaddr)
/* Calculate IP checksum. */
picmp->ipchksum = 0;
picmp->ipchksum = ~(ip_chksum(dev));
picmp->ipchksum = ~(ipv4_chksum(dev));
/* Calculate the ICMP checksum. */