Kea  1.9.9-git
tls_acceptor.h
Go to the documentation of this file.
1 // Copyright (C) 2016-2021 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 TLS_ACCEPTOR_H
8 #define TLS_ACCEPTOR_H
9 
10 #ifndef BOOST_ASIO_HPP
11 #error "asio.hpp must be included before including this, see asiolink.h as to why"
12 #endif
13 
14 #include <asiolink/io_acceptor.h>
15 #include <asiolink/io_service.h>
16 #include <asiolink/io_socket.h>
17 #include <asiolink/tcp_acceptor.h>
18 #include <asiolink/tcp_endpoint.h>
19 #include <asiolink/tcp_socket.h>
20 #include <asiolink/tls_socket.h>
21 #include <boost/shared_ptr.hpp>
22 #include <netinet/in.h>
23 
24 namespace isc {
25 namespace asiolink {
26 
30 template<typename C>
31 class TLSAcceptor : public TCPAcceptor<C> {
32 public:
33 
37  explicit TLSAcceptor(IOService& io_service) : TCPAcceptor<C>(io_service) {
38  }
39 
41  virtual ~TLSAcceptor() { }
42 
53  template<typename SocketCallback>
54  void asyncAccept(const TLSSocket<SocketCallback>& socket, C& callback) {
55  TCPAcceptor<C>::acceptor_->async_accept(socket.getASIOSocket(), callback);
56  }
57 };
58 
59 } // namespace asiolink
60 } // namespace isc
61 
62 #endif
Defines the logger used by the top-level component of kea-dhcp-ddns.