resolved-dns-transaction.h revision 71d35b6b5563817dfbe757ab9e3b9f018b2db491
/*-*- 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;
enum DnsTransactionState {
};
#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;
int cached_rcode;
unsigned n_attempts;
int dns_udp_fd;
/* The active server */
/* TCP connection logic, if we need it */
/* Queries 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 */
/* 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)