]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
minor changes
authorRazvan Becheriu <razvan@isc.org>
Fri, 12 Apr 2019 11:56:14 +0000 (14:56 +0300)
committerRazvan Becheriu <razvan@isc.org>
Fri, 12 Apr 2019 12:26:28 +0000 (15:26 +0300)
src/bin/dhcp4/ctrl_dhcp4_srv.h
src/bin/dhcp4/dhcp4_srv.h
src/bin/dhcp6/ctrl_dhcp6_srv.h
src/bin/dhcp6/dhcp6_srv.h

index f05f72481c98401b3b58313064be5fecba7f7215..8593d53824911954aa835bc952dd90a86afd3009 100644 (file)
@@ -123,7 +123,6 @@ public:
         return (server_);
     }
 
-
 private:
     /// @brief Callback that will be called from iface_mgr when data
     /// is received over control socket.
index 42321ee04879ee9c103e9e025a63115a3d85115a..5584da80875df83916a79742023cd836c1e70457 100644 (file)
@@ -20,6 +20,7 @@
 #include <dhcpsrv/cb_ctl_dhcp4.h>
 #include <dhcpsrv/cfg_option.h>
 #include <dhcpsrv/callout_handle_store.h>
+#include <dhcpsrv/cfg_option.h>
 #include <dhcpsrv/d2_client_mgr.h>
 #include <dhcpsrv/network_state.h>
 #include <dhcpsrv/subnet.h>
@@ -202,7 +203,6 @@ private:
     asiolink::IOServicePtr io_service_;
 
 public:
-
     /// @brief defines if certain option may, must or must not appear
     typedef enum {
         FORBIDDEN,
@@ -380,7 +380,9 @@ public:
                                       NameChangeSender::Result result,
                                       dhcp_ddns::NameChangeRequestPtr& ncr);
 
-    /// @brief Discard all in-progress packets
+    /// @brief Discards cached and parked packets
+    /// Clears the call_handle store and packet parking lots
+    /// of all packets.  Called during reconfigure and shutdown.
     void discardPackets();
 
 protected:
@@ -929,7 +931,6 @@ protected:
     void classifyPacket(const Pkt4Ptr& pkt);
 
 public:
-
     /// @brief Evaluate classes.
     ///
     /// @note Second part of the classification.
@@ -982,11 +983,6 @@ protected:
     void processPacketBufferSend(hooks::CalloutHandlePtr& callout_handle,
                                  Pkt4Ptr& rsp);
 
-    /// @brief Allocation Engine.
-    /// Pointer to the allocation engine that we are currently using
-    /// It must be a pointer, because we will support changing engines
-    /// during normal operation (e.g. to use different allocators)
-    boost::shared_ptr<AllocEngine> alloc_engine_;
 
 private:
 
@@ -1016,6 +1012,11 @@ protected:
     /// UDP port number to which server sends responses.
     uint16_t client_port_;
 
+    /// @brief Allocation Engine.
+    /// Pointer to the allocation engine that we are currently using
+    /// It must be a pointer, because we will support changing engines
+    /// during normal operation (e.g. to use different allocators)
+    boost::shared_ptr<AllocEngine> alloc_engine_;
     /// @brief Holds information about disabled DHCP service and/or
     /// disabled subnet/network scopes.
     NetworkStatePtr network_state_;
index 7b4f99884ea0d140ac60a0bb9d78adbc72ca19ca..b180fb871fc6c828794afcbf1045c7b7842a7b2e 100644 (file)
@@ -124,7 +124,6 @@ public:
     }
 
 private:
-
     /// @brief Callback that will be called from iface_mgr when data
     /// is received over control socket.
     ///
index 1ebd0b94ff66d3eafe236d6e90f138a09e67e0d0..ab0bfd1e0b5dd785caf84aa6c3e7ce508113c948 100644 (file)
@@ -8,14 +8,14 @@
 #define DHCPV6_SRV_H
 
 #include <asiolink/io_service.h>
-#include <dhcp_ddns/ncr_msg.h>
 #include <dhcp/dhcp6.h>
+#include <dhcp/pkt6.h>
 #include <dhcp/duid.h>
 #include <dhcp/option.h>
 #include <dhcp/option6_client_fqdn.h>
 #include <dhcp/option6_ia.h>
-#include <dhcp/option_definition.h>
-#include <dhcp/pkt6.h>
+#include <dhcp/option_custom.h>
+#include <dhcp_ddns/ncr_msg.h>
 #include <dhcpsrv/thread_pool.h>
 #include <dhcpsrv/alloc_engine.h>
 #include <dhcpsrv/callout_handle_store.h>
@@ -27,6 +27,8 @@
 #include <hooks/callout_handle.h>
 #include <process/daemon.h>
 
+#include <boost/noncopyable.hpp>
+
 #include <functional>
 #include <iostream>
 #include <queue>
@@ -60,6 +62,10 @@ public:
 /// that is going to be used as server-identifier, receives incoming
 /// packets, processes them, manages leases assignment and generates
 /// appropriate responses.
+///
+/// This class does not support any controlling mechanisms directly.
+/// See the derived \ref ControlledDhcpv6Srv class for support for
+/// command and configuration updates over msgq.
 class Dhcpv6Srv : public process::Daemon {
 private:
 
@@ -82,10 +88,13 @@ public:
     /// Instantiates necessary services, required to run DHCPv6 server.
     /// In particular, creates IfaceMgr that will be responsible for
     /// network interaction. Will instantiate lease manager, and load
-    /// old or create new DUID.
+    /// old or create new DUID. It is possible to specify alternate
+    /// port on which DHCPv6 server will listen on and alternate port
+    /// where DHCPv6 server sends all responses to. Those are mostly useful
+    /// for testing purposes.
     ///
-    /// @param server_port port on which all sockets will listen
-    /// @param client_port port to which all responses will be sent
+    /// @param server_port specifies port number to listen on
+    /// @param client_port specifies port number to send to
     /// @param run_multithreaded enables or disables multithreaded mode
     Dhcpv6Srv(uint16_t server_port = DHCP6_SERVER_PORT,
               uint16_t client_port = 0,
@@ -181,6 +190,11 @@ public:
     /// @brief Instructs the server to shut down.
     void shutdown();
 
+    ///
+    /// @name Public accessors returning values required to (re)open sockets.
+    ///
+    //@{
+    ///
     /// @brief Get UDP port on which server should listen.
     ///
     /// Typically, server listens on UDP port 547. Other ports are only
@@ -190,6 +204,7 @@ public:
     uint16_t getServerPort() const {
         return (server_port_);
     }
+    //@}
 
     /// @brief Starts DHCP_DDNS client IO if DDNS updates are enabled.
     ///
@@ -753,6 +768,7 @@ protected:
     /// @param pkt packet to be classified
     void classifyPacket(const Pkt6Ptr& pkt);
 
+public:
     /// @brief Evaluate classes.
     ///
     /// @note Second part of the classification.
@@ -763,7 +779,7 @@ protected:
     /// @param pkt packet to be classified.
     /// @param depend_on_known if false classes depending on the KNOWN or
     /// UNKNOWN classes are skipped, if true only these classes are evaluated.
-    void evaluateClasses(const Pkt6Ptr& pkt, bool depend_on_known);
+    static void evaluateClasses(const Pkt6Ptr& pkt, bool depend_on_known);
 
     /// @brief Assigns classes retrieved from host reservation database.
     ///