Browse Source

[1186] doxygen comments cleanup.

Tomek Mrugalski 13 years ago
parent
commit
566e635f4f
2 changed files with 15 additions and 39 deletions
  1. 2 32
      src/bin/dhcp6/iface_mgr.cc
  2. 13 7
      src/bin/dhcp6/iface_mgr.h

+ 2 - 32
src/bin/dhcp6/iface_mgr.cc

@@ -29,7 +29,7 @@ using namespace isc::dhcp;
 
 namespace isc {
 
-// IfaceMgr is a singleton implementation
+/// IfaceMgr is a singleton implementation
 IfaceMgr* IfaceMgr::instance_ = 0;
 
 void
@@ -313,15 +313,6 @@ IfaceMgr::openSocket(const std::string& ifname,
     return (sock);
 }
 
-/**
- * joins multicast group
- *
- * @param sock socket file descriptor
- * @param ifname name of the interface (DHCPv6 uses link-scoped mc groups)
- * @param mcast multicast address to join (string)
- *
- * @return true if joined successfully, false otherwise
- */
 bool
 IfaceMgr::joinMcast(int sock, const std::string& ifname,
 const std::string & mcast) {
@@ -347,19 +338,8 @@ const std::string & mcast) {
     return (true);
 }
 
-/**
- * Sends UDP packet over IPv6.
- *
- * All parameters for actual transmission are specified in
- * Pkt6 structure itself. That includes destination address,
- * src/dst port and interface over which data will be sent.
- *
- * @param pkt A packet object that is going to be sent.
- *
- * @return True, if transmission was successful. False otherwise.
- */
 bool
-IfaceMgr::send(boost::shared_ptr<Pkt6> pkt) {
+IfaceMgr::send(boost::shared_ptr<Pkt6>& pkt) {
     struct msghdr m;
     struct iovec v;
     int result;
@@ -431,16 +411,6 @@ IfaceMgr::send(boost::shared_ptr<Pkt6> pkt) {
     return (result);
 }
 
-
-/**
- * Attempts to receive UDP/IPv6 packet over open sockets.
- *
- * TODO Start using select() and add timeout to be able
- * to not wait infinitely, but rather do something useful
- * (e.g. remove expired leases)
- *
- * @return Object prepresenting received packet.
- */
 boost::shared_ptr<Pkt6>
 IfaceMgr::receive() {
     struct msghdr m;

+ 13 - 7
src/bin/dhcp6/iface_mgr.h

@@ -17,6 +17,7 @@
 
 #include <list>
 #include <boost/shared_ptr.hpp>
+#include <boost/scoped_array.hpp>
 #include <boost/noncopyable.hpp>
 #include "asiolink/io_address.h"
 #include "dhcp/pkt6.h"
@@ -116,15 +117,15 @@ public:
 
     /// @brief Sends a packet.
     ///
-    /// Sends a packet. All parameters regarding interface, destination
-    /// address are set in pkt object.
+    /// Sends a packet. All parameters for actual transmission are specified in
+    /// Pkt6 structure itself. That includes destination address, src/dst port
+    /// and interface over which data will be sent.
     ///
     /// @param pkt packet to be sent
     ///
     /// @return true if sending was successful
-    ///
     bool
-    send(boost::shared_ptr<Pkt6> pkt);
+    send(boost::shared_ptr<Pkt6>& pkt);
 
     /// @brief Tries to receive packet over open sockets.
     ///
@@ -132,8 +133,11 @@ public:
     /// If reception is successful and all information about its sender
     /// are obtained, Pkt6 object is created and returned.
     ///
-    /// @return Pkt6 object representing received packet (or NULL)
+    /// TODO Start using select() and add timeout to be able
+    /// to not wait infinitely, but rather do something useful
+    /// (e.g. remove expired leases)
     ///
+    /// @return Pkt6 object representing received packet (or NULL)
     boost::shared_ptr<Pkt6> receive();
 
     // don't use private, we need derived classes in tests
@@ -186,10 +190,12 @@ protected:
     // is bound to multicast address. And we all know what happens
     // to people who try to use multicast as source address.
 
-    /// control-buffer, used in transmission and reception
-    char * control_buf_;
+    /// length of the control_buf_ array
     int control_buf_len_;
 
+    /// control-buffer, used in transmission and reception
+    boost::scoped_array<char> control_buf_;
+
 private:
     /// Opens sockets on detected interfaces.
     bool