]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/template/answer/dht/class_XmlDhtBootstrapAnswerTemplateEngine.php
Added private key hash distribution in announcement and answer.
[hub.git] / application / hub / main / template / answer / dht / class_XmlDhtBootstrapAnswerTemplateEngine.php
index 13e4db02e06e5e87684e3949449295b346f23e40..38a46461ac3542b3ccf2a720d9e43c8b6fea8b9e 100644 (file)
@@ -27,6 +27,7 @@ class XmlDhtBootstrapAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine im
         * Some XML nodes must be available for later data extraction
         */
        const DHT_BOOTSTRAP_DATA_SESSION_ID       = 'my-session-id';
+       const DHT_BOOTSTRAP_DATA_PRIVATE_KEY_HASH = 'my-private-key-hash';
        const DHT_BOOTSTRAP_DATA_NODE_STATUS      = 'my-status';
        const DHT_BOOTSTRAP_DATA_EXTERNAL_ADDRESS = 'my-external-address';
        const DHT_BOOTSTRAP_DATA_INTERNAL_ADDRESS = 'my-internal-address';
@@ -168,6 +169,16 @@ class XmlDhtBootstrapAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine im
                $this->getStackInstance()->pushNamed('node_dht_bootstrap_answer', self::DHT_BOOTSTRAP_DATA_SESSION_ID);
        }
 
+       /**
+        * Starts the my-private-key-hash
+        *
+        * @return      void
+        */
+       protected function startMyPrivateKeyHash () {
+               // Push the node name on the stacker
+               $this->getStackInstance()->pushNamed('node_dht_bootstrap_answer', self::DHT_BOOTSTRAP_DATA_PRIVATE_KEY_HASH);
+       }
+
        /**
         * Starts the my-status
         *
@@ -208,6 +219,16 @@ class XmlDhtBootstrapAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine im
                $this->getStackInstance()->popNamed('node_dht_bootstrap_answer');
        }
 
+       /**
+        * Finishes the my-private-key-hash
+        *
+        * @return      void
+        */
+       protected function finishMyPrivateKeyHash () {
+               // Pop the last entry
+               $this->getStackInstance()->popNamed('node_dht_bootstrap_answer');
+       }
+
        /**
         * Finishes the my-session-id
         *
@@ -288,6 +309,26 @@ class XmlDhtBootstrapAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine im
                $this->getStackInstance()->pushNamed('node_dht_bootstrap_answer', 'your-session-id');
        }
 
+       /**
+        * Starts the your-private-key-hash
+        *
+        * @return      void
+        */
+       protected function startYourPrivateKeyHash () {
+               // Push the node name on the stacker
+               $this->getStackInstance()->pushNamed('node_dht_bootstrap_answer', 'your-private-key-hash');
+       }
+
+       /**
+        * Finishes the your-private-key-hash
+        *
+        * @return      void
+        */
+       protected function finishYourPrivateKeyHash () {
+               // Pop the last entry
+               $this->getStackInstance()->popNamed('node_dht_bootstrap_answer');
+       }
+
        /**
         * Finishes the your-session-id
         *