Kea  1.9.9-git
ha_impl.h
Go to the documentation of this file.
1 // Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC")
2 //
3 // This Source Code Form is subject to the terms of the Mozilla Public
4 // License, v. 2.0. If a copy of the MPL was not distributed with this
5 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 
7 #ifndef HA_IMPL_H
8 #define HA_IMPL_H
9 
10 #include <ha_config.h>
11 #include <ha_service.h>
12 #include <asiolink/io_service.h>
13 #include <cc/data.h>
14 #include <dhcpsrv/network_state.h>
15 #include <hooks/hooks.h>
16 #include <boost/noncopyable.hpp>
17 #include <boost/shared_ptr.hpp>
18 
19 
20 namespace isc {
21 namespace ha {
22 
31 class HAImpl : public boost::noncopyable {
32 public:
33 
35  HAImpl();
36 
41  void configure(const data::ConstElementPtr& input_config);
42 
53  void startService(const asiolink::IOServicePtr& io_service,
54  const dhcp::NetworkStatePtr& network_state,
55  const HAServerType& server_type);
56 
58  ~HAImpl();
59 
60 public:
61 
64  return (config_);
65  }
66 
86  void buffer4Receive(hooks::CalloutHandle& callout_handle);
87 
91  void leases4Committed(hooks::CalloutHandle& callout_handle);
92 
112  void buffer6Receive(hooks::CalloutHandle& callout_handle);
113 
117  void leases6Committed(hooks::CalloutHandle& callout_handle);
118 
125  void commandProcessed(hooks::CalloutHandle& callout_handle);
126 
130  void heartbeatHandler(hooks::CalloutHandle& callout_handle);
131 
135  void synchronizeHandler(hooks::CalloutHandle& callout_handle);
136 
140  void scopesHandler(hooks::CalloutHandle& callout_handle);
141 
145  void continueHandler(hooks::CalloutHandle& callout_handle);
146 
150  void maintenanceNotifyHandler(hooks::CalloutHandle& callout_handle);
151 
155  void maintenanceStartHandler(hooks::CalloutHandle& callout_handle);
156 
160  void maintenanceCancelHandler(hooks::CalloutHandle& callout_handle);
161 
165  void haResetHandler(hooks::CalloutHandle& callout_handle);
166 
167 protected:
168 
171 
174 
175 };
176 
178 typedef boost::shared_ptr<HAImpl> HAImplPtr;
179 
180 } // end of namespace isc::ha
181 } // end of namespace isc
182 
183 #endif
void startService(const asiolink::IOServicePtr &io_service, const dhcp::NetworkStatePtr &network_state, const HAServerType &server_type)
Creates high availability service using current configuration.
Definition: ha_impl.cc:41
~HAImpl()
Destructor.
Definition: ha_impl.cc:52
void synchronizeHandler(hooks::CalloutHandle &callout_handle)
Implements handler for the ha-sync command.
Definition: ha_impl.cc:328
boost::shared_ptr< HAImpl > HAImplPtr
Pointer to the High Availability hooks library implementation.
Definition: ha_impl.h:178
void maintenanceCancelHandler(hooks::CalloutHandle &callout_handle)
Implements handler for the ha-maintenance-cancel command.
Definition: ha_impl.cc:482
HAConfigPtr getConfig() const
Returns parsed configuration.
Definition: ha_impl.h:63
void maintenanceNotifyHandler(hooks::CalloutHandle &callout_handle)
Implements handler for the ha-maintenance-notify command.
Definition: ha_impl.cc:453
HAServicePtr service_
Pointer to the high availability service (state machine).
Definition: ha_impl.h:173
void maintenanceStartHandler(hooks::CalloutHandle &callout_handle)
Implements handler for the ha-maintenance-start command.
Definition: ha_impl.cc:476
HAServerType
Lists possible server types for which HA service is created.
void buffer6Receive(hooks::CalloutHandle &callout_handle)
Implementation of the "buffer6_receive" callout.
Definition: ha_impl.cc:175
Per-packet callout handle.
boost::shared_ptr< HAService > HAServicePtr
Pointer to the HAService class.
Definition: ha_service.h:1240
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
void haResetHandler(hooks::CalloutHandle &callout_handle)
Implements handler for the ha-reset command.
Definition: ha_impl.cc:488
void scopesHandler(hooks::CalloutHandle &callout_handle)
Implements handler for the ha-scopes command.
Definition: ha_impl.cc:390
void continueHandler(hooks::CalloutHandle &callout_handle)
Implements handler for the ha-continue command.
Definition: ha_impl.cc:447
HAImpl()
Constructor.
Definition: ha_impl.cc:30
Defines the logger used by the top-level component of kea-dhcp-ddns.
void configure(const data::ConstElementPtr &input_config)
Parses configuration.
Definition: ha_impl.cc:35
void leases4Committed(hooks::CalloutHandle &callout_handle)
Implementation of the "leases4_committed" callout.
Definition: ha_impl.cc:114
HAConfigPtr config_
Holds parsed configuration.
Definition: ha_impl.h:170
High Availability hooks library implementation.
Definition: ha_impl.h:31
boost::shared_ptr< NetworkState > NetworkStatePtr
Pointer to the NetworkState object.
void buffer4Receive(hooks::CalloutHandle &callout_handle)
Implementation of the "buffer4_receive" callout.
Definition: ha_impl.cc:61
void commandProcessed(hooks::CalloutHandle &callout_handle)
Implementation of the "command_processed" callout.
Definition: ha_impl.cc:289
void leases6Committed(hooks::CalloutHandle &callout_handle)
Implementation of the "leases6_committed" callout.
Definition: ha_impl.cc:228
void heartbeatHandler(hooks::CalloutHandle &callout_handle)
Implements handle for the heartbeat command.
Definition: ha_impl.cc:322
boost::shared_ptr< HAConfig > HAConfigPtr
Pointer to the High Availability configuration structure.
Definition: ha_config.h:760