4.15.2.1. Configuring policies for LP commands

Changing the default behavior of commands can be done by using the hash attribute request. The hash is indexed by the command names. The possible actions are described in the following table. See Section 2.1, Policies for requests and responses for details.

ActionDescription
LP_REQ_ACCEPT Allow the command to pass.
LP_REQ_REJECT Block the command and report it to the client.
LP_REQ_ABORT Terminate the connection.
LP_REQ_DROP Block the command without further action.
LP_REQ_POLICY Call the function specified to make a decision about the event. The function receives three parameters: self, command, and the parameters of the command. See Section 2.1, Policies for requests and responses for details.

Table 4.42.  Action codes for LP requests

To call a policy function, the hash value must be a tuple containing LP_REQ_POLICY as its first value and the function to be called as the second. The arguments which the function is called with depend on the command.