Kea 3.1.1
isc::lease_query::LeaseQueryConnection Class Reference

Derivation of TcpConnection used for Bulk LeaseQuery. More...

#include <lease_query_connection.h>

+ Inheritance diagram for isc::lease_query::LeaseQueryConnection:

Public Member Functions

 LeaseQueryConnection (const asiolink::IOServicePtr &io_service, const tcp::TcpConnectionAcceptorPtr &acceptor, const asiolink::TlsContextPtr &tls_context, tcp::TcpConnectionPool &connection_pool, const tcp::TcpConnectionAcceptorCallback &acceptor_callback, const tcp::TcpConnectionFilterCallback &filter_callback, const long idle_timeout, const uint16_t family, const size_t max_concurrent_queries, const size_t read_max=32768)
 Constructor.
 
virtual ~LeaseQueryConnection ()
 Destructor.
 
void addPendingQuery (BlqQueryPtr query)
 Queues a query to the end of the queue of waiting queries.
 
void addRunningQuery (BulkLeaseQueryPtr query)
 Adds a query to the end of the list of in-progress queries.
 
bool canSend () const
 Can send (aka stopped) flag.
 
virtual void close ()
 Closes the socket.
 
virtual tcp::TcpRequestPtr createRequest ()
 Creates a new empty request ready to receive data.
 
bool findQuery (const Xid &xid) const
 Find queries based on Xid in the query list and queue.
 
size_t getNumResponses () const
 Returns the number of responses in the response queue.
 
size_t getNumRunningQueries () const
 Returns the number of queries in the in-progress list.
 
std::string getRemoteEndpointAddressAsText () const
 Export getRemoteEndpointAddressAsText.
 
asiolink::IOAddress getRequesterAddress () const
 Returns the requester's ip address.
 
bool isStopping () const
 Stopping flag.
 
tcp::TcpResponsePtr makeTcpResponse (BlqResponsePtr blq_response) const
 Constructs a ready to send TcpResponse from and BlqResponse.
 
bool noPendingQuery () const
 Returns True if the queue of waiting queries is empty.
 
BlqQueryPtr popPendingQuery ()
 Pops a query from the queue of waiting queries.
 
virtual void post (const BlqPostCbArg &callback)
 Posts an event callback to the connection's IOService.
 
virtual void processNextQuery ()
 Process next waiting query.
 
virtual bool pushToSend (BlqResponsePtr response)
 Adds a response to the connection's outbound queue of responses.
 
