Lines Matching +full:ip +full:- +full:addr
4 * SPDX-License-Identifier: Apache-2.0
52 * @brief Network Interface unicast IP addresses
54 * Stores the unicast IP addresses assigned to this network interface.
57 /** IP address */
69 /** How the IP address was set */
135 /** Is the IP address valid forever */
138 /** Is this IP address used or not */
141 /** Is this IP address usage limited to the subnet (mesh) or not */
144 /** Is this IP address temporary and generated for example by
156 * @brief Network Interface multicast IP addresses
158 * Stores the multicast IP addresses assigned to this network interface.
161 /** IP address */
178 /** Is this multicast IP address used or not */
205 /** Is the IP prefix valid forever */
223 /** IP address */
300 /* Total number of flags - must be at the end of the enum */
334 /** Unicast IP addresses */
337 /** Multicast IP addresses */
364 * "DESYNC_FACTOR is a random value within the range 0 - MAX_DESYNC_FACTOR.
448 struct in6_addr addr; member
476 /** Unicast IP addresses */
479 /** Multicast IP addresses */
485 /** IPv4 time-to-live */
488 /** IPv4 time-to-live for multicast packets */
510 /** IP address Lease time */
513 /** IP address Renewal time */
516 /** IP address Rebinding time */
522 /** Requested IP addr */
555 /** Requested IP addr */
565 /* We always need to have at least one IP config */
570 * @brief Network interface IP address configuration.
583 * @brief IP and other configuration related data for network interface.
587 /** IP address configuration setting */
588 struct net_if_ip ip; member
685 /** TCP/IP Offload functions.
686 * If non-NULL, then the TCP/IP stack is located
698 * If non-NULL, the interface is considered offloaded at socket level.
765 (void)k_mutex_lock(&iface->lock, K_FOREVER); in net_if_lock()
772 k_mutex_unlock(&iface->lock); in net_if_unlock()
786 (void)k_mutex_lock(&iface->tx_lock, K_FOREVER); in net_if_tx_lock()
797 k_mutex_unlock(&iface->tx_lock); in net_if_tx_unlock()
811 if (iface == NULL || iface->if_dev == NULL) { in net_if_flag_set()
815 atomic_set_bit(iface->if_dev->flags, value); in net_if_flag_set()
829 if (iface == NULL || iface->if_dev == NULL) { in net_if_flag_test_and_set()
833 return atomic_test_and_set_bit(iface->if_dev->flags, value); in net_if_flag_test_and_set()
845 if (iface == NULL || iface->if_dev == NULL) { in net_if_flag_clear()
849 atomic_clear_bit(iface->if_dev->flags, value); in net_if_flag_clear()
863 if (iface == NULL || iface->if_dev == NULL) { in net_if_flag_test_and_clear()
867 return atomic_test_and_clear_bit(iface->if_dev->flags, value); in net_if_flag_test_and_clear()
881 if (iface == NULL || iface->if_dev == NULL) { in net_if_flag_is_set()
885 return atomic_test_bit(iface->if_dev->flags, value); in net_if_flag_is_set()
899 if (iface == NULL || iface->if_dev == NULL) { in net_if_oper_state_set()
903 BUILD_ASSERT((enum net_if_oper_state)(-1) > 0 && NET_IF_OPER_UNKNOWN == 0); in net_if_oper_state_set()
905 iface->if_dev->oper_state = oper_state; in net_if_oper_state_set()
908 return iface->if_dev->oper_state; in net_if_oper_state_set()
920 if (iface == NULL || iface->if_dev == NULL) { in net_if_oper_state()
924 return iface->if_dev->oper_state; in net_if_oper_state()
965 if (iface == NULL || iface->if_dev == NULL) { in net_if_l2()
969 return iface->if_dev->l2; in net_if_l2()
991 if (iface == NULL || iface->if_dev == NULL) { in net_if_l2_data()
995 return iface->if_dev->l2_data; in net_if_l2_data()
1007 if (iface == NULL || iface->if_dev == NULL) { in net_if_get_device()
1011 return iface->if_dev->dev; in net_if_get_device()
1038 * @brief Return the IP offload status
1042 * @return True if IP offloading is active, false otherwise.
1047 return (iface != NULL && iface->if_dev != NULL && in net_if_is_ip_offloaded()
1048 iface->if_dev->offload != NULL); in net_if_is_ip_offloaded()
1061 * @return True if IP or socket offloading is active, false otherwise.
1066 * @brief Return the IP offload plugin
1075 if (iface == NULL || iface->if_dev == NULL) { in net_if_offload()
1079 return iface->if_dev->offload; in net_if_offload()
1097 if (iface == NULL || iface->if_dev == NULL) { in net_if_is_socket_offloaded()
1101 return (iface->if_dev->socket_offload != NULL); in net_if_is_socket_offloaded()
1119 if (iface == NULL || iface->if_dev == NULL) { in net_if_socket_offload_set()
1123 iface->if_dev->socket_offload = socket_offload; in net_if_socket_offload_set()
1140 if (iface == NULL || iface->if_dev == NULL) { in net_if_socket_offload()
1144 return iface->if_dev->socket_offload; in net_if_socket_offload()
1161 if (iface == NULL || iface->if_dev == NULL) { in net_if_get_link_addr()
1165 return &iface->if_dev->link_addr; in net_if_get_link_addr()
1181 return &iface->config; in net_if_get_config()
1223 * This function is intended for upper-layer protocols to inform the IPv6
1246 uint8_t *addr, uint8_t len, in net_if_set_link_addr_unlocked() argument
1252 return -EPERM; in net_if_set_link_addr_unlocked()
1255 if (len > sizeof(net_if_get_link_addr(iface)->addr)) { in net_if_set_link_addr_unlocked()
1256 return -EINVAL; in net_if_set_link_addr_unlocked()
1259 ret = net_linkaddr_create(net_if_get_link_addr(iface), addr, len, type); in net_if_set_link_addr_unlocked()
1264 net_hostname_set_postfix(addr, len); in net_if_set_link_addr_unlocked()
1270 uint8_t *addr, uint8_t len,
1276 const void *addr,
1279 #define net_if_addr_unref(iface, family, addr, ifaddr) \ argument
1280 net_if_addr_unref_debug(iface, family, addr, ifaddr, __func__, __LINE__)
1284 const void *addr,
1287 #define net_if_addr_ref(iface, family, addr) \ argument
1288 net_if_addr_ref_debug(iface, family, addr, __func__, __LINE__)
1292 const void *addr,
1296 const void *addr);
1305 * @param addr A pointer to a uint8_t buffer representing the address.
1313 uint8_t *addr, uint8_t len, in net_if_set_link_addr() argument
1317 return net_if_set_link_addr_unlocked(iface, addr, len, type); in net_if_set_link_addr()
1319 return net_if_set_link_addr_locked(iface, addr, len, type); in net_if_set_link_addr()
1332 if (iface == NULL || iface->if_dev == NULL) { in net_if_get_mtu()
1336 return iface->if_dev->mtu; in net_if_get_mtu()
1348 if (iface == NULL || iface->if_dev == NULL) { in net_if_set_mtu()
1352 iface->if_dev->mtu = mtu; in net_if_set_mtu()
1358 * @param ifaddr IP address for network interface
1368 ifaddr->is_infinite = is_infinite; in net_if_addr_set_lf()
1390 * @brief Get network interface IP config
1402 return &iface->config; in net_if_config_get()
1482 * @param addr IPv6 address
1487 struct net_if_addr *net_if_ipv6_addr_lookup(const struct in6_addr *addr,
1494 * @param addr IPv6 address
1499 struct in6_addr *addr);
1504 * @param addr IPv6 address
1509 __syscall int net_if_ipv6_addr_lookup_by_index(const struct in6_addr *addr);
1515 * @param addr IPv6 address
1522 struct in6_addr *addr,
1530 * @param addr IPv6 address
1537 struct in6_addr *addr,
1554 * @param addr IPv6 address
1558 bool net_if_ipv6_addr_rm(struct net_if *iface, const struct in6_addr *addr);
1564 * @param addr IPv6 address
1569 const struct in6_addr *addr);
1573 * @brief Callback used while iterating over network interface IP addresses
1576 * @param addr Pointer to current IP address
1580 struct net_if_addr *addr,
1588 * @param cb User-supplied callback function to call
1598 * @param addr IPv6 multicast address
1603 const struct in6_addr *addr);
1609 * @param addr IPv6 multicast address
1613 bool net_if_ipv6_maddr_rm(struct net_if *iface, const struct in6_addr *addr);
1617 * @brief Callback used while iterating over network interface multicast IP addresses
1620 * @param maddr Pointer to current multicast IP address
1632 * @param cb User-supplied callback function to call
1642 * @param addr IPv6 address
1648 struct net_if_mcast_addr *net_if_ipv6_maddr_lookup(const struct in6_addr *addr,
1658 * @param addr IP multicast address.
1662 const struct net_addr *addr,
1707 * @param addr Multicast address
1710 void net_if_mcast_monitor(struct net_if *iface, const struct net_addr *addr,
1717 * @param addr IPv6 multicast address
1720 struct net_if_mcast_addr *addr);
1725 * @param addr IPv6 multicast address
1729 static inline bool net_if_ipv6_maddr_is_joined(struct net_if_mcast_addr *addr) in net_if_ipv6_maddr_is_joined() argument
1731 if (addr == NULL) { in net_if_ipv6_maddr_is_joined()
1735 return addr->is_joined; in net_if_ipv6_maddr_is_joined()
1742 * @param addr IPv6 multicast address
1745 struct net_if_mcast_addr *addr);
1751 * @param addr IPv6 address
1756 const struct in6_addr *addr);
1762 * @param addr IPv6 address
1768 struct in6_addr *addr,
1790 * @param addr IPv6 prefix address
1795 bool net_if_ipv6_prefix_rm(struct net_if *iface, struct in6_addr *addr,
1807 prefix->is_infinite = is_infinite; in net_if_ipv6_prefix_set_lf()
1832 * @param addr IPv6 address
1836 bool net_if_ipv6_addr_onlink(struct net_if **iface, struct in6_addr *addr);
1851 return &router->address.in6_addr; in net_if_router_ipv6()
1856 static struct in6_addr addr; in net_if_router_ipv6() local
1860 return &addr; in net_if_router_ipv6()
1869 * @param addr IPv6 address
1874 struct in6_addr *addr);
1881 * @param addr IPv6 address
1886 struct in6_addr *addr);
1901 * @param addr IPv6 address
1907 struct in6_addr *addr,
2020 if (!iface->config.ip.ipv6) { in net_if_ipv6_set_base_reachable_time()
2024 iface->config.ip.ipv6->base_reachable_time = reachable_time; in net_if_ipv6_set_base_reachable_time()
2046 if (!iface->config.ip.ipv6) { in net_if_ipv6_get_reachable_time()
2050 return iface->config.ip.ipv6->reachable_time; in net_if_ipv6_get_reachable_time()
2079 ipv6->reachable_time = net_if_ipv6_calc_reachable_time(ipv6); in net_if_ipv6_set_reachable_time()
2099 if (!iface->config.ip.ipv6) { in net_if_ipv6_set_retrans_timer()
2103 iface->config.ip.ipv6->retrans_timer = retrans_timer; in net_if_ipv6_set_retrans_timer()
2124 if (!iface->config.ip.ipv6) { in net_if_ipv6_get_retrans_timer()
2128 return iface->config.ip.ipv6->retrans_timer; in net_if_ipv6_get_retrans_timer()
2239 * @param addr IPv6 address that failed DAD
2241 void net_if_ipv6_dad_failed(struct net_if *iface, const struct in6_addr *addr);
2280 * @brief Get IPv4 time-to-live value specified for a given interface
2284 * @return Time-to-live
2289 * @brief Set IPv4 time-to-live value specified to a given interface
2292 * @param ttl Time-to-live value
2297 * @brief Get IPv4 multicast time-to-live value specified for a given interface
2301 * @return Time-to-live
2306 * @brief Set IPv4 multicast time-to-live value specified to a given interface
2309 * @param ttl Time-to-live value
2316 * @param addr IPv4 address
2321 struct net_if_addr *net_if_ipv4_addr_lookup(const struct in_addr *addr,
2328 * @param addr IPv4 address
2335 struct in_addr *addr,
2343 * @param addr IPv4 address
2347 bool net_if_ipv4_addr_rm(struct net_if *iface, const struct in_addr *addr);
2352 * @param addr IPv4 address
2357 __syscall int net_if_ipv4_addr_lookup_by_index(const struct in_addr *addr);
2363 * @param addr IPv4 address
2370 struct in_addr *addr,
2378 * @param addr IPv4 address
2383 const struct in_addr *addr);
2390 * @param cb User-supplied callback function to call
2400 * @param addr IPv4 multicast address
2405 const struct in_addr *addr);
2411 * @param addr IPv4 multicast address
2415 bool net_if_ipv4_maddr_rm(struct net_if *iface, const struct in_addr *addr);
2422 * @param cb User-supplied callback function to call
2432 * @param addr IPv4 address
2438 struct net_if_mcast_addr *net_if_ipv4_maddr_lookup(const struct in_addr *addr,
2445 * @param addr IPv4 multicast address
2448 struct net_if_mcast_addr *addr);
2453 * @param addr IPv4 multicast address
2457 static inline bool net_if_ipv4_maddr_is_joined(struct net_if_mcast_addr *addr) in net_if_ipv4_maddr_is_joined() argument
2459 if (addr == NULL) { in net_if_ipv4_maddr_is_joined()
2463 return addr->is_joined; in net_if_ipv4_maddr_is_joined()
2470 * @param addr IPv4 multicast address
2473 struct net_if_mcast_addr *addr);
2488 return &router->address.in_addr; in net_if_router_ipv4()
2493 static struct in_addr addr; in net_if_router_ipv4() local
2497 return &addr; in net_if_router_ipv4()
2506 * @param addr IPv4 address
2511 struct in_addr *addr);
2518 * @param addr IPv4 address
2523 struct in_addr *addr);
2528 * @param addr IPv4 address
2535 struct in_addr *addr,
2552 * @param addr IPv4 address
2557 const struct in_addr *addr);
2563 * @param addr IPv4 address, this should be in network byte order
2568 const struct in_addr *addr);
2644 * @param addr IPv4 address to check.
2650 const struct in_addr *addr);
2691 * @param addr IPv4 address related to this netmask
2697 const struct in_addr *addr,
2704 * @param addr IPv4 address related to this netmask
2710 const struct in_addr *addr,
2827 /** Interface supports IP version 4 header checksum calculation */
2837 /** Interface supports IP version 6 header checksum calculation */
2852 * in which case the IP stack does not need to calculate the checksum.
2865 * packet offloading in which case the IP stack does not need to calculate the
2910 * @param cb User-supplied callback function to call
3005 * (for example Wi-Fi network association).
3129 return -ENOTSUP; in net_if_set_promisc()
3178 return !!iface->tx_pending; in net_if_are_pending_tx_packets()
3192 * @return 0 on success, or -EALREADY/-EBUSY as possible errors.
3201 * @return 0 on success, or -EALREADY as a possible error.
3216 * @brief Check if the network interface supports Wi-Fi.
3220 * @return True if interface supports Wi-Fi, False otherwise.
3225 * @brief Get first Wi-Fi network interface.
3232 * @brief Get Wi-Fi network station interface.
3239 * @brief Get first Wi-Fi network Soft-AP interface.
3255 * -EINVAL if invalid parameters,
3256 * -ERANGE if name cannot be copied to the user supplied buffer,
3257 * -ENOTSUP if interface name support is disabled,
3271 * -ENOTSUP interface name support is disabled
3272 * -EINVAL if invalid parameters are given,
3273 * -ENAMETOOLONG if name is too long
3303 IF_ENABLED(CONFIG_NET_IP, (.ip = {},)) \
3339 [0 ... (_num_configs - 1)] = { \
3365 [0 ... (NET_IF_MAX_CONFIGS - 1)] = { \
3612 *(_dst) = ((uintptr_t)_net_if_list_end - \