X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fresolve%2Fresolved-dns-query.h;h=67fe7f6e8f5b033a1b1d3aff676b42689c557e47;hb=02dd6e189a6d2b7f3884ad4cdb3d8c85e009c565;hp=0b7656489269c187adc68a205fe0bffdae6d2818;hpb=934e9b10b4f4bfb48e21883670c7f45b6911fa9b;p=elogind.git diff --git a/src/resolve/resolved-dns-query.h b/src/resolve/resolved-dns-query.h index 0b7656489..67fe7f6e8 100644 --- a/src/resolve/resolved-dns-query.h +++ b/src/resolve/resolved-dns-query.h @@ -36,6 +36,7 @@ typedef struct DnsQueryTransaction DnsQueryTransaction; #include "resolved-dns-packet.h" #include "resolved-dns-question.h" #include "resolved-dns-answer.h" +#include "resolved-dns-stream.h" typedef enum DnsQueryState { DNS_QUERY_NULL, @@ -48,6 +49,8 @@ typedef enum DnsQueryState { DNS_QUERY_INVALID_REPLY, DNS_QUERY_RESOURCES, DNS_QUERY_ABORTED, + _DNS_QUERY_STATE_MAX, + _DNS_QUERY_STATE_INVALID = -1 } DnsQueryState; struct DnsQueryTransaction { @@ -65,11 +68,8 @@ struct DnsQueryTransaction { sd_event_source *timeout_event_source; unsigned n_attempts; - /* TCP connection logic */ - int tcp_fd; - sd_event_source *tcp_event_source; - size_t tcp_written, tcp_read; - be16_t tcp_read_size; + /* TCP connection logic, if we need it */ + DnsStream *stream; /* Queries this transaction is referenced by and that shall by * notified about this specific transaction completing. */ @@ -122,4 +122,7 @@ void dns_query_ready(DnsQuery *q); int dns_query_cname_redirect(DnsQuery *q, const char *name); +const char* dns_query_state_to_string(DnsQueryState p) _const_; +DnsQueryState dns_query_state_from_string(const char *s) _pure_; + DEFINE_TRIVIAL_CLEANUP_FUNC(DnsQuery*, dns_query_free);