Lines Matching refs:res

129 	restrict_u *	res,
137 inet_ntop(AF_INET6, &res->u.v6.addr, as, sizeof as);
138 inet_ntop(AF_INET6, &res->u.v6.mask, ms, sizeof ms);
140 struct in_addr sia = { htonl(res->u.v4.addr) };
141 struct in_addr sim = { htonl(res->u.v4.mask) };
147 res, as, ms, res->count, res->rflags, res->mflags,
148 res->ippeerlimit, res->expire, res->link);
159 restrict_u * res;
164 for (res = &restrict_def4; res != NULL; res = next) {
165 dump_restrict(res, 0);
166 next = res->link;
170 for (res = &restrict_def6; res != NULL; res = next) {
171 dump_restrict(res, 1);
172 next = res->link;
177 for (res = restrictlist4; res != NULL; res = next) {
178 dump_restrict(res, 0);
179 next = res->link;
184 for (res = restrictlist6; res != NULL; res = next) {
185 dump_restrict(res, 1);
186 next = res->link;
242 restrict_u * res;
245 UNLINK_HEAD_SLIST(res, resfree4, link);
246 if (res != NULL)
247 return res;
251 res = (void *)((char *)rl + (count - 1) * cb);
253 LINK_SLIST(resfree4, res, link);
254 res = (void *)((char *)res - cb);
256 INSIST(rl == res);
258 return res;
268 restrict_u * res;
271 UNLINK_HEAD_SLIST(res, resfree6, link);
272 if (res != NULL)
273 return res;
277 res = (void *)((char *)rl + (count - 1) * cb);
279 LINK_SLIST(resfree6, res, link);
280 res = (void *)((char *)res - cb);
282 INSIST(rl == res);
284 return res;
290 restrict_u * res,
298 if (RES_LIMITED & res->rflags)
305 UNLINK_SLIST(unlinked, *plisthead, res, link, restrict_u);
306 INSIST(unlinked == res);
309 zero_mem(res, V6_SIZEOF_RESTRICT_U);
312 zero_mem(res, V4_SIZEOF_RESTRICT_U);
315 LINK_SLIST(*plisthead, res, link);
344 restrict_u * res;
347 for (res = restrictlist4; res != NULL; res = next) {
348 struct in_addr sia = { htonl(res->u.v4.addr) };
350 next = res->link;
353 if ( res->expire
354 && res->expire <= current_time)
355 free_res(res, v6); /* zeroes the contents */
356 if ( res->u.v4.addr == (addr & res->u.v4.mask)
357 && ( !(RESM_NTPONLY & res->mflags)
359 DPRINTF(2, ("MATCH: ippeerlimit %d\n", res->ippeerlimit));
362 DPRINTF(2, ("doesn't match: ippeerlimit %d\n", res->ippeerlimit));
364 return res;
375 restrict_u * res;
379 for (res = restrictlist6; res != NULL; res = next) {
380 next = res->link;
381 INSIST(next != res);
382 if (res->expire &&
383 res->expire <= current_time)
384 free_res(res, v6);
385 MASK_IPV6_ADDR(&masked, addr, &res->u.v6.mask);
386 if (ADDR6_EQ(&masked, &res->u.v6.addr)
387 && (!(RESM_NTPONLY & res->mflags)
391 return res;
410 restrict_u *res;
422 for (res = rlist; res != NULL; res = res->link)
423 if (res->mflags == pmatch->mflags &&
424 !memcmp(&res->u, &pmatch->u, cb))
426 return res;
613 restrict_u * res;
634 res = NULL;
665 res = match_restrict_entry(&match, v6);
674 if (NULL == res) {
676 res = alloc_res6();
677 memcpy(res, &match,
681 res = alloc_res4();
682 memcpy(res, &match,
687 *plisthead, res,
689 ? res_sorts_before6(res, L_S_S_CUR())
690 : res_sorts_before4(res, L_S_S_CUR()),
697 && !(RES_LIMITED & res->rflags))
699 res->rflags |= rflags;
702 res->ippeerlimit = match.ippeerlimit;
711 if (res != NULL) {
712 if ( (RES_LIMITED & res->rflags)
715 res->rflags &= ~rflags;
726 if (res != NULL
728 || !(RESM_INTERFACE & res->mflags))
729 && res != &restrict_def4
730 && res != &restrict_def6)
731 free_res(res, v6);
754 restrict_u * res;
781 res = match_restrict4_addr(SRCADR(addr), SRCPORT(addr));
782 INSIST(res != NULL);
783 found_specific = (SRCADR(&onesmask) == res->u.v4.mask);
785 res = match_restrict6_addr(&SOCK_ADDR6(addr),
787 INSIST(res != NULL);
788 found_specific = ADDR6_EQ(&res->u.v6.mask,
791 if (!expire && found_specific && res->expire) {
793 free_res(res, IS_IPV6(addr));