Browse Source

[2270] Fixes in Doxygen comments in src/bin/dhcp6

Tomek Mrugalski 12 years ago
parent
commit
65a83c79b1
2 changed files with 28 additions and 14 deletions
  1. 14 7
      src/bin/dhcp6/config_parser.cc
  2. 14 7
      src/bin/dhcp6/config_parser.h

+ 14 - 7
src/bin/dhcp6/config_parser.cc

@@ -134,7 +134,7 @@ protected:
 /// in its base class, \ref DhcpConfigParser.
 ///
 /// For overview of usability of this generic purpose parser, see
-/// \ref dhcpv6-config-inherit page.
+/// \ref dhcp6-config-inherit page.
 class Uint32Parser : public DhcpConfigParser {
 public:
 
@@ -147,7 +147,7 @@ public:
     /// @brief builds parameter value
     ///
     /// Parses configuration entry and stores it in a storage. See
-    /// \ref setStorage() for details.
+    /// \ref Uint32Parser::setStorage() for details.
     ///
     /// @param value pointer to the content of parsed values
     virtual void build(ConstElementPtr value) {
@@ -180,7 +180,7 @@ public:
 
     /// @brief sets storage for value of this parameter
     ///
-    /// See \ref dhcpv6-config-inherit for details.
+    /// See \ref dhcp6-config-inherit for details.
     ///
     /// @param storage pointer to the storage container
     void setStorage(Uint32Storage* storage) {
@@ -208,7 +208,7 @@ protected:
 /// in its base class, \ref DhcpConfigParser.
 ///
 /// For overview of usability of this generic purpose parser, see
-/// \ref dhcpv6-config-inherit page.
+/// \ref dhcp6-config-inherit page.
 class StringParser : public DhcpConfigParser {
 public:
 
@@ -250,7 +250,7 @@ public:
 
     /// @brief sets storage for value of this parameter
     ///
-    /// See \ref dhcpv6-config-inherit for details.
+    /// See \ref dhcp6-config-inherit for details.
     ///
     /// @param storage pointer to the storage container
     void setStorage(StringStorage* storage) {
@@ -286,9 +286,10 @@ public:
     /// "interface" parameter only. All other types will throw exception.
     ///
     /// @param param_name name of the configuration parameter being parsed
+    /// @throw BadValue if supplied parameter name is not "interface"
     InterfaceListConfigParser(const std::string& param_name) {
         if (param_name != "interface") {
-            isc_throw(NotImplemented, "Internal error. Interface configuration "
+            isc_throw(BadValue, "Internal error. Interface configuration "
                       "parser called for the wrong parameter: " << param_name);
         }
     }
@@ -347,6 +348,8 @@ public:
     /// This method parses the actual list of interfaces.
     /// No validation is done at this stage, everything is interpreted as
     /// interface name.
+    /// @param pools_list list of pools defined for a subnet
+    /// @throw BadValue if storage was not specified (setStorage() not called)
     void build(ConstElementPtr pools_list) {
         // setStorage() should have been called before build
         if (!pools_) {
@@ -416,7 +419,7 @@ public:
 
     /// @brief sets storage for value of this parameter
     ///
-    /// See \ref dhcpv6-config-inherit for details.
+    /// See \ref dhcp6-config-inherit for details.
     ///
     /// @param storage pointer to the storage container
     void setStorage(PoolStorage* storage) {
@@ -551,6 +554,7 @@ protected:
     ///
     /// @param config_id name od the entry
     /// @return parser object for specified entry name
+    /// @throw NotImplemented if trying to create a parser for unknown config element
     DhcpConfigParser* createSubnet6ConfigParser(const std::string& config_id) {
         FactoryMap factories;
 
@@ -589,6 +593,7 @@ protected:
     ///
     /// @param name name of the parameter
     /// @return triplet with the parameter name
+    /// @throw Dhcp6ConfigError when requested parameter is not present
     Triplet<uint32_t> getParam(const std::string& name) {
         uint32_t value = 0;
         bool found = false;
@@ -695,6 +700,7 @@ public:
 ///
 /// @param config_id pointer to received global configuration entry
 /// @return parser for specified global DHCPv6 parameter
+/// @throw NotImplemented if trying to create a parser for unknown config element
 DhcpConfigParser* createGlobalDhcpConfigParser(const std::string& config_id) {
     FactoryMap factories;
 
@@ -742,6 +748,7 @@ DhcpConfigParser* createGlobalDhcpConfigParser(const std::string& config_id) {
 ///
 /// @param config_set a new configuration for DHCPv6 server
 /// @return answer that contains result of reconfiguration
+/// @throw Dhcp6ConfigError if trying to create a parser for NULL config
 ConstElementPtr
 configureDhcp6Server(Dhcpv6Srv& , ConstElementPtr config_set) {
     if (!config_set) {

+ 14 - 7
src/bin/dhcp6/config_parser.h

@@ -32,15 +32,22 @@ class Dhcpv6Srv;
 class Dhcp6ConfigError : public isc::Exception {
 public:
 
-/// @brief constructor
-///
-/// @param file name of the file, where exception occurred
-/// @param line line of the file, where exception occurred
-/// @param what text description of the issue that caused exception
-Dhcp6ConfigError(const char* file, size_t line, const char* what) :
-    isc::Exception(file, line, what) {}
+    /// @brief constructor
+    ///
+    /// @param file name of the file, where exception occurred
+    /// @param line line of the file, where exception occurred
+    /// @param what text description of the issue that caused exception
+    Dhcp6ConfigError(const char* file, size_t line, const char* what)
+        : isc::Exception(file, line, what) {}
 };
 
+/// @brief Base abstract class for all DHCPv6 parsers
+///
+/// Each instance of a class derived from this class parses one specific config
+/// element. Sometimes elements are simple (e.g. a string) and sometimes quite
+/// complex (e.g. a subnet). In such case, it is likely that a parser will
+/// spawn child parsers to parse child elements in the configuration.
+/// @todo: Merge this class with Dhcp4ConfigParser in src/bin/dhcp4
 class DhcpConfigParser {
     ///
     /// \name Constructors and Destructor