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

4  * SPDX-License-Identifier: Apache-2.0
24 static struct k_work_delayable mdns_ipv4_timer;
25 static void do_mdns_ipv4_lookup(struct k_work *work);
28 static struct k_work_delayable mdns_ipv6_timer;
29 static void do_mdns_ipv6_lookup(struct k_work *work);
51 LOG_INF("Cannot resolve address"); in dns_result_cb()
67 if (info->ai_family == AF_INET) { in dns_result_cb()
69 addr = &net_sin(&info->ai_addr)->sin_addr; in dns_result_cb()
70 } else if (info->ai_family == AF_INET6) { in dns_result_cb()
72 addr = &net_sin6(&info->ai_addr)->sin6_addr; in dns_result_cb()
74 LOG_ERR("Invalid IP address family %d", info->ai_family); in dns_result_cb()
78 LOG_INF("%s %s address: %s", user_data ? (char *)user_data : "<null>", in dns_result_cb()
80 net_addr_ntop(info->ai_family, addr, in dns_result_cb()
100 LOG_INF("Cannot resolve address using mDNS"); in mdns_result_cb()
116 if (info->ai_family == AF_INET) { in mdns_result_cb()
118 addr = &net_sin(&info->ai_addr)->sin_addr; in mdns_result_cb()
119 } else if (info->ai_family == AF_INET6) { in mdns_result_cb()
121 addr = &net_sin6(&info->ai_addr)->sin6_addr; in mdns_result_cb()
123 LOG_ERR("Invalid IP address family %d", info->ai_family); in mdns_result_cb()
127 LOG_INF("%s %s address: %s", user_data ? (char *)user_data : "<null>", in mdns_result_cb()
129 net_addr_ntop(info->ai_family, addr, in mdns_result_cb()
134 static struct net_mgmt_event_callback mgmt4_cb;
135 static struct k_work_delayable ipv4_timer;
137 static void do_ipv4_lookup(struct k_work *work) in do_ipv4_lookup()
139 static const char *query = "www.zephyrproject.org"; in do_ipv4_lookup()
140 static uint16_t dns_id; in do_ipv4_lookup()
150 LOG_ERR("Cannot resolve IPv4 address (%d)", ret); in do_ipv4_lookup()
157 static void schedule_ipv4_queries(void) in schedule_ipv4_queries()
168 static void print_dhcpv4_addr(struct net_if *iface, struct net_if_addr *if_addr, in print_dhcpv4_addr()
179 if (if_addr->addr_type != NET_ADDR_DHCP) { in print_dhcpv4_addr()
183 LOG_INF("IPv4 address: %s", in print_dhcpv4_addr()
184 net_addr_ntop(AF_INET, &if_addr->address.in_addr, in print_dhcpv4_addr()
186 LOG_INF("Lease time: %u seconds", iface->config.dhcpv4.lease_time); in print_dhcpv4_addr()
189 &if_addr->address.in_addr); in print_dhcpv4_addr()
194 &iface->config.ip.ipv4->gw, in print_dhcpv4_addr()
200 static void ipv4_addr_add_handler(struct net_mgmt_event_callback *cb, in ipv4_addr_add_handler()
220 static void check_dhcpv4_addr(struct net_if *iface, struct net_if_addr *if_addr, in check_dhcpv4_addr()
225 if (if_addr->addr_type != NET_ADDR_DHCP) { in check_dhcpv4_addr()
232 static void setup_dhcpv4(struct net_if *iface) in setup_dhcpv4()
236 /* If DHCP registers an IP address before we register the in setup_dhcpv4()
243 /* Already have DHCP assigned address, schedule queries. */ in setup_dhcpv4()
248 /* Otherwise, wait for DHCP to assign an address. */ in setup_dhcpv4()
249 LOG_INF("Getting IPv4 address via DHCP before issuing DNS query"); in setup_dhcpv4()
264 static void do_mdns_ipv4_lookup(struct k_work *work) in do_mdns_ipv4_lookup()
266 static const char *query = "zephyr.local"; in do_mdns_ipv4_lookup()
278 LOG_ERR("Cannot resolve mDNS IPv4 address (%d)", ret); in do_mdns_ipv4_lookup()
290 #error "You need to define an IPv4 address or enable DHCPv4!"
293 static void do_ipv4_lookup(void) in do_ipv4_lookup()
295 static const char *query = "www.zephyrproject.org"; in do_ipv4_lookup()
296 static uint16_t dns_id; in do_ipv4_lookup()
306 LOG_ERR("Cannot resolve IPv4 address (%d)", ret); in do_ipv4_lookup()
313 static void setup_ipv4(struct net_if *iface) in setup_ipv4()
332 #error "You need to define an IPv6 address!"
335 static void do_ipv6_lookup(void) in do_ipv6_lookup()
337 static const char *query = "www.zephyrproject.org"; in do_ipv6_lookup()
338 static uint16_t dns_id; in do_ipv6_lookup()
348 LOG_ERR("Cannot resolve IPv6 address (%d)", ret); in do_ipv6_lookup()
355 static void setup_ipv6(struct net_if *iface) in setup_ipv6()
368 static void do_mdns_ipv6_lookup(struct k_work *work) in do_mdns_ipv6_lookup()
370 static const char *query = "zephyr.local"; in do_mdns_ipv6_lookup()
382 LOG_ERR("Cannot resolve mDNS IPv6 address (%d)", ret); in do_mdns_ipv6_lookup()