| Kea 3.0.2-git

simple_remove_without_dhcid.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 SIMPLE_REMOVE_WITHOUT_DHCID_H
8#define SIMPLE_REMOVE_WITHOUT_DHCID_H
9
11
12#include <d2srv/nc_trans.h>
13
14 namespace isc {
15 namespace d2 {
16
18 class SimpleRemoveWithoutDHCIDTransactionError : public isc::Exception {
19 public:
20 SimpleRemoveWithoutDHCIDTransactionError(const char* file, size_t line,
21 const char* what) :
22 isc::Exception(file, line, what) { }
23};
24
49 class SimpleRemoveWithoutDHCIDTransaction : public NameChangeTransaction {
50 public:
51
53
54 static const int REMOVING_FWD_RRS_ST = NCT_DERIVED_STATE_MIN + 2;
55
57 static const int REMOVING_REV_PTRS_ST = NCT_DERIVED_STATE_MIN + 3;
59
61
63
64
77 SimpleRemoveWithoutDHCIDTransaction(asiolink::IOServicePtr& io_service,
78 dhcp_ddns::NameChangeRequestPtr& ncr,
79 DdnsDomainPtr& forward_domain,
80 DdnsDomainPtr& reverse_domain,
81 D2CfgMgrPtr& cfg_mgr);
82
84 virtual ~SimpleRemoveWithoutDHCIDTransaction();
85
86 protected:
93 virtual void defineEvents();
94
102 virtual void verifyEvents();
103
110 virtual void defineStates();
111
119 virtual void verifyStates();
120
141 void readyHandler();
142
164 void selectingFwdServerHandler();
165
188 void selectingRevServerHandler();
189
233 void removingFwdRRsHandler();
234
275 void removingRevPtrsHandler();
276
291 void processRemoveOkHandler();
292
310 void processRemoveFailedHandler();
311
325 void buildRemoveFwdRRsRequest();
326
340 void buildRemoveRevPtrsRequest();
341};
342
344 typedef boost::shared_ptr<SimpleRemoveWithoutDHCIDTransaction> SimpleRemoveWithoutDHCIDTransactionPtr;
345
346
347} // namespace isc::d2
348} // namespace isc
349#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::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::d2::SimpleRemoveWithoutDHCIDTransactionError::SimpleRemoveWithoutDHCIDTransactionError
SimpleRemoveWithoutDHCIDTransactionError(const char *file, size_t line, const char *what)
Definition simple_remove_without_dhcid.h:20
isc::d2::SimpleRemoveWithoutDHCIDTransaction::processRemoveOkHandler
void processRemoveOkHandler()
State handler for PROCESS_TRANS_OK_ST.
Definition simple_remove_without_dhcid.cc:448
isc::d2::SimpleRemoveWithoutDHCIDTransaction::REMOVING_FWD_RRS_ST
static const int REMOVING_FWD_RRS_ST
State that attempts to remove FQDN/IP RR for an FQDN.
Definition simple_remove_without_dhcid.h:54
isc::d2::SimpleRemoveWithoutDHCIDTransaction::readyHandler
void readyHandler()
State handler for READY_ST.
Definition simple_remove_without_dhcid.cc:122
isc::d2::SimpleRemoveWithoutDHCIDTransaction::removingFwdRRsHandler
void removingFwdRRsHandler()
State handler for REMOVING_FWD_RRS_ST.
Definition simple_remove_without_dhcid.cc:171
isc::d2::SimpleRemoveWithoutDHCIDTransaction::verifyEvents
virtual void verifyEvents()
Validates the contents of the set of events.
Definition simple_remove_without_dhcid.cc:54
isc::d2::SimpleRemoveWithoutDHCIDTransaction::REMOVING_REV_PTRS_ST
static const int REMOVING_REV_PTRS_ST
State that attempts to remove reverse PTR records.
Definition simple_remove_without_dhcid.h:57
isc::d2::SimpleRemoveWithoutDHCIDTransaction::selectingRevServerHandler
void selectingRevServerHandler()
State handler for SELECTING_REV_SERVER_ST.
Definition simple_remove_without_dhcid.cc:296
isc::d2::SimpleRemoveWithoutDHCIDTransaction::defineEvents
virtual void defineEvents()
Adds events defined by SimpleRemoveWithoutDHCIDTransaction to the event set.
Definition simple_remove_without_dhcid.cc:44
isc::d2::SimpleRemoveWithoutDHCIDTransaction::processRemoveFailedHandler
void processRemoveFailedHandler()
State handler for PROCESS_TRANS_FAILED_ST.
Definition simple_remove_without_dhcid.cc:465
isc::d2::SimpleRemoveWithoutDHCIDTransaction::buildRemoveRevPtrsRequest
void buildRemoveRevPtrsRequest()
Builds a DNS request to remove a reverse DNS entry for a FQDN.
Definition simple_remove_without_dhcid.cc:507
isc::d2::SimpleRemoveWithoutDHCIDTransaction::buildRemoveFwdRRsRequest
void buildRemoveFwdRRsRequest()
Builds a DNS request to remove forward DNS RR for a FQDN.
Definition simple_remove_without_dhcid.cc:484
isc::d2::SimpleRemoveWithoutDHCIDTransaction::selectingFwdServerHandler
void selectingFwdServerHandler()
State handler for SELECTING_FWD_SERVER_ST.
Definition simple_remove_without_dhcid.cc:142
isc::d2::SimpleRemoveWithoutDHCIDTransaction::verifyStates
virtual void verifyStates()
Validates the contents of the set of states.
Definition simple_remove_without_dhcid.cc:106
isc::d2::SimpleRemoveWithoutDHCIDTransaction::defineStates
virtual void defineStates()
Adds states defined by SimpleRemoveWithoutDHCIDTransaction to the state set.
Definition simple_remove_without_dhcid.cc:72
isc::d2::SimpleRemoveWithoutDHCIDTransaction::removingRevPtrsHandler
void removingRevPtrsHandler()
State handler for REMOVING_REV_PTRS_ST.
Definition simple_remove_without_dhcid.cc:326
isc::d2::SimpleRemoveWithoutDHCIDTransaction::~SimpleRemoveWithoutDHCIDTransaction
virtual ~SimpleRemoveWithoutDHCIDTransaction()
Destructor.
Definition simple_remove_without_dhcid.cc:40
isc::d2::SimpleRemoveWithoutDHCIDTransaction::SimpleRemoveWithoutDHCIDTransaction
SimpleRemoveWithoutDHCIDTransaction(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 simple_remove_without_dhcid.cc:27
isc::asiolink::IOServicePtr
boost::shared_ptr< IOService > IOServicePtr
Defines a smart pointer to an IOService instance.
Definition io_service.h:28
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::SimpleRemoveWithoutDHCIDTransactionPtr
boost::shared_ptr< SimpleRemoveWithoutDHCIDTransaction > SimpleRemoveWithoutDHCIDTransactionPtr
Defines a pointer to a SimpleRemoveWithoutDHCIDTransaction.
Definition simple_remove_without_dhcid.h:344
isc::d2::D2CfgMgrPtr
boost::shared_ptr< D2CfgMgr > D2CfgMgrPtr
Defines a shared pointer to D2CfgMgr.
Definition d2_cfg_mgr.h:367
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:28
isc
Defines the logger used by the top-level component of kea-lfc.
Definition agent_parser.cc:148
nc_trans.h
This file defines the class NameChangeTransaction.