Lines Matching +full:bit +full:- +full:per +full:- +full:seconds
9 * SPDX-License-Identifier: Apache-2.0
41 * seconds value internally for applicable options. These are also values
53 /* This is the upper bound on DESYNC_FACTOR. The value is in seconds.
63 #define DESYNC_FACTOR(ipv6) ((ipv6)->desync_factor)
67 /* The REGEN_ADVANCE is in seconds
139 ARRAY_FOR_EACH(ipv6->unicast, i) { in ipv6_pe_prefix_already_exists()
140 if (!ipv6->unicast[i].is_used || in ipv6_pe_prefix_already_exists()
141 ipv6->unicast[i].address.family != AF_INET6 || in ipv6_pe_prefix_already_exists()
142 !ipv6->unicast[i].is_temporary || in ipv6_pe_prefix_already_exists()
143 ipv6->unicast[i].addr_state == NET_ADDR_DEPRECATED) { in ipv6_pe_prefix_already_exists()
148 (uint8_t *)&ipv6->unicast[i].address.in6_addr, in ipv6_pe_prefix_already_exists()
163 ARRAY_FOR_EACH(ipv6->unicast, i) { in ipv6_pe_prefix_remove()
164 if (ipv6->unicast[i].is_used && in ipv6_pe_prefix_remove()
165 ipv6->unicast[i].address.family == AF_INET6 && in ipv6_pe_prefix_remove()
166 ipv6->unicast[i].is_temporary && in ipv6_pe_prefix_remove()
168 (uint8_t *)&ipv6->unicast[i].address.in6_addr, in ipv6_pe_prefix_remove()
171 &ipv6->unicast[i].address.in6_addr); in ipv6_pe_prefix_remove()
185 ARRAY_FOR_EACH(ipv6->unicast, i) { in ipv6_pe_prefix_update_lifetimes()
186 if (!(ipv6->unicast[i].is_used && in ipv6_pe_prefix_update_lifetimes()
187 ipv6->unicast[i].address.family == AF_INET6 && in ipv6_pe_prefix_update_lifetimes()
188 ipv6->unicast[i].is_temporary && in ipv6_pe_prefix_update_lifetimes()
189 ipv6->unicast[i].addr_state == NET_ADDR_PREFERRED && in ipv6_pe_prefix_update_lifetimes()
191 (uint8_t *)&ipv6->unicast[i].address.in6_addr, in ipv6_pe_prefix_update_lifetimes()
196 addr_age = k_uptime_seconds() - ipv6->unicast[i].addr_create_time; in ipv6_pe_prefix_update_lifetimes()
200 (new_age >= (TEMP_PREFERRED_LIFETIME - in ipv6_pe_prefix_update_lifetimes()
205 net_if_ipv6_addr_update_lifetime(&ipv6->unicast[i], vlifetime); in ipv6_pe_prefix_update_lifetimes()
207 /* RFC 8981 ch 3.5, "... at most one temporary address per in ipv6_pe_prefix_update_lifetimes()
208 * prefix should be in a non-deprecated state at any given in ipv6_pe_prefix_update_lifetimes()
250 memcpy(buf.mac, net_if_get_link_addr(iface)->addr, in gen_temporary_iid()
251 MIN(sizeof(buf.mac), net_if_get_link_addr(iface)->len)); in gen_temporary_iid()
338 TEMP_PREFERRED_LIFETIME - in net_ipv6_pe_start()
341 preferred_lifetime <= REGEN_ADVANCE(ipv6->retrans_timer, 1U)) { in net_ipv6_pe_start()
344 REGEN_ADVANCE(ipv6->retrans_timer, 1U), in net_ipv6_pe_start()
357 (iface->config.name, in net_ipv6_pe_start()
358 sizeof(iface->config.name)), in net_ipv6_pe_start()
359 (net_if_get_device(iface)->name, in net_ipv6_pe_start()
360 strlen(net_if_get_device(iface)->name))), in net_ipv6_pe_start()
382 iface->pe_enabled = false; in net_ipv6_pe_start()
396 lifetime = TEMP_VALID_LIFETIME - in net_ipv6_pe_start()
401 /* Make sure that the address timeout happens at least two seconds in net_ipv6_pe_start()
406 ifaddr->is_temporary = true; in net_ipv6_pe_start()
407 ifaddr->addr_preferred_lifetime = preferred_lifetime; in net_ipv6_pe_start()
408 ifaddr->addr_timeout = ifaddr->addr_preferred_lifetime - DESYNC_FACTOR(ipv6); in net_ipv6_pe_start()
409 ifaddr->addr_create_time = k_uptime_seconds(); in net_ipv6_pe_start()
412 lifetime, DESYNC_FACTOR(ipv6), ifaddr->addr_timeout, in net_ipv6_pe_start()
413 ifaddr->addr_preferred_lifetime, vlifetime); in net_ipv6_pe_start()
420 vlifetimeout = K_SECONDS(ifaddr->addr_timeout); in net_ipv6_pe_start()
424 NET_DBG("Next check for temp addresses in %d seconds", in net_ipv6_pe_start()
425 ifaddr->addr_timeout); in net_ipv6_pe_start()
452 ARRAY_FOR_EACH(ipv6->unicast, i) { in iface_cb()
453 if (!ipv6->unicast[i].is_used || in iface_cb()
454 ipv6->unicast[i].address.family != AF_INET6 || in iface_cb()
455 !ipv6->unicast[i].is_temporary) { in iface_cb()
460 (uint8_t *)&ipv6->unicast[i].address.in6_addr, in iface_cb()
469 &ipv6->unicast[i].address.in6_addr); in iface_cb()
474 &ipv6->unicast[i].address.in6_addr); in iface_cb()
526 int free_slot = -1; in net_ipv6_pe_add_filter()
549 ret = -EALREADY; in net_ipv6_pe_add_filter()
555 ret = -ENOMEM; in net_ipv6_pe_add_filter()
582 return -ENOTSUP; in net_ipv6_pe_add_filter()
589 int ret = -ENOENT; in net_ipv6_pe_del_filter()
618 return -ENOTSUP; in net_ipv6_pe_del_filter()
671 dw->iface, &dw->addr, in send_deprecated_event()
688 ARRAY_FOR_EACH(ipv6->unicast, i) { in renewal_cb()
691 if (!ipv6->unicast[i].is_used || in renewal_cb()
692 ipv6->unicast[i].address.family != AF_INET6 || in renewal_cb()
693 !ipv6->unicast[i].is_temporary || in renewal_cb()
694 ipv6->unicast[i].addr_state == NET_ADDR_DEPRECATED) { in renewal_cb()
701 diff = (int32_t)(ipv6->unicast[i].addr_create_time - k_uptime_seconds()); in renewal_cb()
704 if (diff < (ipv6->unicast[i].addr_preferred_lifetime - in renewal_cb()
705 REGEN_ADVANCE(ipv6->retrans_timer, 1U) - in renewal_cb()
710 net_ipaddr_copy(&prefix, &ipv6->unicast[i].address.in6_addr); in renewal_cb()
711 memset(prefix.s6_addr + 8, 0, sizeof(prefix) - 8); in renewal_cb()
714 net_sprint_ipv6_addr(&ipv6->unicast[i].address.in6_addr)); in renewal_cb()
716 ipv6->unicast[i].addr_state = NET_ADDR_DEPRECATED; in renewal_cb()
720 * re-connect to use the new address. We cannot send deprecated in renewal_cb()
722 * and that takes a bit time. in renewal_cb()
740 &ipv6->unicast[i].address.in6_addr, in renewal_cb()
762 lifetime = TEMP_VALID_LIFETIME - in net_ipv6_pe_init()
766 iface->pe_enabled = false; in net_ipv6_pe_init()
768 ret = -EINVAL; in net_ipv6_pe_init()
772 iface->pe_enabled = true; in net_ipv6_pe_init()
773 iface->pe_prefer_public = in net_ipv6_pe_init()
783 iface->pe_enabled ? "enabled" : "disabled", in net_ipv6_pe_init()
784 iface->pe_prefer_public ? "public" : "temporary", in net_ipv6_pe_init()