Kea: subnet_id.h Source File

| Kea 3.0.3-git

subnet_id.h
Go to the documentation of this file.
1// Copyright (C) 2014-2024 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 SUBNET_ID_H
8#define SUBNET_ID_H
9
10#include <exceptions/exceptions.h>
11#include <stdint.h>
12#include <typeinfo>
13#include <limits>
14#include <set>
15
16namespace isc {
17namespace dhcp {
18
25 typedef uint32_t SubnetID;
26
28static const SubnetID SUBNET_ID_GLOBAL = 0;
30static const SubnetID SUBNET_ID_MAX = std::numeric_limits<uint32_t>::max()-1;
32static const SubnetID SUBNET_ID_UNUSED = std::numeric_limits<uint32_t>::max();
33
36 class DuplicateSubnetID : public Exception {
37public:
38 DuplicateSubnetID(const char* file, size_t line, const char* what) :
39 isc::Exception(file, line, what) { }
40};
41
43 typedef std::set<dhcp::SubnetID> SubnetIDSet;
44
45}
46}
47
48#endif // SUBNET_ID_H
isc::Exception::Exception
Exception(const char *file, size_t line, const char *what)
Constructor for a given type for exceptions with file name and file line number.
Definition exceptions/exceptions.cc:17
isc::Exception::what
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Definition exceptions/exceptions.cc:32
isc::dhcp::DuplicateSubnetID::DuplicateSubnetID
DuplicateSubnetID(const char *file, size_t line, const char *what)
Definition subnet_id.h:38
exceptions.h
isc::dhcp
Definition dhcp4/client_handler.cc:20
isc::dhcp::SubnetIDSet
std::set< dhcp::SubnetID > SubnetIDSet
Ordered list aka set of subnetIDs.
Definition subnet_id.h:43
isc::dhcp::SubnetID
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
Definition subnet_id.h:25
isc::util::file
Definition filesystem.cc:28
isc
Defines the logger used by the top-level component of kea-lfc.
Definition agent_parser.cc:148