Kea  2.1.7-git
isc::dhcp::Network4 Class Reference

Specialization of the Network object for DHCPv4 case. More...

#include <network.h>

+ Inheritance diagram for isc::dhcp::Network4:

Public Member Functions

 Network4 ()
 Constructor. More...
 
util::Optional< bool > getAuthoritative (const Inheritance &inheritance=Inheritance::ALL) const
 Returns the flag indicating if requests for unknown IP addresses should be rejected with DHCPNAK instead of ignored. More...
 
util::Optional< std::string > getFilename (const Inheritance &inheritance=Inheritance::ALL) const
 Returns boot file name for this subnet. More...
 
util::Optional< bool > getMatchClientId (const Inheritance &inheritance=Inheritance::ALL) const
 Returns the flag indicating if the client identifiers should be used to identify the client's lease. More...
 
virtual asiolink::IOAddress getServerId () const
 Returns binary representation of the dhcp-server-identifier option (54). More...
 
util::Optional< asiolink::IOAddressgetSiaddr (const Inheritance &inheritance=Inheritance::ALL) const
 Returns siaddr for this network. More...
 
util::Optional< std::string > getSname (const Inheritance &inheritance=Inheritance::ALL) const
 Returns server hostname for this network. More...
 
void setAuthoritative (const util::Optional< bool > &authoritative)
 Sets the flag indicating if requests for unknown IP addresses should be rejected with DHCPNAK instead of ignored. More...
 
void setFilename (const util::Optional< std::string > &filename)
 Sets boot file name for the network. More...
 
void setMatchClientId (const util::Optional< bool > &match)
 Sets the flag indicating if the client identifier should be used to identify the client's lease. More...
 
void setSiaddr (const util::Optional< asiolink::IOAddress > &siaddr)
 Sets siaddr for the network. More...
 
void setSname (const util::Optional< std::string > &sname)
 Sets server hostname for the network. More...
 
virtual data::ElementPtr toElement () const
 Unparses network object. More...
 
- Public Member Functions inherited from isc::dhcp::Network
 Network ()
 Constructor. More...
 
virtual ~Network ()
 Virtual destructor. More...
 
void addRelayAddress (const asiolink::IOAddress &addr)
 Adds an address to the list addresses in the network's relay info. More...
 
void allowClientClass (const isc::dhcp::ClientClass &class_name)
 Sets the supported class to class class_name. More...
 
virtual bool clientSupported (const isc::dhcp::ClientClasses &client_classes) const
 Checks whether this network supports client that belongs to specified classes. More...
 
util::Optional< uint32_t > getCacheMaxAge (const Inheritance &inheritance=Inheritance::ALL) const
 Returns value in seconds to use as cache maximum age. More...
 
util::Optional< double > getCacheThreshold (const Inheritance &inheritance=Inheritance::ALL) const
 Returns percentage to use as cache threshold. More...
 
util::Optional< bool > getCalculateTeeTimes (const Inheritance &inheritance=Inheritance::ALL) const
 Returns whether or not T1/T2 calculation is enabled. More...
 
CfgOptionPtr getCfgOption ()
 Returns pointer to the option data configuration for this network. More...
 
ConstCfgOptionPtr getCfgOption () const
 Returns const pointer to the option data configuration for this network. More...
 
util::Optional< ClientClassgetClientClass (const Inheritance &inheritance=Inheritance::ALL) const
 returns the client class More...
 
util::Optional< std::string > getDdnsGeneratedPrefix (const Inheritance &inheritance=Inheritance::ALL) const
 Returns ddns-generated-prefix. More...
 
util::Optional< bool > getDdnsOverrideClientUpdate (const Inheritance &inheritance=Inheritance::ALL) const
 Returns ddns-override-client-update. More...
 
util::Optional< bool > getDdnsOverrideNoUpdate (const Inheritance &inheritance=Inheritance::ALL) const
 Returns ddns-override-no-update. More...
 
