From: Tomek Mrugalski Date: Fri, 27 Jan 2012 13:33:35 +0000 (+0100) Subject: [1531] Doxygen warnings removed in DHCP code. X-Git-Tag: trac2351_base~226^2~158^2~11^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0dc861f4c32cfd154904819d5c4b8dff71fdc47c;p=thirdparty%2Fkea.git [1531] Doxygen warnings removed in DHCP code. --- diff --git a/src/bin/dhcp4/dhcp4_srv.h b/src/bin/dhcp4/dhcp4_srv.h index cd4697765a..5bcd0d6b47 100644 --- a/src/bin/dhcp4/dhcp4_srv.h +++ b/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 @@ -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 processInform(boost::shared_ptr& inform); /// @brief Copies default parameters from client's to server's message diff --git a/src/lib/asiolink/io_address.cc b/src/lib/asiolink/io_address.cc index 370e8f5af7..832452cfb7 100644 --- a/src/lib/asiolink/io_address.cc +++ b/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) {} diff --git a/src/lib/dhcp/iface_mgr.cc b/src/lib/dhcp/iface_mgr.cc index b704370c90..d5dd1702f5 100644 --- a/src/lib/dhcp/iface_mgr.cc +++ b/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::iterator sock = sockets_.begin(); while (sock!=sockets_.end()) { if (sock->sockfd_ == sockfd) { @@ -1034,5 +1035,5 @@ IfaceMgr::getSocket(isc::dhcp::Pkt4 const& pkt) { } - +} } diff --git a/src/lib/dhcp/iface_mgr.h b/src/lib/dhcp/iface_mgr.h index 5eba76b0da..5d8bcfec06 100644 --- a/src/lib/dhcp/iface_mgr.h +++ b/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 diff --git a/src/lib/dhcp/libdhcp++.h b/src/lib/dhcp/libdhcp++.h index 468e6bbf81..08a0ee47c4 100644 --- a/src/lib/dhcp/libdhcp++.h +++ b/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 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 diff --git a/src/lib/dhcp/option.cc b/src/lib/dhcp/option.cc index 23de31548e..c4ee0da0ef 100644 --- a/src/lib/dhcp/option.cc +++ b/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& data) check(); } -Option::Option(Universe u, uint16_t type, vector::const_iterator first, - vector::const_iterator last) +Option::Option(Universe u, uint16_t type, std::vector::const_iterator first, + std::vector::const_iterator last) :universe_(u), type_(type), data_(std::vector(first,last)) { check(); } @@ -344,3 +346,6 @@ void Option::setUint32(uint32_t value) { Option::~Option() { } + +} // end of isc::dhcp namespace +} // end of isc namespace diff --git a/src/lib/dhcp/option.h b/src/lib/dhcp/option.h index d80fc05730..8185eef505 100644 --- a/src/lib/dhcp/option.h +++ b/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 diff --git a/src/lib/dhcp/option4_addrlst.cc b/src/lib/dhcp/option4_addrlst.cc index 88eb915427..f8fb61fb3e 100644 --- a/src/lib/dhcp/option4_addrlst.cc +++ b/src/lib/dhcp/option4_addrlst.cc @@ -23,10 +23,12 @@ #include 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::const_iterator first, - vector::const_iterator last) + std::vector::const_iterator first, + std::vector::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 diff --git a/src/lib/dhcp/option6_ia.cc b/src/lib/dhcp/option6_ia.cc index cd55553716..54689c5390 100644 --- a/src/lib/dhcp/option6_ia.cc +++ b/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& 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 diff --git a/src/lib/dhcp/option6_ia.h b/src/lib/dhcp/option6_ia.h index cab806819c..ab518e503f 100644 --- a/src/lib/dhcp/option6_ia.h +++ b/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 /// diff --git a/src/lib/dhcp/option6_iaaddr.h b/src/lib/dhcp/option6_iaaddr.h index 40e5967eb1..851f78d51c 100644 --- a/src/lib/dhcp/option6_iaaddr.h +++ b/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 buf, diff --git a/src/lib/dhcp/pkt4.h b/src/lib/dhcp/pkt4.h index c52074704b..a43fd576bf 100644 --- a/src/lib/dhcp/pkt4.h +++ b/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. diff --git a/src/lib/dhcp/pkt6.cc b/src/lib/dhcp/pkt6.cc index ff27d5e991..bf283c0a20 100644 --- a/src/lib/dhcp/pkt6.cc +++ b/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 -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