3 #include <netinet/in.h>
11 memset (buf
, '\0', 16);
13 if (! IN6_IS_ADDR_UNSPECIFIED (buf
))
15 puts ("positive IN6_IS_ADDR_UNSPECIFIED failed");
18 for (size_t i
= 0; i
< 16; ++i
)
21 if (IN6_IS_ADDR_UNSPECIFIED (buf
))
23 printf ("negative IN6_IS_ADDR_UNSPECIFIED with byte %zu failed\n",
30 if (IN6_IS_ADDR_LOOPBACK (buf
))
32 puts ("negative IN6_IS_ADDR_UNSPECIFIED failed");
36 if (! IN6_IS_ADDR_LOOPBACK (buf
))
38 puts ("positive IN6_IS_ADDR_UNSPECIFIED failed");
45 if (! IN6_IS_ADDR_LINKLOCAL (buf
))
47 puts ("positive IN6_IS_ADDR_LINKLOCAL failed");
50 for (size_t i
= 1; i
< 16; ++i
)
53 if (! IN6_IS_ADDR_LINKLOCAL (buf
))
55 printf ("positive IN6_IS_ADDR_LINKLOCAL byte %zu failed\n", i
);
62 if (IN6_IS_ADDR_LINKLOCAL (buf
))
64 puts ("negative IN6_IS_ADDR_LINKLOCAL failed");
69 if (IN6_IS_ADDR_LINKLOCAL (buf
))
71 puts ("negative IN6_IS_ADDR_LINKLOCAL #2 failed");
77 if (! IN6_IS_ADDR_SITELOCAL (buf
))
79 puts ("positive IN6_IS_ADDR_SITELOCAL failed");
82 for (size_t i
= 1; i
< 16; ++i
)
85 if (! IN6_IS_ADDR_SITELOCAL (buf
))
87 printf ("positive IN6_IS_ADDR_SITELOCAL byte %zu failed\n", i
);
94 if (IN6_IS_ADDR_SITELOCAL (buf
))
96 puts ("negative IN6_IS_ADDR_SITELOCAL failed");
101 if (IN6_IS_ADDR_SITELOCAL (buf
))
103 puts ("negative IN6_IS_ADDR_SITELOCAL #2 failed");
107 memset (buf
, '\0', 16);
110 if (! IN6_IS_ADDR_V4MAPPED (buf
))
112 puts ("positive IN6_IS_ADDR_V4MAPPED failed");
115 for (size_t i
= 12; i
< 16; ++i
)
118 if (! IN6_IS_ADDR_V4MAPPED (buf
))
120 printf ("positive IN6_IS_ADDR_V4MAPPED byte %zu failed\n", i
);
125 for (size_t i
= 0; i
< 12; ++i
)
128 if (IN6_IS_ADDR_V4MAPPED (buf
))
130 printf ("negative IN6_IS_ADDR_V4MAPPED byte %zu failed\n", i
);
136 memset (buf
, '\0', 16);
137 for (size_t i
= 12; i
< 16; ++i
)
140 if (! IN6_IS_ADDR_V4COMPAT (buf
))
142 printf ("positive IN6_IS_ADDR_V4COMPAT byte %zu failed\n", i
);
147 for (size_t i
= 0; i
< 12; ++i
)
150 if (IN6_IS_ADDR_V4COMPAT (buf
))
152 printf ("negative IN6_IS_ADDR_V4COMPAT byte %zu failed\n", i
);
157 if (IN6_IS_ADDR_V4COMPAT (buf
))
159 puts ("negative IN6_IS_ADDR_V4COMPAT #2 failed");
163 if (IN6_IS_ADDR_V4COMPAT (buf
))
165 puts ("negative IN6_IS_ADDR_V4COMPAT #3 failed");
172 #define TEST_FUNCTION do_test ()
173 #include "../test-skeleton.c"