4 This file is part of systemd.
6 Copyright 2014 Lennart Poettering
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
24 #include "in-addr-util.h"
25 #include "ratelimit.h"
26 #include "resolve-util.h"
28 typedef struct Link Link
;
29 typedef struct LinkAddress LinkAddress
;
31 #include "resolved-dns-rr.h"
32 #include "resolved-dns-search-domain.h"
33 #include "resolved-dns-server.h"
34 #include "resolved-manager.h"
36 #define LINK_SEARCH_DOMAINS_MAX 32
37 #define LINK_DNS_SERVERS_MAX 32
43 union in_addr_union in_addr
;
45 unsigned char flags
, scope
;
47 DnsResourceRecord
*llmnr_address_rr
;
48 DnsResourceRecord
*llmnr_ptr_rr
;
50 LIST_FIELDS(LinkAddress
, addresses
);
59 LIST_HEAD(LinkAddress
, addresses
);
61 LIST_HEAD(DnsServer
, dns_servers
);
62 DnsServer
*current_dns_server
;
63 unsigned n_dns_servers
;
65 LIST_HEAD(DnsSearchDomain
, search_domains
);
66 unsigned n_search_domains
;
68 ResolveSupport llmnr_support
;
69 ResolveSupport mdns_support
;
70 DnssecMode dnssec_mode
;
71 Set
*dnssec_negative_trust_anchors
;
73 DnsScope
*unicast_scope
;
74 DnsScope
*llmnr_ipv4_scope
;
75 DnsScope
*llmnr_ipv6_scope
;
76 DnsScope
*mdns_ipv4_scope
;
77 DnsScope
*mdns_ipv6_scope
;
81 char name
[IF_NAMESIZE
];
89 int link_new(Manager
*m
, Link
**ret
, int ifindex
);
90 Link
*link_free(Link
*l
);
91 int link_process_rtnl(Link
*l
, sd_netlink_message
*m
);
92 int link_update(Link
*l
);
93 bool link_relevant(Link
*l
, int family
, bool local_multicast
);
94 LinkAddress
* link_find_address(Link
*l
, int family
, const union in_addr_union
*in_addr
);
95 void link_add_rrs(Link
*l
, bool force_remove
);
97 void link_flush_settings(Link
*l
);
98 void link_set_dnssec_mode(Link
*l
, DnssecMode mode
);
99 void link_allocate_scopes(Link
*l
);
101 DnsServer
* link_set_dns_server(Link
*l
, DnsServer
*s
);
102 DnsServer
* link_get_dns_server(Link
*l
);
103 void link_next_dns_server(Link
*l
);
105 DnssecMode
link_get_dnssec_mode(Link
*l
);
106 bool link_dnssec_supported(Link
*l
);
108 int link_save_user(Link
*l
);
109 int link_load_user(Link
*l
);
110 void link_remove_user(Link
*l
);
112 int link_address_new(Link
*l
, LinkAddress
**ret
, int family
, const union in_addr_union
*in_addr
);
113 LinkAddress
*link_address_free(LinkAddress
*a
);
114 int link_address_update_rtnl(LinkAddress
*a
, sd_netlink_message
*m
);
115 bool link_address_relevant(LinkAddress
*l
, bool local_multicast
);
116 void link_address_add_rrs(LinkAddress
*a
, bool force_remove
);
118 DEFINE_TRIVIAL_CLEANUP_FUNC(Link
*, link_free
);