resolved-dns-server.h revision 9df3ba6c6cb65eecec06f39dfe85a3596cedac4e
3731acf1acfb4a6eb68374a5b137f3b368f63381Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
3731acf1acfb4a6eb68374a5b137f3b368f63381Lennart Poettering
3731acf1acfb4a6eb68374a5b137f3b368f63381Lennart Poettering#pragma once
3731acf1acfb4a6eb68374a5b137f3b368f63381Lennart Poettering
3731acf1acfb4a6eb68374a5b137f3b368f63381Lennart Poettering/***
3731acf1acfb4a6eb68374a5b137f3b368f63381Lennart Poettering This file is part of systemd.
3731acf1acfb4a6eb68374a5b137f3b368f63381Lennart Poettering
3731acf1acfb4a6eb68374a5b137f3b368f63381Lennart Poettering Copyright 2014 Lennart Poettering
3731acf1acfb4a6eb68374a5b137f3b368f63381Lennart Poettering
3731acf1acfb4a6eb68374a5b137f3b368f63381Lennart Poettering systemd is free software; you can redistribute it and/or modify it
3731acf1acfb4a6eb68374a5b137f3b368f63381Lennart Poettering under the terms of the GNU Lesser General Public License as published by
3731acf1acfb4a6eb68374a5b137f3b368f63381Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
3731acf1acfb4a6eb68374a5b137f3b368f63381Lennart Poettering (at your option) any later version.
3731acf1acfb4a6eb68374a5b137f3b368f63381Lennart Poettering
3731acf1acfb4a6eb68374a5b137f3b368f63381Lennart Poettering systemd is distributed in the hope that it will be useful, but
3731acf1acfb4a6eb68374a5b137f3b368f63381Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
3731acf1acfb4a6eb68374a5b137f3b368f63381Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3731acf1acfb4a6eb68374a5b137f3b368f63381Lennart Poettering Lesser General Public License for more details.
3731acf1acfb4a6eb68374a5b137f3b368f63381Lennart Poettering
3731acf1acfb4a6eb68374a5b137f3b368f63381Lennart Poettering You should have received a copy of the GNU Lesser General Public License
3731acf1acfb4a6eb68374a5b137f3b368f63381Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering***/
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering
4f5dd3943bef8a04be7e3b838b822bb9a7ad6cb3Lennart Poettering#include "in-addr-util.h"
4f5dd3943bef8a04be7e3b838b822bb9a7ad6cb3Lennart Poettering
3731acf1acfb4a6eb68374a5b137f3b368f63381Lennart Poetteringtypedef struct DnsServer DnsServer;
4f5dd3943bef8a04be7e3b838b822bb9a7ad6cb3Lennart Poetteringtypedef enum DnsServerSource DnsServerSource;
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poetteringtypedef enum DnsServerType {
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering DNS_SERVER_SYSTEM,
1ca208fb4f93e5869704af1812cbff7130a2fc03Zbigniew Jędrzejewski-Szmek DNS_SERVER_FALLBACK,
4f5dd3943bef8a04be7e3b838b822bb9a7ad6cb3Lennart Poettering DNS_SERVER_LINK,
3731acf1acfb4a6eb68374a5b137f3b368f63381Lennart Poettering} DnsServerType;
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering#include "resolved-link.h"
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poetteringstruct DnsServer {
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering Manager *manager;
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering unsigned n_ref;
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering DnsServerType type;
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering Link *link;
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering int family;
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering union in_addr_union address;
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering usec_t resend_timeout;
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering usec_t max_rtt;
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering bool marked:1;
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering LIST_FIELDS(DnsServer, servers);
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering};
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poetteringint dns_server_new(
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering Manager *m,
938d2699d2e818bd996614e89ea3d668200ad2a8Zbigniew Jędrzejewski-Szmek DnsServer **s,
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering DnsServerType type,
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering Link *l,
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering int family,
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering const union in_addr_union *address);
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart PoetteringDnsServer* dns_server_ref(DnsServer *s);
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart PoetteringDnsServer* dns_server_unref(DnsServer *s);
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poetteringvoid dns_server_packet_received(DnsServer *s, usec_t rtt);
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poetteringvoid dns_server_packet_lost(DnsServer *s, usec_t usec);
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart PoetteringDEFINE_TRIVIAL_CLEANUP_FUNC(DnsServer*, dns_server_unref);
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering
39883f622f392d8579f4428fc5a789a102efbb10Lennart Poetteringextern const struct hash_ops dns_server_hash_ops;
0f4ba83c397e807939a4eb0b2cbd04ad4ab548ccLennart Poettering