Lines Matching +full:0 +full:- +full:127

1 /*-
55 g_total = 0; in main()
56 g_pass = 0; in main()
57 g_fail = 0; in main()
58 memset(g_funcname, 0, sizeof(g_funcname)); in main()
72 if (g_fail == 0) in main()
87 set_funcname("test_rth_init", sizeof("test_rth_init\0")); in test_rth_init()
90 checkptr(NULL, pbuf, "buffer too small\0"); in test_rth_init()
92 pbuf = inet6_rth_init((void *)buf, 10240, IPV6_RTHDR_TYPE_0, 0); in test_rth_init()
93 checkptr((caddr_t)&buf, pbuf, "0 segments\0"); in test_rth_init()
95 pbuf = inet6_rth_init((void *)buf, 10240, IPV6_RTHDR_TYPE_0, 127); in test_rth_init()
96 checkptr((caddr_t)&buf, pbuf, "127 segments\0"); in test_rth_init()
98 pbuf = inet6_rth_init((void *)buf, 10240, IPV6_RTHDR_TYPE_0, -1); in test_rth_init()
99 checkptr(NULL, pbuf, "negative number of segments\0"); in test_rth_init()
102 checkptr(NULL, pbuf, "128 segments\0"); in test_rth_init()
113 set_funcname("test_rth_add", sizeof("test_rth_add\0")); in test_rth_add()
115 if (NULL == inet6_rth_init(buf, 10240, IPV6_RTHDR_TYPE_0, 127)) in test_rth_add()
117 memset((void *)&hints, 0, sizeof(struct addrinfo)); in test_rth_add()
120 if (0 != getaddrinfo("::1", NULL, (const struct addrinfo *)&hints, &res)) in test_rth_add()
122 for (i = 0; i < 127; i++) in test_rth_add()
124 &((struct sockaddr_in6 *)(res->ai_addr))->sin6_addr); in test_rth_add()
125 checknum(127, ((struct ip6_rthdr0 *)buf)->ip6r0_segleft, 0, in test_rth_add()
126 "add 127 segments\0"); in test_rth_add()
129 &((struct sockaddr_in6 *)(res->ai_addr))->sin6_addr); in test_rth_add()
130 checknum(-1, ret, 0, "add 128th segment to 127 segment header\0"); in test_rth_add()
141 set_funcname("test_rth_segments", sizeof("test_rth_segments\0")); in test_rth_segments()
146 if (NULL == inet6_rth_init((void *)buf, 10240, IPV6_RTHDR_TYPE_0, 0)) in test_rth_segments()
148 ((struct ip6_rthdr *)buf)->ip6r_type = ~IPV6_RTHDR_TYPE_0; in test_rth_segments()
150 checknum(-1, seg, 0, "invalid routing header type\0"); in test_rth_segments()
153 * Test: 0 segments. in test_rth_segments()
155 if (NULL == inet6_rth_init((void *)buf, 10240, IPV6_RTHDR_TYPE_0, 0)) in test_rth_segments()
158 checknum(0, seg, 0, "0 segments\0"); in test_rth_segments()
161 * Test: 127 segments. in test_rth_segments()
163 if (NULL == inet6_rth_init((void *)buf, 10240, IPV6_RTHDR_TYPE_0, 127)) in test_rth_segments()
166 checknum(127, seg, 0, "127 segments\0"); in test_rth_segments()
169 * Test: -1 segments. in test_rth_segments()
172 if (NULL == inet6_rth_init((void *)buf, 10240, IPV6_RTHDR_TYPE_0, 0)) in test_rth_segments()
174 ((struct ip6_rthdr0 *)buf)->ip6r0_len = -1 * 2; in test_rth_segments()
176 checknum(-1, seg, 0, "-1 segments\0"); in test_rth_segments()
182 if (NULL == inet6_rth_init((void *)buf, 10240, IPV6_RTHDR_TYPE_0, 127)) in test_rth_segments()
184 ((struct ip6_rthdr0 *)buf)->ip6r0_len = 128 * 2; in test_rth_segments()
186 checknum(-1, seg, 0, "128 segments\0"); in test_rth_segments()
195 set_funcname("test_rth_space", sizeof("test_rth_space\0")); in test_rth_space()
200 len = inet6_rth_space(~IPV6_RTHDR_TYPE_0, 0); in test_rth_space()
201 checknum(0, len, 0, "invalid routing header type\0"); in test_rth_space()
206 len = inet6_rth_space(IPV6_RTHDR_TYPE_0, 0); in test_rth_space()
207 checknum(0, len, 1, "0 segments\0"); in test_rth_space()
208 len = inet6_rth_space(IPV6_RTHDR_TYPE_0, 127); in test_rth_space()
209 checknum(0, len, 1, "0 segments\0"); in test_rth_space()
214 len = inet6_rth_space(IPV6_RTHDR_TYPE_0, -1); in test_rth_space()
215 checknum(0, len, 0, "-1 segments\0"); in test_rth_space()
217 checknum(0, len, 0, "128 segments\0"); in test_rth_space()
236 mh.msg_controllen = CMSG_SPACE(0) * 2; /* 2 cmsghdr with no data */ in test_cmsg_nexthdr()
237 cmh.cmsg_len = CMSG_LEN(0); in test_cmsg_nexthdr()
246 (void *)((caddr_t)ancbuf + CMSG_SPACE(0)), in test_cmsg_nexthdr()
251 "more than one cmsghdr\0"); in test_cmsg_nexthdr()
258 mh.msg_controllen = CMSG_SPACE(0); in test_cmsg_nexthdr()
259 cmh.cmsg_len = CMSG_LEN(0); in test_cmsg_nexthdr()
263 checkptr(NULL, (caddr_t)cmhnextp, "only one cmsghdr\0"); in test_cmsg_nexthdr()
275 checkptr((caddr_t)cmhp, (caddr_t)cmhnextp, "null second argument\0"); in test_cmsg_nexthdr()
290 init_hdrs(&mh, NULL, NULL, 0); in test_cmsg_firsthdr()
294 "msg_control is NULL\0"); in test_cmsg_firsthdr()
296 /* - where msg_controllen < sizeof cmsghdr */ in test_cmsg_firsthdr()
297 init_hdrs(&mh, NULL, NULL, 0); in test_cmsg_firsthdr()
299 mh.msg_controllen = sizeof(cmh) - 1; in test_cmsg_firsthdr()
302 "msg_controllen < sizeof cmsghdr\0"); in test_cmsg_firsthdr()
304 /* - where msg_controllen == 0 */ in test_cmsg_firsthdr()
305 init_hdrs(&mh, NULL, NULL, 0); in test_cmsg_firsthdr()
307 mh.msg_controllen = 0; in test_cmsg_firsthdr()
310 "msg_controllen == 0\0"); in test_cmsg_firsthdr()
314 memset((void *)ancbuf, 0, sizeof(ancbuf)); in test_cmsg_firsthdr()
321 "with payload\0"); in test_cmsg_firsthdr()
328 memset((void *)mhp, 0, sizeof(struct msghdr)); in init_hdrs()
330 memset((void *)cmhp, 0, sizeof(struct cmsghdr)); in init_hdrs()
332 memset((void *)bufp, 0, bufsize); in init_hdrs()