14 #include <boost/scoped_ptr.hpp>
91 void serveScope(
const std::string& scope_name);
107 void serveScopes(
const std::vector<std::string>& scopes);
181 void serveScopeInternal(
const std::string& scope_name);
192 void serveScopeOnlyInternal(
const std::string& scope_name);
201 void serveScopesInternal(
const std::vector<std::string>& scopes);
209 void serveDefaultScopesInternal();
220 void serveFailoverScopesInternal();
225 void serveNoScopesInternal();
234 bool amServingScopeInternal(
const std::string& scope_name)
const;
241 std::set<std::string> getServedScopesInternal()
const;
257 template<
typename QueryPtrType>
258 bool inScopeInternal(
const QueryPtrType& query, std::string& scope_class)
const;
300 uint8_t
loadBalanceHash(
const uint8_t* key,
const size_t key_len)
const;
329 std::vector<HAConfig::PeerConfigPtr>
peers_;
345 #endif // QUERY_FILTER_H
void serveScope(const std::string &scope_name)
Enable scope.
void serveNoScopes()
Disables all scopes.
bool inScope(const dhcp::Pkt4Ptr &query4, std::string &scope_class) const
Checks if this server should process the DHCPv4 query.
std::string makeScopeClass(const std::string &scope_name) const
Returns scope class name for the specified scope name.
QueryFilter(const HAConfigPtr &config)
Constructor.
std::set< std::string > getServedScopes() const
Returns served scopes.
int loadBalance(const dhcp::Pkt4Ptr &query4) const
Performs load balancing of the DHCPv4 queries.
std::vector< HAConfig::PeerConfigPtr > peers_
Vector of HA peers configurations.
void serveDefaultScopes()
Serve default scopes for the given HA mode.
DHCP query filtering class.
boost::shared_ptr< Pkt6 > Pkt6Ptr
A pointer to Pkt6 packet.
std::map< std::string, bool > scopes_
Holds mapping of the scope names to the flag which indicates if the scopes are enabled or disabled...
void serveScopes(const std::vector< std::string > &scopes)
Enables selected scopes.
boost::scoped_ptr< std::mutex > mutex_
Mutex to protect the internal state.
boost::shared_ptr< Pkt4 > Pkt4Ptr
A pointer to Pkt4 object.
bool amServingScope(const std::string &scope_name) const
Checks if this server instance is configured to process traffic belonging to a particular scope...
void validateScopeName(const std::string &scope_name) const
Checks if the scope name matches a name of any of the configured servers.
void serveFailoverScopes()
Enable scopes required in failover case.
Defines the logger used by the top-level component of kea-dhcp-ddns.
uint8_t loadBalanceHash(const uint8_t *key, const size_t key_len) const
Compute load balancing hash.
HAConfigPtr config_
Pointer to the HA configuration.
void serveScopeOnly(const std::string &scope_name)
Enable scope and disable all other scopes.
int active_servers_
Number of the active servers in the given HA mode.
boost::shared_ptr< HAConfig > HAConfigPtr
Pointer to the High Availability configuration structure.