1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-12 16:36:34 +00:00

open / open|filtered tables work for shortport.service now

This commit is contained in:
diman
2007-12-08 15:28:55 +00:00
parent 05656f057b
commit 005a84fc59

View File

@@ -44,11 +44,19 @@ service = function(service, _proto, _state)
service_table = service
end
if(type(state) == "string") then
state_table = {state}
elseif(type(state) == "table") then
state_table = state
end
return function(host, port)
if(port.protocol == proto and port.state == state) then
for _, service in ipairs(service_table) do
if(port.service == service) then
return true
for _, state in pairs(state_table) do
if(port.protocol == proto and port.state == state) then
for _, service in ipairs(service_table) do
if(port.service == service) then
return true
end
end
end
end