Kea: pkt_template.h Source File

| Kea 3.0.3-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
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>
38 using PktT = typename AdapterPkt<D>::type;
39
40template <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
dhcp_space.h
isc::dhcp
Definition dhcp4/client_handler.cc:20
isc::dhcp::PktTPtr
boost::shared_ptr< PktT< D > > PktTPtr
Definition pkt_template.h:41
isc::dhcp::PktT
typename AdapterPkt< D >::type PktT
Definition pkt_template.h:38
isc::util::DHCPv6
@ DHCPv6
Definition dhcp_space.h:19
isc::util::DHCPv4
@ DHCPv4
Definition dhcp_space.h:18
isc
Defines the logger used by the top-level component of kea-lfc.
Definition agent_parser.cc:148
pkt4.h
pkt6.h