Simon Kelley | d1ced3a | 2018-01-01 22:18:03 +0000 | [diff] [blame] | 1 | /* dnsmasq is Copyright (c) 2000-2018 Simon Kelley |
Simon Kelley | c3a0408 | 2014-01-11 22:18:19 +0000 | [diff] [blame] | 2 | |
| 3 | This program is free software; you can redistribute it and/or modify |
| 4 | it under the terms of the GNU General Public License as published by |
| 5 | the Free Software Foundation; version 2 dated June, 1991, or |
| 6 | (at your option) version 3 dated 29 June, 2007. |
| 7 | |
| 8 | This program is distributed in the hope that it will be useful, |
| 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | GNU General Public License for more details. |
| 12 | |
| 13 | You should have received a copy of the GNU General Public License |
| 14 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ |
| 16 | |
| 17 | |
| 18 | |
| 19 | #define IN6_IS_ADDR_ULA(a) \ |
| 20 | ((((__const uint32_t *) (a))[0] & htonl (0xff000000)) \ |
| 21 | == htonl (0xfd000000)) |
| 22 | |
| 23 | #define IN6_IS_ADDR_ULA_ZERO(a) \ |
| 24 | (((__const uint32_t *) (a))[0] == htonl (0xfd000000) \ |
| 25 | && ((__const uint32_t *) (a))[1] == 0 \ |
| 26 | && ((__const uint32_t *) (a))[2] == 0 \ |
| 27 | && ((__const uint32_t *) (a))[3] == 0) |
| 28 | |
| 29 | #define IN6_IS_ADDR_LINK_LOCAL_ZERO(a) \ |
| 30 | (((__const uint32_t *) (a))[0] == htonl (0xfe800000) \ |
| 31 | && ((__const uint32_t *) (a))[1] == 0 \ |
| 32 | && ((__const uint32_t *) (a))[2] == 0 \ |
| 33 | && ((__const uint32_t *) (a))[3] == 0) |
| 34 | |