Browse Source

[1531] Doxygen warnings removed in DHCP code.

Tomek Mrugalski 13 years ago
parent
commit
0dc861f4c3

+ 2 - 2
src/bin/dhcp4/dhcp4_srv.h

@@ -68,7 +68,7 @@ protected:
     /// should be served. In particular, a lease is selected and sent
     /// as an offer to a client if it should be served.
     ///
-    /// @param solicit DISCOVER message received from client
+    /// @param discover DISCOVER message received from client
     ///
     /// @return OFFER message or NULL
     boost::shared_ptr<Pkt4>
@@ -103,7 +103,7 @@ protected:
 
     /// @brief Stub function that will handle incoming INFORM messages.
     ///
-    /// @param infRequest message received from client
+    /// @param inform message received from client
     boost::shared_ptr<Pkt4> processInform(boost::shared_ptr<Pkt4>& inform);
 
     /// @brief Copies default parameters from client's to server's message

+ 2 - 2
src/lib/asiolink/io_address.cc

@@ -37,7 +37,7 @@ namespace asiolink {
 
 // XXX: we cannot simply construct the address in the initialization list,
 // because we'd like to throw our own exception on failure.
-IOAddress::IOAddress(const string& address_str) {
+IOAddress::IOAddress(const std::string& address_str) {
     asio::error_code err;
     asio_address_ = ip::address::from_string(address_str, err);
     if (err) {
@@ -46,7 +46,7 @@ IOAddress::IOAddress(const string& address_str) {
     }
 }
 
-IOAddress::IOAddress(const ip::address& asio_address) :
+IOAddress::IOAddress(const asio::ip::address& asio_address) :
     asio_address_(asio_address)
 {}
 

+ 3 - 2
src/lib/dhcp/iface_mgr.cc

@@ -30,6 +30,7 @@ using namespace isc::asiolink;
 using namespace isc::dhcp;
 
 namespace isc {
+namespace dhcp {
 
 /// IfaceMgr is a singleton implementation
 IfaceMgr* IfaceMgr::instance_ = 0;
@@ -94,7 +95,7 @@ bool IfaceMgr::Iface::delAddress(const isc::asiolink::IOAddress& addr) {
     return (false);
 }
 
-bool IfaceMgr::Iface::delSocket(uint16_t sockfd) {
+bool IfaceMgr::Iface::delSocket(int sockfd) {
     list<SocketInfo>::iterator sock = sockets_.begin();
     while (sock!=sockets_.end()) {
         if (sock->sockfd_ == sockfd) {
@@ -1034,5 +1035,5 @@ IfaceMgr::getSocket(isc::dhcp::Pkt4 const& pkt) {
 }
 
 
-
+}
 }

+ 4 - 4
src/lib/dhcp/iface_mgr.h

@@ -141,17 +141,17 @@ public:
         /// @brief Adds socket descriptor to an interface.
         ///
         /// @param socket SocketInfo structure that describes socket.
-        void addSocket(const SocketInfo& sock)
-            { sockets_.push_back(sock); }
+        void addSocket(const SocketInfo& socket)
+            { sockets_.push_back(socket); }
 
         /// @brief Closes socket.
         ///
         /// Closes socket and removes corresponding SocketInfo structure
         /// from an interface.
         ///
-        /// @param socket descriptor to be closed/removed.
+        /// @param sockfd descriptor to be closed/removed.
         /// @return true if there was such socket, false otherwise
-        bool delSocket(uint16_t sockfd);
+        bool delSocket(int sockfd);
 
         /// socket used to sending data
         /// TODO: this should be protected

+ 5 - 5
src/lib/dhcp/libdhcp++.h

@@ -68,7 +68,9 @@ public:
     /// in options container.
     ///
     /// @param buf Buffer to be parsed.
+    /// @param buf_len length of the buffer passed in buf.
     /// @param offset Specifies offset for the first option.
+    /// @param parse_len length of buffer to be parsed.
     /// @param options Reference to option container. Options will be
     ///        put here.
     ///
@@ -77,20 +79,18 @@ public:
     static unsigned int
     unpackOptions6(const boost::shared_array<uint8_t> buf, unsigned int buf_len,
                    unsigned int offset, unsigned int parse_len,
-                   isc::dhcp::Option::OptionCollection& options_);
+                   isc::dhcp::Option::OptionCollection& options);
 
-    ///
     /// Registers factory method that produces options of specific option types.
     ///
     /// @param u universe of the option (V4 or V6)
-    /// @param opt_type option-type
+    /// @param type option-type
     /// @param factory function pointer
     ///
     /// @return true, if registration was successful, false otherwise
-    ///
     static bool
     OptionFactoryRegister(Option::Universe u,
-                          unsigned short type,
+                          uint16_t type,
                           Option::Factory * factory);
 protected:
     // pointers to factories that produce DHCPv6 options

+ 8 - 3
src/lib/dhcp/option.cc

@@ -25,9 +25,11 @@
 #include "dhcp/libdhcp++.h"
 
 using namespace std;
-using namespace isc::dhcp;
 using namespace isc::util;
 
+namespace isc {
+namespace dhcp {
+
 Option::Option(Universe u, unsigned short type)
     :universe_(u), type_(type) {
 
@@ -54,8 +56,8 @@ Option::Option(Universe u, unsigned short type, std::vector<uint8_t>& data)
     check();
 }
 
-Option::Option(Universe u, uint16_t type, vector<uint8_t>::const_iterator first,
-               vector<uint8_t>::const_iterator last)
+Option::Option(Universe u, uint16_t type, std::vector<uint8_t>::const_iterator first,
+               std::vector<uint8_t>::const_iterator last)
     :universe_(u), type_(type), data_(std::vector<uint8_t>(first,last)) {
     check();
 }
@@ -344,3 +346,6 @@ void Option::setUint32(uint32_t value) {
 Option::~Option() {
 
 }
+
+} // end of isc::dhcp namespace
+} // end of isc namespace

+ 2 - 0
src/lib/dhcp/option.h

@@ -300,6 +300,7 @@ protected:
     /// @param buf buffer that contains raw buffer to parse (on-wire format)
     /// @param buf_len buffer length (used for buffer overflow checks)
     /// @param offset offset from start of the buf buffer
+    /// @param parse_len number of bytes to be parsed.
     ///
     /// @return offset to the next byte after last parsed byte
     virtual unsigned int
@@ -313,6 +314,7 @@ protected:
     /// @param buf buffer that contains raw buffer to parse (on-wire format)
     /// @param buf_len buffer length (used for buffer overflow checks)
     /// @param offset offset from start of the buf buffer
+    /// @param parse_len number of bytes to be parsed.
     ///
     /// @return offset to the next byte after last parsed byte
     virtual unsigned int

+ 8 - 3
src/lib/dhcp/option4_addrlst.cc

@@ -23,10 +23,12 @@
 #include <dhcp/option4_addrlst.h>
 
 using namespace std;
-using namespace isc::dhcp;
 using namespace isc::util;
 using namespace isc::asiolink;
 
+namespace isc {
+namespace dhcp {
+
 Option4AddrLst::Option4AddrLst(uint8_t type)
     :Option(V4, type) {
 }
@@ -39,8 +41,8 @@ Option4AddrLst::Option4AddrLst(uint8_t type, const AddressContainer& addrs)
 
 
 Option4AddrLst::Option4AddrLst(uint8_t type,
-                               vector<uint8_t>::const_iterator first,
-                               vector<uint8_t>::const_iterator last)
+                               std::vector<uint8_t>::const_iterator first,
+                               std::vector<uint8_t>::const_iterator last)
     :Option(V4, type) {
     if ( (distance(first, last) % V4ADDRESS_LEN) ) {
         isc_throw(OutOfRange, "DHCPv4 Option4AddrLst " << type_
@@ -133,3 +135,6 @@ std::string Option4AddrLst::toText(int indent /* =0 */ ) {
 
     return tmp.str();
 }
+
+} // end of isc::dhcp namespace
+} // end of isc namespace

+ 8 - 3
src/lib/dhcp/option6_ia.cc

@@ -24,14 +24,16 @@
 
 using namespace std;
 using namespace isc;
-using namespace isc::dhcp;
 using namespace isc::util;
 
-Option6IA::Option6IA(unsigned short type, unsigned int iaid)
+namespace isc {
+namespace dhcp {
+
+Option6IA::Option6IA(uint16_t type, uint32_t iaid)
     :Option(Option::V6, type), iaid_(iaid) {
 }
 
-Option6IA::Option6IA(unsigned short type,
+Option6IA::Option6IA(uint16_t type,
                      const boost::shared_array<uint8_t>& buf,
                      unsigned int buf_len,
                      unsigned int offset,
@@ -134,3 +136,6 @@ uint16_t Option6IA::len() {
     }
     return (length);
 }
+
+} // end of isc::dhcp namespace
+} // end of isc namespace

+ 1 - 1
src/lib/dhcp/option6_ia.h

@@ -31,7 +31,7 @@ public:
     ///
     /// @param type option type (usually 4 for IA_NA, 25 for IA_PD)
     /// @param iaid identity association identifier (id of IA)
-    Option6IA(uint16_t type, unsigned int iaid);
+    Option6IA(uint16_t type, uint32_t iaid);
 
     /// @brief ctor, used for received options
     ///

+ 1 - 0
src/lib/dhcp/option6_iaaddr.h

@@ -45,6 +45,7 @@ public:
     ///
     /// @param type option type
     /// @param buf pointer to a buffer
+    /// @param buf_len length of the buffer passed in buf
     /// @param offset offset to first data byte in that buffer
     /// @param len data length of this option
     Option6IAAddr(unsigned short type, boost::shared_array<uint8_t> buf,

+ 7 - 5
src/lib/dhcp/pkt4.h

@@ -240,6 +240,7 @@ public:
     /// Sets sname field
     ///
     /// @param sname value to be set
+    /// @param snameLen length of the buffer passed in sname
     void
     setSname(const uint8_t* sname, size_t snameLen = MAX_SNAME_LEN);
 
@@ -255,6 +256,7 @@ public:
     /// Sets file field
     ///
     /// @param file value to be set
+    /// @param fileLen length of the buffer passed in file
     void
     setFile(const uint8_t* file, size_t fileLen = MAX_FILE_LEN);
 
@@ -266,7 +268,7 @@ public:
     ///
     /// Note: macAddr must be a buffer of at least hlen bytes.
     ///
-    /// @param hwType hardware type (will be sent in htype field)
+    /// @param hType hardware type (will be sent in htype field)
     /// @param hlen hardware length (will be sent in hlen field)
     /// @param macAddr pointer to hardware address
     void setHWAddr(uint8_t hType, uint8_t hlen,
@@ -350,7 +352,7 @@ public:
 
     /// @brief Sets remote address.
     ///
-    /// @params remote specifies remote address
+    /// @param remote specifies remote address
     void setRemoteAddr(const isc::asiolink::IOAddress& remote) {
         remote_addr_ = remote;
     }
@@ -364,7 +366,7 @@ public:
 
     /// @brief Sets local address.
     ///
-    /// @params local specifies local address
+    /// @param local specifies local address
     void setLocalAddr(const isc::asiolink::IOAddress& local) {
         local_addr_ = local;
     }
@@ -378,7 +380,7 @@ public:
 
     /// @brief Sets local port.
     ///
-    /// @params local specifies local port
+    /// @param local specifies local port
     void setLocalPort(uint16_t local) { local_port_ = local; }
 
     /// @brief Returns local port.
@@ -388,7 +390,7 @@ public:
 
     /// @brief Sets remote port.
     ///
-    /// @params remote specifies remote port
+    /// @param remote specifies remote port
     void setRemotePort(uint16_t remote) { remote_port_ = remote; }
 
     /// @brief Returns remote port.

+ 8 - 6
src/lib/dhcp/pkt6.cc

@@ -24,6 +24,7 @@ using namespace std;
 using namespace isc::dhcp;
 
 namespace isc {
+namespace dhcp {
 
 Pkt6::Pkt6(unsigned int dataLen, DHCPv6Proto proto /* = UDP */)
     :data_len_(dataLen),
@@ -43,14 +44,14 @@ Pkt6::Pkt6(unsigned int dataLen, DHCPv6Proto proto /* = UDP */)
 }
 
 Pkt6::Pkt6(uint8_t msg_type,
-           unsigned int transid,
+           uint32_t transid,
            DHCPv6Proto proto /*= UDP*/)
     :local_addr_("::"),
      remote_addr_("::"),
      iface_(""),
      ifindex_(-1),
-     local_port_(-1),
-     remote_port_(-1),
+     local_port_(0),
+     remote_port_(0),
      proto_(proto),
      msg_type_(msg_type),
      transid_(transid) {
@@ -206,7 +207,7 @@ Pkt6::toText() {
 }
 
 boost::shared_ptr<isc::dhcp::Option>
-Pkt6::getOption(unsigned short opt_type) {
+Pkt6::getOption(uint16_t opt_type) {
     isc::dhcp::Option::OptionCollection::const_iterator x = options_.find(opt_type);
     if (x!=options_.end()) {
         return (*x).second;
@@ -220,7 +221,7 @@ Pkt6::addOption(boost::shared_ptr<Option> opt) {
 }
 
 bool
-Pkt6::delOption(unsigned short type) {
+Pkt6::delOption(uint16_t type) {
     isc::dhcp::Option::OptionCollection::iterator x = options_.find(type);
     if (x!=options_.end()) {
         options_.erase(x);
@@ -229,4 +230,5 @@ Pkt6::delOption(unsigned short type) {
     return (false); // can't find option to be deleted
 }
 
-};
+} // end of isc::dhcp namespace
+} // end of isc namespace

+ 12 - 12
src/lib/dhcp/pkt6.h

@@ -41,8 +41,8 @@ public:
     /// @param msg_type type of message (SOLICIT=1, ADVERTISE=2, ...)
     /// @param transid transaction-id
     /// @param proto protocol (TCP or UDP)
-    Pkt6(unsigned char msg_type,
-         unsigned int transid,
+    Pkt6(uint8_t msg_type,
+         uint32_t transid,
          DHCPv6Proto proto = UDP);
 
     /// Constructor, used in message transmission
@@ -106,18 +106,18 @@ public:
     /// Returns message type (e.g. 1 = SOLICIT)
     ///
     /// @return message type
-    unsigned char
+    uint8_t
     getType() { return (msg_type_); }
 
     /// Sets message type (e.g. 1 = SOLICIT)
     ///
     /// @param type message type to be set
-    void setType(unsigned char type) { msg_type_=type; };
+    void setType(uint8_t type) { msg_type_=type; };
 
     /// Returns value of transaction-id field
     ///
     /// @return transaction-id
-    unsigned int getTransid() { return (transid_); };
+    uint32_t getTransid() { return (transid_); };
 
     /// Adds an option to this packet.
     ///
@@ -130,11 +130,11 @@ public:
     /// instances of the same option are allowed (and frequently used).
     /// See getOptions().
     ///
-    /// @param opt_type option type we are looking for
+    /// @param type option type we are looking for
     ///
     /// @return pointer to found option (or NULL)
     boost::shared_ptr<isc::dhcp::Option>
-    getOption(unsigned short type);
+    getOption(uint16_t type);
 
     /// Attempts to delete first suboption of requested type
     ///
@@ -142,7 +142,7 @@ public:
     ///
     /// @return true if option was deleted, false if no such option existed
     bool
-    delOption(unsigned short type);
+    delOption(uint16_t type);
 
     /// TODO need getter/setter wrappers
     ///      and hide following fields as protected
@@ -172,10 +172,10 @@ public:
     int ifindex_;
 
     /// local TDP or UDP port
-    int local_port_;
+    uint16_t local_port_;
 
     /// remote TCP or UDP port
-    int remote_port_;
+    uint16_t remote_port_;
 
     /// TODO Need to implement getOptions() as well
 
@@ -221,10 +221,10 @@ protected:
     DHCPv6Proto proto_;
 
     /// DHCPv6 message type
-    int msg_type_;
+    uint8_t msg_type_;
 
     /// DHCPv6 transaction-id
-    unsigned int transid_;
+    uint32_t transid_;
 }; // Pkt6 class
 
 } // isc::dhcp namespace

+ 2 - 3
src/lib/util/buffer.h

@@ -212,9 +212,8 @@ public:
     /// If specified buffer is too short, it will be expanded
     /// using vector::resize() method.
     ///
-    /// @param Reference to a buffer (data will be stored there).
-    /// @param Size specified number of bytes to read in a vector.
-    ///
+    /// @param data Reference to a buffer (data will be stored there).
+    /// @param len Size specified number of bytes to read in a vector.
     void readVector(std::vector<uint8_t>& data, size_t len)
     {
         if (position_ + len > len_) {