Kea 2.2.0
subnet_id.h
Go to the documentation of this file.
1// Copyright (C) 2014-2021 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
11#include <stdint.h>
12#include <typeinfo>
13#include <limits>
14
15namespace isc {
16namespace dhcp {
17
24typedef uint32_t SubnetID;
25
27static const SubnetID SUBNET_ID_GLOBAL = 0;
29static const SubnetID SUBNET_ID_MAX = std::numeric_limits<uint32_t>::max()-1;
31static const SubnetID SUBNET_ID_UNUSED = std::numeric_limits<uint32_t>::max();
32
36public:
37 DuplicateSubnetID(const char* file, size_t line, const char* what) :
38 isc::Exception(file, line, what) { };
39};
40
41}
42}
43
44#endif // SUBNET_ID_H
This is a base class for exceptions thrown from the DNS library module.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Exception thrown upon attempt to add subnet with an ID that belongs to the subnet that already exists...
Definition: subnet_id.h:35
DuplicateSubnetID(const char *file, size_t line, const char *what)
Definition: subnet_id.h:37
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
Definition: subnet_id.h:24
Defines the logger used by the top-level component of kea-lfc.