mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 08:46:45 +00:00
Remove bit.lua
This commit is contained in:
parent
7e5ef7130b
commit
b222a0d7ee
4 changed files with 5 additions and 95 deletions
|
|
@ -1,5 +1,9 @@
|
|||
#Nmap Changelog ($Id$); -*-text-*-
|
||||
|
||||
o [NSE] Completely removed the bit.lua NSE library. All of its functions are
|
||||
replaced by native Lua bitwise operations, except for `arshift` (arithmetic
|
||||
shift) which has been moved to the bits.lua library. [Daniel Miller]
|
||||
|
||||
o [GH#1291][GH#34] Use pcap_create instead of pcap_live_open in Nmap, and set
|
||||
immediate mode on the pcap descriptor. This solves packet loss problems on
|
||||
Linux and may improve performance on other platforms. [Daniel Cater, Mike
|
||||
|
|
|
|||
|
|
@ -2939,7 +2939,7 @@ categories = {"discovery", "external", "safe"}
|
|||
<literal>@name</literal> and <literal>@class</literal> tags when
|
||||
documenting a table to assist the documentation parser in
|
||||
identifying it. There are several examples of this method of
|
||||
documentation in the Nmap source distribution (including <literal>nmap.luadoc</literal>, <literal>bit.luadoc</literal>, and <literal>pcre.luadoc</literal>).
|
||||
documentation in the Nmap source distribution (including <literal>nmap.luadoc</literal>, <literal>lfs.luadoc</literal>, and <literal>pcre.luadoc</literal>).
|
||||
</para>
|
||||
|
||||
<sect2 id="nsedoc-tags">
|
||||
|
|
|
|||
|
|
@ -1,93 +0,0 @@
|
|||
---
|
||||
-- Bitwise operations on integers.
|
||||
--
|
||||
-- THIS LIBRARY IS DEPRECATED, Please use native Lua 5.3 bitwise operators.
|
||||
--
|
||||
-- @copyright BSD License
|
||||
-- @see https://www.lua.org/manual/5.3/manual.html#3.4.2
|
||||
-- @class module
|
||||
-- @name bit
|
||||
|
||||
local select = select
|
||||
|
||||
local _ENV = {}
|
||||
|
||||
--- Returns the one's complement of <code>a</code>.
|
||||
--
|
||||
-- REPLACEMENT: <code>~a</code>
|
||||
-- @param a Number.
|
||||
-- @return The one's complement of <code>a</code>.
|
||||
function bnot(a)
|
||||
return ~a
|
||||
end
|
||||
|
||||
--- Returns the bitwise and of all its arguments.
|
||||
--
|
||||
-- REPLACEMENT: <code>a & b</code>
|
||||
-- @param ... A variable number of Numbers to and.
|
||||
-- @return The anded result.
|
||||
function band(a, b, ...)
|
||||
a = a & b
|
||||
if select("#", ...) > 0 then
|
||||
return band(a, ...)
|
||||
else
|
||||
return a
|
||||
end
|
||||
end
|
||||
|
||||
--- Returns the bitwise or of all its arguments.
|
||||
--
|
||||
-- REPLACEMENT: <code>a | b</code>
|
||||
-- @param ... A variable number of Numbers to or.
|
||||
-- @return The ored result.
|
||||
function bor(a, b, ...)
|
||||
a = a | b
|
||||
if select("#", ...) > 0 then
|
||||
return bor(a, ...)
|
||||
else
|
||||
return a
|
||||
end
|
||||
end
|
||||
|
||||
--- Returns the bitwise exclusive or of all its arguments.
|
||||
--
|
||||
-- REPLACEMENT: <code>a ~ b</code>
|
||||
-- @param ... A variable number of Numbers to exclusive or.
|
||||
-- @return The exclusive ored result.
|
||||
function bxor(a, b, ...)
|
||||
a = a ~ b
|
||||
if select("#", ...) > 0 then
|
||||
return bxor(a, ...)
|
||||
else
|
||||
return a
|
||||
end
|
||||
end
|
||||
|
||||
--- Returns <code>a</code> left-shifted by <code>b</code> places.
|
||||
--
|
||||
-- REPLACEMENT: <code>a << b</code>
|
||||
-- @param a Number to perform the shift on.
|
||||
-- @param b Number of shifts.
|
||||
function lshift(a, b)
|
||||
return a << b
|
||||
end
|
||||
|
||||
--- Returns <code>a</code> right-shifted by <code>b</code> places.
|
||||
--
|
||||
-- REPLACEMENT: <code>a >> b</code>
|
||||
-- @param a Number to perform the shift on.
|
||||
-- @param b Number of shifts.
|
||||
function rshift(a, b)
|
||||
return a >> b
|
||||
end
|
||||
|
||||
--- Returns the integer remainder of <code>a</code> divided by <code>b</code>.
|
||||
--
|
||||
-- REPLACEMENT: <code>a % b</code>
|
||||
-- @param a Dividend.
|
||||
-- @param b Divisor.
|
||||
function mod(a, b)
|
||||
return a % b
|
||||
end
|
||||
|
||||
return _ENV
|
||||
|
|
@ -34,7 +34,6 @@ local libs = {
|
|||
"base32",
|
||||
"base64",
|
||||
"bin",
|
||||
"bit",
|
||||
"bitcoin",
|
||||
"bits",
|
||||
"bittorrent",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue