zeek/doc/scripts/base/utils/geoip-distance.zeek.rst
Tim Wojtulewicz ded98cd373 Copy docs into Zeek repo directly
This is based on commit 2731def9159247e6da8a3191783c89683363689c from the
zeek-docs repo.
2025-09-26 02:58:29 +00:00

43 lines
1.3 KiB
ReStructuredText

:tocdepth: 3
base/utils/geoip-distance.zeek
==============================
Functions to calculate distance between two locations, based on GeoIP data.
Summary
~~~~~~~
Functions
#########
======================================================= ==========================================================================
:zeek:id:`haversine_distance_ip`: :zeek:type:`function` Returns the distance between two IP addresses using the haversine formula,
based on GeoIP database locations.
======================================================= ==========================================================================
Detailed Interface
~~~~~~~~~~~~~~~~~~
Functions
#########
.. zeek:id:: haversine_distance_ip
:source-code: base/utils/geoip-distance.zeek 14 26
:Type: :zeek:type:`function` (a1: :zeek:type:`addr`, a2: :zeek:type:`addr`) : :zeek:type:`double`
Returns the distance between two IP addresses using the haversine formula,
based on GeoIP database locations. Requires Zeek to be built with GeoIP.
:param a1: First IP address.
:param a2: Second IP address.
:returns: The distance between *a1* and *a2* in miles, or -1.0 if GeoIP data
is not available for either of the IP addresses.
.. zeek:see:: haversine_distance lookup_location