util::Optional< std::string > getDdnsQualifyingSuffix (const Inheritance &inheritance=Inheritance::ALL) const
 Returns ddns-qualifying-suffix. More...
 
util::Optional< D2ClientConfig::ReplaceClientNameModegetDdnsReplaceClientNameMode (const Inheritance &inheritance=Inheritance::ALL) const
 Returns ddns-replace-client-name-mode. More...
 
util::Optional< bool > getDdnsSendUpdates (const Inheritance &inheritance=Inheritance::ALL) const
 Returns ddns-send-updates. More...
 
util::Optional< bool > getDdnsUpdateOnRenew (const Inheritance &inheritance=Inheritance::ALL) const
 Returns ddns-update-on-renew. More...
 
util::Optional< bool > getDdnsUseConflictResolution (const Inheritance &inheritance=Inheritance::ALL) const
 Returns ddns-use-conflict-resolution. More...
 
util::Optional< std::string > getHostnameCharReplacement (const Inheritance &inheritance=Inheritance::ALL) const
 Return the invalid char replacement used to sanitize client hostnames. More...
 
util::Optional< std::string > getHostnameCharSet (const Inheritance &inheritance=Inheritance::ALL) const
 Return the char set regexp used to sanitize client hostnames. More...
 
util::Optional< std::string > getIface (const Inheritance &inheritance=Inheritance::ALL) const
 Returns name of the local interface for which this network is selected. More...
 
const IOAddressListgetRelayAddresses () const
 Returns the list of relay addresses from the network's relay info. More...
 
const RelayInfogetRelayInfo () const
 Returns const reference to relay information. More...
 
const ClientClassesgetRequiredClasses () const
 Returns classes which are required to be evaluated. More...
 
util::Optional< bool > getReservationsGlobal (const Inheritance &inheritance=Inheritance::ALL) const
 Returns whether global reservations should be fetched. More...
 
util::Optional< bool > getReservationsInSubnet (const Inheritance &inheritance=Inheritance::ALL) const
 Returns whether subnet reservations should be fetched. More...
 
util::Optional< bool > getReservationsOutOfPool (const Inheritance &inheritance=Inheritance::ALL) const
 Returns whether only out-of-pool reservations are allowed. More...
 
util::Optional< bool > getStoreExtendedInfo (const Inheritance &inheritance=Inheritance::ALL) const
 Returns store-extended-info. More...
 
isc::util::Triplet< uint32_t > getT1 (const Inheritance &inheritance=Inheritance::ALL) const
 Returns T1 (renew timer), expressed in seconds. More...
 
util::Optional< double > getT1Percent (const Inheritance &inheritance=Inheritance::ALL) const
 Returns percentage to use when calculating the T1 (renew timer). More...
 
isc::util::Triplet< uint32_t > getT2 (const Inheritance &inheritance=Inheritance::ALL) const
 Returns T2 (rebind timer), expressed in seconds. More...
 
util::Optional< double > getT2Percent (const Inheritance &inheritance=Inheritance::ALL) const
 Returns percentage to use when calculating the T2 (rebind timer). More...
 
isc::util::Triplet< uint32_t > getValid (const Inheritance &inheritance=Inheritance::ALL) const
 Return valid-lifetime for addresses in that prefix. More...
 
bool hasFetchGlobalsFn () const
 Checks if the network is associated with a function used to fetch globally configured parameters. More...
 
bool hasRelayAddress (const asiolink::IOAddress &address) const
 Tests if the network's relay info contains the given address. More...
 
bool hasRelays () const
 Indicates if network's relay info has relay addresses. More...
 
void requireClientClass (const isc::dhcp::ClientClass &class_name)
 Adds class class_name to classes required to be evaluated. More...
 
void setCacheMaxAge (const util::Optional< uint32_t > &cache_max_age)
 Sets cache max for a network. More...
 
void setCacheThreshold (const util::Optional< double > &cache_threshold)
 Sets cache threshold for a network. More...
 
