resolved-link.h revision 6073b6f26ab9fc6bf335faa7073ec443eef093fd
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers#pragma once
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers/***
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers This file is part of systemd.
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers Copyright 2014 Lennart Poettering
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers systemd is free software; you can redistribute it and/or modify it
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers under the terms of the GNU Lesser General Public License as published by
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers the Free Software Foundation; either version 2.1 of the License, or
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers (at your option) any later version.
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers systemd is distributed in the hope that it will be useful, but
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers WITHOUT ANY WARRANTY; without even the implied warranty of
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers Lesser General Public License for more details.
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers You should have received a copy of the GNU Lesser General Public License
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers along with systemd; If not, see <http://www.gnu.org/licenses/>.
2bdbf32183fc6816cf34f4850e9fc5f070a34303Marcel Holtmann***/
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers#include <net/if.h>
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers#include "in-addr-util.h"
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers#include "ratelimit.h"
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay Sieverstypedef struct Link Link;
2f8d336478536af789d654599f9523d02e0ca693Kay Sieverstypedef struct LinkAddress LinkAddress;
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers#include "resolved.h"
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers#include "resolved-dns-server.h"
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers#include "resolved-dns-scope.h"
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay Sieversstruct LinkAddress {
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers Link *link;
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers int family;
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers union in_addr_union in_addr;
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers unsigned char flags, scope;
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers LIST_FIELDS(LinkAddress, addresses);
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers};
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay Sieversstruct Link {
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers Manager *manager;
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers int ifindex;
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers unsigned flags;
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers LIST_HEAD(LinkAddress, addresses);
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers LIST_HEAD(DnsServer, dns_servers);
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers DnsServer *current_dns_server;
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers DnsScope *unicast_scope;
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers DnsScope *llmnr_ipv4_scope;
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers DnsScope *llmnr_ipv6_scope;
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers char name[IF_NAMESIZE];
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers uint32_t mtu;
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers RateLimit mdns_ratelimit;
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers RateLimit llmnr_ratelimit;
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers};
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay Sieversint link_new(Manager *m, Link **ret, int ifindex);
2f8d336478536af789d654599f9523d02e0ca693Kay SieversLink *link_free(Link *l);
2f8d336478536af789d654599f9523d02e0ca693Kay Sieversint link_update_rtnl(Link *l, sd_rtnl_message *m);
2f8d336478536af789d654599f9523d02e0ca693Kay Sieversint link_update_monitor(Link *l);
2f8d336478536af789d654599f9523d02e0ca693Kay Sieversbool link_relevant(Link *l, int family);
2f8d336478536af789d654599f9523d02e0ca693Kay SieversLinkAddress* link_find_address(Link *l, int family, union in_addr_union *in_addr);
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay SieversDnsServer* link_find_dns_server(Link *l, int family, union in_addr_union *in_addr);
2f8d336478536af789d654599f9523d02e0ca693Kay SieversDnsServer* link_get_dns_server(Link *l);
2f8d336478536af789d654599f9523d02e0ca693Kay Sieversvoid link_next_dns_server(Link *l);
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay Sieversint link_address_new(Link *l, LinkAddress **ret, int family, union in_addr_union *in_addr);
2f8d336478536af789d654599f9523d02e0ca693Kay SieversLinkAddress *link_address_free(LinkAddress *a);
2f8d336478536af789d654599f9523d02e0ca693Kay Sieversint link_address_update_rtnl(LinkAddress *a, sd_rtnl_message *m);
2f8d336478536af789d654599f9523d02e0ca693Kay Sieversbool link_address_relevant(LinkAddress *l);
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers
2f8d336478536af789d654599f9523d02e0ca693Kay SieversDEFINE_TRIVIAL_CLEANUP_FUNC(Link*, link_free);
2f8d336478536af789d654599f9523d02e0ca693Kay Sievers