Kea 2.7.6
isc::asiodns::IOFetchData Struct Reference

IOFetch Data. More...

+ Inheritance diagram for isc::asiodns::IOFetchData:

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::Callbackcallback
 
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< IOEndpointremote_rcv
 
boost::scoped_ptr< IOEndpointremote_snd
 
boost::scoped_ptr< IOAsioSocket< IOFetch > > socket
 
uint8_t staging [IOFetch::STAGING_LENGTH]
 
bool stopped
 
int timeout
 
boost::asio::deadline_timer timer
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ IOFetchData()

isc::asiodns::IOFetchData::IOFetchData ( IOFetch::Protocol proto,
const IOServicePtr & service,
const IOAddress & address,
uint16_t port,
OutputBufferPtr & buff,
IOFetch::Callback * cb,
int wait )
inline

Constructor.

Just fills in the data members of the IOFetchData structure.

Parameters
protoEither IOFetch::TCP or IOFetch::UDP.
serviceI/O Service object to handle the asynchronous operations.
addressIP address of upstream server.
portPort to use for the query.
buffOutput buffer into which the response (in wire format) is written (if a response is received).
cbCallback object containing the callback to be called when we terminate. The caller is responsible for managing this object and deleting it if necessary.
waitTimeout 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.

◆ ~IOFetchData()

isc::asiodns::IOFetchData::~IOFetchData ( )
inline

Destructor.

Definition at line 125 of file io_fetch.cc.

References timer.

Member Function Documentation

◆ responseOK()

bool isc::asiodns::IOFetchData::responseOK ( )
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.

+ Here is the call graph for this function:

Member Data Documentation

◆ callback

IOFetch::Callback* isc::asiodns::IOFetchData::callback

Definition at line 69 of file io_fetch.cc.

◆ cumulative

size_t isc::asiodns::IOFetchData::cumulative

Definition at line 72 of file io_fetch.cc.

Referenced by responseOK().

◆ expected

size_t isc::asiodns::IOFetchData::expected

Definition at line 73 of file io_fetch.cc.

◆ io_service_

IOServicePtr isc::asiodns::IOFetchData::io_service_

Definition at line 59 of file io_fetch.cc.

◆ msgbuf

OutputBufferPtr isc::asiodns::IOFetchData::msgbuf

Definition at line 67 of file io_fetch.cc.

◆ offset

size_t isc::asiodns::IOFetchData::offset

Definition at line 74 of file io_fetch.cc.

◆ origin

isc::log::MessageID isc::asiodns::IOFetchData::origin

Definition at line 84 of file io_fetch.cc.

◆ packet

bool isc::asiodns::IOFetchData::packet

Definition at line 77 of file io_fetch.cc.

◆ protocol

IOFetch::Protocol isc::asiodns::IOFetchData::protocol

Definition at line 71 of file io_fetch.cc.

◆ qid

isc::dns::qid_t isc::asiodns::IOFetchData::qid

Definition at line 87 of file io_fetch.cc.

Referenced by responseOK().

◆ received

OutputBufferPtr isc::asiodns::IOFetchData::received

Definition at line 68 of file io_fetch.cc.

Referenced by responseOK().

◆ remote_rcv

boost::scoped_ptr<IOEndpoint> isc::asiodns::IOFetchData::remote_rcv

Definition at line 66 of file io_fetch.cc.

Referenced by responseOK().

◆ remote_snd

boost::scoped_ptr<IOEndpoint> isc::asiodns::IOFetchData::remote_snd

Definition at line 65 of file io_fetch.cc.

Referenced by responseOK().

◆ socket

boost::scoped_ptr<IOAsioSocket<IOFetch> > isc::asiodns::IOFetchData::socket

Definition at line 64 of file io_fetch.cc.

◆ staging

uint8_t isc::asiodns::IOFetchData::staging[IOFetch::STAGING_LENGTH]

Definition at line 85 of file io_fetch.cc.

◆ stopped

bool isc::asiodns::IOFetchData::stopped

Definition at line 75 of file io_fetch.cc.

◆ timeout

int isc::asiodns::IOFetchData::timeout

Definition at line 76 of file io_fetch.cc.

◆ timer

boost::asio::deadline_timer isc::asiodns::IOFetchData::timer

Definition at line 70 of file io_fetch.cc.

Referenced by ~IOFetchData().


The documentation for this struct was generated from the following file: