summaryrefslogtreecommitdiff
path: root/nuttx/net/utils/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/net/utils/utils.h')
-rw-r--r--nuttx/net/utils/utils.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/nuttx/net/utils/utils.h b/nuttx/net/utils/utils.h
index 76401a27a..6eabf097e 100644
--- a/nuttx/net/utils/utils.h
+++ b/nuttx/net/utils/utils.h
@@ -139,7 +139,7 @@ unsigned int net_dsec2tick(int dsec);
unsigned int net_timeval2dsec(FAR struct timeval *tv);
/****************************************************************************
- * Name: tcp_chksum
+ * Name: tcp_chksum, tcp_ipv4_chksum, and tcp_ipv6_chksum
*
* Description:
* Calculate the TCP checksum of the packet in d_buf and d_appdata.
@@ -157,7 +157,23 @@ unsigned int net_timeval2dsec(FAR struct timeval *tv);
*
****************************************************************************/
+#ifdef CONFIG_NET_IPv4
+uint16_t tcp_ipv4_chksum(FAR struct net_driver_s *dev);
+#endif
+
+#ifdef CONFIG_NET_IPv6
+/* REVIST: Is this used? */
+uint16_t tcp_ipv6_chksum(FAR struct net_driver_s *dev);
+#endif
+
+#if defined(CONFIG_NET_IPv4) && defined(CONFIG_NET_IPv6)
uint16_t tcp_chksum(FAR struct net_driver_s *dev);
+#elif defined(CONFIG_NET_IPv4)
+# define tcp_chksum(d) tcp_ipv4_chksum(d)
+#else /* if defined(CONFIG_NET_IPv6) */
+# define tcp_chksum(d) tcp_ipv6_chksum(d)
+#endif
+
/****************************************************************************
* Name: udp_chksum