Kea
1.9.9-git
|
Common interface representing a network to which the DHCP clients are connected. More...
#include <network.h>
Classes | |
class | RelayInfo |
Holds optional information about relay. More... | |
Public Types | |
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::RelayInfo > | RelayInfoPtr |
Pointer to the RelayInfo structure. More... | |
Public Member Functions | |
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< ClientClass > | getClientClass (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::ReplaceClientNameMode > | getDdnsReplaceClientNameMode (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 IOAddressList & | getRelayAddresses () const |
Returns the list of relay addresses from the network's relay info. More... | |
const RelayInfo & | getRelayInfo () const |
Returns const reference to relay information. More... | |
const ClientClasses & | getRequiredClasses () 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... | |
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... | |
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... | |
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 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 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 Triplet< uint32_t > &valid) |
Sets new valid lifetime for a network. More... | |
virtual data::ElementPtr | toElement () const |
Unparses network object. 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< ServerTag > | getServerTags () 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 ×tamp) |
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... | |
Protected Member Functions | |
FetchNetworkGlobalsFn | getFetchGlobalsFn () const |
Gets the optional callback function used to fetch globally configured parameters. More... | |
template<typename ReturnType > | |
ReturnType | getGlobalProperty (ReturnType property, const std::string &global_name, const std::string &min_name="", const std::string &max_name="") const |
Returns a value of global configuration parameter with a given name. More... | |
template<typename NumType > | |
Triplet< NumType > | getGlobalProperty (Triplet< NumType > property, const std::string &global_name, const std::string &min_name="", const std::string &max_name="") const |
The getGlobalProperty specialization for Triplet<T>. More... | |
util::Optional< asiolink::IOAddress > | getGlobalProperty (util::Optional< asiolink::IOAddress > property, const std::string &global_name, const std::string &min_name="", const std::string &max_name="") 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 std::string &global_name="", const std::string &min_name="", const std::string &max_name="") const |
Returns a value associated with a network using inheritance. More... | |
Protected Attributes | |
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< ClientClass > | client_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::ReplaceClientNameMode > | ddns_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... | |
Triplet< uint32_t > | t1_ |
a 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... | |
Triplet< uint32_t > | t2_ |
a 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... | |
Triplet< uint32_t > | valid_ |
a 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... | |
Additional Inherited Members | |
Static Public Member Functions inherited from isc::data::UserContext | |
static data::ElementPtr | toElement (data::ConstElementPtr map) |
Copy an Element map. More... | |
Common interface representing a network to which the DHCP clients are connected.
The most common type of network, in Kea's terminology, is a subnet. The Subnet derives from this class. Another types of objects implementing this interface are SharedNetwork4 and SharedNetwork6 objects. They group multiple subnets together to provide means for extending available address pools (a single client may obtain IP address from any of the pools belonging to subnets in the shared network), or for selecting a subnet on a given link, depending on the class of the client (e.g. cable network case: different subnet is selected for cable modems, different one for routers).
The subnets and shared networks share many data structures, e.g. DHCP options, local interface name, address manipulation methods. Both subnets and shared networks derive from this class to provide the common functionality.
The DHCP server configuration is complex because many parameters may be specified at different levels of hierarchy. The lower level values, e.g. subnet specific values, take precedence over upper level values, e.g. shared network specific ones. For historical reasons, the DHCP servers expect that the appropriate values are inherited from the upper configuration levels to the lower configuration levels upon the reconfiguration. For example: if a user didn't specify valid-lifetime for a subnet, calling Subnet4::getValid()
should result in returning a global value of valid-lifetime. In the early Kea days it was achieved by the configuration parsers which would explicitly assign the global valid lifetime to the Subnet4
instances for which the subnet specific value was not provided. This approach has a major benefit that it is fast. However, it makes the subnets tightly dependent on the global values (and shared network specific values). Modification of the global value must result in modification of this value in all subnets for which there is no explicit value provided. This issue became a serious road block during the implementation of the Configuration Backend.
The Network
object has been modified to address the problem of inheritance of global, shared network specific and subnet specific parameters in a generic way, at the same time minimizing the need to change the existing server logic.
The Network
object now holds the pointer to the "parent" Network
object. Thus subnets which belong to a shared network will have that shared network as its parent. Stand-alone subnets, will have no parent.
The general idea is that the accessor functions of the network will first check if the accessed value is specified or not (that is handled by util::Optional
object). If the value is specified it is returned. Otherwise, the object will check if there is a parent object it belongs to and will call the appropriate method of that object. If the value is present it is returned. Otherwise the global value is returned.
Accessing global values from the Network
object is troublesome. There is no uniform way to access those values. For example, the given network may be in a staging or current configuration and it really has no means to know in which of the two it belongs. In fact, an attempt to pass the pointer to the SrvConfig
object would cause a circular dependency between the Network
and the SrvConfig
. Even if it was possible and the Network
had access to the specific SrvConfig
instance, it doesn't handle the cases when the SrvConfig
instance was modified.
To deal with the problem of accessing the global parameters in a flexible manner, we elected to use an optional callback function which can be associated with the Network
object. This callback implements the logic to retrieve global parameters and return them in a well known form, so as the Network
accessors can use them.
typedef boost::shared_ptr<Network::RelayInfo> isc::dhcp::Network::RelayInfoPtr |
|
strong |
Inheritance "mode" used when fetching an optional Network
parameter.
The following modes are currently supported:
Enumerator | |
---|---|
NONE | |
PARENT_NETWORK | |
GLOBAL | |
ALL |
|
inlinevirtual |
void isc::dhcp::Network::addRelayAddress | ( | const asiolink::IOAddress & | addr | ) |
Adds an address to the list addresses in the network's relay info.
addr | address of the relay |
BadValue | if the address is already in the list |
Definition at line 55 of file network.cc.
void isc::dhcp::Network::allowClientClass | ( | const isc::dhcp::ClientClass & | class_name | ) |
Sets the supported class to class class_name.
class_name | client class to be supported by this network |
Definition at line 86 of file network.cc.
Referenced by isc::dhcp::Subnet6ConfigParser::initSubnet().
|
virtual |
Checks whether this network supports client that belongs to specified classes.
This method checks whether a client that belongs to given classes can use this network. For example, if this class is reserved for client class "foo" and the client belongs to classes "foo", "bar" and "baz", it is supported. On the other hand, client belonging to classes "foobar" and "zyxxy" is not supported.
client_classes | list of all classes the client belongs to |
Reimplemented in isc::dhcp::Subnet6, and isc::dhcp::Subnet4.
Definition at line 75 of file network.cc.
References isc::dhcp::ClientClasses::contains().
Referenced by isc::dhcp::Subnet4::clientSupported(), and isc::dhcp::Subnet6::clientSupported().
|
inline |
Returns value in seconds to use as cache maximum age.
inheritance | inheritance mode to be used. |
Definition at line 694 of file network.h.
References cache_max_age_.
|
inline |
Returns percentage to use as cache threshold.
inheritance | inheritance mode to be used. |
Definition at line 677 of file network.h.
References cache_threshold_.
|
inline |
Returns whether or not T1/T2 calculation is enabled.
inheritance | inheritance mode to be used. |
Definition at line 450 of file network.h.
References calculate_tee_times_.
|
inline |
Returns pointer to the option data configuration for this network.
Definition at line 436 of file network.h.
References cfg_option_.
Referenced by isc::dhcp::Subnet6ConfigParser::initSubnet().
|
inline |
Returns const pointer to the option data configuration for this network.
Definition at line 442 of file network.h.
References cfg_option_.
|
inline |
returns the client class
inheritance | inheritance mode to be used. |
Definition at line 332 of file network.h.
References client_class_.
|
inline |
Returns ddns-generated-prefix.
inheritance | inheritance mode to be used. |
Definition at line 596 of file network.h.
References ddns_generated_prefix_.
|
inline |
Returns ddns-override-client-update.
inheritance | inheritance mode to be used. |
Definition at line 533 of file network.h.
References ddns_override_client_update_.
|
inline |
Returns ddns-override-no-update.
inheritance | inheritance mode to be used. |
Definition at line 516 of file network.h.
References ddns_override_no_update_.
|
inline |
Returns ddns-qualifying-suffix.
inheritance | inheritance mode to be used. |
Definition at line 613 of file network.h.
References ddns_qualifying_suffix_.
|
inline |
Returns ddns-replace-client-name-mode.
inheritance | inheritance mode to be used. |
Definition at line 551 of file network.h.
References ddns_replace_client_name_mode_, isc::util::Optional< T >::get(), getGlobalProperty(), NONE, PARENT_NETWORK, isc::dhcp::D2ClientConfig::stringToReplaceClientNameMode(), and isc::util::Optional< T >::unspecified().
|
inline |
Returns ddns-send-updates.
inheritance | inheritance mode to be used. |
Definition at line 500 of file network.h.
References ddns_send_updates_.
|
inline |
Returns ddns-update-on-renew.
inheritance | inheritance mode to be used. |
Definition at line 710 of file network.h.
References ddns_update_on_renew_.
|
inline |
Returns ddns-use-conflict-resolution.
inheritance | inheritance mode to be used. |
Definition at line 727 of file network.h.
References ddns_use_conflict_resolution_.
|
inlineprotected |
Gets the optional callback function used to fetch globally configured parameters.
Definition at line 751 of file network.h.
References fetch_globals_fn_.
|
inlineprotected |
Returns a value of global configuration parameter with a given name.
If the ferch_globals_fn_
function is non-null, this method will invoke this function to retrieve a global value having the given name. Typically, this method is invoked by getProperty
when network specific value of the parameter is not found. In some cases it may be called by other methods. One such example is the getDdnsReplaceClientNameMode
which needs to call getGlobalProperty
explicitly to convert the global replace client name mode value from a string to an enum.
ReturnType | Type of the returned value, e.g. Optional<std::string> . |
property | Value to be returned when it is specified or when no global value is found. |
global_name | Name of the global parameter which value should be returned |
min_name | Name of the min global parameter which value should be returned for triplets |
max_name | Name of the max global parameter which value should be returned for triplets |
property
. Definition at line 782 of file network.h.
References fetch_globals_fn_, and isc::data::Element::map.
Referenced by getDdnsReplaceClientNameMode(), and getProperty().
|
inlineprotected |
The getGlobalProperty
specialization for Triplet<T>.
NumType | Type of the encapsulated value(s). |
property | Value to be returned when it is specified or when no global value is found. |
global_name | Name of the global parameter which value should be returned |
min_name | Name of the min global parameter which value should be returned for triplets |
max_name | Name of the max global parameter which value should be returned for triplets |
property
. Definition at line 820 of file network.h.
References fetch_globals_fn_, and isc::data::Element::map.
|
protected |
The getGlobalProperty
specialization for Optional<IOAddress>.
This does two things:
property | Value to be returned when it is specified or when no global value is found. |
global_name | Name of the global parameter which value should be returned |
min_name | Name of the min global parameter which value should be returned for triplets |
max_name | Name of the max global parameter which value should be returned for triplets |
property
. Definition at line 103 of file network.cc.
|
inline |
Return the invalid char replacement used to sanitize client hostnames.
Definition at line 642 of file network.h.
References hostname_char_replacement_.
|
inline |
Return the char set regexp used to sanitize client hostnames.
Definition at line 628 of file network.h.
References hostname_char_set_.
|
inline |
Returns name of the local interface for which this network is selected.
inheritance | inheritance mode to be used. |
Definition at line 234 of file network.h.
References iface_name_.
|
inlineprotected |
Returns option pointer associated with a network using inheritance.
This template method provides a generic mechanism to retrieve a network parameter using inheritance. It is called from public accessor methods which return an OptionPtr
.
BaseType | Type of this instance, e.g. Network , Network4 etc, which exposes a method to be called. |
MethodPointer | Pointer to the method of the base class which should be called on the parent network instance (typically on SharedNetwork4 or SharedNetwork6 ) to fetch the parent specific value if the value is unspecified for this instance. |
property | the value to return when inheritance mode is NONE, or when the mode is PARENT_NETWORK and the property has not been specified by a parent network. |
inheritance | inheritance mode to be used. |
Definition at line 985 of file network.h.
References GLOBAL, NONE, PARENT_NETWORK, and parent_network_.
|
inlineprotected |
Returns a value associated with a network using inheritance.
This template method provides a generic mechanism to retrieve a network parameter using inheritance. It is called from public accessor methods which return an OptionalValue
or Triplet
.
BaseType | Type of this instance, e.g. Network , Network4 etc, which exposes a method to be called. |
ReturnType | Type of the returned value, e.g. Optional<std::string> . |
MethodPointer | Pointer to the method of the base class which should be called on the parent network instance (typically on SharedNetwork4 or SharedNetwork6 ) to fetch the parent specific value if the value is unspecified for this instance. |
property | Value to be returned when it is specified or when no explicit value is specified on upper inheritance levels. |
inheritance | inheritance mode to be used. |
global_name | Optional name of the global parameter which value should be returned if the given parameter is not specified on network level. This value is empty by default, which indicates that the global value for the given parameter is not supported and shouldn't be fetched. |
min_name | Name of the min global parameter which value should be returned for triplets |
max_name | Name of the max global parameter which value should be returned for triplets |
Definition at line 909 of file network.h.
References getGlobalProperty(), GLOBAL, NONE, PARENT_NETWORK, and parent_network_.
const IOAddressList & isc::dhcp::Network::getRelayAddresses | ( | ) | const |
Returns the list of relay addresses from the network's relay info.
Definition at line 70 of file network.cc.
|
inline |
const ClientClasses & isc::dhcp::Network::getRequiredClasses | ( | ) | const |
Returns classes which are required to be evaluated.
Definition at line 98 of file network.cc.
|
inline |
Returns whether global reservations should be fetched.
inheritance | inheritance mode to be used. |
Definition at line 385 of file network.h.
References reservations_global_.
|
inline |
Returns whether subnet reservations should be fetched.
inheritance | inheritance mode to be used. |
Definition at line 403 of file network.h.
References reservations_in_subnet_.
|
inline |
Returns whether only out-of-pool reservations are allowed.
inheritance | inheritance mode to be used. |
Definition at line 421 of file network.h.
References reservations_out_of_pool_.
|
inline |
Returns store-extended-info.
inheritance | inheritance mode to be used. |
Definition at line 660 of file network.h.
References store_extended_info_.
|
inline |
Returns T1 (renew timer), expressed in seconds.
inheritance | inheritance mode to be used. |
Definition at line 356 of file network.h.
References t1_.
Referenced by isc::dhcp::Subnet6ConfigParser::initSubnet().
|
inline |
Returns percentage to use when calculating the T1 (renew timer).
inheritance | inheritance mode to be used. |
Definition at line 468 of file network.h.
References t1_percent_.
|
inline |
Returns T2 (rebind timer), expressed in seconds.
inheritance | inheritance mode to be used. |
Definition at line 370 of file network.h.
References t2_.
Referenced by isc::dhcp::Subnet6ConfigParser::initSubnet().
|
inline |
Returns percentage to use when calculating the T2 (rebind timer).
inheritance | inheritance mode to be used. |
Definition at line 484 of file network.h.
References t2_percent_.
|
inline |
Return valid-lifetime for addresses in that prefix.
inheritance | inheritance mode to be used. |
Definition at line 340 of file network.h.
References valid_.
Referenced by isc::dhcp::Subnet6ConfigParser::initSubnet().
|
inline |
Checks if the network is associated with a function used to fetch globally configured parameters.
Definition at line 212 of file network.h.
References fetch_globals_fn_.
bool isc::dhcp::Network::hasRelayAddress | ( | const asiolink::IOAddress & | address | ) | const |
Tests if the network's relay info contains the given address.
address | address to search for in the relay list |
Definition at line 65 of file network.cc.
bool isc::dhcp::Network::hasRelays | ( | ) | const |
Indicates if network's relay info has relay addresses.
Definition at line 60 of file network.cc.
void isc::dhcp::Network::requireClientClass | ( | const isc::dhcp::ClientClass & | class_name | ) |
Adds class class_name to classes required to be evaluated.
class_name | client class required to be evaluated |
Definition at line 91 of file network.cc.
Referenced by isc::dhcp::Subnet6ConfigParser::initSubnet().
|
inline |
Sets cache max for a network.
cache_max_age | New cache maximum value in seconds to use. |
Definition at line 702 of file network.h.
References cache_max_age_.
|
inline |
Sets cache threshold for a network.
cache_threshold | New cache threshold percentage to use. |
Definition at line 686 of file network.h.
References cache_threshold_.
|
inline |
Sets whether or not T1/T2 calculation is enabled.
calculate_tee_times | new value of enabled/disabled. |
Definition at line 460 of file network.h.
References calculate_tee_times_.
|
inline |
Sets new ddns-generated-prefix.
ddns_generated_prefix | New value to use. |
Definition at line 605 of file network.h.
References ddns_generated_prefix_.
|
inline |
Sets new ddns-override-client-update.
ddns_override_client_update | New value to use. |
Definition at line 542 of file network.h.
References ddns_override_client_update_.
|
inline |
Sets new ddns-override-no-update.
ddns_override_no_update | New value to use. |
Definition at line 525 of file network.h.
References ddns_override_no_update_.
|
inline |
Sets new ddns-qualifying-suffix.
ddns_qualifying_suffix | New value to use. |
Definition at line 622 of file network.h.
References ddns_qualifying_suffix_.
|
inline |
Sets new ddns-replace-client-name-mode.
ddns_replace_client_name_mode | New value to use. |
Definition at line 587 of file network.h.
References ddns_replace_client_name_mode_.
|
inline |
Sets new ddns-send-updates.
ddns_send_updates | New value to use. |
Definition at line 508 of file network.h.
References ddns_send_updates_.
|
inline |
Sets new ddns-update-on-renew.
ddns_update_on_renew | New value to use. |
Definition at line 719 of file network.h.
References ddns_update_on_renew_.
|
inline |
Sets new ddns-use-conflict-resolution.
ddns_use_conflict_resolution | New value to use. |
Definition at line 736 of file network.h.
References ddns_use_conflict_resolution_.
|
inline |
Sets the optional callback function used to fetch globally configured parameters.
fetch_globals_fn | Pointer to the function. |
Definition at line 204 of file network.h.
References fetch_globals_fn_.
|
inline |
Sets new hostname-char-replacement.
hostname_char_replacement | New value to use. |
Definition at line 651 of file network.h.
References hostname_char_replacement_.
|
inline |
Sets new hostname-char-set.
hostname_char_set | New value to use. |
Definition at line 636 of file network.h.
References hostname_char_set_.
|
inline |
Sets local name of the interface for which this network is selected.
If the interface is specified, the server will use the network associated with this local interface to allocate IP addresses and other resources to a client.
iface_name | Interface name. |
Definition at line 224 of file network.h.
References iface_name_.
Referenced by isc::dhcp::Subnet6ConfigParser::initSubnet().
|
inline |
Sets information about relay.
In some situations where there are shared subnets (i.e. two different subnets are available on the same physical link), there is only one relay that handles incoming requests from clients. In such a case, the usual subnet selection criteria based on relay belonging to the subnet being selected are no longer sufficient and we need to explicitly specify a relay. One notable example of such uncommon, but valid scenario is a cable network, where there is only one CMTS (one relay), but there are 2 distinct subnets behind it: one for cable modems and another one for CPEs and other user equipment behind modems. From manageability perspective, it is essential that modems get addresses from different subnet, so users won't tinker with their modems.
Setting this parameter is not needed in most deployments. This structure holds IP address only for now, but it is expected to be extended in the future.
relay | structure that contains relay information |
Definition at line 258 of file network.h.
References relay_.
|
inline |
Sets whether global reservations should be fetched.
reservations_global | new value of enabled/disabled. |
Definition at line 395 of file network.h.
References reservations_global_.
|
inline |
Sets whether subnet reservations should be fetched.
reservations_in_subnet | new value of enabled/disabled. |
Definition at line 413 of file network.h.
References reservations_in_subnet_.
|
inline |
Sets whether only out-of-pool reservations are allowed.
reservations_out_of_pool | new value of enabled/disabled. |
Definition at line 431 of file network.h.
References reservations_out_of_pool_.
|
inline |
Sets new store-extended-info.
store_extended_info | New value to use. |
Definition at line 669 of file network.h.
References store_extended_info_.
|
inline |
Sets new renew timer for a network.
t1 | New renew timer value in seconds. |
Definition at line 363 of file network.h.
References t1_.
Referenced by isc::dhcp::Subnet4::Subnet4(), and isc::dhcp::Subnet6::Subnet6().
|
inline |
Sets new percentage for calculating T1 (renew timer).
t1_percent | New percentage to use. |
Definition at line 476 of file network.h.
References t1_percent_.
|
inline |
Sets new rebind timer for a network.
t2 | New rebind timer value in seconds. |
Definition at line 377 of file network.h.
References t2_.
Referenced by isc::dhcp::Subnet4::Subnet4(), and isc::dhcp::Subnet6::Subnet6().
|
inline |
Sets new percentage for calculating T2 (rebind timer).
t2_percent | New percentage to use. |
Definition at line 492 of file network.h.
References t2_percent_.
|
inline |
Sets new valid lifetime for a network.
valid | New valid lifetime in seconds. |
Definition at line 349 of file network.h.
References valid_.
Referenced by isc::dhcp::Subnet4::Subnet4(), and isc::dhcp::Subnet6::Subnet6().
|
virtual |
Unparses network object.
Implements isc::data::CfgToElement.
Reimplemented in isc::dhcp::Network6, isc::dhcp::Network4, isc::dhcp::Subnet6, isc::dhcp::Subnet4, isc::dhcp::SharedNetwork6, isc::dhcp::Subnet, and isc::dhcp::SharedNetwork4.
Definition at line 123 of file network.cc.
References isc::dhcp::ClientClasses::cbegin(), isc::dhcp::ClientClasses::cend(), and isc::dhcp::ClientClasses::empty().
|
protected |
Value in seconds to use as cache maximal age.
Definition at line 1116 of file network.h.
Referenced by getCacheMaxAge(), and setCacheMaxAge().
|
protected |
Percentage of the lease lifetime to use as cache threshold.
Definition at line 1113 of file network.h.
Referenced by getCacheThreshold(), and setCacheThreshold().
|
protected |
Enables calculation of T1 and T2 timers.
Definition at line 1072 of file network.h.
Referenced by getCalculateTeeTimes(), and setCalculateTeeTimes().
|
protected |
Pointer to the option data configuration for this subnet.
Definition at line 1069 of file network.h.
Referenced by getCfgOption().
|
protected |
Optional definition of a client class.
If defined, only clients belonging to that class will be allowed to use this particular network. The default value for this is an empty string, which means that any client is allowed, regardless of its class.
Definition at line 1038 of file network.h.
Referenced by getClientClass().
|
protected |
Prefix Kea should use when generating domain-names.
Definition at line 1095 of file network.h.
Referenced by getDdnsGeneratedPrefix(), and setDdnsGeneratedPrefix().
|
protected |
Should Kea perform updates, even if client requested delegation.
Definition at line 1089 of file network.h.
Referenced by getDdnsOverrideClientUpdate(), and setDdnsOverrideClientUpdate().
|
protected |
Should Kea perform updates, even if client requested no updates.
Overrides the client request for no updates via the N flag.
Definition at line 1086 of file network.h.
Referenced by getDdnsOverrideNoUpdate(), and setDdnsOverrideNoUpdate().
|
protected |
Suffix Kea should use when to qualify partial domain-names.
Definition at line 1098 of file network.h.
Referenced by getDdnsQualifyingSuffix(), and setDdnsQualifyingSuffix().
|
protected |
How Kea should handle the domain-name supplied by the client.
Definition at line 1092 of file network.h.
Referenced by getDdnsReplaceClientNameMode(), and setDdnsReplaceClientNameMode().
|
protected |
Should Kea perform DNS updates.
Used to provide scoped enabling and disabling of updates.
Definition at line 1082 of file network.h.
Referenced by getDdnsSendUpdates(), and setDdnsSendUpdates().
|
protected |
Should Kea perform updates when leases are extended.
Definition at line 1119 of file network.h.
Referenced by getDdnsUpdateOnRenew(), and setDdnsUpdateOnRenew().
|
protected |
Used to to tell kea-dhcp-ddns whether or not to use conflict resolution.
Definition at line 1122 of file network.h.
Referenced by getDdnsUseConflictResolution(), and setDdnsUseConflictResolution().
|
protected |
Pointer to the optional callback used to fetch globally configured parameters inherited to the Network
object.
Definition at line 1134 of file network.h.
Referenced by getFetchGlobalsFn(), getGlobalProperty(), hasFetchGlobalsFn(), and setFetchGlobalsFn().
|
protected |
A string to replace invalid characters when scrubbing hostnames.
Meaningful only if hostname_char_set_ is not empty.
Definition at line 1106 of file network.h.
Referenced by getHostnameCharReplacement(), and setHostnameCharReplacement().
|
protected |
Regular expression describing invalid characters for client hostnames.
Definition at line 1102 of file network.h.
Referenced by getHostnameCharSet(), and setHostnameCharSet().
|
protected |
Holds interface name for which this network is selected.
Definition at line 1026 of file network.h.
Referenced by getIface(), and setIface().
|
protected |
Pointer to another network that this network belongs to.
The most common case is that this instance is a subnet which belongs to a shared network and the parent_network_
points to the shared network object. If the network instance (subnet) doesn't belong to a shared network this pointer is null.
Definition at line 1130 of file network.h.
Referenced by getOptionProperty(), getProperty(), isc::dhcp::Subnet::getSharedNetwork(), and isc::dhcp::Subnet::setSharedNetwork().
|
protected |
Relay information.
See RelayInfo for detailed description.
Definition at line 1031 of file network.h.
Referenced by getRelayInfo(), and setRelayInfo().
|
protected |
|
protected |
Enables global reservations.
Definition at line 1056 of file network.h.
Referenced by getReservationsGlobal(), and setReservationsGlobal().
|
protected |
Enables subnet reservations.
Definition at line 1059 of file network.h.
Referenced by getReservationsInSubnet(), and setReservationsInSubnet().
|
protected |
Enables out-of-pool reservations optimization.
When true only out-of-pool reservations are allowed. This allows AllocEngine to skip reservation checks when dealing with addresses that are in pool.
Definition at line 1066 of file network.h.
Referenced by getReservationsOutOfPool(), and setReservationsOutOfPool().
|
protected |
Should Kea store additional client query data (e.g.
relay-agent-info) on the lease.
Definition at line 1110 of file network.h.
Referenced by getStoreExtendedInfo(), and setStoreExtendedInfo().
|
protected |
|
protected |
Percentage of the lease lifetime to use when calculating T1 timer.
Definition at line 1075 of file network.h.
Referenced by getT1Percent(), and setT1Percent().
|
protected |
|
protected |
Percentage of the lease lifetime to use when calculating T2 timer.
Definition at line 1078 of file network.h.
Referenced by getT2Percent(), and setT2Percent().
|
protected |
a Triplet (min/default/max) holding allowed valid lifetime values
Definition at line 1053 of file network.h.
Referenced by getValid(), and setValid().