diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-10-26 01:50:00 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-10-26 08:50:34 +0000 |
commit | 458c3c026ed03d17ec7803c61981274ee4574f89 (patch) | |
tree | 9564e9336b594296e9048893ba917025444f4d52 /wsutil/inet_ipv6.h | |
parent | 0a99d3ef31611db7020d062216c856923ed29fac (diff) |
Add a ws_in6_addr typedef for struct e_in6_addr.
That allows a parallel typedef of ws_in4_addr for guint32.
Change-Id: I03b230247065e0e3840eb87635315a8e523ef562
Reviewed-on: https://code.wireshark.org/review/24073
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wsutil/inet_ipv6.h')
-rw-r--r-- | wsutil/inet_ipv6.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/wsutil/inet_ipv6.h b/wsutil/inet_ipv6.h index dc7183c08e..c3b37e7580 100644 --- a/wsutil/inet_ipv6.h +++ b/wsutil/inet_ipv6.h @@ -29,9 +29,9 @@ #define IPv6_HDR_SIZE 40 #define IPv6_FRAGMENT_HDR_SIZE 8 -struct e_in6_addr { +typedef struct e_in6_addr { guint8 bytes[16]; /* 128 bit IPv6 address */ -}; +} ws_in6_addr; /* * Definition for internet protocol version 6. @@ -42,8 +42,8 @@ struct ws_ip6_hdr { guint16 ip6h_plen; /* payload length */ guint8 ip6h_nxt; /* next header */ guint8 ip6h_hlim; /* hop limit */ - struct e_in6_addr ip6h_src; /* source address */ - struct e_in6_addr ip6h_dst; /* destination address */ + ws_in6_addr ip6h_src; /* source address */ + ws_in6_addr ip6h_dst; /* destination address */ }; /* @@ -73,7 +73,7 @@ struct ip6_rthdr0 { guint8 ip6r0_reserved; /* reserved field */ guint8 ip6r0_slmap[3]; /* strict/loose bit map */ /* followed by up to 127 addresses */ - struct e_in6_addr ip6r0_addr[1]; + ws_in6_addr ip6r0_addr[1]; }; /* Fragment header */ @@ -93,12 +93,12 @@ struct ip6_frag { * Unicast Scope * Note that we must check topmost 10 bits only, not 16 bits (see RFC2373). */ -static inline gboolean in6_is_addr_linklocal(const struct e_in6_addr *a) +static inline gboolean in6_is_addr_linklocal(const ws_in6_addr *a) { return (a->bytes[0] == 0xfe) && ((a->bytes[1] & 0xc0) == 0x80); } -static inline gboolean in6_is_addr_sitelocal(const struct e_in6_addr *a) +static inline gboolean in6_is_addr_sitelocal(const ws_in6_addr *a) { return (a->bytes[0] == 0xfe) && ((a->bytes[1] & 0xc0) == 0xc0); } @@ -106,7 +106,7 @@ static inline gboolean in6_is_addr_sitelocal(const struct e_in6_addr *a) /** * Multicast */ -static inline gboolean in6_is_addr_multicast(const struct e_in6_addr *a) +static inline gboolean in6_is_addr_multicast(const ws_in6_addr *a) { return a->bytes[0] == 0xff; } |