diff --git a/nselib/creds.lua b/nselib/creds.lua index f926c1eeb..0f481a2db 100644 --- a/nselib/creds.lua +++ b/nselib/creds.lua @@ -85,6 +85,12 @@ -- includes the credential state. The file extension is automatically added to -- the filename based on the type requested. -- +-- @args creds.global Credentials to be returned by Credentials.getCredentials +-- regardless of the service. +-- @args creds.[service] Credentials to be returned by +-- Credentials.getCredentials for [service]. E.g. +-- creds.http=admin:password +-- -- @author "Patrik Karlsson " -- @copyright Same as Nmap--See https://nmap.org/book/man-legal.html @@ -172,6 +178,7 @@ RegStorage = { --- Creates a new RegStorage instance -- -- @return a new instance + -- @name RegStorage.new new = function(self) local o = {} setmetatable(o, self) @@ -189,6 +196,7 @@ RegStorage = { -- @param user the name of the user -- @param pass the password of the user -- @param state of the account + -- @name RegStorage.add add = function( self, tags, host, port, service, user, pass, state ) local cred = { tags = tags, @@ -208,6 +216,7 @@ RegStorage = { -- @param host table containing the host -- @param port table containing the port -- @param state table containing the account state + -- @name RegStorage.setFilter setFilter = function( self, host, port, state ) self.filter.host = host self.filter.port = port @@ -217,6 +226,7 @@ RegStorage = { --- Returns a credential iterator matching the selected filters -- -- @return a credential iterator + -- @name RegStorage.getAll getAll = function( self ) local function get_next() local host, port = self.filter.host, self.filter.port @@ -279,6 +289,7 @@ Account = { --- Less-than operation for sorting -- -- Lexicographic comparison by user, pass, and state + -- @name Account.__lt __lt = function (a, b) if a.user and b.user and a.user >= b.user then return false @@ -313,6 +324,7 @@ Credentials = { -- @param tags a table containing tags associated with the credentials -- @param host table as received by the scripts action method -- @param port table as received by the scripts action method + -- @name Credentials.new new = function(self, tags, host, port) local o = {} setmetatable(o, self) @@ -332,6 +344,7 @@ Credentials = { -- @param user the name of the user -- @param pass the password of the user -- @param state of the account + -- @name Credentials.add add = function( self, user, pass, state ) local pass = ( pass and #pass > 0 ) and pass or "" assert( self.host, "No host supplied" ) @@ -362,6 +375,7 @@ Credentials = { -- service - string containing the name of the service -- tags - table containing tags associated with -- the credential + -- @name Credentials.getCredentials getCredentials = function(self, state) local function next_credential() if ( state ) then @@ -423,6 +437,7 @@ Credentials = { --- Returns a table of credentials -- -- @return tbl table containing the discovered credentials + -- @name Credentials.getTable getTable = function(self) local result = {} @@ -514,6 +529,7 @@ Credentials = { -- @param host table or string containing the host to filter -- @param port number containing the port to filter -- @return table suitable from stdnse.format_output + -- @name Credentials.__tostring __tostring = function(self) local all = self:getTable() if ( all ) then return tostring(all) end diff --git a/nselib/membase.lua b/nselib/membase.lua index 24496081e..35024dd75 100644 --- a/nselib/membase.lua +++ b/nselib/membase.lua @@ -1,7 +1,10 @@ --- -- A smallish implementation of the Couchbase Membase TAP protocol -- Based on the scarce documentation from the Couchbase Wiki: --- x http://www.couchbase.org/wiki/display/membase/SASL+Authentication+Example +-- * http://www.couchbase.org/wiki/display/membase/SASL+Authentication+Example +-- +-- @args membase.authmech SASL authentication mechanism to use. Default and +-- currently supported: PLAIN -- -- @author "Patrik Karlsson " -- diff --git a/nselib/slaxml.lua b/nselib/slaxml.lua index 97340e4a9..9073f5837 100644 --- a/nselib/slaxml.lua +++ b/nselib/slaxml.lua @@ -88,6 +88,9 @@ -- * someComment.value : the string content of the PI, i.e. everything but the name -- * someComment.parent : reference to the parent element or document table -- +-- @args slaxml.debug Debug level at which default callbacks will print detailed +-- parsing info. Default: 3 +-- -- @author Gavin Kistner -- @author Gyanendra Mishra diff --git a/nselib/smtp.lua b/nselib/smtp.lua index 135fc9520..c0fc8e0f3 100644 --- a/nselib/smtp.lua +++ b/nselib/smtp.lua @@ -2,6 +2,8 @@ -- Simple Mail Transfer Protocol (SMTP) operations. -- -- @copyright Same as Nmap--See https://nmap.org/book/man-legal.html +-- @args smtp.domain The domain to be returned by get_domain, overriding the +-- target's own domain name. local base64 = require "base64" local comm = require "comm" diff --git a/nselib/unittest.lua b/nselib/unittest.lua index 3e43602c6..a72f614c5 100644 --- a/nselib/unittest.lua +++ b/nselib/unittest.lua @@ -136,6 +136,8 @@ local libs = { "xmpp", } +-- This script-arg is documented in the unittest script to avoid cluttering +-- NSEdoc of all the libraries which include this one. local am_testing = stdnse.get_script_args('unittest.run') ---Check whether tests are being run --