Kea  1.5.0
subnet_id.h
Go to the documentation of this file.
1 // Copyright (C) 2014-2018 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 
14 namespace isc {
15 namespace dhcp {
16 
23 typedef uint32_t SubnetID;
24 
26 static const SubnetID SUBNET_ID_GLOBAL = 0;
28 static const SubnetID SUBNET_ID_MAX = std::numeric_limits<uint32_t>::max()-1;
30 static const SubnetID SUBNET_ID_UNUSED = std::numeric_limits<uint32_t>::max();
31 
34 class DuplicateSubnetID : public Exception {
35 public:
36  DuplicateSubnetID(const char* file, size_t line, const char* what) :
37  isc::Exception(file, line, what) { };
38 };
39 
40 }
41 }
42 
43 #endif // SUBNET_ID_H
isc::dhcp::DuplicateSubnetID
Exception thrown upon attempt to add subnet with an ID that belongs to the subnet that already exists...
Definition: subnet_id.h:34
isc::dhcp::DuplicateSubnetID::DuplicateSubnetID
DuplicateSubnetID(const char *file, size_t line, const char *what)
Definition: subnet_id.h:36
isc::Exception
This is a base class for exceptions thrown from the DNS library module.
Definition: exceptions/exceptions.h:23
isc
Defines the logger used by the top-level component of kea-dhcp-ddns.
Definition: agent_parser.cc:144
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
exceptions.h
isc::dhcp::SubnetID
uint32_t SubnetID
Unique identifier for a subnet (both v4 and v6)
Definition: lease.h:24