resolved-dns-query.h revision 934e9b10b4f4bfb48e21883670c7f45b6911fa9b
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersen/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersen This file is part of systemd.
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersen Copyright 2014 Lennart Poettering
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersen systemd is free software; you can redistribute it and/or modify it
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersen under the terms of the GNU Lesser General Public License as published by
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersen the Free Software Foundation; either version 2.1 of the License, or
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersen (at your option) any later version.
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersen systemd is distributed in the hope that it will be useful, but
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersen WITHOUT ANY WARRANTY; without even the implied warranty of
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersen MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersen Lesser General Public License for more details.
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersen You should have received a copy of the GNU Lesser General Public License
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersen along with systemd; If not, see <http://www.gnu.org/licenses/>.
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersentypedef struct DnsQuery DnsQuery;
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersentypedef struct DnsQueryTransaction DnsQueryTransaction;
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersen#include "resolved-dns-scope.h"
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersen#include "resolved-dns-packet.h"
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersen sd_event_source *timeout_event_source;
8fba1c8d4e3d05d2af2848b6570bdc09e725d06eZbigniew Jędrzejewski-Szmek /* TCP connection logic */
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersen sd_event_source *tcp_event_source;
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersen size_t tcp_written, tcp_read;
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersen /* Queries this transaction is referenced by and that shall by
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersen * notified about this specific transaction completing. */
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersen LIST_FIELDS(DnsQueryTransaction, transactions_by_scope);
8fba1c8d4e3d05d2af2848b6570bdc09e725d06eZbigniew Jędrzejewski-Szmek sd_event_source *timeout_event_source;
8fba1c8d4e3d05d2af2848b6570bdc09e725d06eZbigniew Jędrzejewski-Szmek /* Discovered data */
8fba1c8d4e3d05d2af2848b6570bdc09e725d06eZbigniew Jędrzejewski-Szmek /* Bus client information */
8fba1c8d4e3d05d2af2848b6570bdc09e725d06eZbigniew Jędrzejewski-Szmek union in_addr_union request_address;
8fba1c8d4e3d05d2af2848b6570bdc09e725d06eZbigniew Jędrzejewski-Szmek /* Completion callback */
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersen LIST_FIELDS(DnsQuery, queries);
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel AndersenDnsQueryTransaction* dns_query_transaction_free(DnsQueryTransaction *t);
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersenvoid dns_query_transaction_complete(DnsQueryTransaction *t, DnsQueryState state);
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersenvoid dns_query_transaction_process_reply(DnsQueryTransaction *t, DnsPacket *p);
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersenint dns_query_new(Manager *m, DnsQuery **q, DnsQuestion *question);
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel AndersenDnsQuery *dns_query_free(DnsQuery *q);
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersenint dns_query_go(DnsQuery *q);
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersenvoid dns_query_ready(DnsQuery *q);
95ed3294c632f5606327149f10cef1eb34422862Thomas Hindoe Paaboel Andersenint dns_query_cname_redirect(DnsQuery *q, const char *name);