Kea: check_exists_remove.h Source File

| Kea 3.2.0-git

check_exists_remove.h
Go to the documentation of this file.
1// Copyright (C) 2023-2024 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 CHECK_EXISTS_REMOVE_H
8#define CHECK_EXISTS_REMOVE_H
9
11
12#include <d2srv/nc_trans.h>
13
14namespace isc {
15namespace d2 {
16
18 class CheckExistsRemoveTransactionError : public isc::Exception {
19public:
20 CheckExistsRemoveTransactionError(const char* file, size_t line,
21 const char* what) :
22 isc::Exception(file, line, what) { }
23};
24
51 class CheckExistsRemoveTransaction : public NameChangeTransaction {
52public:
53
55
56 static const int REMOVING_FWD_ADDRS_ST = NCT_DERIVED_STATE_MIN + 1;
57
59 static const int REMOVING_FWD_RRS_ST = NCT_DERIVED_STATE_MIN + 2;
60
62 static const int REMOVING_REV_PTRS_ST = NCT_DERIVED_STATE_MIN + 3;
64
66
68
69
82 CheckExistsRemoveTransaction(asiolink::IOServicePtr& io_service,
83 dhcp_ddns::NameChangeRequestPtr& ncr,
84 DdnsDomainPtr& forward_domain,
85 DdnsDomainPtr& reverse_domain,
86 D2CfgMgrPtr& cfg_mgr);
87
89 virtual ~CheckExistsRemoveTransaction();
90
91protected:
98 virtual void defineEvents();
99
107 virtual void verifyEvents();
108
115 virtual void defineStates();
116
124 virtual void verifyStates();
125
146 void readyHandler();
147
169 void selectingFwdServerHandler();
170
193 void selectingRevServerHandler();
194
236 void removingFwdAddrsHandler();
237
288 void removingFwdRRsHandler();
289
330 void removingRevPtrsHandler();
331
346 void processRemoveOkHandler();
347
366 void processRemoveFailedHandler();
367
381 void buildRemoveFwdAddressRequest();
382
398 void buildRemoveFwdRRsRequest();
399
415 void buildRemoveRevPtrsRequest();
416};
417
419 typedef boost::shared_ptr<CheckExistsRemoveTransaction> CheckExistsRemoveTransactionPtr;
420
421
422} // namespace isc::d2
423} // namespace isc
424#endif
isc::Exception
This is a base class for exceptions thrown from the DNS library module.
Definition exceptions/exceptions.h:23
isc::Exception::Exception
Exception(const char *file, size_t line, const char *what)
Constructor for a given type for exceptions with file name and file line number.
Definition exceptions/exceptions.cc:17
isc::Exception::what
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Definition exceptions/exceptions.cc:32
isc::d2::CheckExistsRemoveTransactionError::CheckExistsRemoveTransactionError
CheckExistsRemoveTransactionError(const char *file, size_t line, const char *what)
Definition check_exists_remove.h:20
isc::d2::CheckExistsRemoveTransaction::buildRemoveRevPtrsRequest
void buildRemoveRevPtrsRequest()
Builds a DNS request to remove a reverse DNS entry for a FQDN.
Definition check_exists_remove.cc:683
isc::d2::CheckExistsRemoveTransaction::defineEvents
virtual void defineEvents()
Adds events defined by CheckExistsRemoveTransaction to the event set.
Definition check_exists_remove.cc:45
isc::d2::CheckExistsRemoveTransaction::processRemoveFailedHandler
void processRemoveFailedHandler()
State handler for PROCESS_TRANS_FAILED_ST.
Definition check_exists_remove.cc:596
isc::d2::CheckExistsRemoveTransaction::CheckExistsRemoveTransaction
CheckExistsRemoveTransaction(asiolink::IOServicePtr &io_service, dhcp_ddns::NameChangeRequestPtr &ncr, DdnsDomainPtr &forward_domain, DdnsDomainPtr &reverse_domain, D2CfgMgrPtr &cfg_mgr)
Event sent when replace attempt to fails with address not in use.
Definition check_exists_remove.cc:28
isc::d2::CheckExistsRemoveTransaction::removingFwdRRsHandler
void removingFwdRRsHandler()
State handler for REMOVING_FWD_RRS_ST.
Definition check_exists_remove.cc:291
isc::d2::CheckExistsRemoveTransaction::buildRemoveFwdAddressRequest
void buildRemoveFwdAddressRequest()
Builds a DNS request to remove a forward DNS address for a FQDN.
Definition check_exists_remove.cc:615
isc::d2::CheckExistsRemoveTransaction::verifyStates
virtual void verifyStates()
Validates the contents of the set of states.
Definition check_exists_remove.cc:111
isc::d2::CheckExistsRemoveTransaction::processRemoveOkHandler
void processRemoveOkHandler()
State handler for PROCESS_TRANS_OK_ST.
Definition check_exists_remove.cc:579
isc::d2::CheckExistsRemoveTransaction::~CheckExistsRemoveTransaction
virtual ~CheckExistsRemoveTransaction()
Destructor.
Definition check_exists_remove.cc:41
isc::d2::CheckExistsRemoveTransaction::REMOVING_REV_PTRS_ST
static const int REMOVING_REV_PTRS_ST
State that attempts to remove reverse PTR records.
Definition check_exists_remove.h:62
isc::d2::CheckExistsRemoveTransaction::readyHandler
void readyHandler()
State handler for READY_ST.
Definition check_exists_remove.cc:128
isc::d2::CheckExistsRemoveTransaction::verifyEvents
virtual void verifyEvents()
Validates the contents of the set of events.
Definition check_exists_remove.cc:55
isc::d2::CheckExistsRemoveTransaction::REMOVING_FWD_ADDRS_ST
static const int REMOVING_FWD_ADDRS_ST
State that attempts to remove specific forward address record.
Definition check_exists_remove.h:56
isc::d2::CheckExistsRemoveTransaction::buildRemoveFwdRRsRequest
void buildRemoveFwdRRsRequest()
Builds a DNS request to remove all forward DNS RRs for a FQDN.
Definition check_exists_remove.cc:646
isc::d2::CheckExistsRemoveTransaction::selectingRevServerHandler
void selectingRevServerHandler()
State handler for SELECTING_REV_SERVER_ST.
Definition check_exists_remove.cc:427
isc::d2::CheckExistsRemoveTransaction::selectingFwdServerHandler
void selectingFwdServerHandler()
State handler for SELECTING_FWD_SERVER_ST.
Definition check_exists_remove.cc:148
isc::d2::CheckExistsRemoveTransaction::removingFwdAddrsHandler
void removingFwdAddrsHandler()
State handler for REMOVING_FWD_ADDRS_ST.
Definition check_exists_remove.cc:176
isc::d2::CheckExistsRemoveTransaction::defineStates
virtual void defineStates()
Adds states defined by CheckExistsRemoveTransaction to the state set.
Definition check_exists_remove.cc:73
isc::d2::CheckExistsRemoveTransaction::removingRevPtrsHandler
void removingRevPtrsHandler()
State handler for REMOVING_REV_PTRS_ST.
Definition check_exists_remove.cc:457
isc::d2::CheckExistsRemoveTransaction::REMOVING_FWD_RRS_ST
static const int REMOVING_FWD_RRS_ST
State that attempts to remove any other forward RRs for the DHCID.
Definition check_exists_remove.h:59
isc::d2::NameChangeTransaction::NameChangeTransaction
NameChangeTransaction(asiolink::IOServicePtr &io_service, dhcp_ddns::NameChangeRequestPtr &ncr, DdnsDomainPtr &forward_domain, DdnsDomainPtr &reverse_domain, D2CfgMgrPtr &cfg_mgr)
Constructor.
Definition nc_trans.cc:69
isc::d2::NameChangeTransaction::NCT_DERIVED_STATE_MIN
static const int NCT_DERIVED_STATE_MIN
Value at which custom states in a derived class should begin.
Definition nc_trans.h:108
isc::asiolink::IOServicePtr
boost::shared_ptr< IOService > IOServicePtr
Defines a smart pointer to an IOService instance.
Definition io_service.h:35
isc::d2
Definition check_exists_add.cc:19
isc::d2::DdnsDomainPtr
boost::shared_ptr< DdnsDomain > DdnsDomainPtr
Defines a pointer for DdnsDomain instances.
Definition d2_config.h:624
isc::d2::D2CfgMgrPtr
boost::shared_ptr< D2CfgMgr > D2CfgMgrPtr
Defines a shared pointer to D2CfgMgr.
Definition d2_cfg_mgr.h:367
isc::d2::CheckExistsRemoveTransactionPtr
boost::shared_ptr< CheckExistsRemoveTransaction > CheckExistsRemoveTransactionPtr
Defines a pointer to a CheckExistsRemoveTransaction.
Definition check_exists_remove.h:419
isc::dhcp_ddns::NameChangeRequestPtr
boost::shared_ptr< NameChangeRequest > NameChangeRequestPtr
Defines a pointer to a NameChangeRequest.
Definition ncr_msg.h:241
isc::util::file
Definition filesystem.cc:29
isc
Defines the logger used by the top-level component of kea-lfc.
Definition check_exists_add.cc:18
nc_trans.h
This file defines the class NameChangeTransaction.