]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3736] Removed a bunch of unused functions.
authorMarcin Siodelski <marcin@isc.org>
Thu, 12 Mar 2015 11:01:16 +0000 (12:01 +0100)
committerMarcin Siodelski <marcin@isc.org>
Thu, 12 Mar 2015 11:01:16 +0000 (12:01 +0100)
17 files changed:
src/bin/dhcp4/dhcp4_srv.cc
src/bin/dhcp4/dhcp4_srv.h
src/bin/dhcp4/json_config_parser.cc
src/bin/dhcp4/tests/dhcp4_srv_unittest.cc
src/bin/dhcp4/tests/fqdn_unittest.cc
src/bin/dhcp6/dhcp6_srv.cc
src/bin/dhcp6/dhcp6_srv.h
src/bin/dhcp6/json_config_parser.cc
src/lib/dhcp/iface_mgr.h
src/lib/dhcp/iface_mgr_bsd.cc
src/lib/dhcp/iface_mgr_linux.cc
src/lib/dhcp/iface_mgr_sun.cc
src/lib/dhcpsrv/parsers/dhcp_parsers.h
src/lib/dhcpsrv/tests/d2_udp_unittest.cc
src/lib/log/tests/logger_manager_unittest.cc
src/lib/util/signal_set.cc
src/lib/util/signal_set.h

index beadeda68e48ab30339fbebe23bc2eccc37e79ed..47909f87c581e060a1b2f1dbe3375d8c3279b297 100644 (file)
@@ -1960,12 +1960,6 @@ Dhcpv4Srv::unpackOptions(const OptionBuffer& buf,
     return (offset);
 }
 
-void
-Dhcpv4Srv::ifaceMgrSocket4ErrorHandler(const std::string& errmsg) {
-    // Log the reason for socket opening failure and return.
-    LOG_WARN(dhcp4_logger, DHCP4_OPEN_SOCKET_FAIL).arg(errmsg);
-}
-
 void Dhcpv4Srv::classifyPacket(const Pkt4Ptr& pkt) {
     boost::shared_ptr<OptionString> vendor_class =
         boost::dynamic_pointer_cast<OptionString>(pkt->getOption(DHO_VENDOR_CLASS_IDENTIFIER));
index 67da6369136b84f102fdd68f78335734e2afc095..6623aae5723c7539b5e43f69ba65aa60e10be56c 100644 (file)
@@ -676,15 +676,6 @@ private:
     /// @return Option that contains netmask information
     static OptionPtr getNetmaskOption(const Subnet4Ptr& subnet);
 
-    /// @brief Implements the error handler for socket open failure.
-    ///
-    /// This callback function is installed on the @c isc::dhcp::IfaceMgr
-    /// when IPv4 sockets are being open. When socket fails to open for
-    /// any reason, this function is called. It simply logs the error message.
-    ///
-    /// @param errmsg An error message containing a cause of the failure.
-    static void ifaceMgrSocket4ErrorHandler(const std::string& errmsg);
-
     /// @brief Allocation Engine.
     /// Pointer to the allocation engine that we are currently using
     /// It must be a pointer, because we will support changing engines
index 278d8bcf90f7366c2954d7119c202d843d481856..a3a28c0b1b1963bdc17bb2ab21ac493327ef9b83 100644 (file)
@@ -199,26 +199,6 @@ protected:
         return (parser);
     }
 
-    /// @brief Determines if the given option space name and code describe
-    /// a standard option for the DHCP4 server.
-    ///
-    /// @param option_space is the name of the option space to consider
-    /// @param code is the numeric option code to consider
-    /// @return returns true if the space and code are part of the server's
-    /// standard options.
-    bool isServerStdOption(std::string option_space, uint32_t code) {
-        return ((option_space.compare("dhcp4") == 0)
-                && LibDHCP::isStandardOption(Option::V4, code));
-    }
-
-    /// @brief Returns the option definition for a given option code from
-    /// the DHCP4 server's standard set of options.
-    /// @param code is the numeric option code of the desired option definition.
-    /// @return returns a pointer the option definition
-    OptionDefinitionPtr getServerStdOptionDefinition (uint32_t code) {
-        return (LibDHCP::getOptionDef(Option::V4, code));
-    }
-
     /// @brief Issues a DHCP4 server specific warning regarding duplicate subnet
     /// options.
     ///
index 6344774e049d4619c8bf784177f55c99041671e2..bdceb0f35481cf6348f55a5c57022c8aaabfb0cf 100644 (file)
@@ -1815,22 +1815,6 @@ public:
         return buffer4_receive_callout(callout_handle);
     }
 
