![]() |
Kea 3.1.1
|
The TKeyExchange
class handles communication with the DNS server.
More...
#include <tkey_exchange.h>
Classes | |
class | Callback |
Callback for the TKeyExchange class. More... | |
Public Types | |
enum | Status { SUCCESS , TIMEOUT , IO_STOPPED , INVALID_RESPONSE , UNSIGNED_RESPONSE , BAD_CREDENTIALS , OTHER } |
A status code of the TKeyExchange. More... | |
Public Member Functions | |
TKeyExchange (const isc::asiolink::IOServicePtr &io_service, const DnsServerPtr &server, const GssTsigKeyPtr &key, Callback *callback, uint32_t timeout=TKEY_EXCHANGE_IO_TIMEOUT, OM_uint32 flags=TKEY_EXCHANGE_FLAGS) | |
Constructor. | |
virtual | ~TKeyExchange () |
Virtual destructor, does nothing. | |
void | cancel () |
This function cancels the in-flight TKEY exchange. | |
void | doExchange () |
This function handles the repeated communication with the DNS server trying to complete the TKEY exchange. | |
isc::asiolink::IOServicePtr | getIOService () |
Gets IO service. | |
void | setIOService (const isc::asiolink::IOServicePtr io_service) |
Sets IO service. | |
Static Public Member Functions | |
static std::string | statusToText (Status status) |
Convert a status to its textual form. | |
Static Public Attributes | |
static const OM_uint32 | TKEY_EXCHANGE_FLAGS = (GSS_C_REPLAY_FLAG | GSS_C_MUTUAL_FLAG | GSS_C_INTEG_FLAG) |
The default TKEY exchange flags. | |
static const uint32_t | TKEY_EXCHANGE_IO_TIMEOUT = 3000 |
The default IO timeout used for IO operations (in milliseconds) set to 3000 (3 seconds). | |
The TKeyExchange
class handles communication with the DNS server.
Communication with the DNS server is asynchronous. Caller must provide a callback, which will be invoked when the response from the DNS server is received, a timeout has occurred or IO service has been stopped for any reason. The caller-supplied callback is called by the internal callback operator implemented by TKeyExchange
. This callback is responsible for initializing the GssTsigContext
instance which encapsulates the response from the DNS. This initialization does not take place if the response from DNS is not received.
Definition at line 36 of file tkey_exchange.h.
A status code of the TKeyExchange.
Definition at line 39 of file tkey_exchange.h.
isc::gss_tsig::TKeyExchange::TKeyExchange | ( | const isc::asiolink::IOServicePtr & | io_service, |
const DnsServerPtr & | server, | ||
const GssTsigKeyPtr & | key, | ||
Callback * | callback, | ||
uint32_t | timeout = TKEY_EXCHANGE_IO_TIMEOUT, | ||
OM_uint32 | flags = TKEY_EXCHANGE_FLAGS ) |
Constructor.
io_service | The IOService which handles IO operations. |
server | The server for which the TKEY exchange is performed. |
key | The TKEY being updated. |
callback | Pointer to an object implementing TKeyExchange::Callback class. This object will be called when DNS message exchange completes or if an error occurs. NULL value disables callback invocation. |
timeout | The timeout for the IO operations. |
flags | The flags used for the TKEY exchange. |
Definition at line 551 of file tkey_exchange.cc.
|
virtual |
Virtual destructor, does nothing.
Definition at line 557 of file tkey_exchange.cc.
References cancel().
void isc::gss_tsig::TKeyExchange::cancel | ( | ) |
This function cancels the in-flight TKEY exchange.
Definition at line 567 of file tkey_exchange.cc.
Referenced by ~TKeyExchange().
void isc::gss_tsig::TKeyExchange::doExchange | ( | ) |
This function handles the repeated communication with the DNS server trying to complete the TKEY exchange.
Definition at line 562 of file tkey_exchange.cc.
IOServicePtr isc::gss_tsig::TKeyExchange::getIOService | ( | ) |
Gets IO service.
Definition at line 572 of file tkey_exchange.cc.
void isc::gss_tsig::TKeyExchange::setIOService | ( | const isc::asiolink::IOServicePtr | io_service | ) |
Sets IO service.
io_service | IOService object, used for all ASIO operations. |
Definition at line 577 of file tkey_exchange.cc.
Convert a status to its textual form.
Definition at line 44 of file tkey_exchange.cc.
References BAD_CREDENTIALS, INVALID_RESPONSE, IO_STOPPED, SUCCESS, TIMEOUT, and UNSIGNED_RESPONSE.
Referenced by isc::gss_tsig::ManagedKey::operator()(), and isc::gss_tsig::ManagedKey::toElement().
|
static |
The default TKEY exchange flags.
The default flags consist in:
Definition at line 117 of file tkey_exchange.h.
Referenced by isc::gss_tsig::GssTsigImpl::createKey().
|
static |
The default IO timeout used for IO operations (in milliseconds) set to 3000 (3 seconds).
Definition at line 121 of file tkey_exchange.h.