2018-10-01 22:27:46 +02:00
|
|
|
// Matrix Construct
|
|
|
|
//
|
|
|
|
// Copyright (C) Matrix Construct Developers, Authors & Contributors
|
2019-10-06 02:02:50 +02:00
|
|
|
// Copyright (C) 2016-2019 Jason Volk <jason@zemos.net>
|
2018-10-01 22:27:46 +02:00
|
|
|
//
|
|
|
|
// Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
// purpose with or without fee is hereby granted, provided that the above
|
|
|
|
// copyright notice and this permission notice is present in all copies. The
|
|
|
|
// full license for this software is available in the LICENSE file.
|
|
|
|
|
2019-10-06 02:02:50 +02:00
|
|
|
//
|
|
|
|
// This file is not included in any include group. It is used when
|
|
|
|
// implementing the dns::cache by modules and extensions.
|
|
|
|
//
|
|
|
|
|
2018-10-01 22:27:46 +02:00
|
|
|
namespace ircd::net::dns::cache
|
|
|
|
{
|
2019-03-23 08:59:25 +01:00
|
|
|
struct waiter;
|
|
|
|
|
2019-10-06 02:02:50 +02:00
|
|
|
bool operator==(const waiter &, const waiter &) noexcept;
|
|
|
|
bool operator!=(const waiter &, const waiter &) noexcept;
|
2019-09-25 20:48:25 +02:00
|
|
|
|
2019-03-23 08:59:25 +01:00
|
|
|
extern std::list<waiter> waiting;
|
2019-09-12 20:03:54 +02:00
|
|
|
extern ctx::mutex mutex;
|
2019-03-22 02:24:36 +01:00
|
|
|
extern ctx::dock dock;
|
2018-10-01 22:27:46 +02:00
|
|
|
}
|
|
|
|
|
2019-03-23 08:59:25 +01:00
|
|
|
struct ircd::net::dns::cache::waiter
|
|
|
|
{
|
|
|
|
dns::callback callback;
|
|
|
|
dns::opts opts;
|
2019-09-12 19:26:02 +02:00
|
|
|
uint16_t port;
|
2019-03-23 08:59:25 +01:00
|
|
|
string_view key;
|
2019-05-27 01:53:08 +02:00
|
|
|
char keybuf[rfc1035::NAME_BUFSIZE*2];
|
2019-03-23 08:59:25 +01:00
|
|
|
|
2019-09-12 19:26:02 +02:00
|
|
|
waiter(const hostport &hp, const dns::opts &opts, dns::callback &&callback);
|
2019-09-10 21:36:51 +02:00
|
|
|
waiter(waiter &&) = delete;
|
|
|
|
waiter(const waiter &) = delete;
|
|
|
|
waiter &operator=(waiter &&) = delete;
|
|
|
|
waiter &operator=(const waiter &) = delete;
|
2019-03-23 08:59:25 +01:00
|
|
|
};
|