From 0a648a9efbf0f7ab443105d55578bee204adb82e Mon Sep 17 00:00:00 2001 From: Marcin Siodelski Date: Mon, 17 Jun 2019 15:10:52 +0200 Subject: [PATCH] [#642,!373] Explained how globals are fetched for various selectors. --- src/hooks/dhcp/mysql_cb/mysql_cb_dhcp4.h | 31 ++++++++++++++++++++++++ src/hooks/dhcp/mysql_cb/mysql_cb_dhcp6.h | 31 ++++++++++++++++++++++++ src/lib/dhcpsrv/config_backend_dhcp4.h | 30 +++++++++++++++++++++++ src/lib/dhcpsrv/config_backend_dhcp6.h | 30 +++++++++++++++++++++++ 4 files changed, 122 insertions(+) diff --git a/src/hooks/dhcp/mysql_cb/mysql_cb_dhcp4.h b/src/hooks/dhcp/mysql_cb/mysql_cb_dhcp4.h index 961aa9d7e3..988bcf3d91 100644 --- a/src/hooks/dhcp/mysql_cb/mysql_cb_dhcp4.h +++ b/src/hooks/dhcp/mysql_cb/mysql_cb_dhcp4.h @@ -162,6 +162,10 @@ public: /// @brief Retrieves global parameter value. /// + /// Typically, the server selector used for this query should be set to + /// ONE. It is possible to use the MULTIPLE server selector but in that + /// case only the first found parameter is returned. + /// /// @param server_selector Server selector. /// @param name Name of the global parameter to be retrieved. /// @return Value of the global parameter. @@ -172,6 +176,33 @@ public: /// @brief Retrieves all global parameters. /// + /// Using the server selector it is possible to fetch the parameters for + /// one or more servers. The following list describes what parameters are + /// returned depending on the server selector specified: + /// - ALL: only common parameters are returned which are associated with + /// the logical server 'all'. No parameters associated with the explicit + /// server tags are returned. + /// + /// - ONE: parameters used by the particular sever are returned. This includes + /// parameters associated with the particular server (identified by tag) + /// and parameters associated with the logical server 'all' when server + /// specific parameters are not given. For example, if there is a + /// renew-timer specified for 'server1' tag, different value of the + /// renew-timer specified for 'all' servers and a rebind-timer specified + /// for 'all' servers, the caller will receive renew-timer value associated + /// with the server1 and the rebind-timer value associated with all servers, + /// because there is no explicit rebind-timer specified for server1. + /// + /// - MULTIPLE: parameters used by multiple servers, but those associated + /// with specific server tags take precedence over the values specified for + /// 'all' servers. This is similar to the case of ONE server described + /// above. The effect of querying for parameters belonging to multiple + /// servers is the same as issuing multiple queries with ONE server + /// being selected multiple times. + /// + /// - UNASSIGNED: parameters not associated with any servers. + /// + /// /// @param server_selector Server selector. virtual data::StampedValueCollection getAllGlobalParameters4(const db::ServerSelector& server_selector) const; diff --git a/src/hooks/dhcp/mysql_cb/mysql_cb_dhcp6.h b/src/hooks/dhcp/mysql_cb/mysql_cb_dhcp6.h index b51fe722a1..16d3fd659f 100644 --- a/src/hooks/dhcp/mysql_cb/mysql_cb_dhcp6.h +++ b/src/hooks/dhcp/mysql_cb/mysql_cb_dhcp6.h @@ -162,6 +162,10 @@ public: /// @brief Retrieves global parameter value. /// + /// Typically, the server selector used for this query should be set to + /// ONE. It is possible to use the MULTIPLE server selector but in that + /// case only the first found parameter is returned. + /// /// @param server_selector Server selector. /// @param name Name of the global parameter to be retrieved. /// @return Value of the global parameter. @@ -172,6 +176,33 @@ public: /// @brief Retrieves all global parameters. /// + /// Using the server selector it is possible to fetch the parameters for + /// one or more servers. The following list describes what parameters are + /// returned depending on the server selector specified: + /// - ALL: only common parameters are returned which are associated with + /// the logical server 'all'. No parameters associated with the explicit + /// server tags are returned. + /// + /// - ONE: parameters used by the particular sever are returned. This includes + /// parameters associated with the particular server (identified by tag) + /// and parameters associated with the logical server 'all' when server + /// specific parameters are not given. For example, if there is a + /// renew-timer specified for 'server1' tag, different value of the + /// renew-timer specified for 'all' servers and a rebind-timer specified + /// for 'all' servers, the caller will receive renew-timer value associated + /// with the server1 and the rebind-timer value associated with all servers, + /// because there is no explicit rebind-timer specified for server1. + /// + /// - MULTIPLE: parameters used by multiple servers, but those associated + /// with specific server tags take precedence over the values specified for + /// 'all' servers. This is similar to the case of ONE server described + /// above. The effect of querying for parameters belonging to multiple + /// servers is the same as issuing multiple queries with ONE server + /// being selected multiple times. + /// + /// - UNASSIGNED: parameters not associated with any servers. + /// + /// /// @param server_selector Server selector. virtual data::StampedValueCollection getAllGlobalParameters6(const db::ServerSelector& server_selector) const; diff --git a/src/lib/dhcpsrv/config_backend_dhcp4.h b/src/lib/dhcpsrv/config_backend_dhcp4.h index 457193e757..d1e016bd4e 100644 --- a/src/lib/dhcpsrv/config_backend_dhcp4.h +++ b/src/lib/dhcpsrv/config_backend_dhcp4.h @@ -165,6 +165,10 @@ public: /// @brief Retrieves global parameter value. /// + /// Typically, the server selector used for this query should be set to + /// ONE. It is possible to use the MULTIPLE server selector but in that + /// case only the first found parameter is returned. + /// /// @param selector Server selector. /// @param name Name of the global parameter to be retrieved. /// @return Value of the global parameter or null if parameter doesn't @@ -175,6 +179,32 @@ public: /// @brief Retrieves all global parameters. /// + /// Using the server selector it is possible to fetch the parameters for + /// one or more servers. The following list describes what parameters are + /// returned depending on the server selector specified: + /// - ALL: only common parameters are returned which are associated with + /// the logical server 'all'. No parameters associated with the explicit + /// server tags are returned. + /// + /// - ONE: parameters used by the particular sever are returned. This includes + /// parameters associated with the particular server (identified by tag) + /// and parameters associated with the logical server 'all' when server + /// specific parameters are not given. For example, if there is a + /// renew-timer specified for 'server1' tag, different value of the + /// renew-timer specified for 'all' servers and a rebind-timer specified + /// for 'all' servers, the caller will receive renew-timer value associated + /// with the server1 and the rebind-timer value associated with all servers, + /// because there is no explicit rebind-timer specified for server1. + /// + /// - MULTIPLE: parameters used by multiple servers, but those associated + /// with specific server tags take precedence over the values specified for + /// 'all' servers. This is similar to the case of ONE server described + /// above. The effect of querying for parameters belonging to multiple + /// servers is the same as issuing multiple queries with ONE server + /// being selected multiple times. + /// + /// - UNASSIGNED: parameters not associated with any servers. + /// /// @param selector Server selector. /// @return Collection of global parameters. virtual data::StampedValueCollection diff --git a/src/lib/dhcpsrv/config_backend_dhcp6.h b/src/lib/dhcpsrv/config_backend_dhcp6.h index 7e8be2bc15..9001413673 100644 --- a/src/lib/dhcpsrv/config_backend_dhcp6.h +++ b/src/lib/dhcpsrv/config_backend_dhcp6.h @@ -166,6 +166,10 @@ public: /// @brief Retrieves global parameter value. /// + /// Typically, the server selector used for this query should be set to + /// ONE. It is possible to use the MULTIPLE server selector but in that + /// case only the first found parameter is returned. + /// /// @param selector Server selector. /// @param name Name of the global parameter to be retrieved. /// @return Value of the global parameter or null if parameter doesn't @@ -176,6 +180,32 @@ public: /// @brief Retrieves all global parameters. /// + /// Using the server selector it is possible to fetch the parameters for + /// one or more servers. The following list describes what parameters are + /// returned depending on the server selector specified: + /// - ALL: only common parameters are returned which are associated with + /// the logical server 'all'. No parameters associated with the explicit + /// server tags are returned. + /// + /// - ONE: parameters used by the particular sever are returned. This includes + /// parameters associated with the particular server (identified by tag) + /// and parameters associated with the logical server 'all' when server + /// specific parameters are not given. For example, if there is a + /// renew-timer specified for 'server1' tag, different value of the + /// renew-timer specified for 'all' servers and a rebind-timer specified + /// for 'all' servers, the caller will receive renew-timer value associated + /// with the server1 and the rebind-timer value associated with all servers, + /// because there is no explicit rebind-timer specified for server1. + /// + /// - MULTIPLE: parameters used by multiple servers, but those associated + /// with specific server tags take precedence over the values specified for + /// 'all' servers. This is similar to the case of ONE server described + /// above. The effect of querying for parameters belonging to multiple + /// servers is the same as issuing multiple queries with ONE server + /// being selected multiple times. + /// + /// - UNASSIGNED: parameters not associated with any servers. + /// /// @param selector Server selector. /// @return Collection of global parameters. virtual data::StampedValueCollection -- 2.47.2