| 1 |
#ifndef WIN32_LEAN_AND_MEAN |
| 2 |
#define WIN32_LEAN_AND_MEAN |
| 3 |
#endif |
| 4 |
#undef __CRT__NO_INLINE |
| 5 |
#define __CRT__NO_INLINE |
| 6 |
#include <winsock2.h> |
| 7 |
#include <ws2tcpip.h> |
| 8 |
|
| 9 |
#undef IN6_IS_ADDR_LOOPBACK |
| 10 |
#define IN6_IS_ADDR_LOOPBACK(a) ( ((a)->s6_words[0] == 0) && \ |
| 11 |
((a)->s6_words[1] == 0) && \ |
| 12 |
((a)->s6_words[2] == 0) && \ |
| 13 |
((a)->s6_words[3] == 0) && \ |
| 14 |
((a)->s6_words[4] == 0) && \ |
| 15 |
((a)->s6_words[5] == 0) && \ |
| 16 |
((a)->s6_words[6] == 0) && \ |
| 17 |
((a)->s6_words[7] == 0x0100) ) |
| 18 |
|
| 19 |
int IN6ADDR_ISLOOPBACK(const struct sockaddr_in6 *a) |
| 20 |
{ |
| 21 |
return ((a->sin6_family==AF_INET6) && |
| 22 |
IN6_IS_ADDR_LOOPBACK(&a->sin6_addr)); |
| 23 |
} |