Kea 2.7.5
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
14namespace isc {
15
16namespace dhcp {
17
20namespace {
21
22template <isc::util::DhcpSpace D>
23struct AdapterPkt {};
24
25template <>
26struct AdapterPkt<isc::util::DHCPv4> {
27 using type = Pkt4;
28};
29
30template <>
31struct AdapterPkt<isc::util::DHCPv6> {
32 using type = Pkt6;
33};
34
35} // namespace
36
37template <isc::util::DhcpSpace D>
38using PktT = typename AdapterPkt<D>::type;
39
40template <isc::util::DhcpSpace D>
41using 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
typename AdapterPkt< D >::type PktT
Defines the logger used by the top-level component of kea-lfc.