virtual void queryComplete (const Xid &xid)
 Finishes up when a query has been completed (e.g.
 
void removeRunningQuery (const Xid &xid)
 Removes a query from the in-progress query list.
 
virtual void requestReceived (tcp::TcpRequestPtr request)
 Processes a completely received request.
 
virtual bool responseSent (tcp::TcpResponsePtr response)
 Processes a response once it has been sent.
 
virtual void sendNextResponse ()
 Sends the next response in the response queue.
 
virtual void shutdown ()
 Shutdown the socket.
 
void startQuery (BlqQueryPtr query_msg)
 Start query processing.
 
virtual void stopThisConnection ()
 Stops current connection.
 
BlqQueryPtr unpackQuery4 (const uint8_t *buffer, size_t length) const
 Unpacks a DHCPv4 packet from a data buffer.
 
BlqQueryPtr unpackQuery6 (const uint8_t *buffer, size_t length) const
 Unpacks a DHCPv6 packet from a data buffer.
 
- Public Member Functions inherited from isc::tcp::TcpConnection
 TcpConnection (const asiolink::IOServicePtr &io_service, const TcpConnectionAcceptorPtr &acceptor, const asiolink::TlsContextPtr &tls_context, TcpConnectionPool &connection_pool, const TcpConnectionAcceptorCallback &acceptor_callback, const TcpConnectionFilterCallback &connection_filter, const long idle_timeout, const size_t read_max=32768)
 Constructor.
 
virtual ~TcpConnection ()
 Destructor.
 
void asyncAccept ()
 Asynchronously accepts new connection.
 
void doHandshake ()
 Asynchronously performs TLS handshake.
 
void doRead (TcpRequestPtr request=TcpRequestPtr())
 Starts asynchronous read from the socket.
 
size_t getReadMax () const
 Fetches the maximum number of bytes read during single socket read.
 
const boost::asio::ip::tcp::endpoint getRemoteEndpoint () const
 Fetches the remote endpoint for the connection's socket.
 
TcpRequestPtr postData (TcpRequestPtr request, WireData &input_data)
 Appends newly received raw data to the given request.
 
void setReadMax (const size_t read_max)
 Sets the maximum number of bytes read during single socket read.
 

Static Public Member Functions

static void doPost (LeaseQueryConnectionWPtr wptr, const BlqPostCbArg &callback)
 Class/static version of post.
 
static bool doPushToSend (LeaseQueryConnectionWPtr wptr, BlqResponsePtr response)
 Class/static version of pushToSend.
 
static void doQueryComplete (LeaseQueryConnectionWPtr wptr, const Xid &xid)
 Class/static version of queryComplete.
 
static void doSendNextResponse (LeaseQueryConnectionWPtr wptr)
 Class/static version of sendNextResponse.
 
- Static Public Member Functions inherited from isc::tcp::TcpConnection
static const boost::asio::ip::tcp::endpoint & NO_ENDPOINT ()
 Returns an empty end point.
 

Protected Attributes

bool can_send_
 Can send flag.
 
uint16_t family_
 Protocol family AF_INET or AF_INET6.
 
asiolink::IOServicePtr io_service_
 IOService that drives the connection events.
 
size_t max_concurrent_queries_
 Maximum number of concurrent queries allowed.
 
XidQueue< BlqMsgpending_queries_
 Queue of queries waiting to enter processing.
 
BlqResponsePtr response_to_send_
 Tracks the response currently being sent.
 
BlqResponseList responses_
 List of responses waiting to be sent.
 
std::mutex responses_mutex_
 Mutex used to lock during responses access.
 
XidQueue< BulkLeaseQueryrunning_queries_
 List of in-process queries.
 
bool stopping_
 Stopping flag.
 
- Protected Attributes inherited from isc::tcp::TcpConnection
TcpConnectionAcceptorPtr acceptor_
 Pointer to the TCP acceptor used to accept new connections.
 
TcpConnectionAcceptorCallback acceptor_callback_
 External TCP acceptor callback.
 
TcpConnectionFilterCallback connection_filter_
 External callback for filtering connections by IP address.
 
TcpConnectionPoolconnection_pool_
 Connection pool holding this connection.
 
long idle_timeout_
 Timeout after which the a TCP connection is shut down by the server.
 
asiolink::IntervalTimer idle_timer_
 Timer used to detect idle Timeout.
 
WireData input_buf_
 Buffer for a single socket read.
 
asiolink::IOServicePtr io_service_
 The IO service used to handle events.
 
size_t read_max_
 Maximum bytes to read in a single socket read.
 
boost::asio::ip::tcp::endpoint remote_endpoint_
 Remote endpoint.
 
std::unique_ptr< asiolink::TCPSocket< SocketCallback > > tcp_socket_
 TCP socket used by this connection.
 
asiolink::TlsContextPtr tls_context_
 TLS context.
 
std::unique_ptr< asiolink::TLSSocket< SocketCallback > > tls_socket_
 TLS socket used by this connection.
 

Additional Inherited Members

- Protected Member Functions inherited from isc::tcp::TcpConnection
void acceptorCallback (const boost::system::error_code &ec)
 Local callback invoked when new connection is accepted.
 
void asyncSendResponse (TcpResponsePtr response)
 Sends TCP response asynchronously.
 
void doWrite (TcpResponsePtr response)
 Starts asynchronous write to the socket.
 
unsigned char * getInputBufData ()
 Returns pointer to the first byte of the input buffer.
 
size_t getInputBufSize () const
 Returns input buffer size.
 
std::string getRemoteEndpointAddressAsText () const
 returns remote address in textual form
 
void handshakeCallback (const boost::system::error_code &ec)
 Local callback invoked when TLS handshake is performed.
 
void idleTimeoutCallback ()
 Callback invoked when the client has been idle.
 
void setupIdleTimer ()
 Reset timer for detecting idle timeout in connections.
 
void shutdownCallback (const boost::system::error_code &ec)
 Callback invoked when TLS shutdown is performed.
 
virtual void shutdownConnection ()
 Shuts down current connection.
 
void socketReadCallback (TcpRequestPtr request, boost::system::error_code ec, size_t length)
 Callback invoked when new data is received over the socket.
 
virtual void socketWriteCallback (TcpResponsePtr request, boost::system::error_code ec, size_t length)
 Callback invoked when data is sent over the socket.
 

Detailed Description

Derivation of TcpConnection used for Bulk LeaseQuery.

Definition at line 156 of file lease_query_connection.h.

Constructor & Destructor Documentation

◆ LeaseQueryConnection()

isc::lease_query::LeaseQueryConnection::LeaseQueryConnection ( const asiolink::IOServicePtr & io_service,
const tcp::TcpConnectionAcceptorPtr & acceptor,
const asiolink::TlsContextPtr & tls_context,
tcp::TcpConnectionPool & connection_pool,
const tcp::TcpConnectionAcceptorCallback & acceptor_callback,
const tcp::TcpConnectionFilterCallback & filter_callback,
const long idle_timeout,
const uint16_t family,
const size_t max_concurrent_queries,
const size_t read_max = 32768 )

Constructor.

Parameters
io_serviceIO service to be used by the connection.
acceptorPointer to the TCP acceptor object used to listen for new TCP connections.
tls_contextTLS context.
connection_poolConnection pool in which this connection is stored.
acceptor_callbackCallback invoked when new connection is accepted.
filter_callbackCallback invoked prior to handshake which can be used to qualify and reject connections.
idle_timeoutTimeout after which a TCP connection is closed by the server.
familyProtocol family, AF_INET or AF_INET6.
max_concurrent_queriesMaximum number of in-progress queries allowed.
read_maxmaximum size of a single socket read. Defaults to 32K.

Definition at line 28 of file lease_query_connection.cc.

References isc::tcp::TcpConnection::TcpConnection(), can_send_, family_, io_service_, max_concurrent_queries_, and stopping_.

+ Here is the call graph for this function:

◆ ~LeaseQueryConnection()

virtual isc::lease_query::LeaseQueryConnection::~LeaseQueryConnection ( )
inlinevirtual

Destructor.

Definition at line 186 of file lease_query_connection.h.

Member Function Documentation

◆ addPendingQuery()

void isc::lease_query::LeaseQueryConnection::addPendingQuery ( BlqQueryPtr query)
inline

Queues a query to the end of the queue of waiting queries.

Parameters
queryQuery to queue.

Definition at line 318 of file lease_query_connection.h.

References pending_queries_.

Referenced by requestReceived().

◆ addRunningQuery()

void isc::lease_query::LeaseQueryConnection::addRunningQuery ( BulkLeaseQueryPtr query)
inline

Adds a query to the end of the list of in-progress queries.

Parameters
queryQuery to add.

Definition at line 290 of file lease_query_connection.h.

References running_queries_.

Referenced by startQuery().

◆ canSend()

bool isc::lease_query::LeaseQueryConnection::canSend ( ) const
inline

Can send (aka stopped) flag.

Returns
True if the connection can be used to send a response, False otherwise i.e. the connection was shutdown or closed.

Definition at line 212 of file lease_query_connection.h.

References can_send_.

◆ close()

void isc::lease_query::LeaseQueryConnection::close ( )
virtual

Closes the socket.

Reimplemented from isc::tcp::TcpConnection.

Definition at line 68 of file lease_query_connection.cc.

References can_send_, isc::tcp::TcpConnection::close(), pending_queries_, response_to_send_, responses_, responses_mutex_, and running_queries_.

+ Here is the call graph for this function:

◆ createRequest()

TcpRequestPtr isc::lease_query::LeaseQueryConnection::createRequest ( )
virtual

Creates a new empty request ready to receive data.

Returns
A new empty request.

Implements isc::tcp::TcpConnection.

Definition at line 100 of file lease_query_connection.cc.

◆ doPost()

static void isc::lease_query::LeaseQueryConnection::doPost ( LeaseQueryConnectionWPtr wptr,
const BlqPostCbArg & callback )
inlinestatic

Class/static version of post.

Parameters
wptrWeak pointer to a lease query connection.
callbackThe callback to post.

Definition at line 362 of file lease_query_connection.h.

Referenced by startQuery().

◆ doPushToSend()

static bool isc::lease_query::LeaseQueryConnection::doPushToSend ( LeaseQueryConnectionWPtr wptr,
BlqResponsePtr response )
inlinestatic

Class/static version of pushToSend.

Parameters
wptrWeak pointer to a lease query connection.
responsePointer to the response to send.
Returns
True if the response can be sent, False otherwise.

Definition at line 344 of file lease_query_connection.h.

Referenced by startQuery().

◆ doQueryComplete()

static void isc::lease_query::LeaseQueryConnection::doQueryComplete ( LeaseQueryConnectionWPtr wptr,
const Xid & xid )
inlinestatic

Class/static version of queryComplete.

Parameters
wptrWeak pointer to a lease query connection.
xidXid of the query that has finished.

Definition at line 381 of file lease_query_connection.h.

Referenced by startQuery().

◆ doSendNextResponse()

static void isc::lease_query::LeaseQueryConnection::doSendNextResponse ( LeaseQueryConnectionWPtr wptr)
inlinestatic

Class/static version of sendNextResponse.

Parameters
wptrWeak pointer to a lease query connection.

Definition at line 231 of file lease_query_connection.h.

Referenced by pushToSend().

◆ findQuery()

bool isc::lease_query::LeaseQueryConnection::findQuery ( const Xid & xid) const
inline

Find queries based on Xid in the query list and queue.

Parameters
xidXid of the query to find.
Returns
True if there is a query with the Xid in the in-progress

Definition at line 311 of file lease_query_connection.h.

References pending_queries_, and running_queries_.

Referenced by requestReceived().

◆ getNumResponses()

size_t isc::lease_query::LeaseQueryConnection::getNumResponses ( ) const

Returns the number of responses in the response queue.

Definition at line 427 of file lease_query_connection.cc.

References responses_, and responses_mutex_.

◆ getNumRunningQueries()

size_t isc::lease_query::LeaseQueryConnection::getNumRunningQueries ( ) const
inline

Returns the number of queries in the in-progress list.

Definition at line 295 of file lease_query_connection.h.

References running_queries_.

Referenced by processNextQuery(), and requestReceived().

◆ getRemoteEndpointAddressAsText()

std::string isc::tcp::TcpConnection::getRemoteEndpointAddressAsText ( ) const

Export getRemoteEndpointAddressAsText.

Definition at line 407 of file tcp_connection.cc.

Referenced by popPendingQuery(), requestReceived(), sendNextResponse(), startQuery(), unpackQuery4(), and unpackQuery6().

◆ getRequesterAddress()

IOAddress isc::lease_query::LeaseQueryConnection::getRequesterAddress ( ) const

Returns the requester's ip address.

Definition at line 433 of file lease_query_connection.cc.

References family_, isc::tcp::TcpConnection::getRemoteEndpoint(), isc::asiolink::IOAddress::IPV4_ZERO_ADDRESS(), isc::asiolink::IOAddress::IPV6_ZERO_ADDRESS(), and isc::tcp::TcpConnection::NO_ENDPOINT().

+ Here is the call graph for this function:

◆ isStopping()

bool isc::lease_query::LeaseQueryConnection::isStopping ( ) const
inline

Stopping flag.

Returns
True if the connection is and will be stopped, False otherwise.

Definition at line 204 of file lease_query_connection.h.

References stopping_.

◆ makeTcpResponse()

TcpResponsePtr isc::lease_query::LeaseQueryConnection::makeTcpResponse ( BlqResponsePtr blq_response) const

Constructs a ready to send TcpResponse from and BlqResponse.

Parameters
blq_responsePointer to the source BlqResponse, cannot be empty.
Returns
A pointer to a TcpResponse.
Exceptions
BadValueif the input pointer is empty.

Definition at line 219 of file lease_query_connection.cc.

References isc_throw.

Referenced by sendNextResponse().

◆ noPendingQuery()

bool isc::lease_query::LeaseQueryConnection::noPendingQuery ( ) const
inline

Returns True if the queue of waiting queries is empty.

Definition at line 323 of file lease_query_connection.h.

References pending_queries_.

Referenced by processNextQuery(), and requestReceived().

◆ popPendingQuery()

BlqQueryPtr isc::lease_query::LeaseQueryConnection::popPendingQuery ( )

Pops a query from the queue of waiting queries.

Definition at line 342 of file lease_query_connection.cc.

References isc::lease_query::BULK_LEASE_QUERY_DEQUEUED, isc::log::DBGLVL_TRACE_BASIC, getRemoteEndpointAddressAsText(), isc::lease_query::lease_query_logger, isc::lease_query::BulkLeaseQuery6::leaseQueryLabel(), LOG_DEBUG, and pending_queries_.

Referenced by processNextQuery().

+ Here is the call graph for this function:

◆ post()

void isc::lease_query::LeaseQueryConnection::post ( const BlqPostCbArg & callback)
virtual

Posts an event callback to the connection's IOService.

Parameters
callbackThe callback to post.

Definition at line 393 of file lease_query_connection.cc.

References isc::lease_query::BULK_LEASE_QUERY_PROCESSING_UNEXPECTED_FAILURE, can_send_, io_service_, isc::lease_query::lease_query_logger, LOG_ERROR, responses_mutex_, and stopping_.

Referenced by startQuery().

◆ processNextQuery()

void isc::lease_query::LeaseQueryConnection::processNextQuery ( )
virtual

Process next waiting query.

Definition at line 355 of file lease_query_connection.cc.

References can_send_, getNumRunningQueries(), max_concurrent_queries_, noPendingQuery(), popPendingQuery(), responses_mutex_, startQuery(), and stopping_.

Referenced by queryComplete().

+ Here is the call graph for this function:

◆ pushToSend()

bool isc::lease_query::LeaseQueryConnection::pushToSend ( BlqResponsePtr response)
virtual

Adds a response to the connection's outbound queue of responses.

Parameters
responsePointer to the response to send.
Returns
True if the response can be sent, False otherwise.

Definition at line 378 of file lease_query_connection.cc.

References can_send_, doSendNextResponse(), io_service_, responses_, responses_mutex_, and stopping_.

+ Here is the call graph for this function:

◆ queryComplete()

void isc::lease_query::LeaseQueryConnection::queryComplete ( const Xid & xid)
virtual

Finishes up when a query has been completed (e.g.

reached EOF, failed, was terminated)

Parameters
xidXid of the query that has finished.

Definition at line 415 of file lease_query_connection.cc.

References can_send_, processNextQuery(), removeRunningQuery(), responses_mutex_, and stopping_.

+ Here is the call graph for this function:

◆ removeRunningQuery()

void isc::lease_query::LeaseQueryConnection::removeRunningQuery ( const Xid & xid)
inline

Removes a query from the in-progress query list.

Parameters
xidXid of the query to remove.

Definition at line 302 of file lease_query_connection.h.

References running_queries_.

Referenced by queryComplete().

◆ requestReceived()

void isc::lease_query::LeaseQueryConnection::requestReceived ( tcp::TcpRequestPtr request)
virtual

Processes a completely received request.

This function is invoked when the connection has completely received a TCP stream request message and performs the following:

  • The stream request wire data is unpacked into a family-specific bulk lease query message.
  • the bulk lease query is processed or queued.
Parameters
requestRequest to process.

Implements isc::tcp::TcpConnection.

Definition at line 105 of file lease_query_connection.cc.

References addPendingQuery(), isc::lease_query::BULK_LEASE_QUERY_AT_MAX_CONCURRENT_QUERIES, isc::lease_query::BULK_LEASE_QUERY_DUPLICATE_XID, isc::lease_query::BULK_LEASE_QUERY_EMPTY_REQUEST, isc::lease_query::BULK_LEASE_QUERY_QUERY_RECEIVED, isc::lease_query::BULK_LEASE_QUERY_UNPACK_ERROR, isc::log::DBGLVL_TRACE_BASIC, family_, findQuery(), getNumRunningQueries(), getRemoteEndpointAddressAsText(), isc_throw, isc::lease_query::lease_query_logger, isc::lease_query::BulkLeaseQuery6::leaseQueryLabel(), LOG_DEBUG, LOG_ERROR, LOG_WARN, max_concurrent_queries_, noPendingQuery(), startQuery(), stopThisConnection(), unpackQuery4(), and unpackQuery6().

+ Here is the call graph for this function:

◆ responseSent()

bool isc::lease_query::LeaseQueryConnection::responseSent ( tcp::TcpResponsePtr response)
virtual

Processes a response once it has been sent.

Parameters
responseResponse that was sent to the remote endpoint.
Returns
Always true, signifying that the connection should start the idle timer.

Implements isc::tcp::TcpConnection.

Definition at line 240 of file lease_query_connection.cc.

References response_to_send_, responses_mutex_, and sendNextResponse().

+ Here is the call graph for this function:

◆ sendNextResponse()

void isc::lease_query::LeaseQueryConnection::sendNextResponse ( )
virtual

Sends the next response in the response queue.

If there is currently no send in progress and there are entries in the response queue, it dequeues a response from the front of the queue and initiates an asynchronous send.

Definition at line 174 of file lease_query_connection.cc.

References isc::tcp::TcpConnection::asyncSendResponse(), isc::lease_query::BULK_LEASE_QUERY_RESPONSE_SEND_ERROR, isc::lease_query::BULK_LEASE_QUERY_RESPONSE_SENT, can_send_, isc::log::DBGLVL_TRACE_BASIC, getRemoteEndpointAddressAsText(), isc::lease_query::lease_query_logger, isc::lease_query::BulkLeaseQuery6::leaseQueryLabel(), LOG_DEBUG, LOG_ERROR, makeTcpResponse(), response_to_send_, responses_, responses_mutex_, stopping_, and isc::tcp::TcpConnection::stopThisConnection().

Referenced by responseSent().

+ Here is the call graph for this function:

◆ shutdown()

void isc::lease_query::LeaseQueryConnection::shutdown ( )
virtual

Shutdown the socket.

Reimplemented from isc::tcp::TcpConnection.

Definition at line 55 of file lease_query_connection.cc.

References can_send_, pending_queries_, response_to_send_, responses_, responses_mutex_, running_queries_, and isc::tcp::TcpConnection::shutdown().

+ Here is the call graph for this function:

◆ startQuery()

void isc::lease_query::LeaseQueryConnection::startQuery ( BlqQueryPtr query_msg)

Start query processing.

A new BulkLeaseQuery instance is created and started.

Parameters
query_msgQuery message to process.

Definition at line 288 of file lease_query_connection.cc.

References addRunningQuery(), isc::lease_query::BULK_LEASE_QUERY_INVALID_REQUEST, can_send_, doPost(), doPushToSend(), doQueryComplete(), family_, getRemoteEndpointAddressAsText(), isc::lease_query::lease_query_logger, isc::lease_query::BulkLeaseQuery4::leaseQueryLabel(), isc::lease_query::BulkLeaseQuery6::leaseQueryLabel(), LOG_ERROR, post(), isc::lease_query::BulkLeaseQuery::processStart(), responses_mutex_, stopping_, and stopThisConnection().

Referenced by processNextQuery(), and requestReceived().

+ Here is the call graph for this function:

◆ stopThisConnection()

void isc::lease_query::LeaseQueryConnection::stopThisConnection ( )
virtual

Stops current connection.

Enforce sequencing with response sending.

Reimplemented from isc::tcp::TcpConnection.

Definition at line 81 of file lease_query_connection.cc.

References can_send_, response_to_send_, responses_mutex_, stopping_, and isc::tcp::TcpConnection::stopThisConnection().

Referenced by requestReceived(), and startQuery().

+ Here is the call graph for this function:

◆ unpackQuery4()

BlqQueryPtr isc::lease_query::LeaseQueryConnection::unpackQuery4 ( const uint8_t * buffer,
size_t length ) const

Unpacks a DHCPv4 packet from a data buffer.

Parameters
bufferBuffer containing the packed DHCPv4 packet.
lengthNumber of bytes in contained in the buffer.
Returns
A BlqQueryPtr containing the unpacked DHCPv4 packet.

Definition at line 252 of file lease_query_connection.cc.

References isc::lease_query::BULK_LEASE_QUERY4_UNSUPPORTED_MSG_TYPE, isc::dhcp::DHCPBULKLEASEQUERY, isc::tcp::TcpConnection::getRemoteEndpoint(), getRemoteEndpointAddressAsText(), isc::lease_query::lease_query_logger, and LOG_ERROR.

Referenced by requestReceived().

+ Here is the call graph for this function:

◆ unpackQuery6()

BlqQueryPtr isc::lease_query::LeaseQueryConnection::unpackQuery6 ( const uint8_t * buffer,
size_t length ) const

Unpacks a DHCPv6 packet from a data buffer.

Parameters
bufferBuffer containing the packed DHCPv6 packet.
lengthNumber of bytes in contained in the buffer.
Returns
A BlqQueryPtr containing the unpacked DHCPv6 packet.

Definition at line 270 of file lease_query_connection.cc.

References isc::lease_query::BULK_LEASE_QUERY6_UNSUPPORTED_MSG_TYPE, DHCPV6_LEASEQUERY, isc::tcp::TcpConnection::getRemoteEndpoint(), getRemoteEndpointAddressAsText(), isc::lease_query::lease_query_logger, and LOG_ERROR.

Referenced by requestReceived().

+ Here is the call graph for this function:

Member Data Documentation

◆ can_send_

bool isc::lease_query::LeaseQueryConnection::can_send_
protected

◆ family_

uint16_t isc::lease_query::LeaseQueryConnection::family_
protected

Protocol family AF_INET or AF_INET6.

Definition at line 400 of file lease_query_connection.h.

Referenced by LeaseQueryConnection(), getRequesterAddress(), requestReceived(), and startQuery().

◆ io_service_

asiolink::IOServicePtr isc::lease_query::LeaseQueryConnection::io_service_
protected

IOService that drives the connection events.

Definition at line 403 of file lease_query_connection.h.

Referenced by LeaseQueryConnection(), post(), and pushToSend().

◆ max_concurrent_queries_

size_t isc::lease_query::LeaseQueryConnection::max_concurrent_queries_
protected

Maximum number of concurrent queries allowed.

Zero means unlimited.

Definition at line 432 of file lease_query_connection.h.

Referenced by LeaseQueryConnection(), processNextQuery(), and requestReceived().

◆ pending_queries_

XidQueue<BlqMsg> isc::lease_query::LeaseQueryConnection::pending_queries_
protected

Queue of queries waiting to enter processing.

When the in-process query list is full (size >= maximum), received queries are queued. When a query was processed a queued query is popped and processed.

Definition at line 419 of file lease_query_connection.h.

Referenced by addPendingQuery(), close(), findQuery(), noPendingQuery(), popPendingQuery(), and shutdown().

◆ response_to_send_

BlqResponsePtr isc::lease_query::LeaseQueryConnection::response_to_send_
protected

Tracks the response currently being sent.

Definition at line 428 of file lease_query_connection.h.

Referenced by close(), responseSent(), sendNextResponse(), shutdown(), and stopThisConnection().

◆ responses_

BlqResponseList isc::lease_query::LeaseQueryConnection::responses_
protected

List of responses waiting to be sent.

Definition at line 422 of file lease_query_connection.h.

Referenced by close(), getNumResponses(), pushToSend(), sendNextResponse(), and shutdown().

◆ responses_mutex_

std::mutex isc::lease_query::LeaseQueryConnection::responses_mutex_
mutableprotected

◆ running_queries_

XidQueue<BulkLeaseQuery> isc::lease_query::LeaseQueryConnection::running_queries_
protected

List of in-process queries.

Definition at line 412 of file lease_query_connection.h.

Referenced by addRunningQuery(), close(), findQuery(), getNumRunningQueries(), removeRunningQuery(), and shutdown().

◆ stopping_

bool isc::lease_query::LeaseQueryConnection::stopping_
protected

The documentation for this class was generated from the following files: