#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,
DNS_QUERY_INVALID_REPLY,
DNS_QUERY_RESOURCES,
DNS_QUERY_ABORTED,
+ _DNS_QUERY_STATE_MAX,
+ _DNS_QUERY_STATE_INVALID = -1
} DnsQueryState;
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. */
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);