Kea  2.3.4-git
pkt_template.h
Go to the documentation of this file.
1 // Copyright (C) 2022 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 ISC_PKT_TEMPLATE_H
8 #define ISC_PKT_TEMPLATE_H
9 
10 #include <dhcp/pkt4.h>
11 #include <dhcp/pkt6.h>
12 #include <util/dhcp_space.h>
13 
14 namespace isc {
15 
16 namespace dhcp {
17 
20 namespace {
21 
22 template <isc::util::DhcpSpace D>
23 struct AdapterPkt {};
24 
25 template <>
26 struct AdapterPkt<isc::util::DHCPv4> {
27  using type = Pkt4;
28 };
29 
30 template <>
31 struct AdapterPkt<isc::util::DHCPv6> {
32  using type = Pkt6;
33 };
34 
35 } // namespace
36 
37 template <isc::util::DhcpSpace D>
38 using PktT = typename AdapterPkt<D>::type;
39 
40 template <isc::util::DhcpSpace D>
41 using PktTPtr = boost::shared_ptr<PktT<D>>;
43 
44 } // namespace dhcp
45 } // namespace isc
46 
47 #endif // ISC_PKT_TEMPLATE_H
boost::shared_ptr< PktT< D > > PktTPtr
Definition: pkt_template.h:41
Defines the logger used by the top-level component of kea-lfc.
typename AdapterPkt< D >::type PktT
Definition: pkt_template.h:38