Kea: isc::asiodns::IOFetchData Struct Reference

| Kea 3.0.2-git

isc::asiodns::IOFetchData Struct Reference

IOFetch Data. More...

Inheritance diagram for isc::asiodns::IOFetchData:
[legend]

## 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

## 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 59 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

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

References isc::asiodns::ASIODNS_UNKNOWN_ORIGIN, callback, cumulative, expected, io_service_, msgbuf, offset, origin, packet, protocol, qid, received, remote_rcv, remote_snd, socket, staging, stopped, timeout, and timer.

## ◆ ~IOFetchData()

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

Destructor.

Definition at line 126 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 137 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 70 of file io_fetch.cc.

Referenced by IOFetchData().

## ◆ cumulative

size_t isc::asiodns::IOFetchData::cumulative

Definition at line 73 of file io_fetch.cc.

Referenced by IOFetchData(), and responseOK().

## ◆ expected

size_t isc::asiodns::IOFetchData::expected

Definition at line 74 of file io_fetch.cc.

Referenced by IOFetchData().

## ◆ io_service_

IOServicePtr isc::asiodns::IOFetchData::io_service_

Definition at line 60 of file io_fetch.cc.

Referenced by IOFetchData().

## ◆ msgbuf

OutputBufferPtr isc::asiodns::IOFetchData::msgbuf

Definition at line 68 of file io_fetch.cc.

Referenced by IOFetchData().

## ◆ offset

size_t isc::asiodns::IOFetchData::offset

Definition at line 75 of file io_fetch.cc.

Referenced by IOFetchData().

## ◆ origin

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

Definition at line 85 of file io_fetch.cc.

Referenced by IOFetchData().

## ◆ packet

bool isc::asiodns::IOFetchData::packet

Definition at line 78 of file io_fetch.cc.

Referenced by IOFetchData().

## ◆ protocol

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

Definition at line 72 of file io_fetch.cc.

Referenced by IOFetchData().

## ◆ qid

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

Definition at line 88 of file io_fetch.cc.

Referenced by IOFetchData(), and responseOK().

## ◆ received

OutputBufferPtr isc::asiodns::IOFetchData::received

Definition at line 69 of file io_fetch.cc.

Referenced by IOFetchData(), and responseOK().

## ◆ remote_rcv

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

Definition at line 67 of file io_fetch.cc.

Referenced by IOFetchData(), and responseOK().

## ◆ remote_snd

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

Definition at line 66 of file io_fetch.cc.

Referenced by IOFetchData(), and responseOK().

## ◆ socket

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

Definition at line 65 of file io_fetch.cc.

Referenced by IOFetchData().

## ◆ staging

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

Definition at line 86 of file io_fetch.cc.

Referenced by IOFetchData().

## ◆ stopped

bool isc::asiodns::IOFetchData::stopped

Definition at line 76 of file io_fetch.cc.

Referenced by IOFetchData().

## ◆ timeout

int isc::asiodns::IOFetchData::timeout

Definition at line 77 of file io_fetch.cc.

Referenced by IOFetchData().

## ◆ timer

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

Definition at line 71 of file io_fetch.cc.

Referenced by IOFetchData(), and ~IOFetchData().

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

- io_fetch.cc