resolved-dns-scope.h revision 623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbf
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering#pragma once
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering/***
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering This file is part of systemd.
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering Copyright 2014 Lennart Poettering
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering systemd is free software; you can redistribute it and/or modify it
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering under the terms of the GNU Lesser General Public License as published by
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering (at your option) any later version.
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering systemd is distributed in the hope that it will be useful, but
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering Lesser General Public License for more details.
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering You should have received a copy of the GNU Lesser General Public License
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering***/
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering#include "list.h"
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poetteringtypedef struct DnsScope DnsScope;
96115cdfe0241ae9b4e7177cd3874c0a93d00b39Thomas Hindoe Paaboel Andersen
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering#include "resolved.h"
4b357e15876b730343db08719c877fdb45b6ad42Michael Marineau#include "resolved-link.h"
4b357e15876b730343db08719c877fdb45b6ad42Michael Marineau#include "resolved-dns-server.h"
4b357e15876b730343db08719c877fdb45b6ad42Michael Marineau#include "resolved-dns-packet.h"
4b357e15876b730343db08719c877fdb45b6ad42Michael Marineau#include "resolved-dns-query.h"
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering#include "resolved-dns-cache.h"
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering#include "resolved-dns-zone.h"
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering#include "resolved-dns-stream.h"
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poetteringtypedef enum DnsScopeMatch {
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering DNS_SCOPE_NO,
1ca208fb4f93e5869704af1812cbff7130a2fc03Zbigniew Jędrzejewski-Szmek DNS_SCOPE_MAYBE,
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering DNS_SCOPE_YES,
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering _DNS_SCOPE_MATCH_MAX,
9a5cb1371b6d8b0a04bd08665bcf9b06cb40c64cZbigniew Jędrzejewski-Szmek _DNS_SCOPE_INVALID = -1
e48fdd84432bbf9c2ecc339183258c7c33116032Lennart Poettering} DnsScopeMatch;
e48fdd84432bbf9c2ecc339183258c7c33116032Lennart Poettering
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poetteringstruct DnsScope {
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering Manager *manager;
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering DnsProtocol protocol;
14bf2c9d375db6a4670bc0ef0e521e35a939a498Lennart Poettering int family;
7384146530ac083efbef62b9ef5bb82c56565cd4Zbigniew Jędrzejewski-Szmek
7384146530ac083efbef62b9ef5bb82c56565cd4Zbigniew Jędrzejewski-Szmek Link *link;
3db604b907323b8df0fc810216f6112056d26a02Lennart Poettering
7384146530ac083efbef62b9ef5bb82c56565cd4Zbigniew Jędrzejewski-Szmek char **domains;
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering DnsCache cache;
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering DnsZone zone;
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering
3db604b907323b8df0fc810216f6112056d26a02Lennart Poettering LIST_HEAD(DnsQueryTransaction, transactions);
7384146530ac083efbef62b9ef5bb82c56565cd4Zbigniew Jędrzejewski-Szmek
7384146530ac083efbef62b9ef5bb82c56565cd4Zbigniew Jędrzejewski-Szmek LIST_FIELDS(DnsScope, scopes);
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering};
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poetteringint dns_scope_new(Manager *m, DnsScope **ret, Link *l, DnsProtocol p, int family);
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart PoetteringDnsScope* dns_scope_free(DnsScope *s);
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poetteringint dns_scope_send(DnsScope *s, DnsPacket *p);
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poetteringint dns_scope_tcp_socket(DnsScope *s, int family, const union in_addr_union *address, uint16_t port);
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering
b94801803417c23d099cb7e508754181ecd27f9cZbigniew Jędrzejewski-SzmekDnsScopeMatch dns_scope_good_domain(DnsScope *s, const char *domain);
b94801803417c23d099cb7e508754181ecd27f9cZbigniew Jędrzejewski-Szmekint dns_scope_good_key(DnsScope *s, DnsResourceKey *key);
7384146530ac083efbef62b9ef5bb82c56565cd4Zbigniew Jędrzejewski-Szmekint dns_scope_good_dns_server(DnsScope *s, int family, const union in_addr_union *address);
7384146530ac083efbef62b9ef5bb82c56565cd4Zbigniew Jędrzejewski-Szmek
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart PoetteringDnsServer *dns_scope_get_server(DnsScope *s);
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poetteringvoid dns_scope_next_dns_server(DnsScope *s);
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering
7384146530ac083efbef62b9ef5bb82c56565cd4Zbigniew Jędrzejewski-Szmekint dns_scope_llmnr_membership(DnsScope *s, bool b);
091526ab20485492124852dcf629787f35816df8Zbigniew Jędrzejewski-Szmek
091526ab20485492124852dcf629787f35816df8Zbigniew Jędrzejewski-Szmekvoid dns_scope_process_query(DnsScope *s, DnsStream *stream, DnsPacket *p);
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering