Lines Matching refs:ipv4auto
26 static inline void ipv4_autoconf_addr_set(struct net_if_ipv4_autoconf *ipv4auto) in ipv4_autoconf_addr_set() argument
30 if (ipv4auto->state == NET_IPV4_AUTOCONF_INIT) { in ipv4_autoconf_addr_set()
31 ipv4auto->requested_ip.s4_addr[0] = 169U; in ipv4_autoconf_addr_set()
32 ipv4auto->requested_ip.s4_addr[1] = 254U; in ipv4_autoconf_addr_set()
33 ipv4auto->requested_ip.s4_addr[2] = sys_rand8_get() % 254; in ipv4_autoconf_addr_set()
34 ipv4auto->requested_ip.s4_addr[3] = sys_rand8_get() % 254; in ipv4_autoconf_addr_set()
38 ipv4auto->state == NET_IPV4_AUTOCONF_INIT ? "Init" : "Renew", in ipv4_autoconf_addr_set()
39 ipv4auto->requested_ip.s4_addr[2], in ipv4_autoconf_addr_set()
40 ipv4auto->requested_ip.s4_addr[3]); in ipv4_autoconf_addr_set()
43 if (!net_if_ipv4_addr_add(ipv4auto->iface, &ipv4auto->requested_ip, in ipv4_autoconf_addr_set()
46 ipv4auto->iface); in ipv4_autoconf_addr_set()
50 net_if_ipv4_set_netmask_by_addr(ipv4auto->iface, in ipv4_autoconf_addr_set()
51 &ipv4auto->requested_ip, in ipv4_autoconf_addr_set()
54 ipv4auto->state = NET_IPV4_AUTOCONF_ASSIGNED; in ipv4_autoconf_addr_set()
68 if (cfg->ipv4auto.iface == NULL) { in acd_event_handler()
84 if (!net_ipv4_addr_cmp(&cfg->ipv4auto.requested_ip, addr)) { in acd_event_handler()
90 cfg->ipv4auto.state = NET_IPV4_AUTOCONF_ASSIGNED; in acd_event_handler()
97 cfg->ipv4auto.state = NET_IPV4_AUTOCONF_INIT; in acd_event_handler()
98 ipv4_autoconf_addr_set(&cfg->ipv4auto); in acd_event_handler()
120 if (cfg->ipv4auto.iface == iface) { in net_ipv4_autoconf_start()
124 cfg->ipv4auto.iface = iface; in net_ipv4_autoconf_start()
128 if (cfg->ipv4auto.state == NET_IPV4_AUTOCONF_ASSIGNED) { in net_ipv4_autoconf_start()
130 cfg->ipv4auto.state = NET_IPV4_AUTOCONF_RENEW; in net_ipv4_autoconf_start()
132 cfg->ipv4auto.state = NET_IPV4_AUTOCONF_INIT; in net_ipv4_autoconf_start()
135 ipv4_autoconf_addr_set(&cfg->ipv4auto); in net_ipv4_autoconf_start()
147 net_if_ipv4_addr_rm(iface, &cfg->ipv4auto.requested_ip); in net_ipv4_autoconf_reset()