1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 21:21:31 +00:00

Document some script args in NSEdoc

This commit is contained in:
dmiller
2015-11-22 13:58:21 +00:00
parent e83078fdcc
commit 8d418d4962
5 changed files with 27 additions and 1 deletions

View File

@@ -85,6 +85,12 @@
-- includes the credential state. The file extension is automatically added to -- includes the credential state. The file extension is automatically added to
-- the filename based on the type requested. -- 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 <patrik@cqure.net>" -- @author "Patrik Karlsson <patrik@cqure.net>"
-- @copyright Same as Nmap--See https://nmap.org/book/man-legal.html -- @copyright Same as Nmap--See https://nmap.org/book/man-legal.html
@@ -172,6 +178,7 @@ RegStorage = {
--- Creates a new RegStorage instance --- Creates a new RegStorage instance
-- --
-- @return a new instance -- @return a new instance
-- @name RegStorage.new
new = function(self) new = function(self)
local o = {} local o = {}
setmetatable(o, self) setmetatable(o, self)
@@ -189,6 +196,7 @@ RegStorage = {
-- @param user the name of the user -- @param user the name of the user
-- @param pass the password of the user -- @param pass the password of the user
-- @param state of the account -- @param state of the account
-- @name RegStorage.add
add = function( self, tags, host, port, service, user, pass, state ) add = function( self, tags, host, port, service, user, pass, state )
local cred = { local cred = {
tags = tags, tags = tags,
@@ -208,6 +216,7 @@ RegStorage = {
-- @param host table containing the host -- @param host table containing the host
-- @param port table containing the port -- @param port table containing the port
-- @param state table containing the account state -- @param state table containing the account state
-- @name RegStorage.setFilter
setFilter = function( self, host, port, state ) setFilter = function( self, host, port, state )
self.filter.host = host self.filter.host = host
self.filter.port = port self.filter.port = port
@@ -217,6 +226,7 @@ RegStorage = {
--- Returns a credential iterator matching the selected filters --- Returns a credential iterator matching the selected filters
-- --
-- @return a credential iterator -- @return a credential iterator
-- @name RegStorage.getAll
getAll = function( self ) getAll = function( self )
local function get_next() local function get_next()
local host, port = self.filter.host, self.filter.port local host, port = self.filter.host, self.filter.port
@@ -279,6 +289,7 @@ Account = {
--- Less-than operation for sorting --- Less-than operation for sorting
-- --
-- Lexicographic comparison by user, pass, and state -- Lexicographic comparison by user, pass, and state
-- @name Account.__lt
__lt = function (a, b) __lt = function (a, b)
if a.user and b.user and a.user >= b.user then if a.user and b.user and a.user >= b.user then
return false return false
@@ -313,6 +324,7 @@ Credentials = {
-- @param tags a table containing tags associated with the credentials -- @param tags a table containing tags associated with the credentials
-- @param host table as received by the scripts action method -- @param host table as received by the scripts action method
-- @param port 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) new = function(self, tags, host, port)
local o = {} local o = {}
setmetatable(o, self) setmetatable(o, self)
@@ -332,6 +344,7 @@ Credentials = {
-- @param user the name of the user -- @param user the name of the user
-- @param pass the password of the user -- @param pass the password of the user
-- @param state of the account -- @param state of the account
-- @name Credentials.add
add = function( self, user, pass, state ) add = function( self, user, pass, state )
local pass = ( pass and #pass > 0 ) and pass or "<empty>" local pass = ( pass and #pass > 0 ) and pass or "<empty>"
assert( self.host, "No host supplied" ) assert( self.host, "No host supplied" )
@@ -362,6 +375,7 @@ Credentials = {
-- <code>service</code> - string containing the name of the service -- <code>service</code> - string containing the name of the service
-- <code>tags</code> - table containing tags associated with -- <code>tags</code> - table containing tags associated with
-- the credential -- the credential
-- @name Credentials.getCredentials
getCredentials = function(self, state) getCredentials = function(self, state)
local function next_credential() local function next_credential()
if ( state ) then if ( state ) then
@@ -423,6 +437,7 @@ Credentials = {
--- Returns a table of credentials --- Returns a table of credentials
-- --
-- @return tbl table containing the discovered credentials -- @return tbl table containing the discovered credentials
-- @name Credentials.getTable
getTable = function(self) getTable = function(self)
local result = {} local result = {}
@@ -514,6 +529,7 @@ Credentials = {
-- @param host table or string containing the host to filter -- @param host table or string containing the host to filter
-- @param port number containing the port to filter -- @param port number containing the port to filter
-- @return table suitable from <code>stdnse.format_output</code> -- @return table suitable from <code>stdnse.format_output</code>
-- @name Credentials.__tostring
__tostring = function(self) __tostring = function(self)
local all = self:getTable() local all = self:getTable()
if ( all ) then return tostring(all) end if ( all ) then return tostring(all) end

View File

@@ -1,7 +1,10 @@
--- ---
-- A smallish implementation of the Couchbase Membase TAP protocol -- A smallish implementation of the Couchbase Membase TAP protocol
-- Based on the scarce documentation from the Couchbase Wiki: -- 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 <patrik@cqure.net>" -- @author "Patrik Karlsson <patrik@cqure.net>"
-- --

View File

@@ -88,6 +88,9 @@
-- * <code>someComment.value</code> : the string content of the PI, i.e. everything but the name -- * <code>someComment.value</code> : the string content of the PI, i.e. everything but the name
-- * <code>someComment.parent</code> : reference to the parent element or document table -- * <code>someComment.parent</code> : 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 <original pure lua implemetation> -- @author Gavin Kistner <original pure lua implemetation>
-- @author Gyanendra Mishra <NSE specific implementation> -- @author Gyanendra Mishra <NSE specific implementation>

View File

@@ -2,6 +2,8 @@
-- Simple Mail Transfer Protocol (SMTP) operations. -- Simple Mail Transfer Protocol (SMTP) operations.
-- --
-- @copyright Same as Nmap--See https://nmap.org/book/man-legal.html -- @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 base64 = require "base64"
local comm = require "comm" local comm = require "comm"

View File

@@ -136,6 +136,8 @@ local libs = {
"xmpp", "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') local am_testing = stdnse.get_script_args('unittest.run')
---Check whether tests are being run ---Check whether tests are being run
-- --