Lines Matching +full:static +full:- +full:address

6  * SPDX-License-Identifier: Apache-2.0
35 static K_SEM_DEFINE(waiter, 0, 1);
36 static K_SEM_DEFINE(counter, 0, UINT_MAX);
37 static atomic_t services_flags;
40 static struct net_mgmt_event_callback mgmt_iface_cb;
43 static inline void services_notify_ready(int flags) in services_notify_ready()
49 static inline bool services_are_ready(int flags) in services_are_ready()
58 static void setup_dhcpv4(struct net_if *iface) in setup_dhcpv4()
65 static void print_dhcpv4_info(struct net_if *iface) in print_dhcpv4_info()
70 ARRAY_FOR_EACH(iface->config.ip.ipv4->unicast, i) { in print_dhcpv4_info()
72 &iface->config.ip.ipv4->unicast[i].ipv4; in print_dhcpv4_info()
74 if (if_addr->addr_type != NET_ADDR_DHCP || in print_dhcpv4_info()
75 !if_addr->is_used) { in print_dhcpv4_info()
80 NET_INFO("IPv4 address: %s", in print_dhcpv4_info()
81 net_addr_ntop(AF_INET, &if_addr->address.in_addr, in print_dhcpv4_info()
84 iface->config.dhcpv4.lease_time); in print_dhcpv4_info()
87 &iface->config.ip.ipv4->unicast[i].netmask, in print_dhcpv4_info()
90 net_addr_ntop(AF_INET, &iface->config.ip.ipv4->gw, in print_dhcpv4_info()
102 static struct net_mgmt_event_callback mgmt4_cb;
104 static void ipv4_addr_add_handler(struct net_mgmt_event_callback *cb, in ipv4_addr_add_handler()
123 static void setup_vlan(struct net_if *iface) in setup_vlan()
139 #error "You need to define an IPv4 address or enable DHCPv4!"
142 static void setup_ipv4(struct net_if *iface) in setup_ipv4()
157 /* Empty address, skip setting ANY address in this case */ in setup_ipv4()
162 NET_ERR("Invalid address: %s", CONFIG_NET_CONFIG_MY_IPV4_ADDR); in setup_ipv4()
167 /* In case DHCP is enabled, make the static address tentative, in setup_ipv4()
168 * to allow DHCP address to override it. This covers a usecase in setup_ipv4()
169 * of "there should be a static IP address for DHCP-less setups", in setup_ipv4()
172 * always be static IP address, and optionally, DHCP address". in setup_ipv4()
183 NET_INFO("IPv4 address: %s", in setup_ipv4()
223 static void setup_dhcpv6(struct net_if *iface) in setup_dhcpv6()
240 #error "You need to define an IPv6 address or enable DHCPv6!"
243 static struct net_mgmt_event_callback mgmt6_cb;
244 static struct in6_addr laddr;
246 static void ipv6_event_handler(struct net_mgmt_event_callback *cb, in ipv6_event_handler()
249 struct net_if_ipv6 *ipv6 = iface->config.ip.ipv6; in ipv6_event_handler()
257 /* save the last added IP address for this interface */ in ipv6_event_handler()
258 for (i = NET_IF_MAX_IPV6_ADDR - 1; i >= 0; i--) { in ipv6_event_handler()
259 if (ipv6->unicast[i].is_used) { in ipv6_event_handler()
261 &ipv6->unicast[i].address.in6_addr, in ipv6_event_handler()
276 !(net_ipv6_addr_cmp(&ifaddr->address.in6_addr, &laddr) && in ipv6_event_handler()
277 ifaddr->addr_state == NET_ADDR_PREFERRED)) { in ipv6_event_handler()
278 /* Address is not yet properly setup */ in ipv6_event_handler()
283 NET_INFO("IPv6 address: %s", in ipv6_event_handler()
286 if (ifaddr->addr_type == NET_ADDR_DHCP) { in ipv6_event_handler()
290 remaining = net_timeout_remaining(&ifaddr->lifetime, in ipv6_event_handler()
293 if (!ifaddr->is_infinite) { in ipv6_event_handler()
310 static void setup_ipv6(struct net_if *iface, uint32_t flags) in setup_ipv6()
316 /* Empty address, skip setting ANY address in this case */ in setup_ipv6()
321 NET_ERR("Invalid address: %s", CONFIG_NET_CONFIG_MY_IPV6_ADDR); in setup_ipv6()
322 /* some interfaces may add IP address later */ in setup_ipv6()
365 static void iface_up_handler(struct net_mgmt_event_callback *cb, in iface_up_handler()
377 static bool check_interface(struct net_if *iface) in check_interface()
395 static bool check_interface(struct net_if *iface) in check_interface()
420 return -ENOENT; in net_config_init_by_iface()
424 return -ENETDOWN; in net_config_init_by_iface()
428 count = -1; in net_config_init_by_iface()
439 while (count-- > 0) { in net_config_init_by_iface()
465 return -ENETDOWN; in net_config_init_by_iface()
471 while (!services_are_ready(flags) && count-- > 0) { in net_config_init_by_iface()
475 if (count == -1 && timeout > 0) { in net_config_init_by_iface()
477 return -ETIMEDOUT; in net_config_init_by_iface()
489 static void iface_find_cb(struct net_if *iface, void *user_data) in iface_find_cb()
525 NET_WARN("No auto-started network interface - " in net_config_init_app()
526 "network-bound app initialization skipped."); in net_config_init_app()
561 if (backend->api->init != NULL) { in net_config_init_app()
562 backend->api->init(backend); in net_config_init_app()
573 static int init_app(void) in init_app()