void setCalculateTeeTimes (const util::Optional< bool > &calculate_tee_times)
 Sets whether or not T1/T2 calculation is enabled. More...
 
void setDdnsGeneratedPrefix (const util::Optional< std::string > &ddns_generated_prefix)
 Sets new ddns-generated-prefix. More...
 
void setDdnsOverrideClientUpdate (const util::Optional< bool > &ddns_override_client_update)
 Sets new ddns-override-client-update. More...
 
void setDdnsOverrideNoUpdate (const util::Optional< bool > &ddns_override_no_update)
 Sets new ddns-override-no-update. More...
 
void setDdnsQualifyingSuffix (const util::Optional< std::string > &ddns_qualifying_suffix)
 Sets new ddns-qualifying-suffix. More...
 
void setDdnsReplaceClientNameMode (const util::Optional< D2ClientConfig::ReplaceClientNameMode > &ddns_replace_client_name_mode)
 Sets new ddns-replace-client-name-mode. More...
 
void setDdnsSendUpdates (const util::Optional< bool > &ddns_send_updates)
 Sets new ddns-send-updates. More...
 
void setDdnsUpdateOnRenew (const util::Optional< bool > &ddns_update_on_renew)
 Sets new ddns-update-on-renew. More...
 
void setDdnsUseConflictResolution (const util::Optional< bool > &ddns_use_conflict_resolution)
 Sets new ddns-use-conflict-resolution. More...
 
void setFetchGlobalsFn (FetchNetworkGlobalsFn fetch_globals_fn)
 Sets the optional callback function used to fetch globally configured parameters. More...
 
void setHostnameCharReplacement (const util::Optional< std::string > &hostname_char_replacement)
 Sets new hostname-char-replacement. More...
 
void setHostnameCharSet (const util::Optional< std::string > &hostname_char_set)
 Sets new hostname-char-set. More...
 
void setIface (const util::Optional< std::string > &iface_name)
 Sets local name of the interface for which this network is selected. More...
 
void setRelayInfo (const RelayInfo &relay)
 Sets information about relay. More...
 
void setReservationsGlobal (const util::Optional< bool > &reservations_global)
 Sets whether global reservations should be fetched. More...
 
void setReservationsInSubnet (const util::Optional< bool > &reservations_in_subnet)
 Sets whether subnet reservations should be fetched. More...
 
void setReservationsOutOfPool (const util::Optional< bool > &reservations_out_of_pool)
 Sets whether only out-of-pool reservations are allowed. More...
 
void setStoreExtendedInfo (const util::Optional< bool > &store_extended_info)
 Sets new store-extended-info. More...
 
void setT1 (const isc::util::Triplet< uint32_t > &t1)
 Sets new renew timer for a network. More...
 
void setT1Percent (const util::Optional< double > &t1_percent)
 Sets new percentage for calculating T1 (renew timer). More...
 
void setT2 (const isc::util::Triplet< uint32_t > &t2)
 Sets new rebind timer for a network. More...
 
void setT2Percent (const util::Optional< double > &t2_percent)
 Sets new percentage for calculating T2 (rebind timer). More...
 
void setValid (const isc::util::Triplet< uint32_t > &valid)
 Sets new valid lifetime for a network. More...
 
- Public Member Functions inherited from isc::data::StampedElement
 StampedElement ()
 Constructor. More...
 
void delServerTag (const std::string &server_tag)
 Deletes server tag. More...
 
isc::data::ElementPtr getMetadata () const
 Returns an object representing metadata to be returned with objects from the configuration backend. More...
 
std::set< ServerTaggetServerTags () const
 Returns server tags. More...
 
bool hasAllServerTag () const
 Checks if the element has 'all' server tag. More...
 
bool hasServerTag (const ServerTag &server_tag) const
 Checks if the element has the given server tag. More...
 
void setServerTag (const std::string &server_tag)
 Adds new server tag. More...
 
- Public Member Functions inherited from isc::data::BaseStampedElement
 BaseStampedElement ()
 Constructor. More...
 
