From b5f645c2c7d850864c7dbcde9f284a54502aa162 Mon Sep 17 00:00:00 2001 From: patrik Date: Thu, 19 Aug 2010 22:08:08 +0000 Subject: [PATCH] Added more documentation regarding the Account and Error object. --- nselib/brute.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/nselib/brute.lua b/nselib/brute.lua index c7d4ec376..b72aa29d0 100644 --- a/nselib/brute.lua +++ b/nselib/brute.lua @@ -9,6 +9,7 @@ -- The library contains the following classes: -- * Account -- ** Implements a simple account class, that converts account "states" to common text representation. +-- ** The state can be either of the following: OPEN, LOCKED or DISABLED -- * Engine -- ** The actual engine doing the brute-forcing . -- * Error @@ -28,7 +29,13 @@ -- Driver:disconnect = function( self ) -- -- --- The login method does not need a lot of explanation. +-- The login method does not need a lot of explanation. The login +-- function should return two parameters. If the login was successful it should +-- return true and an Account. If the login was a failure it +-- should return false and an Error. The driver can signal the +-- Engine to retry a set of credentials by calling the Error objects +-- setRetry method. It may also signal the Engine to abort all +-- password guessing by calling the Error objects setAbort method. -- -- The purpose of the check method is to be able to determine -- whether the script has all the information it needs, before starting the @@ -198,6 +205,13 @@ Options = { -- The account object which is to be reported back from each driver Account = { + --- Creates a new instance of the Account class + -- + -- @param username containing the user's name + -- @param password containing the user's password + -- @param state containing the account state and should be one of the + -- following OPEN, LOCKED, + -- DISABLED. new = function(self, username, password, state) local o = {} setmetatable(o, self)