Enhanced update logic to respect not activated hostnames. If a hostname could not...
[bpdyndnsd] / src / service.hpp
index 09548f2..7d71d97 100644 (file)
@@ -33,6 +33,7 @@ private:
 
     std::string ActualIP;
     bool ActualIPIsBurnt;
+    bool Activated;
 
     int UpdateInterval;
     int MaxUpdatesWithinInterval;
@@ -58,15 +59,24 @@ private:
         ar & MaxUpdatesWithinInterval;
         ar & MaxEqualUpdatesInSuccession;
         ar & DNSCacheTTL;
+        ar & Activated;
     }
 
     Logger::Ptr Log;
 
 protected:
 
-    enum UpdateErrorCode { UpdateOk=0, GenericError=1, NoChange=2, Blocked=3 };
+    enum UpdateErrorCode { UpdateOk=0, UpdateError=1, NoChange=2, Blocked=3, NotAuth=4, GenericError=4 };
     virtual UpdateErrorCode perform_update(const std::string& ip) = 0;
 
+    // UpdateOk:        Update was successful
+    // UpdateError:     Unspecified error code returned from update server
+    // NoChange:        IP was not changed_to_online
+    // Blocked:         Client blocked due to abusive updates
+    // NotAuth:         Authentication was not successful
+    // GenericError:    Generic error. For example update server not reached, wrong hostname, not authenticated or network error.
+    //                  Generic error indicates that the update server couldn't associate the update request to any hostname.
+
 public:
 
     typedef boost::shared_ptr<Service> Ptr;
@@ -118,6 +128,9 @@ public:
 
     std::string get_service_name() const;
 
+    void set_activated();
+    bool get_activated() const;
+
     bool operator== (const Service& other) const;
     bool operator!= (const Service& other) const;
 };