]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5332] Removed unused messages and some cleanup
authorThomas Markwalder <tmark@isc.org>
Fri, 22 Sep 2017 18:35:12 +0000 (14:35 -0400)
committerThomas Markwalder <tmark@isc.org>
Fri, 22 Sep 2017 18:35:12 +0000 (14:35 -0400)
src/hooks/dhcp/lease_cmds/lease_cmds.cc
src/hooks/dhcp/lease_cmds/lease_cmds_callouts.cc
src/hooks/dhcp/lease_cmds/lease_cmds_messages.mes

index 7c548e43ca446a2bbc4c1ca5842864e40b51f9ce..863294428f0576658d2a7aeb7343f8e1912ba1b6 100644 (file)
@@ -201,60 +201,6 @@ public:
     /// @return parsed parameters
     /// @throw BadValue if input arguments don't make sense.
     Parameters getParameters(bool v6, const ConstElementPtr& args);
-
-#if 0
-private:
-    /// @brief Extracts the command name and arguments from a Callout handle
-    ///
-    /// @param handle Callout context handle expected to contain the JSON command
-    /// text
-    ///
-    /// @throw isc::BadValue if the text does not contain a properly formed command
-    void extractCommand(CalloutHandle& handle) {
-        try {
-            ConstElementPtr command;
-            handle.getArgument("command", command);
-            cmd_name_ = parseCommand(cmd_args_, command);
-        } catch (std::exception& ex) {
-            isc_throw(isc::BadValue, "JSON command text is invalid: " << ex.what());
-        }
-    }
-
-    /// @brief Set the callout argument "response" to indicate success
-    ///
-    /// @param handle Callout context handle in which to set the "response" argument
-    /// @param text string text to be used as the response description
-    void setSuccessResponse(CalloutHandle& handle, const std::string& text) {
-        ConstElementPtr response = createAnswer(CONTROL_RESULT_SUCCESS, text);
-        setResponse (handle, response);
-    }
-
-    /// @brief Set the callout argument "response" to indicate an error
-    ///
-    /// @param handle Callout context handle in which to set the "response" argument
-    /// @param text string text to be used as the response description
-    /// @param status numeric value to use as the response result, defaults to
-    /// CONTROL_RESULT_ERROR
-    void setErrorResponse(CalloutHandle& handle, const std::string& text,
-        int status=CONTROL_RESULT_ERROR) {
-        ConstElementPtr response = createAnswer(status, text);
-        setResponse (handle, response);
-    }
-
-    /// @brief Set the callout argument "response" to the given response
-    ///
-    /// @param handle Callout context handle in which to set the "response" argument
-    /// @param response ElementPtr to a the result to use as the reponse
-    void setResponse(CalloutHandle& handle, ConstElementPtr& response) {
-        handle.setArgument ("response", response);
-    }
-
-    /// @brief Stores the command name extracted by a call to extractCommand
-    std::string cmd_name_;
-
-    /// @brief Stores the command arguments extracted by a call to extractCommand
-    ConstElementPtr cmd_args_;
-#endif
 };
 
 int
index 07a590fc4a220cb953ae72c6633498e62da9328f..51afc10fe386cbfc3a2e7bc4bf67c799c85343a1 100644 (file)
@@ -31,6 +31,12 @@ int lease4_add(CalloutHandle& handle) {
     return(lease_cmds.leaseAddHandler(handle));
 }
 
+/// @brief This is a command callout for 'lease6-add' command.
+///
+/// @param handle Callout handle used to retrieve a command and
+/// provide a response.
+/// @return 0 if this callout has been invoked successfully,
+/// 1 otherwise.
 int lease6_add(CalloutHandle& handle) {
     LeaseCmds lease_cmds;
     return(lease_cmds.leaseAddHandler(handle));
index 985ebf3c306c8131d7d1edf262288d88a9a83ba1..0684281701298c76951d3945a87803b193ce7af2 100644 (file)
@@ -8,10 +8,6 @@ added are logged.
 The lease4-add command has failed. Both the reason as well as the
 parameters passed are logged.
 
-% LEASE_CMDS_ADD4_MALFORMED lease4-add is malformed, reason: %1
-The JSON text received by the lease4-add handler was not a properly formed
-control channel command.
-
 % LEASE_CMDS_ADD6 lease6-add command successful (parameters: %1)
 The lease6-add command has been successful. Parameters of the host
 added are logged.
@@ -20,10 +16,6 @@ added are logged.
 The lease6-add command has failed. Both the reason as well as the
 parameters passed are logged.
 
-% LEASE_CMDS_ADD6_MALFORMED lease6-add is malformed, reason: %1
-The JSON text received by the lease6-add handler was not a properly formed
-control channel command.
-
 % LEASE_CMDS_DEINIT_FAILED unloading Lease Commands hooks library failed: %1
 This error message indicates an error during unloading the Lease Commands
 hooks library. The details of the error are provided as argument of
@@ -41,10 +33,6 @@ Parameters of the host removed are logged.
 The attempt to delete an IPv4 lease (lease4-del command) has failed. Both the
 reason as well as the parameters passed are logged.
 
-% LEASE_CMDS_DEL4_MALFORMED lease4-del is malformed, reason: %1
-The JSON text received by the lease4-del handler was not a properly formed
-control channel command.
-
 % LEASE_CMDS_DEL6 lease4-del command successful (parameters: %1)
 The attempt to delete an IPv4 lease (lease4-del command) has been successful.
 Parameters of the host removed are logged.
@@ -53,18 +41,6 @@ Parameters of the host removed are logged.
 The attempt to delete an IPv6 lease (lease4-del command) has failed. Both the
 reason as well as the parameters passed are logged.
 
-% LEASE_CMDS_DEL6_MALFORMED lease6-del is malformed, reason: %1
-The JSON text received by the lease6-del handler was not a properly formed
-control channel command.
-
-% LEASE_CMDS_GET4_MALFORMED lease4-get is malformed, reason: %1
-The JSON text received by the lease4-get handler was not a properly formed
-control channel command.
-
-% LEASE_CMDS_GET6_MALFORMED lease6-get is malformed, reason: %1
-The JSON text received by the lease6-get handler was not a properly formed
-control channel command.
-
 % LEASE_CMDS_INIT_FAILED loading Lease Commands hooks library failed: %1
 This error message indicates an error during loading the Lease Commands
 hooks library. The details of the error are provided as argument of
@@ -73,19 +49,3 @@ the log message.
 % LEASE_CMDS_INIT_OK loading Lease Commands hooks library successful
 This info message indicates that the Lease Commands hooks library has been
 loaded successfully. Enjoy!
-
-% LEASE_CMDS_UPDATE4_MALFORMED lease4-update is malformed, reason: %1
-The JSON text received by the lease4-update handler was not a properly formed
-control channel command.
-
-% LEASE_CMDS_UPDATE6_MALFORMED lease6-update is malformed, reason: %1
-The JSON text received by the lease6-update handler was not a properly formed
-control channel command.
-
-% LEASE_CMDS_WIPE4_MALFORMED lease4-wipe is malformed, reason: %1
-The JSON text received by the lease4-wipe handler was not a properly formed
-control channel command.
-
-% LEASE_CMDS_WIPE6_MALFORMED lease6-wipe is malformed, reason: %1
-The JSON text received by the lease6-wipe handler was not a properly formed
-control channel command.