20 #include <boost/shared_ptr.hpp> 83 static const int READY_ST = SM_DERIVED_STATE_MIN + 1;
91 static const int SELECTING_FWD_SERVER_ST = SM_DERIVED_STATE_MIN + 2;
99 static const int SELECTING_REV_SERVER_ST = SM_DERIVED_STATE_MIN + 3;
102 static const int PROCESS_TRANS_OK_ST = SM_DERIVED_STATE_MIN + 4;
105 static const int PROCESS_TRANS_FAILED_ST = SM_DERIVED_STATE_MIN + 5;
108 static const int NCT_DERIVED_STATE_MIN = SM_DERIVED_STATE_MIN + 101;
112 static const int SELECT_SERVER_EVT = SM_DERIVED_EVENT_MIN + 1;
116 static const int SERVER_SELECTED_EVT = SM_DERIVED_EVENT_MIN + 2;
119 static const int SERVER_IO_ERROR_EVT = SM_DERIVED_EVENT_MIN + 3;
125 static const int NO_MORE_SERVERS_EVT =SM_DERIVED_EVENT_MIN + 4;
130 static const int IO_COMPLETED_EVT = SM_DERIVED_EVENT_MIN + 5;
135 static const int UPDATE_OK_EVT = SM_DERIVED_EVENT_MIN + 6;
141 static const int UPDATE_FAILED_EVT = SM_DERIVED_EVENT_MIN + 7;
144 static const int NCT_DERIVED_EVENT_MIN = SM_DERIVED_EVENT_MIN + 101;
151 static const unsigned int DNS_UPDATE_DEFAULT_TIMEOUT = 100;
154 static const unsigned int MAX_UPDATE_TRIES_PER_SERVER = 3;
183 void startTransaction();
213 virtual void sendUpdate(
const std::string& comment =
"");
224 virtual void defineEvents();
235 virtual void verifyEvents();
246 virtual void defineStates();
257 virtual void verifyStates();
270 virtual void onModelFailure(
const std::string& explanation);
284 void retryTransition(
const int fail_to_state);
292 void clearDnsUpdateRequest();
295 void clearUpdateAttempts();
308 void clearDnsUpdateResponse();
313 void setForwardChangeCompleted(
const bool value);
318 void setReverseChangeCompleted(
const bool value);
346 bool selectNextServer();
354 bool selectTSIGKey();
359 void setUpdateAttempts(
const size_t value);
365 return (io_service_);
418 std::string responseString()
const;
428 std::string transactionOutcomeString()
const;
442 const TransactionKey& getTransactionKey()
const;
452 std::string getRequestId()
const;
513 bool getForwardChangeCompleted()
const;
522 bool getReverseChangeCompleted()
const;
528 size_t getUpdateAttempts()
const;
570 bool forward_change_completed_;
573 bool reverse_change_completed_;
585 size_t next_server_pos_;
588 size_t update_attempts_;
Implements a finite state machine.
Thrown if the transaction encounters a general error.
boost::shared_ptr< NameChangeTransaction > NameChangeTransactionPtr
Defines a pointer to a NameChangeTransaction.
boost::shared_ptr< DNSClient > DNSClientPtr
boost::shared_ptr< DdnsDomain > DdnsDomainPtr
Defines a pointer for DdnsDomain instances.
boost::shared_ptr< D2UpdateMessage > D2UpdateMessagePtr
Pointer to the DNS Update Message.
boost::shared_ptr< D2TsigKey > D2TsigKeyPtr
Type of pointer to a D2 TSIG key.
boost::shared_ptr< IOService > IOServicePtr
Defines a smart pointer to an IOService instance.
boost::shared_ptr< NameChangeRequest > NameChangeRequestPtr
Defines a pointer to a NameChangeRequest.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Callback for the DNSClient class.
isc::dhcp_ddns::D2Dhcid TransactionKey
Defines the type used as the unique key for transactions.
Status
A status code of the DNSClient.
NameChangeStatus
Defines the runtime processing status values for requests.
boost::shared_ptr< D2CfgMgr > D2CfgMgrPtr
Defines a shared pointer to D2CfgMgr.
const asiolink::IOServicePtr & getIOService()
Fetches the IOService the transaction uses for IO processing.
This is a base class for exceptions thrown from the DNS library module.
Defines the logger used by the top-level component of kea-lfc.
NameChangeTransactionError(const char *file, size_t line, const char *what)
The RRType class encapsulates DNS resource record types.
Container class for handling the DHCID value within a NameChangeRequest.
Embodies the "life-cycle" required to carry out a DDNS update.
boost::shared_ptr< AbstractRRset > RRsetPtr
A pointer-like type pointing to an RRset object.
boost::shared_ptr< DnsServerInfoStorage > DnsServerInfoStoragePtr
Defines a pointer to DnsServerInfo storage containers.
This file defines the class StateModel.
This file provides the classes needed to embody, compose, and decompose DNS update requests that are ...
boost::shared_ptr< DnsServerInfo > DnsServerInfoPtr
Defines a pointer for DnsServerInfo instances.