summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-address.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/networkd-address.h')
-rw-r--r--src/network/networkd-address.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/network/networkd-address.h b/src/network/networkd-address.h
index 5be2f77..e09551e 100644
--- a/src/network/networkd-address.h
+++ b/src/network/networkd-address.h
@@ -10,6 +10,7 @@
#include "hash-funcs.h"
#include "in-addr-util.h"
#include "network-util.h"
+#include "networkd-address-generation.h"
#include "networkd-link.h"
#include "networkd-util.h"
#include "time-util.h"
@@ -34,6 +35,8 @@ struct Address {
NetworkConfigState state;
union in_addr_union provider; /* DHCP server or router address */
+ unsigned n_ref;
+
int family;
unsigned char prefixlen;
unsigned char scope;
@@ -55,11 +58,15 @@ struct Address {
bool scope_set:1;
bool ip_masquerade_done:1;
bool requested_as_null:1;
+ bool used_by_dhcp_server:1;
/* duplicate_address_detection is only used by static or IPv4 dynamic addresses.
* To control DAD for IPv6 dynamic addresses, set IFA_F_NODAD to flags. */
AddressFamily duplicate_address_detection;
+ /* Used by address generator. */
+ IPv6Token *token;
+
/* Called when address become ready */
address_ready_callback_t callback;
@@ -83,21 +90,25 @@ void link_get_address_states(
extern const struct hash_ops address_hash_ops;
+bool address_can_update(const Address *existing, const Address *requesting);
+
+Address* address_ref(Address *address);
+Address* address_unref(Address *address);
+
int address_new(Address **ret);
int address_new_static(Network *network, const char *filename, unsigned section_line, Address **ret);
-Address* address_free(Address *address);
int address_get(Link *link, const Address *in, Address **ret);
int address_get_harder(Link *link, const Address *in, Address **ret);
int address_configure_handler_internal(sd_netlink *rtnl, sd_netlink_message *m, Link *link, const char *error_msg);
-int address_remove(Address *address);
-int address_remove_and_drop(Address *address);
+int address_remove(Address *address, Link *link);
+int address_remove_and_cancel(Address *address, Link *link);
int address_dup(const Address *src, Address **ret);
bool address_is_ready(const Address *a);
bool link_check_addresses_ready(Link *link, NetworkConfigSource source);
-DEFINE_SECTION_CLEANUP_FUNCTIONS(Address, address_free);
+DEFINE_SECTION_CLEANUP_FUNCTIONS(Address, address_unref);
-int link_drop_managed_addresses(Link *link);
+int link_drop_static_addresses(Link *link);
int link_drop_foreign_addresses(Link *link);
int link_drop_ipv6ll_addresses(Link *link);
void link_foreignize_addresses(Link *link);
@@ -112,9 +123,8 @@ static inline int link_get_ipv4_address(Link *link, const struct in_addr *addres
return link_get_address(link, AF_INET, &(union in_addr_union) { .in = *address }, prefixlen, ret);
}
int manager_get_address(Manager *manager, int family, const union in_addr_union *address, unsigned char prefixlen, Address **ret);
-bool manager_has_address(Manager *manager, int family, const union in_addr_union *address, bool check_ready);
+bool manager_has_address(Manager *manager, int family, const union in_addr_union *address);
-void address_cancel_request(Address *address);
int link_request_address(
Link *link,
const Address *address,