Kea: duid_factory.h Source File

| Kea 3.2.0-git

duid_factory.h
Go to the documentation of this file.
1// Copyright (C) 2015-2026 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 DUID_FACTORY_H
8#define DUID_FACTORY_H
9
10#include <dhcp/duid.h>
11#include <boost/noncopyable.hpp>
12#include <stdint.h>
13#include <string>
14#include <vector>
15
16namespace isc {
17namespace dhcp {
18
63 class DUIDFactory : public boost::noncopyable {
64public:
65
70 DUIDFactory(const std::string& storage_location = "");
71
76 bool isStored() const;
77
97 void createLLT(const uint16_t htype, const uint32_t time_in,
98 const std::vector<uint8_t>& ll_identifier);
99
111 void createEN(const uint32_t enterprise_id,
112 const std::vector<uint8_t>& identifier);
113
130 void createLL(const uint16_t htype,
131 const std::vector<uint8_t>& ll_identifier);
132
147 DuidPtr get();
148
149private:
150
160 void createLinkLayerId(std::vector<uint8_t>& identifier,
161 uint16_t& htype) const;
162
169 void set(const std::vector<uint8_t>& duid_vector);
170
172 void readFromFile();
173
175 std::string storage_location_;
176
178 DuidPtr duid_;
179
180};
181
182} // end of isc::dhcp namespace
183} // end of isc namespace
184
185#endif /* DUID_FACTORY_H */
isc::dhcp::DUIDFactory::isStored
bool isStored() const
Checks if generated DUID will be stored in the file.
Definition duid_factory.cc:48
isc::dhcp::DUIDFactory::DUIDFactory
DUIDFactory(const std::string &storage_location="")
Constructor.
Definition duid_factory.cc:43
isc::dhcp::DUIDFactory::createLLT
void createLLT(const uint16_t htype, const uint32_t time_in, const std::vector< uint8_t > &ll_identifier)
Generates DUID-LLT.
Definition duid_factory.cc:53
isc::dhcp::DUIDFactory::createEN
void createEN(const uint32_t enterprise_id, const std::vector< uint8_t > &identifier)
Generates DUID-EN.
Definition duid_factory.cc:121
isc::dhcp::DUIDFactory::get
DuidPtr get()
Returns current DUID.
Definition duid_factory.cc:343
isc::dhcp::DUIDFactory::createLL
void createLL(const uint16_t htype, const std::vector< uint8_t > &ll_identifier)
Generates DUID-LL.
Definition duid_factory.cc:188
duid.h
isc::dhcp
Definition dhcp4/client_handler.cc:20
isc::dhcp::DuidPtr
boost::shared_ptr< DUID > DuidPtr
Definition duid.h:136
isc
Defines the logger used by the top-level component of kea-lfc.
Definition check_exists_add.cc:18