resolved-dns-transaction.h revision ef7ce6df4d5084bb0cba78e71a2bb932b59045e8
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#pragma once
/***
This file is part of systemd.
Copyright 2014 Lennart Poettering
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/>.
***/
typedef struct DnsTransaction DnsTransaction;
typedef enum DnsTransactionState DnsTransactionState;
typedef enum DnsTransactionSource DnsTransactionSource;
enum DnsTransactionState {
};
enum DnsTransactionSource {
};
#include "resolved-dns-answer.h"
#include "resolved-dns-packet.h"
#include "resolved-dns-question.h"
#include "resolved-dns-scope.h"
struct DnsTransaction {
bool initial_jitter_scheduled;
bool initial_jitter_elapsed;
int answer_rcode;
bool answer_authenticated;
unsigned n_attempts;
int dns_udp_fd;
/* The active server */
/* the features of the DNS server at time of transaction start */
/* TCP connection logic, if we need it */
/* Query candidates this transaction is referenced by and that
* shall be notified about this specific transaction
* completing. */
/* Zone items this transaction is referenced by and that shall
* be notified about completion. */
unsigned block_gc;
};
void dns_transaction_gc(DnsTransaction *t);
int dns_transaction_go(DnsTransaction *t);
/* LLMNR Jitter interval, see RFC 4795 Section 7 */
/* mDNS Jitter interval, see RFC 6762 Section 5.2 */
/* Maximum attempts to send DNS requests, across all DNS servers */
#define DNS_TRANSACTION_ATTEMPTS_MAX 16
/* Maximum attempts to send LLMNR requests, see RFC 4795 Section 2.7 */
#define LLMNR_TRANSACTION_ATTEMPTS_MAX 3
#define TRANSACTION_ATTEMPTS_MAX(p) ((p) == DNS_PROTOCOL_LLMNR ? LLMNR_TRANSACTION_ATTEMPTS_MAX : DNS_TRANSACTION_ATTEMPTS_MAX)