Check for loopback. @return @c true if this is an IP loopback address, @c false otherwise.
| 702 | /// Check for loopback. |
| 703 | /// @return @c true if this is an IP loopback address, @c false otherwise. |
| 704 | inline bool |
| 705 | ats_is_ip_loopback(sockaddr const *ip) |
| 706 | { |
| 707 | return ip && ((AF_INET == ip->sa_family && 0x7F == ats_ip_addr8_cast(ip)[0]) || |
| 708 | (AF_INET6 == ip->sa_family && IN6_IS_ADDR_LOOPBACK(&ats_ip6_addr_cast(ip)))); |
| 709 | } |
| 710 | |
| 711 | /// Check for loopback. |
| 712 | /// @return @c true if this is an IP loopback address, @c false otherwise. |