 |
Kea
1.5.0
|
Go to the documentation of this file.
13 #include <boost/function.hpp>
14 #include <boost/bind.hpp>
38 "NameRemoveTransaction, request type must be CHG_REMOVE");
191 }
catch (
const std::exception& ex) {
196 DHCP_DDNS_FORWARD_REMOVE_ADDRS_BUILD_FAILURE)
257 .arg(
getNcr()->getFqdn());
266 DHCP_DDNS_FORWARD_REMOVE_ADDRS_BAD_DNSCLIENT_STATUS)
302 }
catch (
const std::exception& ex) {
307 DHCP_DDNS_FORWARD_REMOVE_RRS_BUILD_FAILURE)
385 .arg(
getNcr()->getFqdn());
396 DHCP_DDNS_FORWARD_REMOVE_RRS_BAD_DNSCLIENT_STATUS)
461 }
catch (
const std::exception& ex) {
530 .arg(
getNcr()->getFqdn());
541 DHCP_DDNS_REVERSE_REMOVE_BAD_DNSCLIENT_STATUS)
void defineState(unsigned int value, const std::string &label, StateHandler handler, const StatePausing &state_pausing=STATE_PAUSE_NEVER)
Adds an state value and associated label to the set of states.
static const RRClass & ANY()
#define LOG_ERROR(LOGGER, MESSAGE)
Macro to conveniently test error output and log it.
std::string getRequestId() const
Fetches the request id that identifies this transaction.
DdnsDomainPtr & getForwardDomain()
Fetches the forward DdnsDomain.
virtual ~NameRemoveTransaction()
Destructor.
boost::shared_ptr< D2CfgMgr > D2CfgMgrPtr
Defines a shared pointer to D2CfgMgr.
static const RRType & A()
static const RRClass & IN()
boost::shared_ptr< AbstractRRset > RRsetPtr
A pointer-like type pointing to an RRset object.
static const int SERVER_SELECTED_EVT
Issued when a server has been selected.
void buildRemoveFwdRRsRequest()
Builds a DNS request to remove all forward DNS RRs for a FQDN.
static const int PROCESS_TRANS_FAILED_ST
State which processes an unsuccessful transaction conclusion.
void setReverseChangeCompleted(const bool value)
Sets the reverse change completion flag to the given value.
void transition(unsigned int state, unsigned int event)
Sets up the model to transition into given state with a given event.
void setDnsUpdateRequest(D2UpdateMessagePtr &request)
Sets the update request packet to the given packet.
bool doOnEntry()
Checks if on entry flag is true.
void processRemoveOkHandler()
State handler for PROCESS_TRANS_OK_ST.
static const int READY_ST
State from which a transaction is started.
DdnsDomainPtr & getReverseDomain()
Fetches the reverse DdnsDomain.
static const Rcode & NXRRSET()
A constant object for the NXRRSET Rcode (see Rcode::NXRRSET_CODE).
boost::shared_ptr< NameChangeRequest > NameChangeRequestPtr
Defines a pointer to a NameChangeRequest.
virtual void verifyEvents()
Validates the contents of the set of events.
std::string transactionOutcomeString() const
Returns a string version of transaction outcome.
void selectingFwdServerHandler()
State handler for SELECTING_FWD_SERVER_ST.
static const RRType & PTR()
static const Rcode & NOERROR()
A constant object for the NOERROR Rcode (see Rcode::NOERROR_CODE).
virtual void verifyStates()
Validates the contents of the set of states.
static const int NO_MORE_SERVERS_EVT
Issued when there are no more servers from which to select.
void buildRemoveRevPtrsRequest()
Builds a DNS request to remove a reverse DNS entry for a FQDN.
void removingFwdRRsHandler()
State handler for REMOVING_FWD_RRS_ST.
void addPtrRdata(dns::RRsetPtr &rrset)
Adds an RData for the lease FQDN to the given RRset.
DNSClient::Status getDnsUpdateStatus() const
Fetches the most recent DNS update status.
virtual void defineEvents()
Adds events defined by NameChangeTransaction to the event set.
bool selectNextServer()
Selects the next server in the current server list.
NameRemoveTransaction(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.
Defines the logger used by the top-level component of kea-dhcp-ddns.
virtual void sendUpdate(const std::string &comment="")
Send the update request to the current server.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
void clearDnsUpdateRequest()
Destroys the current update request packet and resets update attempts count.
virtual void defineStates()
Adds states defined by NameRemoveTransaction to the state set.
static const int REMOVING_REV_PTRS_ST
State that attempts to remove reverse PTR records.
static const int SELECT_SERVER_EVT
Issued when a server needs to be selected.
void buildRemoveFwdAddressRequest()
Builds a DNS request to remove a forward DNS address for a FQDN.
uint16_t getCode() const
Returns the Rcode code value.
The Name class encapsulates DNS names.
@ OTHER
Other, unclassified error.
static const int UPDATE_OK_EVT
Issued when the attempted update successfully completed.
static const RRClass & NONE()
void removingFwdAddrsHandler()
State handler for REMOVING_FWD_ADDRS_ST.
std::string getContextStr() const
Convenience method which returns a string rendition of the current state and next event.
@ INVALID_RESPONSE
Response received but invalid.
void addLeaseAddressRdata(dns::RRsetPtr &rrset)
Adds an RData for the lease address to the given RRset.
virtual D2UpdateMessagePtr prepNewRequest(DdnsDomainPtr domain)
Creates a new DNS update request based on the given domain.
@ SUCCESS
Response received and is ok.
const D2UpdateMessagePtr & getDnsUpdateResponse() const
Fetches the most recent DNS update response packet.
static const RRType & DHCID()
void initServerSelection(const DdnsDomainPtr &domain)
Initializes server selection from the given DDNS domain.
void readyHandler()
State handler for READY_ST.
static const int UPDATE_FAILED_EVT
Issued when the attempted update fails to complete.
void processRemoveFailedHandler()
State handler for PROCESS_TRANS_FAILED_ST.
static const int PROCESS_TRANS_OK_ST
State which processes successful transaction conclusion.
The RRTTL class encapsulates TTLs used in DNS resource records.
Embodies the "life-cycle" required to carry out a DDNS update.
static const RRType & ANY()
virtual void verifyStates()
Validates the contents of the set of states.
void removingRevPtrsHandler()
State handler for REMOVING_REV_PTRS_ST.
boost::shared_ptr< IOService > IOServicePtr
Defines a smart pointer to an IOService instance.
@ TIMEOUT
No response, timeout.
const DnsServerInfoPtr & getCurrentServer() const
Fetches the currently selected server.
virtual void verifyEvents()
Validates the contents of the set of events.
const dhcp_ddns::NameChangeRequestPtr & getNcr() const
Fetches the NameChangeRequest for this transaction.
isc::log::Logger d2_to_dns_logger("d2-to-dns")
void endModel()
Conducts a normal transition to the end of the model.
void selectingRevServerHandler()
State handler for SELECTING_REV_SERVER_ST.
The RRset class is a concrete derived class of BasicRRset which contains a pointer to an additional R...
static std::string reverseIpAddress(const std::string &address)
Generate a reverse order string for the given IP address.
void setNcrStatus(const dhcp_ddns::NameChangeStatus &status)
Sets the status of the transaction's NameChangeRequest.
static const int REMOVING_FWD_ADDRS_ST
State that attempts to remove specific forward address record.
unsigned int getNextEvent() const
Fetches the model's next event.
static const int START_EVT
Event issued to start the model execution.
static const int REMOVING_FWD_RRS_ST
State that attempts to remove any other forward RRs for the DHCID.
void retryTransition(const int fail_to_state)
Determines the state and next event based on update attempts.
void addDhcidRdata(dns::RRsetPtr &rrset)
Adds an RData for the lease client's DHCID to the given RRset.
virtual void defineStates()
Adds states defined by NameChangeTransaction to the state set.
static const RRType & AAAA()
const dns::RRType & getAddressRRType() const
Returns the DHCP data type for the lease address.
Thrown if the NameRemoveTransaction encounters a general error.
const D2UpdateMessagePtr & getDnsUpdateRequest() const
Fetches the current DNS update request packet.
static const int SERVER_IO_ERROR_EVT
Issued when an update fails due to an IO error.
void setForwardChangeCompleted(const bool value)
Sets the forward change completion flag to the given value.
boost::shared_ptr< DdnsDomain > DdnsDomainPtr
Defines a pointer for DdnsDomain instances.
boost::shared_ptr< D2UpdateMessage > D2UpdateMessagePtr
Pointer to the DNS Update Message.
static const int SELECTING_FWD_SERVER_ST
State in which forward DNS server selection is done.
static const int SELECTING_REV_SERVER_ST
State in which reverse DNS server selection is done.
#define LOG_INFO(LOGGER, MESSAGE)
Macro to conveniently test info output and log it.
static const int IO_COMPLETED_EVT
Issued when a DNS update packet exchange has completed.
DNS Response Codes (RCODEs) class.
virtual void defineEvents()
Adds events defined by NameRemoveTransaction to the event set.
const StatePtr getState(unsigned int value)
Fetches the state referred to by value.