diff options
author | Joe Perches <joe@perches.com> | 2007-12-16 16:46:59 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:58:17 -0500 |
commit | b5cb2bbc4c6cb489941be881e8adfe136ee45b8e (patch) | |
tree | f7a1280cfb46609910d8e6189bc96edc5375b645 /include/net/sctp | |
parent | 37ef8dd7f3f2f228336e3779e7cec762d90e1f00 (diff) |
[IPV4] sctp: Use ipv4_is_<type>
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sctp')
-rw-r--r-- | include/net/sctp/constants.h | 36 |
1 files changed, 6 insertions, 30 deletions
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index 05f22a6afbcd..fefcba67bd1e 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
@@ -365,36 +365,12 @@ typedef enum { | |||
365 | * Also, RFC 8.4, non-unicast addresses are not considered valid SCTP | 365 | * Also, RFC 8.4, non-unicast addresses are not considered valid SCTP |
366 | * addresses. | 366 | * addresses. |
367 | */ | 367 | */ |
368 | #define IS_IPV4_UNUSABLE_ADDRESS(a) \ | 368 | #define IS_IPV4_UNUSABLE_ADDRESS(a) \ |
369 | ((htonl(INADDR_BROADCAST) == *a) || \ | 369 | ((htonl(INADDR_BROADCAST) == a) || \ |
370 | (MULTICAST(*a)) || \ | 370 | ipv4_is_multicast(a) || \ |
371 | (((unsigned char *)(a))[0] == 0) || \ | 371 | ipv4_is_zeronet(a) || \ |
372 | ((((unsigned char *)(a))[0] == 198) && \ | 372 | ipv4_is_test_198(a) || \ |
373 | (((unsigned char *)(a))[1] == 18) && \ | 373 | ipv4_is_anycast_6to4(a)) |
374 | (((unsigned char *)(a))[2] == 0)) || \ | ||
375 | ((((unsigned char *)(a))[0] == 192) && \ | ||
376 | (((unsigned char *)(a))[1] == 88) && \ | ||
377 | (((unsigned char *)(a))[2] == 99))) | ||
378 | |||
379 | /* IPv4 Link-local addresses: 169.254.0.0/16. */ | ||
380 | #define IS_IPV4_LINK_ADDRESS(a) \ | ||
381 | ((((unsigned char *)(a))[0] == 169) && \ | ||
382 | (((unsigned char *)(a))[1] == 254)) | ||
383 | |||
384 | /* RFC 1918 "Address Allocation for Private Internets" defines the IPv4 | ||
385 | * private address space as the following: | ||
386 | * | ||
387 | * 10.0.0.0 - 10.255.255.255 (10/8 prefix) | ||
388 | * 172.16.0.0.0 - 172.31.255.255 (172.16/12 prefix) | ||
389 | * 192.168.0.0 - 192.168.255.255 (192.168/16 prefix) | ||
390 | */ | ||
391 | #define IS_IPV4_PRIVATE_ADDRESS(a) \ | ||
392 | ((((unsigned char *)(a))[0] == 10) || \ | ||
393 | ((((unsigned char *)(a))[0] == 172) && \ | ||
394 | (((unsigned char *)(a))[1] >= 16) && \ | ||
395 | (((unsigned char *)(a))[1] < 32)) || \ | ||
396 | ((((unsigned char *)(a))[0] == 192) && \ | ||
397 | (((unsigned char *)(a))[1] == 168))) | ||
398 | 374 | ||
399 | /* Flags used for the bind address copy functions. */ | 375 | /* Flags used for the bind address copy functions. */ |
400 | #define SCTP_ADDR6_ALLOWED 0x00000001 /* IPv6 address is allowed by | 376 | #define SCTP_ADDR6_ALLOWED 0x00000001 /* IPv6 address is allowed by |