uint64_t getId () const
 Returns element's database identifier. More...
 
boost::posix_time::ptime getModificationTime () const
 Returns timestamp. More...
 
void setId (const uint64_t id)
 Sets element's database identifier. More...
 
void setModificationTime (const boost::posix_time::ptime &timestamp)
 Sets timestamp to the explicitly provided value. More...
 
void updateModificationTime ()
 Sets timestamp to the current time. More...
 
- Public Member Functions inherited from isc::data::UserContext
void contextToElement (data::ElementPtr map) const
 Merge unparse a user_context object. More...
 
data::ConstElementPtr getContext () const
 Returns const pointer to the user context. More...
 
void setContext (const data::ConstElementPtr &ctx)
 Sets user context. More...
 
- Public Member Functions inherited from isc::data::CfgToElement
virtual ~CfgToElement ()
 Destructor. More...
 

Additional Inherited Members

- Public Types inherited from isc::dhcp::Network
enum  Inheritance { Inheritance::NONE, Inheritance::PARENT_NETWORK, Inheritance::GLOBAL, Inheritance::ALL }
 Inheritance "mode" used when fetching an optional Network parameter. More...
 
typedef boost::shared_ptr< Network::RelayInfoRelayInfoPtr
 Pointer to the RelayInfo structure. More...
 
- Static Public Member Functions inherited from isc::data::UserContext
static data::ElementPtr toElement (data::ConstElementPtr map)
 Copy an Element map. More...
 
- Protected Member Functions inherited from isc::dhcp::Network
FetchNetworkGlobalsFn getFetchGlobalsFn () const
 Gets the optional callback function used to fetch globally configured parameters. More...
 
template<typename ReturnType >
ReturnType getGlobalProperty (ReturnType property, const int global_index, const int min_index=-1, const int max_index=-1) const
 Returns a value of global configuration parameter with a given index. More...
 
template<typename NumType >
isc::util::Triplet< NumType > getGlobalProperty (isc::util::Triplet< NumType > property, const int global_index, const int min_index=-1, const int max_index=-1) const
 The getGlobalProperty specialization for isc::util::Triplet<T>. More...
 
util::Optional< asiolink::IOAddressgetGlobalProperty (util::Optional< asiolink::IOAddress > property, const int global_index, const int min_index=-1, const int max_index=-1) const
 The getGlobalProperty specialization for Optional<IOAddress>. More...
 
template<typename BaseType >
OptionPtr getOptionProperty (OptionPtr(BaseType::*MethodPointer)(const Inheritance &inheritance) const, OptionPtr property, const Inheritance &inheritance) const
 Returns option pointer associated with a network using inheritance. More...
 
template<typename BaseType , typename ReturnType >
ReturnType getProperty (ReturnType(BaseType::*MethodPointer)(const Inheritance &) const, ReturnType property, const Inheritance &inheritance, const int global_index=-1, const int min_index=-1, const int max_index=-1) const
 Returns a value associated with a network using inheritance. More...
 
- Protected Attributes inherited from isc::dhcp::Network
util::Optional< uint32_t > cache_max_age_
 Value in seconds to use as cache maximal age. More...
 
util::Optional< double > cache_threshold_
 Percentage of the lease lifetime to use as cache threshold. More...
 
util::Optional< bool > calculate_tee_times_
 Enables calculation of T1 and T2 timers. More...
 
CfgOptionPtr cfg_option_
 Pointer to the option data configuration for this subnet. More...
 
util::Optional< ClientClassclient_class_
 Optional definition of a client class. More...
 
util::Optional< std::string > ddns_generated_prefix_
 Prefix Kea should use when generating domain-names. More...
 
util::Optional< bool > ddns_override_client_update_
 Should Kea perform updates, even if client requested delegation. More...
 
util::Optional< bool > ddns_override_no_update_
 Should Kea perform updates, even if client requested no updates. More...
 
