BIND 10 trac1531, updated. 0dc861f4c32cfd154904819d5c4b8dff71fdc47c [1531] Doxygen warnings removed in DHCP code.
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Jan 27 13:34:04 UTC 2012
The branch, trac1531 has been updated
via 0dc861f4c32cfd154904819d5c4b8dff71fdc47c (commit)
from 029db306a1acc7c7856cb9da3e18fda5cdaf630f (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 0dc861f4c32cfd154904819d5c4b8dff71fdc47c
Author: Tomek Mrugalski <tomasz at isc.org>
Date: Fri Jan 27 14:33:35 2012 +0100
[1531] Doxygen warnings removed in DHCP code.
-----------------------------------------------------------------------
Summary of changes:
src/bin/dhcp4/dhcp4_srv.h | 4 ++--
src/lib/asiolink/io_address.cc | 4 ++--
src/lib/dhcp/iface_mgr.cc | 5 +++--
src/lib/dhcp/iface_mgr.h | 8 ++++----
src/lib/dhcp/libdhcp++.h | 10 +++++-----
src/lib/dhcp/option.cc | 11 ++++++++---
src/lib/dhcp/option.h | 2 ++
src/lib/dhcp/option4_addrlst.cc | 11 ++++++++---
src/lib/dhcp/option6_ia.cc | 11 ++++++++---
src/lib/dhcp/option6_ia.h | 2 +-
src/lib/dhcp/option6_iaaddr.h | 1 +
src/lib/dhcp/pkt4.h | 12 +++++++-----
src/lib/dhcp/pkt6.cc | 14 ++++++++------
src/lib/dhcp/pkt6.h | 24 ++++++++++++------------
src/lib/util/buffer.h | 5 ++---
15 files changed, 73 insertions(+), 51 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/dhcp4/dhcp4_srv.h b/src/bin/dhcp4/dhcp4_srv.h
index cd46977..5bcd0d6 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<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
diff --git a/src/lib/asiolink/io_address.cc b/src/lib/asiolink/io_address.cc
index 370e8f5..832452c 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 b704370..d5dd170 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<SocketInfo>::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 5eba76b..5d8bcfe 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 468e6bb..08a0ee4 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<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
diff --git a/src/lib/dhcp/option.cc b/src/lib/dhcp/option.cc
index 23de315..c4ee0da 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<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
diff --git a/src/lib/dhcp/option.h b/src/lib/dhcp/option.h
index d80fc05..8185eef 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 88eb915..f8fb61f 100644
--- a/src/lib/dhcp/option4_addrlst.cc
+++ b/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
diff --git a/src/lib/dhcp/option6_ia.cc b/src/lib/dhcp/option6_ia.cc
index cd55553..54689c5 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<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
diff --git a/src/lib/dhcp/option6_ia.h b/src/lib/dhcp/option6_ia.h
index cab8068..ab518e5 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 40e5967..851f78d 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<uint8_t> buf,
diff --git a/src/lib/dhcp/pkt4.h b/src/lib/dhcp/pkt4.h
index c520747..a43fd57 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 ff27d5e..bf283c0 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<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
diff --git a/src/lib/dhcp/pkt6.h b/src/lib/dhcp/pkt6.h
index 019eeb2..0fe07b2 100644
--- a/src/lib/dhcp/pkt6.h
+++ b/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
diff --git a/src/lib/util/buffer.h b/src/lib/util/buffer.h
index eb90d64..46afc08 100644
--- a/src/lib/util/buffer.h
+++ b/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_) {
More information about the bind10-changes
mailing list