1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Some cleanup of issues by nnposter: Fixes #614, fixes #615, fixes #618

This commit is contained in:
dmiller
2016-12-18 05:01:40 +00:00
parent 1b92c92092
commit 6926b66859
3 changed files with 12 additions and 15 deletions

View File

@@ -15,28 +15,26 @@ _ENV = stdnse.module("geoip", stdnse.seeall)
-- @param lat The latitude in degrees
-- @param lon The longitude in degrees
add = function(ip, lat, lon)
if not nmap.registry.geoip then
nmap.registry.geoip = {}
end
if not nmap.registry.geoip[ip] then
nmap.registry.geoip[ip] = {}
end
local lat_n = tonumber(lat)
if lat_n < -90 or lat_n > 90 then
if not lat_n or lat_n < -90 or lat_n > 90 then
stdnse.debug1("Invalid latitude for %s: %s.", ip, lat)
return
end
local lon_n = tonumber(lon)
if lon_n < -180 or lon_n > 180 then
if not lat_n or lon_n < -180 or lon_n > 180 then
stdnse.debug1("Invalid longitude for %s: %s.", ip, lon)
return
end
nmap.registry.geoip[ip]["latitude"] = lat
nmap.registry.geoip[ip]["longitude"] = lon
if not nmap.registry.geoip then
nmap.registry.geoip = {}
end
nmap.registry.geoip[ip] = {
latitude = lat,
longitude = lon
}
end
--- Check if any coordinates have been stored in the registry

View File

@@ -26,7 +26,7 @@ Additional information for the Bing Maps REST Services API can be found at:
-- @args ip-geolocation-map-bing.api_key The required Bing Maps API key for your
-- account. An API key can be generated at https://www.bingmapsportal.com/
--
-- ip-geolocation-map-bing.center GPS coordinates defining the center of the
-- @args ip-geolocation-map-bing.center GPS coordinates defining the center of the
-- image. If omitted, Bing Maps will choose a center that shows all the
-- markers.
--

View File

@@ -26,7 +26,7 @@ Additional information for the Google Static Maps API can be found at:
-- your account. An API key can be generated at
-- https://developers.google.com/maps/documentation/static-maps/." @args
--
-- ip-geolocation-map-google.center GPS coordinates defining the center of the
-- @args ip-geolocation-map-google.center GPS coordinates defining the center of the
-- image. If omitted, Google Maps will choose a center that shows all the
-- markers.
--
@@ -136,7 +136,6 @@ local parse_args = function()
end
local marker_style = stdnse.get_script_args(SCRIPT_NAME .. ".marker_style")
stdnse.debug1('--> [%s]', marker_style)
if not marker_style then
marker_style = ""
end