aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2016-06-13 05:35:14 +0100
committerJoão Valverde <j@v6e.pt>2016-06-13 22:50:26 +0000
commit90fa55ddd2512659bc376d074d7c370f04323c20 (patch)
tree7cbc22cadfcc8d5fc8ab9a5497bfe78dd9d0d0d2 /wsutil
parent72af485d4ec5f9e4936749fe63d781f750b32bdf (diff)
Add missing const to inet_ipv6.h
Make it simpler too. Change-Id: I97dc79d7ac536089c1fa6ec2c20f19754d47a9d4 Reviewed-on: https://code.wireshark.org/review/15866 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'wsutil')
-rw-r--r--wsutil/inet_ipv6.h26
1 files changed, 9 insertions, 17 deletions
diff --git a/wsutil/inet_ipv6.h b/wsutil/inet_ipv6.h
index 21543253c4..72cac4d302 100644
--- a/wsutil/inet_ipv6.h
+++ b/wsutil/inet_ipv6.h
@@ -30,30 +30,22 @@ struct e_in6_addr {
* 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_linklocal(const struct e_in6_addr *a)
+{
+ return (a->bytes[0] == 0xfe) && ((a->bytes[1] & 0xc0) == 0x80);
}
-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;
+static inline gboolean in6_is_addr_sitelocal(const struct e_in6_addr *a)
+{
+ return (a->bytes[0] == 0xfe) && ((a->bytes[1] & 0xc0) == 0xc0);
}
-#endif
/**
* Multicast
*/
-static inline gboolean in6_is_addr_multicast(struct e_in6_addr *a) {
- if (a->bytes[0] == 0xff) {
- return TRUE;
- }
- return FALSE;
+static inline gboolean in6_is_addr_multicast(const struct e_in6_addr *a)
+{
+ return a->bytes[0] == 0xff;
}
#endif