mirror of
https://github.com/nmap/nmap.git
synced 2025-12-18 05:29:02 +00:00
Updates to strbuf API.
This commit is contained in:
@@ -693,7 +693,7 @@ that.</para>
|
|||||||
are often useful for low-level network communication, Reuben
|
are often useful for low-level network communication, Reuben
|
||||||
Thomas'
|
Thomas'
|
||||||
<ulink url="http://luaforge.net/projects/bitlib">bitwise operation library</ulink>
|
<ulink url="http://luaforge.net/projects/bitlib">bitwise operation library</ulink>
|
||||||
for Lua has been Thomas' bitwise operation library for Lua has been
|
for Lua has
|
||||||
integrated into NSE. The arguments to the bitwise operation
|
integrated into NSE. The arguments to the bitwise operation
|
||||||
functions should be integers. The number of bits available
|
functions should be integers. The number of bits available
|
||||||
for logical operations depends on the data type used to
|
for logical operations depends on the data type used to
|
||||||
@@ -1249,12 +1249,13 @@ if(s) code_to_be_done_on_match end
|
|||||||
</para>
|
</para>
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><option>buffer = strbuf.new("first-string")</option>
|
<term><option>buffer = strbuf.new(...)</option>
|
||||||
<indexterm><primary>new</primary></indexterm></term>
|
<indexterm><primary>new</primary></indexterm></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Creates a new string buffer. The argument is optional and is the
|
Creates a new string buffer. The optional arguments are added
|
||||||
first string to be added to the buffer.
|
to the string buffer. Attempting to add non-strings will
|
||||||
|
result in undefined behavior.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@@ -2873,20 +2874,14 @@ categories = {"safe", "intrusive"}
|
|||||||
<para>
|
<para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
portrule = function(host, port)
|
portrule = function(host, port)
|
||||||
local identd, decision
|
|
||||||
|
|
||||||
local ident_port = { number=113, protocol="tcp" }
|
local ident_port = { number=113, protocol="tcp" }
|
||||||
identd = nmap.get_port_state(host, ident_port)
|
local identd = nmap.get_port_state(host, ident_port)
|
||||||
|
|
||||||
if
|
if identd ~= nil and identd.state == "open" and port.state == "open" then
|
||||||
identd ~= nil and identd.state == "open" and port.state == "open"
|
return true
|
||||||
then
|
|
||||||
decision = true
|
|
||||||
else
|
else
|
||||||
decision = false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
return decision
|
|
||||||
end
|
end
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
|||||||
Reference in New Issue
Block a user