]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/network/networkd-address.h
network: disable IPv4LL for ipvlan with L3 or L3S mode
[thirdparty/systemd.git] / src / network / networkd-address.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
fc2f9534
LP
2#pragma once
3
fc2f9534
LP
4#include <inttypes.h>
5#include <stdbool.h>
6
a2106925 7#include "conf-parser.h"
fc2f9534
LP
8#include "in-addr-util.h"
9
10typedef struct Address Address;
11
fc2f9534 12#include "networkd-link.h"
71d35b6b 13#include "networkd-network.h"
fcbf4cb7 14#include "networkd-util.h"
fc2f9534
LP
15
16#define CACHE_INFO_INFINITY_LIFE_TIME 0xFFFFFFFFU
17
634f0f98
ZJS
18typedef struct Network Network;
19typedef struct Link Link;
f4859fc7 20typedef struct NetworkConfigSection NetworkConfigSection;
634f0f98 21
fc2f9534
LP
22struct Address {
23 Network *network;
f4859fc7 24 NetworkConfigSection *section;
fc2f9534 25
cf1d700d
TG
26 Link *link;
27
fc2f9534
LP
28 int family;
29 unsigned char prefixlen;
30 unsigned char scope;
31 uint32_t flags;
32 char *label;
33
34 struct in_addr broadcast;
35 struct ifa_cacheinfo cinfo;
36
37 union in_addr_union in_addr;
38 union in_addr_union in_addr_peer;
39
adda1ed9 40 bool ip_masquerade_done:1;
e63be084
SS
41 bool duplicate_address_detection;
42 bool manage_temporary_address;
43 bool home_address;
44 bool prefix_route;
45 bool autojoin;
fc2f9534
LP
46
47 LIST_FIELDS(Address, addresses);
48};
49
f0213e37 50int address_new(Address **ret);
fc2f9534 51void address_free(Address *address);
adda1ed9 52int address_add_foreign(Link *link, int family, const union in_addr_union *in_addr, unsigned char prefixlen, Address **ret);
c4a03a56 53int address_add(Link *link, int family, const union in_addr_union *in_addr, unsigned char prefixlen, Address **ret);
cf1d700d 54int address_get(Link *link, int family, const union in_addr_union *in_addr, unsigned char prefixlen, Address **ret);
889b550f 55int address_update(Address *address, unsigned char flags, unsigned char scope, const struct ifa_cacheinfo *cinfo);
91b5f997 56int address_drop(Address *address);
302a796f
YW
57int address_configure(Address *address, Link *link, link_netlink_message_handler_t callback, bool update);
58int address_remove(Address *address, Link *link, link_netlink_message_handler_t callback);
fc2f9534 59bool address_equal(Address *a1, Address *a2);
ce6c77eb 60bool address_is_ready(const Address *a);
fcbf4cb7 61int address_section_verify(Address *a);
fc2f9534 62
fcbf4cb7 63DEFINE_NETWORK_SECTION_FUNCTIONS(Address, address_free);
fc2f9534 64
a2106925
LP
65CONFIG_PARSER_PROTOTYPE(config_parse_address);
66CONFIG_PARSER_PROTOTYPE(config_parse_broadcast);
67CONFIG_PARSER_PROTOTYPE(config_parse_label);
68CONFIG_PARSER_PROTOTYPE(config_parse_lifetime);
69CONFIG_PARSER_PROTOTYPE(config_parse_address_flags);
70CONFIG_PARSER_PROTOTYPE(config_parse_address_scope);