aboutsummaryrefslogtreecommitdiffstats
path: root/epan/ipv6-utils.h
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2005-09-12 06:21:35 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2005-09-12 06:21:35 +0000
commit7fdcb3f7e0c5b330f8ee5f6d79654d6585a2086f (patch)
tree221a7573bb57f01d4f28be59a4a1e5d7f9b9c909 /epan/ipv6-utils.h
parentd5ce5e569cd1d693c27951559ae08f46fe22087a (diff)
Don't collide with the "regular" IPv6 defintions in at least some
platforms in ipv6-utils.h. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15764 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/ipv6-utils.h')
-rw-r--r--epan/ipv6-utils.h37
1 files changed, 13 insertions, 24 deletions
diff --git a/epan/ipv6-utils.h b/epan/ipv6-utils.h
index 129bd58e96..79a5d37fc1 100644
--- a/epan/ipv6-utils.h
+++ b/epan/ipv6-utils.h
@@ -29,32 +29,21 @@
#define __IPV6_UTILS_H__
struct e_in6_addr {
- union {
- guint32 u6_addr32[4];
- guint16 u6_addr16[8];
- guint8 u6_addr8[16];
- } u6_addr; /* 128 bit IP6 address */
+ guint8 bytes[16]; /* 128 bit IP6 address */
};
-#ifdef s6_addr32
-#undef s6_addr32
-#endif
-
-#ifdef s6_addr16
-#undef s6_addr16
-#endif
-
-#ifdef s6_addr8
-#undef s6_addr8
-#endif
-
-#ifdef s6_addr
-#undef s6_addr
-#endif
+/*
+ * Unicast Scope
+ * Note that we must check topmost 10 bits only, not 16 bits (see RFC2373).
+ */
+#define E_IN6_IS_ADDR_LINKLOCAL(a) \
+ (((a)->bytes[0] == 0xfe) && (((a)->bytes[1] & 0xc0) == 0x80))
+#define E_IN6_IS_ADDR_SITELOCAL(a) \
+ (((a)->bytes[0] == 0xfe) && (((a)->bytes[1] & 0xc0) == 0xc0))
-#define s6_addr32 u6_addr.u6_addr32
-#define s6_addr16 u6_addr.u6_addr16
-#define s6_addr8 u6_addr.u6_addr8
-#define s6_addr u6_addr.u6_addr8
+/*
+ * Multicast
+ */
+#define E_IN6_IS_ADDR_MULTICAST(a) ((a)->bytes[0] == 0xff)
#endif /* __IPV6_UTILS_H__ */