1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-18 13:39:02 +00:00

Updates to strbuf API.

This commit is contained in:
batrick
2008-06-08 07:20:45 +00:00
parent 0632f1f8da
commit b8d8702dda

View File

@@ -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 identd = nmap.get_port_state(host, ident_port)
local ident_port = { number=113, protocol="tcp" } if identd ~= nil and identd.state == "open" and port.state == "open" then
identd = nmap.get_port_state(host, ident_port) return true
else
if return false
identd ~= nil and identd.state == "open" and port.state == "open" end
then
decision = true
else
decision = false
end
return decision
end end
</programlisting> </programlisting>
</para> </para>