mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 14:27:37 +08:00
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:
+2
-2
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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. */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user