summaryrefslogtreecommitdiff
path: root/nuttx/include/netinet/in.h
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/include/netinet/in.h')
-rw-r--r--nuttx/include/netinet/in.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/nuttx/include/netinet/in.h b/nuttx/include/netinet/in.h
index 565ffbeb1..219f15119 100644
--- a/nuttx/include/netinet/in.h
+++ b/nuttx/include/netinet/in.h
@@ -110,6 +110,28 @@
#define s6_addr16 in6_u.u6_addr16
#define s6_addr32 in6_u.u6_addr32
+/* Checks for special IPv6 addresses */
+
+#define IN6_IS_ADDR_MULTICAST(a) \
+ ((a)->s6_addr[0] == 0xff)
+
+#define IN6_IS_ADDR_LOOPBACK(a) \
+ ((a)->s6_addr32[0] == 0 && \
+ (a)->s6_addr32[1] == 0 && \
+ (a)->s6_addr32[2] == 0 && \
+ (a)->s6_addr32[3] == HTONL(1))
+
+#define IN6_IS_ADDR_UNSPECIFIED(a) \
+ ((a)->s6_addr32[0] == 0 && \
+ (a)->s6_addr32[1] == 0 && \
+ (a)->s6_addr32[2] == 0 && \
+ (a)->s6_addr32[3] == 0)
+
+#define IN6_IS_ADDR_V4MAPPED(a) \
+ ((a)->s6_addr32[0] == 0 && \
+ (a)->s6_addr32[1] == 0 && \
+ (a)->s6_addr32[2] == HTONL(0xffff))
+
/****************************************************************************
* Public Type Definitions
****************************************************************************/