Browse Source

[3736] Removed a bunch of unused functions.

Marcin Siodelski 10 years ago
parent
commit
6ed885b735

+ 0 - 6
src/bin/dhcp4/dhcp4_srv.cc

@@ -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));

+ 0 - 9
src/bin/dhcp4/dhcp4_srv.h

@@ -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

+ 0 - 20
src/bin/dhcp4/json_config_parser.cc

@@ -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.
     ///

+ 0 - 16
src/bin/dhcp4/tests/dhcp4_srv_unittest.cc

@@ -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

+ 0 - 31
src/bin/dhcp4/tests/fqdn_unittest.cc

@@ -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,

+ 0 - 6
src/bin/dhcp6/dhcp6_srv.cc

@@ -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));

+ 0 - 9
src/bin/dhcp6/dhcp6_srv.h

@@ -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

+ 0 - 21
src/bin/dhcp6/json_config_parser.cc

@@ -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.
     ///

+ 0 - 17
src/lib/dhcp/iface_mgr.h

@@ -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.

+ 0 - 15
src/lib/dhcp/iface_mgr_bsd.cc

@@ -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

+ 0 - 10
src/lib/dhcp/iface_mgr_linux.cc

@@ -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,

+ 0 - 16
src/lib/dhcp/iface_mgr_sun.cc

@@ -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

+ 0 - 16
src/lib/dhcpsrv/parsers/dhcp_parsers.h

@@ -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.
     ///

+ 0 - 8
src/lib/dhcpsrv/tests/d2_udp_unittest.cc

@@ -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.

+ 1 - 1
src/lib/log/tests/logger_manager_unittest.cc

@@ -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.

+ 11 - 0
src/lib/util/signal_set.cc

@@ -185,6 +185,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
     // remove function is erasing the elements and we don't want to
@@ -298,6 +303,12 @@ SignalSet::remove(const int sig) {
 }
 
 void
+SignalSet::unblock() const {
+    maskSignals(SIG_UNBLOCK);
+}
+
+
+void
 SignalSet::setOnReceiptHandler(BoolSignalHandler handler) {
     onreceipt_handler_ = handler;
 }

+ 2 - 6
src/lib/util/signal_set.h

@@ -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_;