14#include <boost/scoped_ptr.hpp> 
   91    void serveScope(
const std::string& scope_name);
 
  107    void serveScopes(
const std::vector<std::string>& scopes);
 
  241    void serveScopeInternal(
const std::string& scope_name);
 
  252    void serveScopeOnlyInternal(
const std::string& scope_name);
 
  261    void serveScopesInternal(
const std::vector<std::string>& scopes);
 
  269    void serveDefaultScopesInternal();
 
  280    void serveFailoverScopesInternal();
 
  285    void serveNoScopesInternal();
 
  294    bool amServingScopeInternal(
const std::string& scope_name) 
const;
 
  301    std::set<std::string> getServedScopesInternal() 
const;
 
  317    template<
typename QueryPtrType>
 
  318    bool queryInScopeInternal(
const QueryPtrType& query, std::string& scope_class) 
const;
 
  330    template<
typename LeasePtrType>
 
  331    bool leaseInScopeInternal(
const LeasePtrType& lease) 
const;
 
  401    uint8_t 
loadBalanceHash(
const uint8_t* key, 
const size_t key_len) 
const;
 
  430    std::vector<HAConfig::PeerConfigPtr> 
peers_;
 
 
void serveScopes(const std::vector< std::string > &scopes)
Enables selected scopes.
bool inScope(const dhcp::Pkt4Ptr &query4, std::string &scope_class) const
Checks if this server should process the DHCPv4 query.
bool amServingScope(const std::string &scope_name) const
Checks if this server instance is configured to process traffic belonging to a particular scope.
std::string makeScopeClass(const std::string &scope_name) const
Returns scope class name for the specified scope name.
boost::scoped_ptr< std::mutex > mutex_
Mutex to protect the internal state.
void serveFailoverScopes()
Enable scopes required in failover case.
uint8_t loadBalanceHash(const uint8_t *key, const size_t key_len) const
Compute load balancing hash.
void validateScopeName(const std::string &scope_name) const
Checks if the scope name matches a name of any of the configured servers.
int active_servers_
Number of the active servers in the given HA mode.
HAConfigPtr config_
Pointer to the HA configuration.
void serveScopeOnly(const std::string &scope_name)
Enable scope and disable all other scopes.
int loadBalance(const dhcp::Pkt4Ptr &query4) const
Performs load balancing of the DHCPv4 queries.
static bool isHaType(const dhcp::Pkt4Ptr &query4)
Determines if a DHCPv4 query is a message type HA should process.
void serveDefaultScopes()
Serve default scopes for the given HA mode.
void serveNoScopes()
Disables all scopes.
std::set< std::string > getServedScopes() const
Returns served scopes.
void serveScope(const std::string &scope_name)
Enable scope.
std::vector< HAConfig::PeerConfigPtr > peers_
Vector of HA peers configurations.
std::map< std::string, bool > scopes_
Holds mapping of the scope names to the flag which indicates if the scopes are enabled or disabled.
QueryFilter(const HAConfigPtr &config)
Constructor.
boost::shared_ptr< Pkt4 > Pkt4Ptr
A pointer to Pkt4 object.
boost::shared_ptr< Lease6 > Lease6Ptr
Pointer to a Lease6 structure.
boost::shared_ptr< Pkt6 > Pkt6Ptr
A pointer to Pkt6 packet.
boost::shared_ptr< Lease4 > Lease4Ptr
Pointer to a Lease4 structure.
boost::shared_ptr< HAConfig > HAConfigPtr
Pointer to the High Availability configuration structure.
Defines the logger used by the top-level component of kea-lfc.