resolved-dns-transaction.h revision ec2c5e4398f9d65e5dfe61530f2556224733d1e6
/*-*- 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-scope.h"
#include "resolved-dns-rr.h"
#include "resolved-dns-packet.h"
#include "resolved-dns-question.h"
#include "resolved-dns-answer.h"
#include "resolved-dns-stream.h"
struct DnsTransaction {
int cached_rcode;
unsigned n_attempts;
/* 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);
/* After how much time to repeat classic DNS requests */
/* After how much time to repeat LLMNR requests, see RFC 4795 Section 7 */
/* LLMNR Jitter interval, see RFC 4795 Section 7 */
/* Maximum attempts to send DNS requests, across all DNS servers */
#define DNS_TRANSACTION_ATTEMPTS_MAX 8
/* Maximum attempts to send LLMNR requests, see RFC 4795 Section 2.7 */
#define LLMNR_TRANSACTION_ATTEMPTS_MAX 3
#define TRANSACTION_TIMEOUT_USEC(p) (p == DNS_PROTOCOL_LLMNR ? LLMNR_TRANSACTION_TIMEOUT_USEC : DNS_TRANSACTION_TIMEOUT_USEC)
#define TRANSACTION_ATTEMPTS_MAX(p) (p == DNS_PROTOCOL_LLMNR ? LLMNR_TRANSACTION_ATTEMPTS_MAX : DNS_TRANSACTION_ATTEMPTS_MAX)