Lines Matching refs:ifaddr

1225 	struct net_if_addr *ifaddr, *next;  in dad_timeout()  local
1236 ifaddr, next, dad_node) { in dad_timeout()
1240 delay = (int32_t)(ifaddr->dad_start + in dad_timeout()
1247 sys_slist_remove(&active_dad_timers, NULL, &ifaddr->dad_node); in dad_timeout()
1248 sys_slist_append(&expired_list, &ifaddr->dad_node); in dad_timeout()
1250 ifaddr = NULL; in dad_timeout()
1253 if ((ifaddr != NULL) && (delay > 0)) { in dad_timeout()
1259 SYS_SLIST_FOR_EACH_CONTAINER(&expired_list, ifaddr, dad_node) { in dad_timeout()
1263 net_sprint_ipv6_addr(&ifaddr->address.in6_addr), in dad_timeout()
1264 ifaddr->ifindex); in dad_timeout()
1266 ifaddr->addr_state = NET_ADDR_PREFERRED; in dad_timeout()
1267 iface = net_if_get_by_index(ifaddr->ifindex); in dad_timeout()
1271 &ifaddr->address.in6_addr, in dad_timeout()
1277 net_ipv6_nbr_rm(iface, &ifaddr->address.in6_addr); in dad_timeout()
1282 struct net_if_addr *ifaddr) in net_if_ipv6_start_dad() argument
1284 ifaddr->addr_state = NET_ADDR_TENTATIVE; in net_if_ipv6_start_dad()
1292 net_sprint_ipv6_addr(&ifaddr->address.in6_addr)); in net_if_ipv6_start_dad()
1294 ifaddr->dad_count = 1U; in net_if_ipv6_start_dad()
1296 if (!net_ipv6_start_dad(iface, ifaddr)) { in net_if_ipv6_start_dad()
1297 ifaddr->dad_start = k_uptime_get_32(); in net_if_ipv6_start_dad()
1298 ifaddr->ifindex = net_if_get_by_iface(iface); in net_if_ipv6_start_dad()
1302 &ifaddr->dad_node); in net_if_ipv6_start_dad()
1303 sys_slist_append(&active_dad_timers, &ifaddr->dad_node); in net_if_ipv6_start_dad()
1315 net_sprint_ipv6_addr(&ifaddr->address.in6_addr)); in net_if_ipv6_start_dad()
1321 struct net_if_addr *ifaddr; in net_if_start_dad() local
1360 ifaddr = net_if_ipv6_addr_add(iface, &addr, NET_ADDR_AUTOCONF, 0); in net_if_start_dad()
1361 if (!ifaddr) { in net_if_start_dad()
1367 IF_ENABLED(CONFIG_NET_IPV6_IID_STABLE, (ipv6->iid = ifaddr)); in net_if_start_dad()
1375 &ipv6->unicast[i] == ifaddr || in net_if_start_dad()
1390 struct net_if_addr *ifaddr; in net_if_ipv6_dad_failed() local
1395 ifaddr = net_if_ipv6_addr_lookup(addr, &iface); in net_if_ipv6_dad_failed()
1396 if (!ifaddr) { in net_if_ipv6_dad_failed()
1403 ifaddr->dad_count++; in net_if_ipv6_dad_failed()
1408 (ifaddr->addr_timeout), (0)); in net_if_ipv6_dad_failed()
1410 (ifaddr->addr_preferred_lifetime), (0U)); in net_if_ipv6_dad_failed()
1412 if (!net_ipv6_pe_check_dad(ifaddr->dad_count)) { in net_if_ipv6_dad_failed()
1421 &ifaddr->address.in6_addr, in net_if_ipv6_dad_failed()
1446 struct net_if_addr *ifaddr) in net_if_ipv6_start_dad() argument
1448 ifaddr->addr_state = NET_ADDR_PREFERRED; in net_if_ipv6_start_dad()
1690 static void address_expired(struct net_if_addr *ifaddr) in address_expired() argument
1693 net_sprint_ipv6_addr(&ifaddr->address.in6_addr)); in address_expired()
1696 &ifaddr->lifetime.node); in address_expired()
1698 net_timeout_set(&ifaddr->lifetime, 0, 0); in address_expired()
1702 if (&iface->config.ip.ipv6->unicast[i] == ifaddr) { in address_expired()
1757 static void address_start_timer(struct net_if_addr *ifaddr, uint32_t vlifetime) in address_start_timer() argument
1763 &ifaddr->lifetime.node); in address_start_timer()
1766 &ifaddr->lifetime.node); in address_start_timer()
1768 net_timeout_set(&ifaddr->lifetime, vlifetime, k_uptime_get_32()); in address_start_timer()
1774 struct net_if_addr *ifaddr) in net_if_ipv6_start_dad() argument
1776 ifaddr->addr_state = NET_ADDR_PREFERRED; in net_if_ipv6_start_dad()
1784 struct net_if_addr *ifaddr = NULL; in net_if_ipv6_addr_lookup() local
1812 ifaddr = &ipv6->unicast[i]; in net_if_ipv6_addr_lookup()
1822 return ifaddr; in net_if_ipv6_addr_lookup()
1828 struct net_if_addr *ifaddr = NULL; in net_if_ipv6_addr_lookup_by_iface() local
1848 ifaddr = &ipv6->unicast[i]; in net_if_ipv6_addr_lookup_by_iface()
1856 return ifaddr; in net_if_ipv6_addr_lookup_by_iface()
1885 void net_if_ipv6_addr_update_lifetime(struct net_if_addr *ifaddr, in net_if_ipv6_addr_update_lifetime() argument
1891 net_sprint_ipv6_addr(&ifaddr->address.in6_addr), in net_if_ipv6_addr_update_lifetime()
1894 ifaddr->addr_state = NET_ADDR_PREFERRED; in net_if_ipv6_addr_update_lifetime()
1896 address_start_timer(ifaddr, vlifetime); in net_if_ipv6_addr_update_lifetime()
1921 static inline void net_if_addr_init(struct net_if_addr *ifaddr, in net_if_addr_init() argument
1926 ifaddr->is_used = true; in net_if_addr_init()
1927 ifaddr->is_temporary = false; in net_if_addr_init()
1928 ifaddr->address.family = AF_INET6; in net_if_addr_init()
1929 ifaddr->addr_type = addr_type; in net_if_addr_init()
1930 ifaddr->atomic_ref = ATOMIC_INIT(1); in net_if_addr_init()
1932 net_ipaddr_copy(&ifaddr->address.in6_addr, addr); in net_if_addr_init()
1937 ifaddr->is_infinite = false; in net_if_addr_init()
1943 net_if_ipv6_addr_update_lifetime(ifaddr, vlifetime); in net_if_addr_init()
1945 ifaddr->is_infinite = true; in net_if_addr_init()
1954 struct net_if_addr *ifaddr = NULL; in net_if_ipv6_addr_add() local
1963 ifaddr = ipv6_addr_find(iface, addr); in net_if_ipv6_addr_add()
1964 if (ifaddr) { in net_if_ipv6_addr_add()
2010 ifaddr = &ipv6->unicast[i]; in net_if_ipv6_addr_add()
2017 return ifaddr; in net_if_ipv6_addr_add()
3756 struct net_if_addr *ifaddr = NULL; in net_if_ipv4_addr_get_first_by_index() local
3776 ifaddr = &ipv4->unicast[i].ipv4; in net_if_ipv4_addr_get_first_by_index()
3783 return ifaddr; in net_if_ipv4_addr_get_first_by_index()
3789 struct net_if_addr *ifaddr = NULL; in net_if_ipv4_addr_lookup() local
3815 ifaddr = &ipv4->unicast[i].ipv4; in net_if_ipv4_addr_lookup()
3825 return ifaddr; in net_if_ipv4_addr_lookup()
4183 void net_if_ipv4_acd_succeeded(struct net_if *iface, struct net_if_addr *ifaddr) in net_if_ipv4_acd_succeeded() argument
4188 net_sprint_ipv4_addr(&ifaddr->address.in_addr), in net_if_ipv4_acd_succeeded()
4189 ifaddr->ifindex); in net_if_ipv4_acd_succeeded()
4191 ifaddr->addr_state = NET_ADDR_PREFERRED; in net_if_ipv4_acd_succeeded()
4194 &ifaddr->address.in_addr, in net_if_ipv4_acd_succeeded()
4200 void net_if_ipv4_acd_failed(struct net_if *iface, struct net_if_addr *ifaddr) in net_if_ipv4_acd_failed() argument
4205 net_sprint_ipv4_addr(&ifaddr->address.in_addr), in net_if_ipv4_acd_failed()
4206 ifaddr->ifindex); in net_if_ipv4_acd_failed()
4209 &ifaddr->address.in_addr, in net_if_ipv4_acd_failed()
4212 net_if_ipv4_addr_rm(iface, &ifaddr->address.in_addr); in net_if_ipv4_acd_failed()
4217 void net_if_ipv4_start_acd(struct net_if *iface, struct net_if_addr *ifaddr) in net_if_ipv4_start_acd() argument
4219 ifaddr->addr_state = NET_ADDR_TENTATIVE; in net_if_ipv4_start_acd()
4226 net_sprint_ipv4_addr(&ifaddr->address.in_addr)); in net_if_ipv4_start_acd()
4228 if (net_ipv4_acd_start(iface, ifaddr) != 0) { in net_if_ipv4_start_acd()
4230 net_sprint_ipv4_addr(&ifaddr->address.in_addr), in net_if_ipv4_start_acd()
4234 net_if_ipv4_acd_succeeded(iface, ifaddr); in net_if_ipv4_start_acd()
4238 iface, net_sprint_ipv4_addr(&ifaddr->address.in_addr)); in net_if_ipv4_start_acd()
4284 void net_if_ipv4_start_acd(struct net_if *iface, struct net_if_addr *ifaddr) in net_if_ipv4_start_acd() argument
4288 ifaddr->addr_state = NET_ADDR_PREFERRED; in net_if_ipv4_start_acd()
4300 struct net_if_addr *ifaddr = NULL; in net_if_ipv4_addr_add() local
4311 ifaddr = ipv4_addr_find(iface, addr); in net_if_ipv4_addr_add()
4312 if (ifaddr) { in net_if_ipv4_addr_add()
4322 ifaddr = &cur->ipv4; in net_if_ipv4_addr_add()
4328 ifaddr = &cur->ipv4; in net_if_ipv4_addr_add()
4334 if (ifaddr) { in net_if_ipv4_addr_add()
4335 ifaddr->is_used = true; in net_if_ipv4_addr_add()
4336 ifaddr->address.family = AF_INET; in net_if_ipv4_addr_add()
4337 ifaddr->address.in_addr.s4_addr32[0] = in net_if_ipv4_addr_add()
4339 ifaddr->addr_type = addr_type; in net_if_ipv4_addr_add()
4340 ifaddr->atomic_ref = ATOMIC_INIT(1); in net_if_ipv4_addr_add()
4344 ifaddr->is_infinite = false; in net_if_ipv4_addr_add()
4346 ifaddr->is_infinite = true; in net_if_ipv4_addr_add()
4361 net_if_ipv4_start_acd(iface, ifaddr); in net_if_ipv4_addr_add()
4363 ifaddr->addr_state = NET_ADDR_PREFERRED; in net_if_ipv4_addr_add()
4369 &ifaddr->address.in_addr, in net_if_ipv4_addr_add()
4377 return ifaddr; in net_if_ipv4_addr_add()
4983 struct net_if_addr *ifaddr = NULL; in get_ifaddr() local
5027 ifaddr = &ipv6->unicast[found]; in get_ifaddr()
5055 ifaddr = &ipv4->unicast[i].ipv4; in get_ifaddr()
5064 return ifaddr; in get_ifaddr()
5068 struct net_if_addr *ifaddr, in remove_ipv6_ifaddr() argument
5080 if (!ifaddr->is_infinite) { in remove_ipv6_ifaddr()
5085 &ifaddr->lifetime.node); in remove_ipv6_ifaddr()
5098 &ifaddr->dad_node); in remove_ipv6_ifaddr()
5109 net_ipv6_addr_create_solicited_node(&ifaddr->address.in6_addr, in remove_ipv6_ifaddr()
5120 &ifaddr->address.in6_addr, in remove_ipv6_ifaddr()
5127 struct net_if_addr *ifaddr) in remove_ipv4_ifaddr() argument
5139 net_ipv4_acd_cancel(iface, ifaddr); in remove_ipv4_ifaddr()
5144 &ifaddr->address.in_addr, in remove_ipv4_ifaddr()
5168 struct net_if_addr *ifaddr; in net_if_addr_ref_debug() local
5178 ifaddr = get_ifaddr(iface, family, addr, NULL); in net_if_addr_ref_debug()
5181 ref = ifaddr ? atomic_get(&ifaddr->atomic_ref) : 0; in net_if_addr_ref_debug()
5193 } while (!atomic_cas(&ifaddr->atomic_ref, ref, ref + 1)); in net_if_addr_ref_debug()
5198 net_addr_ntop(ifaddr->address.family, in net_if_addr_ref_debug()
5199 (void *)&ifaddr->address.in_addr, in net_if_addr_ref_debug()
5201 ifaddr->addr_state, in net_if_addr_ref_debug()
5206 return ifaddr; in net_if_addr_ref_debug()
5220 struct net_if_addr *ifaddr; in net_if_addr_unref_debug() local
5231 ifaddr = get_ifaddr(iface, family, addr, &maddr_count); in net_if_addr_unref_debug()
5233 if (!ifaddr) { in net_if_addr_unref_debug()
5246 ref = atomic_get(&ifaddr->atomic_ref); in net_if_addr_unref_debug()
5252 ifaddr, in net_if_addr_unref_debug()
5258 } while (!atomic_cas(&ifaddr->atomic_ref, ref, ref - 1)); in net_if_addr_unref_debug()
5263 net_addr_ntop(ifaddr->address.family, in net_if_addr_unref_debug()
5264 (void *)&ifaddr->address.in_addr, in net_if_addr_unref_debug()
5266 ifaddr->addr_state, in net_if_addr_unref_debug()
5274 ifaddr->is_used = false; in net_if_addr_unref_debug()
5277 remove_ipv6_ifaddr(iface, ifaddr, maddr_count); in net_if_addr_unref_debug()
5281 remove_ipv4_ifaddr(iface, ifaddr); in net_if_addr_unref_debug()