diff options
| author | Alexander Aring <alex.aring@gmail.com> | 2014-07-29 17:47:02 -0400 |
|---|---|---|
| committer | Marcel Holtmann <marcel@holtmann.org> | 2014-07-30 13:28:39 -0400 |
| commit | 556a5bfc03c35c6f0b4e85ef6a19d00f0eb6dd00 (patch) | |
| tree | 401e9b530eebe89f9a2a5df0840eeef63b4fd1c8 /include/net | |
| parent | 85c71240a3e6c151038d9ed3fa88fc0fb80043fb (diff) | |
6lowpan: iphc: use ipv6 api to check address scope
This patch removes the own implementation to check of link-layer,
broadcast and any address type and use the IPv6 api for that.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/6lowpan.h | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/include/net/6lowpan.h b/include/net/6lowpan.h index 79b530fb2c4d..18010bce68c8 100644 --- a/include/net/6lowpan.h +++ b/include/net/6lowpan.h | |||
| @@ -75,20 +75,10 @@ | |||
| 75 | (((a)->s6_addr[14]) == (m)[6]) && \ | 75 | (((a)->s6_addr[14]) == (m)[6]) && \ |
| 76 | (((a)->s6_addr[15]) == (m)[7])) | 76 | (((a)->s6_addr[15]) == (m)[7])) |
| 77 | 77 | ||
| 78 | /* ipv6 address is unspecified */ | ||
| 79 | #define is_addr_unspecified(a) \ | ||
| 80 | ((((a)->s6_addr32[0]) == 0) && \ | ||
| 81 | (((a)->s6_addr32[1]) == 0) && \ | ||
| 82 | (((a)->s6_addr32[2]) == 0) && \ | ||
| 83 | (((a)->s6_addr32[3]) == 0)) | ||
| 84 | |||
| 85 | /* compare ipv6 addresses prefixes */ | 78 | /* compare ipv6 addresses prefixes */ |
| 86 | #define ipaddr_prefixcmp(addr1, addr2, length) \ | 79 | #define ipaddr_prefixcmp(addr1, addr2, length) \ |
| 87 | (memcmp(addr1, addr2, length >> 3) == 0) | 80 | (memcmp(addr1, addr2, length >> 3) == 0) |
| 88 | 81 | ||
| 89 | /* local link, i.e. FE80::/10 */ | ||
| 90 | #define is_addr_link_local(a) (((a)->s6_addr16[0]) == htons(0xFE80)) | ||
| 91 | |||
| 92 | /* | 82 | /* |
| 93 | * check whether we can compress the IID to 16 bits, | 83 | * check whether we can compress the IID to 16 bits, |
| 94 | * it's possible for unicast adresses with first 49 bits are zero only. | 84 | * it's possible for unicast adresses with first 49 bits are zero only. |
| @@ -100,9 +90,6 @@ | |||
| 100 | (((a)->s6_addr[12]) == 0xfe) && \ | 90 | (((a)->s6_addr[12]) == 0xfe) && \ |
| 101 | (((a)->s6_addr[13]) == 0)) | 91 | (((a)->s6_addr[13]) == 0)) |
| 102 | 92 | ||
| 103 | /* multicast address */ | ||
| 104 | #define is_addr_mcast(a) (((a)->s6_addr[0]) == 0xFF) | ||
| 105 | |||
| 106 | /* check whether the 112-bit gid of the multicast address is mappable to: */ | 93 | /* check whether the 112-bit gid of the multicast address is mappable to: */ |
| 107 | 94 | ||
| 108 | /* 9 bits, for FF02::1 (all nodes) and FF02::2 (all routers) addresses only. */ | 95 | /* 9 bits, for FF02::1 (all nodes) and FF02::2 (all routers) addresses only. */ |
