2014-07-16 00:26:02 +02:00
|
|
|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
/***
|
|
|
|
This file is part of systemd.
|
|
|
|
|
|
|
|
Copyright 2014 Lennart Poettering
|
|
|
|
|
|
|
|
systemd is free software; you can redistribute it and/or modify it
|
|
|
|
under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2.1 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
systemd is distributed in the hope that it will be useful, but
|
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
|
|
|
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
***/
|
|
|
|
|
2014-07-18 13:59:49 +02:00
|
|
|
#include "in-addr-util.h"
|
|
|
|
|
2014-07-16 00:26:02 +02:00
|
|
|
typedef struct DnsServer DnsServer;
|
|
|
|
typedef enum DnsServerSource DnsServerSource;
|
|
|
|
|
2014-08-01 16:04:12 +02:00
|
|
|
typedef enum DnsServerType {
|
|
|
|
DNS_SERVER_SYSTEM,
|
|
|
|
DNS_SERVER_FALLBACK,
|
|
|
|
DNS_SERVER_LINK,
|
|
|
|
} DnsServerType;
|
|
|
|
|
2014-08-12 19:32:55 +02:00
|
|
|
#include "resolved-link.h"
|
|
|
|
|
2014-07-16 00:26:02 +02:00
|
|
|
struct DnsServer {
|
|
|
|
Manager *manager;
|
|
|
|
|
2014-08-01 16:04:12 +02:00
|
|
|
DnsServerType type;
|
|
|
|
|
2014-07-18 13:59:49 +02:00
|
|
|
Link *link;
|
|
|
|
|
2014-07-18 16:09:30 +02:00
|
|
|
int family;
|
2014-07-16 00:26:02 +02:00
|
|
|
union in_addr_union address;
|
|
|
|
|
2014-07-18 13:59:49 +02:00
|
|
|
bool marked:1;
|
2014-07-16 00:26:02 +02:00
|
|
|
|
|
|
|
LIST_FIELDS(DnsServer, servers);
|
|
|
|
};
|
|
|
|
|
|
|
|
int dns_server_new(
|
|
|
|
Manager *m,
|
|
|
|
DnsServer **s,
|
2014-08-01 16:04:12 +02:00
|
|
|
DnsServerType type,
|
2014-07-16 00:26:02 +02:00
|
|
|
Link *l,
|
2014-07-18 16:09:30 +02:00
|
|
|
int family,
|
2014-07-18 13:59:49 +02:00
|
|
|
const union in_addr_union *address);
|
2014-07-16 00:26:02 +02:00
|
|
|
|
|
|
|
DnsServer* dns_server_free(DnsServer *s);
|
2014-08-12 12:21:10 +02:00
|
|
|
|
2014-08-13 01:00:18 +02:00
|
|
|
extern const struct hash_ops dns_server_hash_ops;
|