Kea 2.7.5
|
Public Member Functions | |
IOFetchData (IOFetch::Protocol proto, const IOServicePtr &service, const IOAddress &address, uint16_t port, OutputBufferPtr &buff, IOFetch::Callback *cb, int wait) | |
Constructor. | |
~IOFetchData () | |
Destructor. | |
bool | responseOK () |
Checks if the response we received was ok. | |
Public Attributes | |
IOFetch::Callback * | callback |
size_t | cumulative |
size_t | expected |
IOServicePtr | io_service_ |
OutputBufferPtr | msgbuf |
size_t | offset |
isc::log::MessageID | origin |
bool | packet |
IOFetch::Protocol | protocol |
isc::dns::qid_t | qid |
OutputBufferPtr | received |
boost::scoped_ptr< IOEndpoint > | remote_rcv |
boost::scoped_ptr< IOEndpoint > | remote_snd |
boost::scoped_ptr< IOAsioSocket< IOFetch > > | socket |
uint8_t | staging [IOFetch::STAGING_LENGTH] |
bool | stopped |
int | timeout |
boost::asio::deadline_timer | timer |
IOFetch Data.
The data for IOFetch is held in a separate struct pointed to by a shared_ptr object. This is because the IOFetch object will be copied often (it is used as a coroutine and passed as callback to many async_*() functions) and we want keep the same data). Organising the data in this way keeps copying to a minimum.
Definition at line 58 of file io_fetch.cc.
|
inline |
Constructor.
Just fills in the data members of the IOFetchData structure.
proto | Either IOFetch::TCP or IOFetch::UDP. |
service | I/O Service object to handle the asynchronous operations. |
address | IP address of upstream server. |
port | Port to use for the query. |
buff | Output buffer into which the response (in wire format) is written (if a response is received). |
cb | Callback object containing the callback to be called when we terminate. The caller is responsible for managing this object and deleting it if necessary. |
wait | Timeout for the fetch (in ms). |
TODO: May need to alter constructor (see comment 4 in Trac ticket #554).
Definition at line 106 of file io_fetch.cc.
|
inline |
|
inline |
Checks if the response we received was ok.
The data member contains the buffer we read, as well as the address we sent to and the address we received from, length is provided by the operator() in IOFetch. The addresses must match, number of octets read must be at least two, and they must match the qid of the message we sent.
Definition at line 136 of file io_fetch.cc.
References cumulative, qid, isc::util::readUint16(), received, remote_rcv, and remote_snd.
IOFetch::Callback* isc::asiodns::IOFetchData::callback |
Definition at line 69 of file io_fetch.cc.
size_t isc::asiodns::IOFetchData::cumulative |
Definition at line 72 of file io_fetch.cc.
Referenced by responseOK().
size_t isc::asiodns::IOFetchData::expected |
Definition at line 73 of file io_fetch.cc.
IOServicePtr isc::asiodns::IOFetchData::io_service_ |
Definition at line 59 of file io_fetch.cc.
OutputBufferPtr isc::asiodns::IOFetchData::msgbuf |
Definition at line 67 of file io_fetch.cc.
size_t isc::asiodns::IOFetchData::offset |
Definition at line 74 of file io_fetch.cc.
isc::log::MessageID isc::asiodns::IOFetchData::origin |
Definition at line 84 of file io_fetch.cc.
bool isc::asiodns::IOFetchData::packet |
Definition at line 77 of file io_fetch.cc.
IOFetch::Protocol isc::asiodns::IOFetchData::protocol |
Definition at line 71 of file io_fetch.cc.
isc::dns::qid_t isc::asiodns::IOFetchData::qid |
Definition at line 87 of file io_fetch.cc.
Referenced by responseOK().
OutputBufferPtr isc::asiodns::IOFetchData::received |
Definition at line 68 of file io_fetch.cc.
Referenced by responseOK().
boost::scoped_ptr<IOEndpoint> isc::asiodns::IOFetchData::remote_rcv |
Definition at line 66 of file io_fetch.cc.
Referenced by responseOK().
boost::scoped_ptr<IOEndpoint> isc::asiodns::IOFetchData::remote_snd |
Definition at line 65 of file io_fetch.cc.
Referenced by responseOK().
boost::scoped_ptr<IOAsioSocket<IOFetch> > isc::asiodns::IOFetchData::socket |
Definition at line 64 of file io_fetch.cc.
uint8_t isc::asiodns::IOFetchData::staging[IOFetch::STAGING_LENGTH] |
Definition at line 85 of file io_fetch.cc.
bool isc::asiodns::IOFetchData::stopped |
Definition at line 75 of file io_fetch.cc.
int isc::asiodns::IOFetchData::timeout |
Definition at line 76 of file io_fetch.cc.
boost::asio::deadline_timer isc::asiodns::IOFetchData::timer |
Definition at line 70 of file io_fetch.cc.
Referenced by ~IOFetchData().