resolved-dns-transaction.h revision 7cc6ed7ba6c667caef9a92ba4d59e1ecdc3af8ff
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich This file is part of systemd.
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich Copyright 2014 Lennart Poettering
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich systemd is free software; you can redistribute it and/or modify it
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich under the terms of the GNU Lesser General Public License as published by
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich the Free Software Foundation; either version 2.1 of the License, or
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich (at your option) any later version.
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich systemd is distributed in the hope that it will be useful, but
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich WITHOUT ANY WARRANTY; without even the implied warranty of
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich Lesser General Public License for more details.
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich You should have received a copy of the GNU Lesser General Public License
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich along with systemd; If not, see <http://www.gnu.org/licenses/>.
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevichtypedef struct DnsTransaction DnsTransaction;
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevichtypedef enum DnsTransactionState DnsTransactionState;
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevichtypedef enum DnsTransactionSource DnsTransactionSource;
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich DNS_TRANSACTION_NOT_FOUND, /* like NXDOMAIN, but when LLMNR/TCP connections fail */
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich#define DNS_TRANSACTION_IS_LIVE(state) IN_SET((state), DNS_TRANSACTION_NULL, DNS_TRANSACTION_PENDING, DNS_TRANSACTION_VALIDATING)
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich int answer_errno; /* if state is DNS_TRANSACTION_ERRNO */
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich /* Indicates whether the primary answer is authenticated,
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich * i.e. whether the RRs from answer which directly match the
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich * question are authenticated, or, if there are none, whether
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich * the NODATA or NXDOMAIN case is. It says nothing about
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich * additional RRs listed in the answer, however they have
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich * their own DNS_ANSWER_AUTHORIZED FLAGS. Note that this bit
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich * is defined different than the AD bit in DNS packets, as
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich * that covers more than just the actual primary answer. */
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich /* Contains DNSKEY, DS, SOA RRs we already verified and need
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich * to authenticate this reply */
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich /* UDP connection logic, if we need it */
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich /* TCP connection logic, if we need it */
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich /* The active server */
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich /* The features of the DNS server at time of transaction start */
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich DnsServerFeatureLevel current_feature_level;
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich /* Query candidates this transaction is referenced by and that
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich * shall be notified about this specific transaction
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich * completing. */
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich /* Zone items this transaction is referenced by and that shall
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich * be notified about completion. */
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich /* Other transactions that this transactions is referenced by
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich * and that shall be notified about completion. This is used
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich * when transactions want to validate their RRsets, but need
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich * another DNSKEY or DS RR to do so. */
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich /* The opposite direction: the transactions this transaction
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich * created in order to request DNSKEY or DS RRs. */
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich LIST_FIELDS(DnsTransaction, transactions_by_scope);
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevichint dns_transaction_new(DnsTransaction **ret, DnsScope *s, DnsResourceKey *key);
a220f3583ce0f3e3fc7295325126088382eb45afViktar VauchkevichDnsTransaction* dns_transaction_free(DnsTransaction *t);
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevichbool dns_transaction_gc(DnsTransaction *t);
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevichint dns_transaction_go(DnsTransaction *t);
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevichvoid dns_transaction_process_reply(DnsTransaction *t, DnsPacket *p);
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevichvoid dns_transaction_complete(DnsTransaction *t, DnsTransactionState state);
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevichvoid dns_transaction_notify(DnsTransaction *t, DnsTransaction *source);
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevichint dns_transaction_validate_dnssec(DnsTransaction *t);
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevichint dns_transaction_request_dnssec_keys(DnsTransaction *t);
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevichconst char *dns_transaction_key_string(DnsTransaction *t);
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevichconst char* dns_transaction_state_to_string(DnsTransactionState p) _const_;
a220f3583ce0f3e3fc7295325126088382eb45afViktar VauchkevichDnsTransactionState dns_transaction_state_from_string(const char *s) _pure_;
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevichconst char* dns_transaction_source_to_string(DnsTransactionSource p) _const_;
a220f3583ce0f3e3fc7295325126088382eb45afViktar VauchkevichDnsTransactionSource dns_transaction_source_from_string(const char *s) _pure_;
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich/* LLMNR Jitter interval, see RFC 4795 Section 7 */
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich#define LLMNR_JITTER_INTERVAL_USEC (100 * USEC_PER_MSEC)
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich/* mDNS Jitter interval, see RFC 6762 Section 5.2 */
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich#define MDNS_JITTER_MIN_USEC (20 * USEC_PER_MSEC)
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich#define MDNS_JITTER_RANGE_USEC (100 * USEC_PER_MSEC)
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich/* Maximum attempts to send DNS requests, across all DNS servers */
a220f3583ce0f3e3fc7295325126088382eb45afViktar Vauchkevich/* Maximum attempts to send LLMNR requests, see RFC 4795 Section 2.7 */