Lines Matching refs:rap
235 struct ra *rap, *sorted, *ran, *rat;
244 for (rap = ifp->ras; rap && (ran = rap->next, 1); rap = ran) {
246 if (timercmp(&rap->received, &sorted->received, <)) {
247 rap->next = sorted;
248 sorted = rap;
253 if (timercmp(&rap->received, &rat->next->received, <)) {
254 rap->next = rat->next;
255 rat->next = rap;
261 rat->next = rap;
262 rap->next = NULL;
287 struct ra *rap;
354 for (rap = ifp->ras; rap; rap = rap->next) {
355 if (memcmp(rap->from.s6_addr, from.sin6_addr.s6_addr,
356 sizeof(rap->from.s6_addr)) == 0)
362 if (options & DHCPCD_DEBUG || rap == NULL ||
363 (rap->expired || rap->data_len != len ||
364 memcmp(rap->data, (unsigned char *)icp, rap->data_len) != 0))
366 if (rap) {
367 free(rap->data);
368 rap->data_len = 0;
374 if (rap == NULL) {
375 rap = xmalloc(sizeof(*rap));
376 rap->next = ifp->ras;
377 rap->options = NULL;
378 ifp->ras = rap;
379 memcpy(rap->from.s6_addr, from.sin6_addr.s6_addr,
380 sizeof(rap->from.s6_addr));
381 strlcpy(rap->sfrom, sfrom, sizeof(rap->sfrom));
382 rap->data_len = 0;
384 if (rap->data_len == 0) {
385 rap->data = xmalloc(len);
386 memcpy(rap->data, icp, len);
387 rap->data_len = len;
390 get_monotonic(&rap->received);
392 rap->lifetime = ntohs(nd_ra->nd_ra_router_lifetime);
393 rap->expired = 0;
443 rap->prefix_len = pi->nd_opt_pi_prefix_len;
444 rap->prefix_vltime =
446 rap->prefix_pltime =
510 for (raol = NULL, rao = rap->options;
523 rap->options = rao->next;
532 rao->next = rap->options;
533 rap->options = rao;
543 timeradd(&rap->received, &expire, &rao->expire);
573 const struct ra *rap;
581 for (rap = ifp->ras, i = 1; rap; rap = rap->next, i++) {
585 setvar(&env, prefix, buffer, rap->sfrom);
589 for (rao = rap->options; rao; rao = rao->next) {
626 "%d", rap->prefix_len);
632 "%d", rap->prefix_vltime);
638 "%d", rap->prefix_pltime);
654 ipv6rs_free_opts(struct ra *rap)
658 for (rao = rap->options; rao && (raon = rao->next, 1); rao = raon) {
667 struct ra *rap, *ran;
671 for (rap = ifp->ras; rap && (ran = rap->next, 1); rap = ran) {
672 ipv6rs_free_opts(rap);
673 free(rap->data);
674 free(rap);
683 struct ra *rap, *ran, *ral;
695 for (rap = ifp->ras, ral = NULL;
696 rap && (ran = rap->next, 1);
697 ral = rap, rap = ran)
699 lt.tv_sec = rap->lifetime;
701 timeradd(&rap->received, <, &expire);
704 ifp->name, rap->sfrom);
705 rap->expired = expired = 1;
710 ipv6rs_free_opts(rap);
711 free(rap);
718 for (rao = rap->options, raol = NULL;
727 ifp->name, rap->sfrom, rao->type);
728 rap->expired = expired = 1;
732 rap->options = raon;