BIND 10 trac2491, updated. b561ee0919676f6e9c34329151c2b46d60f1824b [2491] Better comments in createStatusCode function.

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Dec 3 18:15:06 UTC 2012


The branch, trac2491 has been updated
       via  b561ee0919676f6e9c34329151c2b46d60f1824b (commit)
      from  372f3a19f5bad9ed51e50d083063fccbe1ff6900 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b561ee0919676f6e9c34329151c2b46d60f1824b
Author: Marcin Siodelski <marcin at isc.org>
Date:   Mon Dec 3 19:14:57 2012 +0100

    [2491] Better comments in createStatusCode function.

-----------------------------------------------------------------------

Summary of changes:
 src/bin/dhcp6/dhcp6_srv.cc |   11 +++++++++++
 1 file changed, 11 insertions(+)

-----------------------------------------------------------------------
diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc
index bd3675b..c1a70ce 100644
--- a/src/bin/dhcp6/dhcp6_srv.cc
+++ b/src/bin/dhcp6/dhcp6_srv.cc
@@ -349,16 +349,27 @@ void Dhcpv6Srv::appendRequestedOptions(const Pkt6Ptr& question, Pkt6Ptr& answer)
 }
 
 OptionPtr Dhcpv6Srv::createStatusCode(uint16_t code, const std::string& text) {
+    // @todo This function uses OptionCustom class to manage contents
+    // of the data fields. Since this this option is frequently used
+    // it may be good to implement dedicated class to avoid performance
+    // impact.
+
+    // Get the definition of the option holding status code.
     OptionDefinitionPtr status_code_def =
         LibDHCP::getOptionDef(Option::V6, D6O_STATUS_CODE);
+    // This definition is assumed to be initialized in LibDHCP.
     assert(status_code_def);
 
+    // As there is no dedicated class to represent Status Code
+    // the OptionCustom class should be returned here.
     boost::shared_ptr<OptionCustom> option_status =
         boost::dynamic_pointer_cast<
             OptionCustom>(status_code_def->optionFactory(Option::V6, D6O_STATUS_CODE));
     assert(option_status);
 
+    // Set status code to 'code' (0 - means data field #0).
     option_status->writeInteger<uint16_t>(code, 0);
+    // Set a message (1 - means data field #1).
     option_status->writeString(text, 1);
     return (option_status);
 }



More information about the bind10-changes mailing list