-    /// Test callback that deletes MAC address
-    /// @param callout_handle handle passed by the hooks framework
-    /// @return always 0
-    static int
-    buffer4_receive_delete_hwaddr(CalloutHandle& callout_handle) {
-
-        Pkt4Ptr pkt;
-        callout_handle.getArgument("query4", pkt);
-
-        pkt->data_[2] = 0; // offset 2 is hlen, let's set it to zero
-        memset(&pkt->data_[28], 0, Pkt4::MAX_CHADDR_LEN); // Clear CHADDR content
-
-        // carry on as usual
-        return buffer4_receive_callout(callout_handle);
-    }
-
     /// Test callback that sets skip flag
     /// @param callout_handle handle passed by the hooks framework
     /// @return always 0
index 3f3d78e571ad9c5b127ba75d6018b5a825664601..d143b378b202ffb1df4810aa7dc0c9f6b00e1d4b 100644 (file)
@@ -291,37 +291,6 @@ public:
 
     }
 
-    // Test that the client message holding an FQDN is processed and
-    // that the response packet is as expected.
-    void testProcessMessageWithFqdn(const uint8_t msg_type,
-                            const std::string& hostname) {
-        Pkt4Ptr req = generatePktWithFqdn(msg_type, Option4ClientFqdn::FLAG_S |
-                                          Option4ClientFqdn::FLAG_E, hostname,
-                                          Option4ClientFqdn::FULL, true);
-        Pkt4Ptr reply;
-        if (msg_type == DHCPDISCOVER) {
-            ASSERT_NO_THROW(reply = srv_->processDiscover(req));
-
-        } else if (msg_type == DHCPREQUEST) {
-            ASSERT_NO_THROW(reply = srv_->processRequest(req));
-
-        } else if (msg_type == DHCPRELEASE) {
-            ASSERT_NO_THROW(srv_->processRelease(req));
-            return;
-
-        } else {
-            return;
-        }
-
-        if (msg_type == DHCPDISCOVER) {
-            checkResponse(reply, DHCPOFFER, 1234);
-
-        } else {
-            checkResponse(reply, DHCPACK, 1234);
-        }
-
-    }
-
     // Verify that NameChangeRequest holds valid values.
     void verifyNameChangeRequest(const isc::dhcp_ddns::NameChangeType type,
                                  const bool reverse, const bool forward,
index 3483808e45548d86c1155dfd6e861d4c546bb128..45481a237e17c3990d433da3464dbf84559626b0 100644 (file)
@@ -2582,12 +2582,6 @@ Dhcpv6Srv::unpackOptions(const OptionBuffer& buf,
     return (offset);
 }
 
-void
-Dhcpv6Srv::ifaceMgrSocket6ErrorHandler(const std::string& errmsg) {
-    // Log the reason for socket opening failure and return.
-    LOG_WARN(dhcp6_logger, DHCP6_OPEN_SOCKET_FAIL).arg(errmsg);
-}
-
 void Dhcpv6Srv::classifyPacket(const Pkt6Ptr& pkt) {
     OptionVendorClassPtr vclass = boost::dynamic_pointer_cast<
         OptionVendorClass>(pkt->getOption(D6O_VENDOR_CLASS));
index 2f294de5bd78f201643b9e6b380232ba148be2b8..fd90aea6d4c41468897c65b9e0448f0a9064a192 100644 (file)
@@ -616,15 +616,6 @@ protected:
 
 private:
 
-    /// @brief Implements the error handler for socket open failure.
-    ///
-    /// This callback function is installed on the @c isc::dhcp::IfaceMgr
-    /// when IPv6 sockets are being open. When socket fails to open for
-    /// any reason, this function is called. It simply logs the error message.
-    ///
-    /// @param errmsg An error message containing a cause of the failure.
-    static void ifaceMgrSocket6ErrorHandler(const std::string& errmsg);
-
     /// @brief Generate FQDN to be sent to a client if none exists.
     ///
     /// This function is meant to be called by the functions which process
index 708a45c94492975827d12a21e4193f30f6bc1f85..b170b534b131621d1abfb41060014249baaa4364 100644 (file)
@@ -408,27 +408,6 @@ protected:
         return (parser);
     }
 
-
-    /// @brief Determines if the given option space name and code describe
-    /// a standard option for the DHCP6 server.
-    ///
-    /// @param option_space is the name of the option space to consider
-    /// @param code is the numeric option code to consider
-    /// @return returns true if the space and code are part of the server's
-    /// standard options.
-    bool isServerStdOption(std::string option_space, uint32_t code) {
-        return ((option_space.compare("dhcp6") == 0)
-                && LibDHCP::isStandardOption(Option::V6, code));
-    }
-
-    /// @brief Returns the option definition for a given option code from
-    /// the DHCP6 server's standard set of options.
-    /// @param code is the numeric option code of the desired option definition.
-    /// @return returns a pointer the option definition
-    OptionDefinitionPtr getServerStdOptionDefinition (uint32_t code) {
-        return (LibDHCP::getOptionDef(Option::V6, code));
-    }
-
     /// @brief Issues a DHCP6 server specific warning regarding duplicate subnet
     /// options.
     ///
index 2627468d8b1e7bf7e23595baab6761800a263dc7..74d66f3e152c4dbad5cd4bf9b3b21eebf7a6d660 100644 (file)
@@ -1132,23 +1132,6 @@ protected:
     /// Control-buffer, used in transmission and reception.
     boost::scoped_array<char> control_buf_;
 
-    /// @brief A wrapper for OS-specific operations before sending IPv4 packet
-    ///
-    /// @param m message header (will be later used for sendmsg() call)
-    /// @param control_buf buffer to be used during transmission
-    /// @param control_buf_len buffer length
-    /// @param pkt packet to be sent
-    void os_send4(struct msghdr& m, boost::scoped_array<char>& control_buf,
-                  size_t control_buf_len, const Pkt4Ptr& pkt);
-
-    /// @brief OS-specific operations during IPv4 packet reception
-    ///
-    /// @param m message header (was used during recvmsg() call)
-    /// @param pkt packet received (some fields will be set here)
-    ///
-    /// @return true if successful, false otherwise
-    bool os_receive4(struct msghdr& m, Pkt4Ptr& pkt);
-
 private:
     /// @brief Identifies local network address to be used to
     /// connect to remote address.
index 35cd5035556fd9d14773ca787fbce66ec33f19f6..10b7e3c8bb5a9443662895d29bb2f26c97b45022 100644 (file)
@@ -129,21 +129,6 @@ void Iface::setFlags(uint64_t flags) {
     flag_broadcast_ = flags & IFF_BROADCAST;
 }
 
-void IfaceMgr::os_send4(struct msghdr& /*m*/,
-                        boost::scoped_array<char>& /*control_buf*/,
-                        size_t /*control_buf_len*/,
-                        const Pkt4Ptr& /*pkt*/) {
-  // @todo: Are there any specific actions required before sending IPv4 packet
-  // on BSDs? See iface_mgr_linux.cc for working Linux implementation.
-}
-
-bool IfaceMgr::os_receive4(struct msghdr& /*m*/, Pkt4Ptr& /*pkt*/) {
-  // @todo: Are there any specific actions required before receiving IPv4 packet
-  // on BSDs? See iface_mgr_linux.cc for working Linux implementation.
-
-  return (true); // pretend that we have everything set up for reception.
-}
-
 void
 IfaceMgr::setMatchingPacketFilter(const bool direct_response_desired) {
     // If direct response is desired we have to use BPF. If the direct
index b4b81c80f9acad714aa2cfcb8fa2ba91a88c71f8..783c675beef28fba47c297a4d34bd6a5c60614b2 100644 (file)
@@ -524,16 +524,6 @@ IfaceMgr::setMatchingPacketFilter(const bool direct_response_desired) {
     }
 }
 
-void IfaceMgr::os_send4(struct msghdr&, boost::scoped_array<char>&,
-                        size_t, const Pkt4Ptr&) {
-    return;
-
-}
-
-bool IfaceMgr::os_receive4(struct msghdr&, Pkt4Ptr&) {
-    return (true);
-}
-
 bool
 IfaceMgr::openMulticastSocket(Iface& iface,
                               const isc::asiolink::IOAddress& addr,
index ff30cfeb6681e926d962d8b03dccca73219dfe57..8a5c34e35449b0830be5086b4d2914fe59726238 100644 (file)
@@ -131,22 +131,6 @@ void Iface::setFlags(uint64_t flags) {
     flag_broadcast_ = flags & IFF_BROADCAST;
 }
 
-void IfaceMgr::os_send4(struct msghdr& /*m*/,
-                        boost::scoped_array<char>& /*control_buf*/,
-                        size_t /*control_buf_len*/,
-                        const Pkt4Ptr& /*pkt*/) {
-  // @todo: Are there any specific actions required before sending IPv4 packet
-  // on Solaris based systems? See iface_mgr_linux.cc
-  // for working Linux implementation.
-}
-
-bool IfaceMgr::os_receive4(struct msghdr& /*m*/, Pkt4Ptr& /*pkt*/) {
-  // @todo: Are there any specific actions required before receiving IPv4 packet
-  // on BSDs? See iface_mgr_linux.cc for working Linux implementation.
-
-  return (true); // pretend that we have everything set up for reception.
-}
-
 void
 IfaceMgr::setMatchingPacketFilter(const bool /* direct_response_desired */) {
     // @todo Currently we ignore the preference to use direct traffic
index 7fc0c078177a111463883cd169bf169cc40e100b..8d3b89be915a763e67af7b145e4844bb097be64a 100644 (file)
@@ -996,22 +996,6 @@ protected:
     virtual DhcpConfigParser* createSubnetConfigParser(
                                             const std::string& config_id) = 0;
 
-    /// @brief Determines if the given option space name and code describe
-    /// a standard option for the  server.
-    ///
-    /// @param option_space is the name of the option space to consider
-    /// @param code is the numeric option code to consider
-    /// @return returns true if the space and code are part of the server's
-    /// standard options.
-    virtual bool isServerStdOption(std::string option_space, uint32_t code) = 0;
-
-    /// @brief Returns the option definition for a given option code from
-    /// the server's standard set of options.
-    /// @param code is the numeric option code of the desired option definition.
-    /// @return returns a pointer the option definition
-    virtual OptionDefinitionPtr getServerStdOptionDefinition (
-                                                             uint32_t code) = 0;
-
     /// @brief Issues a server specific warning regarding duplicate subnet
     /// options.
     ///
index 3a1ba1defb7021f1f1ca7649724e0c817e687579..93fea40b056ac082659a3fce02fc625976b4ce91 100644 (file)
@@ -62,14 +62,6 @@ public:
     virtual ~D2ClientMgrTest(){
     }
 
-    /// @brief Updates the D2ClientMgr's configuration to DDNS disabled.
-    void disableDdns() {
-        D2ClientConfigPtr new_cfg;
-        ASSERT_NO_THROW(new_cfg.reset(new D2ClientConfig()));
-        ASSERT_NO_THROW(setD2ClientConfig(new_cfg));
-        ASSERT_FALSE(ddnsEnabled());
-    }
-
     /// @brief Updates the D2ClientMgr's configuration to DDNS enabled.
     ///
     /// @param server_address IP address of kea-dhcp-ddns.
index 1b6e2da965ec7ce55f1672c86f96d122491ac4ed..660f6fd40b0d1e0fd98a2a25e008aae9a2db916a 100644 (file)
@@ -64,7 +64,7 @@ class SpecificationForFileLogger {
 public:
 
     // Constructor - allocate file and create the specification object
-    SpecificationForFileLogger() : spec_(), name_(createTempFileName()),
+    SpecificationForFileLogger() : spec_(), name_(createTempFilename()),
                                    logname_("filelogger") {
 
         // Set the output to a temporary file.
index 76229d61fa9b42e4df181d3539bc90ab8fd33faf..e863a6182c8b1deabf164bbeb39568488dd79a54 100644 (file)
@@ -184,6 +184,11 @@ SignalSet::add(const int sig) {
     }
 }
 
+void
+SignalSet::block() const {
+    maskSignals(SIG_BLOCK);
+}
+
 void
 SignalSet::clear() {
     // Iterate over a copy of the registered signal set because the
@@ -297,6 +302,12 @@ SignalSet::remove(const int sig) {
     }
 }
 
+void
+SignalSet::unblock() const {
+    maskSignals(SIG_UNBLOCK);
+}
+
+
 void
 SignalSet::setOnReceiptHandler(BoolSignalHandler handler) {
     onreceipt_handler_ = handler;
index 816a1a638fa53a9096ff395885b24d9cd64c5083..bba826cc75e5111adf6ab7f42f1fbbb131dae169 100644 (file)
@@ -197,9 +197,7 @@ private:
     ///
     /// This function blocks the signals in a set to prevent race condition
     /// between the signal handler and the new signal coming in.
-    void block() const {
-        maskSignals(SIG_BLOCK);
-    }
+    void block() const;
 
     /// @brief Removes the signal from the set.
     ///
@@ -235,9 +233,7 @@ private:
     /// @brief Unblocks signals in the set.
     ///
     /// This function unblocks the signals in a set.
-    void unblock() const {
-        maskSignals(SIG_UNBLOCK);
-    }
+    void unblock() const;
 
     /// @brief Stores the set of signals registered in this signal set.
     std::set<int> local_signals_;