Kea 3.0.0
lease_query_listener.h
Go to the documentation of this file.
1// Copyright (C) 2022-2025 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef LEASE_QUERY_LISTENER_H
8#define LEASE_QUERY_LISTENER_H
9
10#include <config.h>
12#include <asiolink/io_service.h>
13#include <dhcp/pkt.h>
14#include <tcp/tcp_listener.h>
15#include <tcp/tcp_connection.h>
17
18namespace isc {
19namespace lease_query {
20
23public:
37 const asiolink::IOAddress& server_address,
38 const unsigned short server_port,
39 const asiolink::TlsContextPtr& tls_context,
40 const tcp::TcpListener::IdleTimeout& idle_timeout,
41 const tcp::TcpConnectionFilterCallback& filter_callback,
42 const uint16_t family,
43 const size_t max_concurrent_queries = 0)
44 : tcp::TcpListener(io_service,
45 server_address,
46 server_port,
47 tls_context,
48 idle_timeout,
49 filter_callback),
50 family_(family),
51 max_concurrent_queries_(max_concurrent_queries) {
52 }
53
56 }
57
58protected:
66 const tcp::TcpConnectionAcceptorCallback& acceptor_callback,
67 const tcp::TcpConnectionFilterCallback& connection_filter) {
72 acceptor_callback,
73 connection_filter,
75 family_,
77 return (conn);
78 }
79
81 uint16_t family_;
82
86};
87
89typedef boost::shared_ptr<LeaseQueryListener> LeaseQueryListenerPtr;
90
91} // end of namespace isc::lease_query
92} // end of namespace isc
93
94#endif // LEASE_QUERY_LISTENER_H
Derivation of TcpConnection used for Bulk LeaseQuery.
uint16_t family_
Protocol family AF_INET or AF_INET6.
virtual tcp::TcpConnectionPtr createConnection(const tcp::TcpConnectionAcceptorCallback &acceptor_callback, const tcp::TcpConnectionFilterCallback &connection_filter)
Creates an instance of the TcpConnection.
LeaseQueryListener(const asiolink::IOServicePtr &io_service, const asiolink::IOAddress &server_address, const unsigned short server_port, const asiolink::TlsContextPtr &tls_context, const tcp::TcpListener::IdleTimeout &idle_timeout, const tcp::TcpConnectionFilterCallback &filter_callback, const uint16_t family, const size_t max_concurrent_queries=0)
Constructor.
size_t max_concurrent_queries_
Maximum number of concurrent queries allowed.
Implements a class that listens for, accepts, and manages TCP connections.
asiolink::IOServicePtr io_service_
Pointer to the IO service.
TcpListener(const asiolink::IOServicePtr &io_service, const asiolink::IOAddress &server_address, const unsigned short server_port, const asiolink::TlsContextPtr &tls_context, const IdleTimeout &idle_timeout, const TcpConnectionFilterCallback &connection_filter=0)
Constructor.
asiolink::TlsContextPtr tls_context_
TLS context.
TcpConnectionPool connections_
Pool of active connections.
long idle_timeout_
Timeout after which idle connection is closed by the server.
TcpConnectionAcceptorPtr acceptor_
Acceptor instance.
boost::shared_ptr< LeaseQueryConnection > LeaseQueryConnectionPtr
Defines a shared pointer to a LeaseQueryConnection.
boost::shared_ptr< LeaseQueryListener > LeaseQueryListenerPtr
Defines a pointer to a LeaseQueryListener.
std::function< bool(const boost::asio::ip::tcp::endpoint &)> TcpConnectionFilterCallback
Type of the callback for filtering new connections by ip address.
boost::shared_ptr< TcpConnection > TcpConnectionPtr
Pointer to the TcpConnection.
std::function< void(const boost::system::error_code &)> TcpConnectionAcceptorCallback
Type of the callback for the TCP acceptor used in this library.
Defines the logger used by the top-level component of kea-lfc.
Idle connection timeout.