/// Returns message type (e.g. 1 = SOLICIT)
///
/// @return message type
- uint8_t getType() { return (msg_type_); }
+ uint8_t getType() const { return (msg_type_); }
/// Sets message type (e.g. 1 = SOLICIT)
///
/// @brief Returns remote address
///
/// @return remote address
- const isc::asiolink::IOAddress& getRemoteAddr() { return (remote_addr_); }
+ const isc::asiolink::IOAddress& getRemoteAddr() const {
+ return (remote_addr_);
+ }
/// @brief Sets local address.
///
/// @brief Returns local address.
///
/// @return local address
- const isc::asiolink::IOAddress& getLocalAddr() { return (local_addr_); }
+ const isc::asiolink::IOAddress& getLocalAddr() const {
+ return (local_addr_);
+ }
/// @brief Sets local port.
///
/// @brief Returns local port.
///
/// @return local port
- uint16_t getLocalPort() { return (local_port_); }
+ uint16_t getLocalPort() const { return (local_port_); }
/// @brief Sets remote port.
///
/// @brief Returns remote port.
///
/// @return remote port
- uint16_t getRemotePort() { return (remote_port_); }
+ uint16_t getRemotePort() const { return (remote_port_); }
/// @brief Sets interface index.
///
/// @brief Maximum size of a hardware address
static const size_t HWADDR_MAX = 20;
- /// @brief Constructor
- ///
- /// @param addr IPv4 address as unsigned 32-bit integer in network byte
- /// order.
- /// @param hwaddr Hardware address buffer
- /// @param hwaddr_len Length of hardware address buffer
- /// @param clientid Client identification buffer
- /// @param clientid_len Length of client identification buffer
- /// @param valid_lft Lifetime of the lease
- /// @param cltt Client last transmission time
- /// @param subnet_id Subnet identification
- Lease4(uint32_t addr, const uint8_t* hwaddr, size_t hwaddr_len,
- const uint8_t* clientid, size_t clientid_len, uint32_t valid_lft,
- time_t cltt, uint32_t subnet_id)
- : addr_(addr), ext_(0), hwaddr_(hwaddr, hwaddr + hwaddr_len),
- client_id_(new ClientId(clientid, clientid_len)), t1_(0), t2_(0),
- valid_lft_(valid_lft), cltt_(cltt), subnet_id_(subnet_id),
- fixed_(false), hostname_(), fqdn_fwd_(false), fqdn_rev_(false),
- comments_()
- {}
-
- /// @brief Default Constructor
- ///
- /// Initialize fields that don't have a default constructor.
- Lease4() : addr_(0) {}
-
/// IPv4 address
isc::asiolink::IOAddress addr_;
/// system administrator.
std::string comments_;
+ /// @brief Constructor
+ ///
+ /// @param addr IPv4 address as unsigned 32-bit integer in network byte
+ /// order.
+ /// @param hwaddr Hardware address buffer
+ /// @param hwaddr_len Length of hardware address buffer
+ /// @param clientid Client identification buffer
+ /// @param clientid_len Length of client identification buffer
+ /// @param valid_lft Lifetime of the lease
+ /// @param cltt Client last transmission time
+ /// @param subnet_id Subnet identification
+ Lease4(uint32_t addr, const uint8_t* hwaddr, size_t hwaddr_len,
+ const uint8_t* clientid, size_t clientid_len, uint32_t valid_lft,
+ time_t cltt, uint32_t subnet_id)
+ : addr_(addr), ext_(0), hwaddr_(hwaddr, hwaddr + hwaddr_len),
+ client_id_(new ClientId(clientid, clientid_len)), t1_(0), t2_(0),
+ valid_lft_(valid_lft), cltt_(cltt), subnet_id_(subnet_id),
+ fixed_(false), hostname_(), fqdn_fwd_(false), fqdn_rev_(false),
+ comments_()
+ {}
+
+ /// @brief Default Constructor
+ ///
+ /// Initialize fields that don't have a default constructor.
+ Lease4() : addr_(0), fixed_(false), fqdn_fwd_(false), fqdn_rev_(false)
+ {}
+
/// @brief Compare two leases for equality
///
/// @param other lease6 object with which to compare
LEASE_IA_PD /// the lease contains IPv6 prefix (for prefix delegation)
} LeaseType;
- /// @brief Constructor
- Lease6(LeaseType type, const isc::asiolink::IOAddress& addr, DuidPtr duid,
- uint32_t iaid, uint32_t preferred, uint32_t valid, uint32_t t1,
- uint32_t t2, SubnetID subnet_id, uint8_t prefixlen_ = 0);
-
/// @brief IPv6 address
///
/// IPv6 address or, in the case of a prefix delegation, the prefix.
/// @todo: Add DHCPv6 failover related fields here
+ /// @brief Constructor
+ Lease6(LeaseType type, const isc::asiolink::IOAddress& addr, DuidPtr duid,
+ uint32_t iaid, uint32_t preferred, uint32_t valid, uint32_t t1,
+ uint32_t t2, SubnetID subnet_id, uint8_t prefixlen_ = 0);
+
/// @brief Constructor
///
/// Initialize fields that don't have a default constructor.
- Lease6() : addr_("::") {}
+ Lease6() : addr_("::"), type_(LEASE_IA_NA), fixed_(false), fqdn_fwd_(false),
+ fqdn_rev_(false)
+ {}
/// @brief Convert Lease6 to Printable Form
///