-// Copyright (C) 2013-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2025 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
static const size_t MAX_QUEUE_DEFAULT = 1024;
/// @brief Defines the list of possible states for D2QueueMgr.
- enum State {
- NOT_INITTED,
- INITTED,
- RUNNING,
- STOPPING,
- STOPPED_QUEUE_FULL,
- STOPPED_RECV_ERROR,
- STOPPED,
+ enum State : int {
+ NOT_INITTED = 0,
+ INITTED = 1,
+ RUNNING = 2,
+ STOPPING = 3,
+ STOPPED_QUEUE_FULL = 4,
+ STOPPED_RECV_ERROR = 5,
+ STOPPED = 6,
};
/// @brief Constructor
namespace radius {
/// @brief Type of accounting events.
-typedef enum {
- EVENT_CREATE, //< A new lease was created (leaseX_select hooks).
- EVENT_RENEW, //< A lease was renewed (leaseX_renew hooks).
- EVENT_REBIND, //< A lease was rebound (lease6_rebind hook).
- EVENT_EXPIRE, //< A lease was expired (leaseX_expire hooks).
- EVENT_RELEASE, //< A lease was released (leaseX_release hooks).
- EVENT_DECLINE, //< A lease was declined (leaseX_decline hooks).
- EVENT_ADD, //< A command added a lease (command_processed hook).
- EVENT_UPDATE, //< A command updated a lease (command_processed hook).
- EVENT_DEL //< A command deleted a lease (command_processed hook).
-} Event;
+enum Event : int {
+ EVENT_CREATE = 0, //< A new lease was created (leaseX_select hooks).
+ EVENT_RENEW = 1, //< A lease was renewed (leaseX_renew hooks).
+ EVENT_REBIND = 2, //< A lease was rebound (lease6_rebind hook).
+ EVENT_EXPIRE = 3, //< A lease was expired (leaseX_expire hooks).
+ EVENT_RELEASE = 4, //< A lease was released (leaseX_release hooks).
+ EVENT_DECLINE = 5, //< A lease was declined (leaseX_decline hooks).
+ EVENT_ADD = 6, //< A command added a lease (command_processed hook).
+ EVENT_UPDATE = 7, //< A command updated a lease (command_processed hook).
+ EVENT_DEL = 8, //< A command deleted a lease (command_processed hook).
+};
/// @brief Translate an event to text.
///
/// @note that this applies to the status of I/Os in the fetch - a fetch that
/// resulted in a packet being received from the server is a SUCCESS, even if
/// the contents of the packet indicate that some error occurred.
- enum Result {
+ enum Result : int {
SUCCESS = 0, // Success, fetch completed
TIME_OUT = 1, // Failure, fetch timed out
STOPPED = 2, // Control code, fetch has been stopped
-// Copyright (C) 2011-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2025 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
namespace cryptolink {
/// @brief Hash algorithm identifiers.
-enum HashAlgorithm {
+enum HashAlgorithm : int {
UNKNOWN_HASH = 0, // This value can be used in conversion
// functions, to be returned when the
// input is unknown (but a value MUST be
-// Copyright (C) 2013-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2025 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
};
/// @brief A status code of the DNSClient.
- enum Status {
- SUCCESS, ///< Response received and is ok.
- TIMEOUT, ///< No response, timeout.
- IO_STOPPED, ///< IO was stopped.
- INVALID_RESPONSE, ///< Response received but invalid.
- OTHER ///< Other, unclassified error.
+ enum Status : int {
+ SUCCESS = 0, ///< Response received and is ok.
+ TIMEOUT = 1, ///< No response, timeout.
+ IO_STOPPED = 2, ///< IO was stopped.
+ INVALID_RESPONSE = 3, ///< Response received but invalid.
+ OTHER = 4, ///< Other, unclassified error.
};
/// @brief Callback for the @c DNSClient class.
-// Copyright (C) 2013-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2025 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
stream << "OTHER";
break;
default:
- stream << "UNKNOWN("
- << static_cast<int>(getDnsUpdateStatus()) << ")";
+ stream << "UNKNOWN(" << getDnsUpdateStatus() << ")";
break;
}
-// Copyright (C) 2013-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2025 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
static const size_t MAX_QUEUE_DEFAULT = 1024;
/// @brief Defines the outcome of an asynchronous NCR send.
- enum Result {
- SUCCESS,
- TIME_OUT,
- STOPPED,
- ERROR
+ enum Result : int {
+ SUCCESS = 0,
+ TIME_OUT = 1,
+ STOPPED = 2,
+ ERROR = 3,
};
/// @brief Abstract class for defining application layer send callbacks.
-// Copyright (C) 2014-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2025 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
/// - DUID (DHCPv4 and DHCPv6) (identifier name: "duid"),
/// - circuit identifier (DHCPv4) (identifier name: "circuit-id"),
/// - client identifier (DHCPv4) (identifier name: "client-id")
- enum IdentifierType {
- IDENT_HWADDR,
- IDENT_DUID,
- IDENT_CIRCUIT_ID,
- IDENT_CLIENT_ID,
- IDENT_FLEX, ///< Flexible host identifier.
+ enum IdentifierType : int {
+ IDENT_HWADDR = 0,
+ IDENT_DUID = 1,
+ IDENT_CIRCUIT_ID = 2,
+ IDENT_CLIENT_ID = 3,
+ IDENT_FLEX = 4, ///< Flexible host identifier.
};
/// @brief Constant pointing to the last identifier of the
static std::string lifetimeToText(uint32_t lifetime);
/// @brief Type of lease or pool
- typedef enum {
+ enum Type : int {
TYPE_NA = 0, ///< the lease contains non-temporary IPv6 address
TYPE_TA = 1, ///< the lease contains temporary IPv6 address
TYPE_PD = 2, ///< the lease contains IPv6 prefix (for prefix delegation)
- TYPE_V4 = 3 ///< IPv4 lease
- } Type;
+ TYPE_V4 = 3, ///< IPv4 lease
+ };
/// @brief returns text representation of a lease type
/// @param type lease or pool type to be converted