util::Optional< std::string > ddns_qualifying_suffix_
 Suffix Kea should use when to qualify partial domain-names. More...
 
util::Optional< D2ClientConfig::ReplaceClientNameModeddns_replace_client_name_mode_
 How Kea should handle the domain-name supplied by the client. More...
 
util::Optional< bool > ddns_send_updates_
 Should Kea perform DNS updates. More...
 
util::Optional< bool > ddns_update_on_renew_
 Should Kea perform updates when leases are extended. More...
 
util::Optional< bool > ddns_use_conflict_resolution_
 Used to to tell kea-dhcp-ddns whether or not to use conflict resolution. More...
 
FetchNetworkGlobalsFn fetch_globals_fn_
 Pointer to the optional callback used to fetch globally configured parameters inherited to the Network object. More...
 
util::Optional< std::string > hostname_char_replacement_
 A string to replace invalid characters when scrubbing hostnames. More...
 
util::Optional< std::string > hostname_char_set_
 Regular expression describing invalid characters for client hostnames. More...
 
util::Optional< std::string > iface_name_
 Holds interface name for which this network is selected. More...
 
WeakNetworkPtr parent_network_
 Pointer to another network that this network belongs to. More...
 
RelayInfo relay_
 Relay information. More...
 
ClientClasses required_classes_
 Required classes. More...
 
util::Optional< bool > reservations_global_
 Enables global reservations. More...
 
util::Optional< bool > reservations_in_subnet_
 Enables subnet reservations. More...
 
util::Optional< bool > reservations_out_of_pool_
 Enables out-of-pool reservations optimization. More...
 
