resolved-dns-server.h revision 39d8db043b599a7382f94bfc904d5e108af438bd
03831d35f7499c87d51205817c93e9a8d42c4baestevel/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#pragma once
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel/***
03831d35f7499c87d51205817c93e9a8d42c4baestevel This file is part of systemd.
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel Copyright 2014 Lennart Poettering
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel systemd is free software; you can redistribute it and/or modify it
03831d35f7499c87d51205817c93e9a8d42c4baestevel under the terms of the GNU Lesser General Public License as published by
03831d35f7499c87d51205817c93e9a8d42c4baestevel the Free Software Foundation; either version 2.1 of the License, or
03831d35f7499c87d51205817c93e9a8d42c4baestevel (at your option) any later version.
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel systemd is distributed in the hope that it will be useful, but
03831d35f7499c87d51205817c93e9a8d42c4baestevel WITHOUT ANY WARRANTY; without even the implied warranty of
03831d35f7499c87d51205817c93e9a8d42c4baestevel MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
03831d35f7499c87d51205817c93e9a8d42c4baestevel Lesser General Public License for more details.
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel You should have received a copy of the GNU Lesser General Public License
03831d35f7499c87d51205817c93e9a8d42c4baestevel along with systemd; If not, see <http://www.gnu.org/licenses/>.
03831d35f7499c87d51205817c93e9a8d42c4baestevel***/
52f4394b704526bb3aa41e8729fd03e754732822jfrank
03831d35f7499c87d51205817c93e9a8d42c4baestevel#include "in-addr-util.h"
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baesteveltypedef struct DnsServer DnsServer;
03831d35f7499c87d51205817c93e9a8d42c4baesteveltypedef enum DnsServerSource DnsServerSource;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#include "resolved-manager.h"
03831d35f7499c87d51205817c93e9a8d42c4baestevel#include "resolved-link.h"
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baesteveltypedef enum DnsServerType {
03831d35f7499c87d51205817c93e9a8d42c4baestevel DNS_SERVER_SYSTEM,
03831d35f7499c87d51205817c93e9a8d42c4baestevel DNS_SERVER_FALLBACK,
03831d35f7499c87d51205817c93e9a8d42c4baestevel DNS_SERVER_LINK,
03831d35f7499c87d51205817c93e9a8d42c4baestevel} DnsServerType;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevelstruct DnsServer {
03831d35f7499c87d51205817c93e9a8d42c4baestevel Manager *manager;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel DnsServerType type;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel Link *link;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel int family;
03831d35f7499c87d51205817c93e9a8d42c4baestevel union in_addr_union address;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel bool marked:1;
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel LIST_FIELDS(DnsServer, servers);
03831d35f7499c87d51205817c93e9a8d42c4baestevel};
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevelint dns_server_new(
03831d35f7499c87d51205817c93e9a8d42c4baestevel Manager *m,
03831d35f7499c87d51205817c93e9a8d42c4baestevel DnsServer **s,
03831d35f7499c87d51205817c93e9a8d42c4baestevel DnsServerType type,
03831d35f7499c87d51205817c93e9a8d42c4baestevel Link *l,
03831d35f7499c87d51205817c93e9a8d42c4baestevel int family,
03831d35f7499c87d51205817c93e9a8d42c4baestevel const union in_addr_union *address);
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevelDnsServer* dns_server_free(DnsServer *s);
03831d35f7499c87d51205817c93e9a8d42c4baestevel