Kea 1.5.0
ha_impl.h
Go to the documentation of this file.
1// Copyright (C) 2018 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>
15#include <hooks/hooks.h>
16#include <boost/noncopyable.hpp>
17#include <boost/shared_ptr.hpp>
18
19
20namespace isc {
21namespace ha {
22
31class HAImpl : public boost::noncopyable {
32public:
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
59 return (config_);
60 }
61
81 void buffer4Receive(hooks::CalloutHandle& callout_handle);
82
86 void leases4Committed(hooks::CalloutHandle& callout_handle);
87
107 void buffer6Receive(hooks::CalloutHandle& callout_handle);
108
112 void leases6Committed(hooks::CalloutHandle& callout_handle);
113
123 void commandProcessed(hooks::CalloutHandle& callout_handle);
124
128 void heartbeatHandler(hooks::CalloutHandle& callout_handle);
129
133 void synchronizeHandler(hooks::CalloutHandle& callout_handle);
134
138 void scopesHandler(hooks::CalloutHandle& callout_handle);
139
143 void continueHandler(hooks::CalloutHandle& callout_handle);
144
145protected:
146
149
152
153};
154
156typedef boost::shared_ptr<HAImpl> HAImplPtr;
157
158} // end of namespace isc::ha
159} // end of namespace isc
160
161#endif
High Availability hooks library implementation.
Definition: ha_impl.h:31
void scopesHandler(hooks::CalloutHandle &callout_handle)
Implements handler for the ha-scopes command.
Definition: ha_impl.cc:337
void continueHandler(hooks::CalloutHandle &callout_handle)
Implements handler for the ha-continue command.
Definition: ha_impl.cc:394
HAServicePtr service_
Pointer to the high availability service (state machine).
Definition: ha_impl.h:151
void configure(const data::ConstElementPtr &input_config)
Parases configuration.
Definition: ha_impl.cc:35
void synchronizeHandler(hooks::CalloutHandle &callout_handle)
Implements handler for the ha-sync command.
Definition: ha_impl.cc:275
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
void leases4Committed(hooks::CalloutHandle &callout_handle)
Implementation of the "leases4_committed" callout.
Definition: ha_impl.cc:101
HAConfigPtr getConfig() const
Returns parsed configuration.
Definition: ha_impl.h:58
void buffer4Receive(hooks::CalloutHandle &callout_handle)
Implementation of the "buffer4_receive" callout.
Definition: ha_impl.cc:50
HAConfigPtr config_
Holds parsed configuration.
Definition: ha_impl.h:148
void buffer6Receive(hooks::CalloutHandle &callout_handle)
Implementation of the "buffer6_receive" callout.
Definition: ha_impl.cc:155
void commandProcessed(hooks::CalloutHandle &callout_handle)
Implementation of the "command_processed" callout.
Definition: ha_impl.cc:260
HAImpl()
Constructor.
Definition: ha_impl.cc:30
void leases6Committed(hooks::CalloutHandle &callout_handle)
Implementation of the "leases6_committed" callout.
Definition: ha_impl.cc:206
void heartbeatHandler(hooks::CalloutHandle &callout_handle)
Implements handle for the heartbeat command.
Definition: ha_impl.cc:269
Per-packet callout handle.
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
boost::shared_ptr< NetworkState > NetworkStatePtr
Pointer to the NetworkState object.
boost::shared_ptr< HAImpl > HAImplPtr
Pointer to the High Availability hooks library implementation.
Definition: ha_impl.h:156
boost::shared_ptr< HAConfig > HAConfigPtr
Pointer to the High Availability configuration structure.
Definition: ha_config.h:509
HAServerType
Lists possible server types for which HA service is created.
boost::shared_ptr< HAService > HAServicePtr
Pointer to the HAService class.
Definition: ha_service.h:752
Defines the logger used by the top-level component of kea-dhcp-ddns.