resolved-dns-scope.h revision 74b2466e14a1961bf3ac0e8a60cfaceec705bd59
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering#pragma once
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering/***
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering This file is part of systemd.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering Copyright 2014 Lennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering systemd is free software; you can redistribute it and/or modify it
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering under the terms of the GNU Lesser General Public License as published by
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering (at your option) any later version.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering systemd is distributed in the hope that it will be useful, but
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering Lesser General Public License for more details.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering You should have received a copy of the GNU Lesser General Public License
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
0dae31d468b1a0e22d98921f7b0dbd92fd217167Zbigniew Jędrzejewski-Szmek***/
0dae31d468b1a0e22d98921f7b0dbd92fd217167Zbigniew Jędrzejewski-Szmek
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering#include "list.h"
4ad7f2761da661853dcc29d542efb4727abb1101Nick Owens
7263f72499e962b3fd54cdb7c79d49ca72121edeZbigniew Jędrzejewski-Szmektypedef struct DnsScope DnsScope;
e4e73a632524c382139034d4271f53b6089ab4cbLennart Poettering
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering#include "resolved.h"
e4e73a632524c382139034d4271f53b6089ab4cbLennart Poettering#include "resolved-link.h"
8730bccfc59fe507bd3e0a3abcf411b497ac4f0eLennart Poettering#include "resolved-dns-server.h"
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering#include "resolved-dns-packet.h"
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering#include "resolved-dns-query.h"
d7671a3efdaef690b4316a03011038f731f2eea9Zbigniew Jędrzejewski-Szmek
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poetteringtypedef enum DnsScopeType {
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering DNS_SCOPE_DNS,
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering DNS_SCOPE_MDNS,
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering} DnsScopeType;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poetteringtypedef enum DnsScopeMatch {
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering DNS_SCOPE_NO,
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering DNS_SCOPE_MAYBE,
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering DNS_SCOPE_YES,
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering _DNS_SCOPE_MATCH_MAX,
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering _DNS_SCOPE_INVALID = -1
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering} DnsScopeMatch;
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poetteringstruct DnsScope {
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering Manager *manager;
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering DnsScopeType type;
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering unsigned char family;
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering Link *link;
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering
36d9205d669bcdcb04fa730d1f3549a9fc9a9001Tom Gundersen char **domains;
58db254ade4fb2ef77de68f28c4f13814819f6a1Lennart Poettering
58db254ade4fb2ef77de68f28c4f13814819f6a1Lennart Poettering LIST_HEAD(DnsQueryTransaction, transactions);
36d9205d669bcdcb04fa730d1f3549a9fc9a9001Tom Gundersen
36d9205d669bcdcb04fa730d1f3549a9fc9a9001Tom Gundersen LIST_FIELDS(DnsScope, scopes);
36d9205d669bcdcb04fa730d1f3549a9fc9a9001Tom Gundersen};
58db254ade4fb2ef77de68f28c4f13814819f6a1Lennart Poettering
58db254ade4fb2ef77de68f28c4f13814819f6a1Lennart Poetteringint dns_scope_new(Manager *m, DnsScope **ret, DnsScopeType t);
58db254ade4fb2ef77de68f28c4f13814819f6a1Lennart PoetteringDnsScope* dns_scope_free(DnsScope *s);
58db254ade4fb2ef77de68f28c4f13814819f6a1Lennart Poettering
58db254ade4fb2ef77de68f28c4f13814819f6a1Lennart Poetteringint dns_scope_send(DnsScope *s, DnsPacket *p);
58db254ade4fb2ef77de68f28c4f13814819f6a1Lennart PoetteringDnsScopeMatch dns_scope_test(DnsScope *s, const char *domain);
58db254ade4fb2ef77de68f28c4f13814819f6a1Lennart Poettering
58db254ade4fb2ef77de68f28c4f13814819f6a1Lennart PoetteringDnsServer *dns_scope_get_server(DnsScope *s);
58db254ade4fb2ef77de68f28c4f13814819f6a1Lennart Poetteringvoid dns_scope_next_dns_server(DnsScope *s);
58db254ade4fb2ef77de68f28c4f13814819f6a1Lennart Poettering