util::Optional< bool > store_extended_info_
 Should Kea store additional client query data (e.g. More...
 
isc::util::Triplet< uint32_t > t1_
 a isc::util::Triplet (min/default/max) holding allowed renew timer values More...
 
util::Optional< double > t1_percent_
 Percentage of the lease lifetime to use when calculating T1 timer. More...
 
isc::util::Triplet< uint32_t > t2_
 a isc::util::Triplet (min/default/max) holding allowed rebind timer values More...
 
util::Optional< double > t2_percent_
 Percentage of the lease lifetime to use when calculating T2 timer. More...
 
isc::util::Triplet< uint32_t > valid_
 a isc::util::Triplet (min/default/max) holding allowed valid lifetime values More...
 
- Protected Attributes inherited from isc::data::BaseStampedElement
uint64_t id_
 Database identifier of the configuration element. More...
 
boost::posix_time::ptime timestamp_
 Holds timestamp value. More...
 
- Protected Attributes inherited from isc::data::UserContext
data::ConstElementPtr user_context_
 Pointer to the user context (may be NULL) More...
 

Detailed Description

Specialization of the Network object for DHCPv4 case.

Definition at line 1151 of file network.h.

Constructor & Destructor Documentation

◆ Network4()

isc::dhcp::Network4::Network4 ( )
inline

Constructor.

Definition at line 1155 of file network.h.

Member Function Documentation

◆ getAuthoritative()

util::Optional<bool> isc::dhcp::Network4::getAuthoritative ( const Inheritance inheritance = Inheritance::ALL) const
inline

Returns the flag indicating if requests for unknown IP addresses should be rejected with DHCPNAK instead of ignored.

Parameters
inheritanceinheritance mode to be used.w
Returns
true if requests for unknown IP addresses should be rejected, false otherwise.

Definition at line 1189 of file network.h.

References isc::dhcp::CfgGlobals::AUTHORITATIVE.

◆ getFilename()

util::Optional<std::string> isc::dhcp::Network4::getFilename ( const Inheritance inheritance = Inheritance::ALL) const
inline

Returns boot file name for this subnet.

Parameters
inheritanceinheritance mode to be used.
Returns
boot file name value

Definition at line 1246 of file network.h.

References isc::dhcp::CfgGlobals::BOOT_FILE_NAME, and isc::dhcp::Network::toElement().

+ Here is the call graph for this function:

◆ getMatchClientId()

util::Optional<bool> isc::dhcp::Network4::getMatchClientId ( const Inheritance inheritance = Inheritance::ALL) const
inline

Returns the flag indicating if the client identifiers should be used to identify the client's lease.

Parameters
inheritanceinheritance mode to be used.
Returns
true if client identifiers should be used, false otherwise.

Definition at line 1166 of file network.h.

References isc::dhcp::CfgGlobals::MATCH_CLIENT_ID.

◆ getServerId()

IOAddress isc::dhcp::Network4::getServerId ( ) const
virtual

Returns binary representation of the dhcp-server-identifier option (54).

Returns
Server identifier option as IPv4 address. Zero IPv4 address indicates that server identifier hasn't been specified.

Definition at line 329 of file network.cc.

References DHCP4_OPTION_SPACE, isc::dhcp::DHO_DHCP_SERVER_IDENTIFIER, and isc::asiolink::IOAddress::IPV4_ZERO_ADDRESS().

Referenced by isc::dhcp::SharedNetwork4::getAllSubnets().

+ Here is the call graph for this function:

◆ getSiaddr()

util::Optional<asiolink::IOAddress> isc::dhcp::Network4::getSiaddr ( const Inheritance inheritance = Inheritance::ALL) const
inline

Returns siaddr for this network.

Returns
siaddr value

Definition at line 1215 of file network.h.

References isc::dhcp::CfgGlobals::NEXT_SERVER.

◆ getSname()

util::Optional<std::string> isc::dhcp::Network4::getSname ( const Inheritance inheritance = Inheritance::ALL) const
inline

Returns server hostname for this network.

Parameters
inheritanceinheritance mode to be used.
Returns
server hostname value

Definition at line 1230 of file network.h.

References isc::dhcp::CfgGlobals::SERVER_HOSTNAME.

◆ setAuthoritative()

void isc::dhcp::Network4::setAuthoritative ( const util::Optional< bool > &  authoritative)
inline

Sets the flag indicating if requests for unknown IP addresses should be rejected with DHCPNAK instead of ignored.

Parameters
authoritativeIf this value is true, the requests for unknown IP addresses will be rejected with DHCPNAK messages

Definition at line 1200 of file network.h.

◆ setFilename()

void isc::dhcp::Network4::setFilename ( const util::Optional< std::string > &  filename)

Sets boot file name for the network.

Will be used for boot file name (may be empty if not defined)

Definition at line 292 of file network.cc.

◆ setMatchClientId()

void isc::dhcp::Network4::setMatchClientId ( const util::Optional< bool > &  match)
inline

Sets the flag indicating if the client identifier should be used to identify the client's lease.

Parameters
matchIf this value is true, the client identifiers are not used for lease lookup.

Definition at line 1178 of file network.h.

◆ setSiaddr()

void isc::dhcp::Network4::setSiaddr ( const util::Optional< asiolink::IOAddress > &  siaddr)

Sets siaddr for the network.

Will be used for siaddr field (the next server) that typically is used as TFTP server. If not specified, the default value of 0.0.0.0 is used.

Definition at line 278 of file network.cc.

References isc::util::Optional< T >::get(), isc_throw, and isc::asiolink::IOAddress::isV4().

+ Here is the call graph for this function:

◆ setSname()

void isc::dhcp::Network4::setSname ( const util::Optional< std::string > &  sname)

Sets server hostname for the network.

Will be used for server hostname field (may be empty if not defined)

Definition at line 287 of file network.cc.

◆ toElement()

ElementPtr isc::dhcp::Network4::toElement ( ) const
virtual

Unparses network object.

Returns
A pointer to unparsed network configuration.

Reimplemented from isc::dhcp::Network.

Reimplemented in isc::dhcp::Subnet4, and isc::dhcp::SharedNetwork4.

Definition at line 297 of file network.cc.

Referenced by isc::dhcp::Subnet4::toElement().


The documentation for this class was generated from the following files: