Move IPv6 address utility functions to wsutil
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>
Fri, 8 Apr 2016 04:18:13 +0000 (05:18 +0100)
committerJoão Valverde <j@v6e.pt>
Sat, 9 Apr 2016 23:36:44 +0000 (23:36 +0000)
Change-Id: Ica8babbf4760b02e4840557fc61241152b2763c5
Reviewed-on: https://code.wireshark.org/review/13025
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: João Valverde <j@v6e.pt>
epan/dissectors/packet-ipv6.c
wsutil/inet_ipv6.h

index 9562ba8dd28516eaf3d87501e26d701484ee2322..6a1cd6070023c8b2c8cf5ed2b3a874a43b6e070b 100644 (file)
@@ -643,36 +643,6 @@ again:
     return try_capture_dissector("ipv6.nxt", nxt, pd, offset, len, cpinfo, pseudo_header);
 }
 
-/**
- * Unicast Scope
- * Note that we must check topmost 10 bits only, not 16 bits (see RFC2373).
- */
-#if 0 /* XXX Currently unused */
-static inline gboolean in6_is_addr_link_local(struct e_in6_addr *a) {
-    if ((a->bytes[0] == 0xfe) && ((a->bytes[1] & 0xc0) == 0x80)) {
-        return TRUE;
-    }
-    return FALSE;
-}
-
-static inline gboolean in6_is_addr_sitelocal(struct e_in6_addr *a) {
-    if ((a->bytes[0] == 0xfe) && ((a->bytes[1] & 0xc0) == 0xc0)) {
-        return TRUE;
-    }
-    return FALSE;
-}
-#endif
-
-/**
- * Multicast
- */
-static inline gboolean in6_is_addr_multicast(struct e_in6_addr *a) {
-    if (a->bytes[0] == 0xff) {
-        return TRUE;
-    }
-    return FALSE;
-}
-
 #ifdef HAVE_GEOIP_V6
 static void
 add_geoip_info_entry(proto_tree *geoip_info_tree, proto_item *geoip_info_item, tvbuff_t *tvb, gint offset, const struct e_in6_addr *ip, int isdst)
index 85a09e7105642ff778610bf2bb6a35c7c91f5193..21543253c426a0f3d08b3cf399a59cd1318bffa5 100644 (file)
@@ -26,4 +26,34 @@ struct e_in6_addr {
        guint8   bytes[16];             /**< 128 bit IP6 address */
 };
 
+/**
+ * Unicast Scope
+ * Note that we must check topmost 10 bits only, not 16 bits (see RFC2373).
+ */
+#if 0 /* XXX Currently unused */
+static inline gboolean in6_is_addr_link_local(struct e_in6_addr *a) {
+    if ((a->bytes[0] == 0xfe) && ((a->bytes[1] & 0xc0) == 0x80)) {
+        return TRUE;
+    }
+    return FALSE;
+}
+
+static inline gboolean in6_is_addr_sitelocal(struct e_in6_addr *a) {
+    if ((a->bytes[0] == 0xfe) && ((a->bytes[1] & 0xc0) == 0xc0)) {
+        return TRUE;
+    }
+    return FALSE;
+}
+#endif
+
+/**
+ * Multicast
+ */
+static inline gboolean in6_is_addr_multicast(struct e_in6_addr *a) {
+    if (a->bytes[0] == 0xff) {
+        return TRUE;
+    }
+    return FALSE;
+}
+
 #endif