1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
3 
4 #include "in-addr-util.h"
5 #include "macro.h"
6 
7 typedef struct Link Link;
8 
9 typedef enum NetDevLocalAddressType {
10         NETDEV_LOCAL_ADDRESS_IPV4LL,
11         NETDEV_LOCAL_ADDRESS_IPV6LL,
12         NETDEV_LOCAL_ADDRESS_DHCP4,
13         NETDEV_LOCAL_ADDRESS_DHCP6,
14         NETDEV_LOCAL_ADDRESS_SLAAC,
15         _NETDEV_LOCAL_ADDRESS_TYPE_MAX,
16         _NETDEV_LOCAL_ADDRESS_TYPE_INVALID = -EINVAL,
17 } NetDevLocalAddressType;
18 
19 const char *netdev_local_address_type_to_string(NetDevLocalAddressType t) _const_;
20 NetDevLocalAddressType netdev_local_address_type_from_string(const char *s) _pure_;
21 
22 int link_get_local_address(
23                 Link *link,
24                 NetDevLocalAddressType type,
25                 int family,
26                 int *ret_family,
27                 union in_addr_union *ret_address);
28