1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-15 04:09:01 +00:00
Files
nmap/nselib/shortport.lua
2007-08-11 04:12:45 +00:00

55 lines
992 B
Lua

module(...)
protorule = function(porttab, service, proto, state)
state = state or "open"
proto = proto or "tcp"
if porttab.service==service
and porttab.protocol == proto
and porttab.state == state
then
return true;
else
return false;
end
end
portnumber = function(porttab, number, proto, state)
state = state or "open"
proto = proto or "tcp"
if porttab.number==number
and porttab.protocol == proto
and porttab.state ==state
then
return true;
else
return false;
end
end
port_in_list = function(porttab, proto, ...)
if not porttab.protocol==proto
then
return false
end
for i, v in ipairs{...} do
if porttab.number == v then
return true
end
end
return false
end
port_or_service = function(porttab, number, service, proto, state)
state= state or "open"
proto = proto or "tcp"
if (porttab.number==number or porttab.service==service)
and porttab.protocol==proto
and porttab.state == state
then
return true
else
return false
end
end