1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Copyright (C) 2022-2024 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Kea Hooks Basic
// Commercial End User License Agreement v2.0. See COPYING file in the premium/
// directory.

#include <config.h>
#include <asiolink/asio_wrapper.h>
#include <asiolink/io_address.h>
#include <asiolink/io_error.h>
#include <asiolink/io_service.h>
#include <mt_lease_query_mgr.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <util/multi_threading_mgr.h>

#include <boost/pointer_cast.hpp><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.

using namespace isc::asiolink;
using namespace isc::tcp;
using namespace isc::util;

namespace ph = std::placeholders;

namespace isc {
namespace lease_query {

MtLeaseQueryListenerMgr::MtLeaseQueryListenerMgr(const IOAddress& address,
                                                 const uint16_t port,
                                                 const uint16_t family,
                                                 const tcp::TcpListener::IdleTimeout& idle_timeout,
                                                 const uint16_t thread_pool_size /* = 1 */,
                                                 TlsContextPtr context /* = () */,
                                                 TcpConnectionFilterCallback connection_filter /* = 0 */,
                                                 const size_t max_concurrent_queries /* = 0 */)
    : MtTcpListenerMgr(std::bind(&MtLeaseQueryListenerMgr::listenerFactory,
                                 this, ph::_1, ph::_2, ph::_3, ph::_4, ph::_5,
                                 ph::_6),
                       address, port, thread_pool_size, context,
                       connection_filter),
      family_(family),
      max_concurrent_queries_(max_concurrent_queries) {
      setIdleTimeout(idle_timeout.value_);
}

TcpListenerPtr
MtLeaseQueryListenerMgr::listenerFactory(const asiolink::IOServicePtr& io_service,
                                         const asiolink::IOAddress& server_address,
                                         const unsigned short server_port,
                                         const asiolink::TlsContextPtr& tls_context,
                                         const TcpListener::IdleTimeout& idle_timeout,
                                         const TcpConnectionFilterCallback& connection_filter) {
    TcpListenerPtr listener(new LeaseQueryListener(io_service,
                                                   server_address,
                                                   server_port,
                                                   tls_context,
                                                   idle_timeout,
                                                   connection_filter,
                                                   family_,
                                                   max_concurrent_queries_));
    return (listener);
}


MtLeaseQueryListenerMgr::~MtLeaseQueryListenerMgr() {
    stop();
}

} // namespace isc::lease_query
} // namespace isc