1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
6 This file is part of systemd.
8 Copyright 2014 Lennart Poettering
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
26 #include "in-addr-util.h"
27 #include "ratelimit.h"
29 typedef struct Link Link;
30 typedef struct LinkAddress LinkAddress;
32 #include "resolved-dns-server.h"
33 #include "resolved-dns-scope.h"
34 #include "resolved-dns-rr.h"
35 #include "resolved-manager.h"
41 union in_addr_union in_addr;
43 unsigned char flags, scope;
45 DnsResourceRecord *llmnr_address_rr;
46 DnsResourceRecord *llmnr_ptr_rr;
48 LIST_FIELDS(LinkAddress, addresses);
57 LIST_HEAD(LinkAddress, addresses);
59 LIST_HEAD(DnsServer, dns_servers);
60 DnsServer *current_dns_server;
62 Support llmnr_support;
64 DnsScope *unicast_scope;
65 DnsScope *llmnr_ipv4_scope;
66 DnsScope *llmnr_ipv6_scope;
68 char name[IF_NAMESIZE];
72 int link_new(Manager *m, Link **ret, int ifindex);
73 Link *link_free(Link *l);
74 int link_update_rtnl(Link *l, sd_rtnl_message *m);
75 int link_update_monitor(Link *l);
76 bool link_relevant(Link *l, int family);
77 LinkAddress* link_find_address(Link *l, int family, const union in_addr_union *in_addr);
78 void link_add_rrs(Link *l, bool force_remove);
80 DnsServer* link_set_dns_server(Link *l, DnsServer *s);
81 DnsServer* link_find_dns_server(Link *l, int family, const union in_addr_union *in_addr);
82 DnsServer* link_get_dns_server(Link *l);
83 void link_next_dns_server(Link *l);
85 int link_address_new(Link *l, LinkAddress **ret, int family, const union in_addr_union *in_addr);
86 LinkAddress *link_address_free(LinkAddress *a);
87 int link_address_update_rtnl(LinkAddress *a, sd_rtnl_message *m);
88 bool link_address_relevant(LinkAddress *l);
89 void link_address_add_rrs(LinkAddress *a, bool force_remove);
91 DEFINE_TRIVIAL_CLEANUP_FUNC(Link*, link_free);