25 typedef boost::shared_ptr<Lease>
LeasePtr;
104 uint32_t valid_lft,
SubnetID subnet_id, time_t cltt,
105 const bool fqdn_fwd,
const bool fqdn_rev,
106 const std::string& hostname,
200 virtual std::string
toText()
const = 0;
253 virtual void decline(uint32_t probation_period) = 0;
297 typedef boost::shared_ptr<Lease4>
Lease4Ptr;
326 const uint8_t* clientid,
size_t clientid_len, uint32_t valid_lft,
327 time_t cltt, uint32_t subnet_id,
328 const bool fqdn_fwd =
false,
const bool fqdn_rev =
false,
329 const std::string& hostname =
"")
330 :
Lease(addr, valid_lft, subnet_id, cltt, fqdn_fwd, fqdn_rev,
333 client_id_.reset(
new ClientId(clientid, clientid_len));
351 const uint32_t valid_lifetime,
354 const bool fqdn_fwd =
false,
355 const bool fqdn_rev =
false,
356 const std::string& hostname =
"");
389 static std::string statesToText(
const uint32_t state);
400 const std::vector<uint8_t>& getClientIdVector()
const;
462 bool belongsToClient(
const HWAddrPtr& hw_address,
479 return (!
operator==(other));
485 virtual std::string
toText()
const;
492 void decline(uint32_t probation_period);
522 typedef boost::shared_ptr<Lease6>
Lease6Ptr;
579 uint32_t iaid, uint32_t preferred, uint32_t valid,
581 uint8_t prefixlen = 128);
598 uint32_t iaid, uint32_t preferred, uint32_t valid,
599 SubnetID subnet_id,
const bool fqdn_fwd,
600 const bool fqdn_rev,
const std::string& hostname,
626 static std::string statesToText(
const uint32_t state);
636 const std::vector<uint8_t>& getDuidVector()
const;
643 void decline(uint32_t probation_period);
654 return (!
operator==(other));
660 virtual std::string
toText()
const;
695 template <isc::util::DhcpSpace D>
696 struct AdapterLease {};
710 template <isc::util::DhcpSpace D>
711 using LeaseT =
typename AdapterLease<D>::type;
713 template <isc::util::DhcpSpace D>
static std::string lifetimeToText(uint32_t lifetime)
Print lifetime.
uint32_t state_
Holds the lease state(s).
boost::shared_ptr< DUID > DuidPtr
HWAddrPtr hwaddr_
Client's MAC/hardware address.
uint32_t iaid_
Identity Association Identifier (IAID)
typename AdapterLease< D >::type LeaseT
static const uint32_t STATE_EXPIRED_RECLAIMED
Expired and reclaimed lease.
Structure that holds a lease for IPv4 address.
std::vector< uint8_t > relay_id_
Relay identifier for Bulk Lease Query.
uint32_t reuseable_preferred_lft_
Remaining preferred lifetime.
bool fqdn_rev_
Reverse zone updated?
virtual void decline(uint32_t probation_period)=0
Sets lease to DECLINED state.
boost::shared_ptr< HWAddr > HWAddrPtr
Shared pointer to a hardware address structure.
static std::string typeToText(Type type)
returns text representation of a lease type
const std::vector< uint8_t > & getHWAddrVector() const
Returns raw (as vector) hardware address.
Base class for user context.
time_t cltt_
Client last transmission time.
uint32_t preferred_lft_
Preferred lifetime.
bool fqdn_fwd_
Forward zone updated?
std::vector< Lease4Ptr > Lease4Collection
A collection of IPv4 leases.
virtual Lease::Type getType() const
Returns Lease type.
the lease contains IPv6 prefix (for prefix delegation)
boost::shared_ptr< Element > ElementPtr
std::string hostname_
Client hostname.
boost::shared_ptr< const Lease6 > ConstLease6Ptr
Pointer to a const Lease6 structure.
SubnetID subnet_id_
Subnet identifier.
ExtendedInfoAction extended_info_action_
Record the action on extended info tables in the lease.
virtual std::string toText() const =0
Convert Lease to Printable Form.
boost::shared_ptr< Lease > LeasePtr
Pointer to the lease object.
bool operator!=(const Lease4 &other) const
Compare two leases for inequality.
bool operator==(const Element &a, const Element &b)
static void syncCurrentExpirationTime(const Lease &from, Lease &to)
Sync lease current expiration time with new value from another lease, so that additional operations c...
int64_t getExpirationTime() const
Returns lease expiration time.
boost::shared_ptr< Lease4 > Lease4Ptr
Pointer to a Lease4 structure.
virtual Lease::Type getType() const
Returns Lease type.
Abstract class for configuration Cfg_* classes.
boost::shared_ptr< Lease4Collection > Lease4CollectionPtr
A shared pointer to the collection of IPv4 leases.
Lease4()
Default constructor.
boost::shared_ptr< LeaseT< D > > LeaseTPtr
Lease4(const isc::asiolink::IOAddress &addr, const HWAddrPtr &hwaddr, const uint8_t *clientid, size_t clientid_len, uint32_t valid_lft, time_t cltt, uint32_t subnet_id, const bool fqdn_fwd=false, const bool fqdn_rev=false, const std::string &hostname="")
Constructor.
void updateCurrentExpirationTime()
Update lease current expiration time with new value, so that additional operations can be done withou...
virtual Lease::Type getType() const =0
Returns Lease type.
boost::shared_ptr< const Element > ConstElementPtr
DuidPtr duid_
Client identifier.
Structure that holds a lease for IPv6 address and/or prefix.
ClientIdPtr client_id_
Client identifier.
Lease::Type type_
Lease type.
Lease(const isc::asiolink::IOAddress &addr, uint32_t valid_lft, SubnetID subnet_id, time_t cltt, const bool fqdn_fwd, const bool fqdn_rev, const std::string &hostname, const HWAddrPtr &hwaddr)
Constructor.
uint8_t prefixlen_
IPv6 prefix length.
std::vector< Lease6Ptr > Lease6Collection
A collection of IPv6 leases.
boost::shared_ptr< ClientId > ClientIdPtr
Shared pointer to a Client ID.
the lease contains temporary IPv6 address
the lease contains non-temporary IPv6 address
bool expired() const
returns true if the lease is expired
time_t current_cltt_
Current client last transmission time.
Defines the logger used by the top-level component of kea-lfc.
static Type textToType(const std::string &text)
Converts type name to the actual type.
bool operator!=(const Lease6 &other) const
Compare two leases for inequality.
update extended info tables.
bool stateExpiredReclaimed() const
Indicates if the lease is in the "expired-reclaimed" state.
static const uint32_t INFINITY_LFT
Infinity (means static, i.e. never expire)
a common structure for IPv4 and IPv6 leases
Type
Type of lease or pool.
std::ostream & operator<<(std::ostream &os, const OpaqueDataTuple &tuple)
Inserts the OpaqueDataTuple as a string into stream.
Holds Client identifier or client IPv4 address.
static std::string basicStatesToText(const uint32_t state)
Returns name(s) of the basic lease state(s).
boost::shared_ptr< Lease6Collection > Lease6CollectionPtr
A shared pointer to the collection of IPv6 leases.
virtual ~Lease()
Destructor.
uint32_t reuseable_valid_lft_
Remaining valid lifetime.
isc::asiolink::IOAddress addr_
IPv4 ot IPv6 address.
static const uint32_t STATE_DEFAULT
A lease in the default state.
static const uint32_t STATE_DECLINED
Declined lease.
bool stateDeclined() const
Indicates if the lease is in the "declined" state.
ExtendedInfoAction
Action on extended info tables.
uint32_t valid_lft_
Valid lifetime.
virtual isc::data::ElementPtr toElement() const =0
Unparse a configuration object.
The IOAddress class represents an IP addresses (version agnostic)
static void fromElementCommon(const LeasePtr &lease, const data::ConstElementPtr &element)
Sets common (for v4 and v6) properties of the lease object.
std::vector< uint8_t > remote_id_
Remote identifier for Bulk Lease Query.
boost::shared_ptr< Lease6 > Lease6Ptr
Pointer to a Lease6 structure.
delete reference to the lease
uint32_t current_valid_lft_
Current valid lifetime.
bool hasIdenticalFqdn(const Lease &other) const
Returns true if the other lease has equal FQDN data.
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.