From: Razvan Becheriu Date: Fri, 12 Apr 2019 11:56:14 +0000 (+0300) Subject: minor changes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5258d49d787af2692a4c0681c89a5e9d12e13454;p=thirdparty%2Fkea.git minor changes --- diff --git a/src/bin/dhcp4/ctrl_dhcp4_srv.h b/src/bin/dhcp4/ctrl_dhcp4_srv.h index f05f72481c..8593d53824 100644 --- a/src/bin/dhcp4/ctrl_dhcp4_srv.h +++ b/src/bin/dhcp4/ctrl_dhcp4_srv.h @@ -123,7 +123,6 @@ public: return (server_); } - private: /// @brief Callback that will be called from iface_mgr when data /// is received over control socket. diff --git a/src/bin/dhcp4/dhcp4_srv.h b/src/bin/dhcp4/dhcp4_srv.h index 42321ee048..5584da8087 100644 --- a/src/bin/dhcp4/dhcp4_srv.h +++ b/src/bin/dhcp4/dhcp4_srv.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -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 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 alloc_engine_; /// @brief Holds information about disabled DHCP service and/or /// disabled subnet/network scopes. NetworkStatePtr network_state_; diff --git a/src/bin/dhcp6/ctrl_dhcp6_srv.h b/src/bin/dhcp6/ctrl_dhcp6_srv.h index 7b4f99884e..b180fb871f 100644 --- a/src/bin/dhcp6/ctrl_dhcp6_srv.h +++ b/src/bin/dhcp6/ctrl_dhcp6_srv.h @@ -124,7 +124,6 @@ public: } private: - /// @brief Callback that will be called from iface_mgr when data /// is received over control socket. /// diff --git a/src/bin/dhcp6/dhcp6_srv.h b/src/bin/dhcp6/dhcp6_srv.h index 1ebd0b94ff..ab0bfd1e0b 100644 --- a/src/bin/dhcp6/dhcp6_srv.h +++ b/src/bin/dhcp6/dhcp6_srv.h @@ -8,14 +8,14 @@ #define DHCPV6_SRV_H #include -#include #include +#include #include #include #include #include -#include -#include +#include +#include #include #include #include @@ -27,6 +27,8 @@ #include #include +#include + #include #include #include @@ -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. ///