Kea 2.5.7
isc::asiodns::IOFetchData Struct Reference

IOFetch Data. More...

Public Member Functions

 IOFetchData (IOFetch::Protocol proto, IOService &service, const IOAddress &address, uint16_t port, OutputBufferPtr &buff, IOFetch::Callback *cb, int wait)
 Constructor.
 
bool responseOK ()
 

Public Attributes

IOFetch::Callbackcallback
 Called on I/O Completion.
 
size_t cumulative
 Cumulative received amount.
 
size_t expected
 Expected amount of data.
 
OutputBufferPtr msgbuf
 Wire buffer for question.
 
size_t offset
 Offset to receive data.
 
isc::log::MessageID origin
 Origin of last asynchronous I/O.
 
bool packet
 true if packet was supplied
 
IOFetch::Protocol protocol
 Protocol being used.
 
isc::dns::qid_t qid
 The QID set in the query.
 
OutputBufferPtr received
 Received data put here.
 
boost::scoped_ptr< IOEndpointremote_rcv
 Where the response came from.
 
boost::scoped_ptr< IOEndpointremote_snd
 Where the fetch is sent.
 
boost::scoped_ptr< IOAsioSocket< IOFetch > > socket
 Socket to use for I/O.
 
uint8_t staging [IOFetch::STAGING_LENGTH]
 Temporary array for received data.
 
bool stopped
 Have we stopped running?
 
int timeout
 Timeout in ms.
 
boost::asio::deadline_timer timer
 Timer to measure timeouts.
 

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 57 of file io_fetch.cc.

Constructor & Destructor Documentation

◆ IOFetchData()

isc::asiodns::IOFetchData::IOFetchData ( IOFetch::Protocol  proto,
IOService 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.

Member Function Documentation

◆ responseOK()

bool isc::asiodns::IOFetchData::responseOK ( )
inline

Definition at line 146 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

Called on I/O Completion.

Definition at line 69 of file io_fetch.cc.

◆ cumulative

size_t isc::asiodns::IOFetchData::cumulative

Cumulative received amount.

Definition at line 72 of file io_fetch.cc.

Referenced by responseOK().

◆ expected

size_t isc::asiodns::IOFetchData::expected

Expected amount of data.

Definition at line 73 of file io_fetch.cc.

◆ msgbuf

OutputBufferPtr isc::asiodns::IOFetchData::msgbuf

Wire buffer for question.

Definition at line 67 of file io_fetch.cc.

◆ offset

size_t isc::asiodns::IOFetchData::offset

Offset to receive data.

Definition at line 74 of file io_fetch.cc.

◆ origin

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

Origin of last asynchronous I/O.

Definition at line 84 of file io_fetch.cc.

◆ packet

bool isc::asiodns::IOFetchData::packet

true if packet was supplied

Definition at line 77 of file io_fetch.cc.

◆ protocol

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

Protocol being used.

Definition at line 71 of file io_fetch.cc.

◆ qid

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

The QID set in the query.

Definition at line 87 of file io_fetch.cc.

Referenced by responseOK().

◆ received

OutputBufferPtr isc::asiodns::IOFetchData::received

Received data put here.

Definition at line 68 of file io_fetch.cc.

Referenced by responseOK().

◆ remote_rcv

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

Where the response came from.

Definition at line 66 of file io_fetch.cc.

Referenced by responseOK().

◆ remote_snd

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

Where the fetch is sent.

Definition at line 65 of file io_fetch.cc.

Referenced by responseOK().

◆ socket

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

Socket to use for I/O.

Definition at line 63 of file io_fetch.cc.

◆ staging

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

Temporary array for received data.

Definition at line 85 of file io_fetch.cc.

◆ stopped

bool isc::asiodns::IOFetchData::stopped

Have we stopped running?

Definition at line 75 of file io_fetch.cc.

◆ timeout

int isc::asiodns::IOFetchData::timeout

Timeout in ms.

Definition at line 76 of file io_fetch.cc.

◆ timer

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

Timer to measure timeouts.

Definition at line 70 of file io_fetch.cc.


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