mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 15:18:20 +00:00

This is based on commit 2731def9159247e6da8a3191783c89683363689c from the zeek-docs repo.
43 lines
1.3 KiB
ReStructuredText
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
|
|
|
|
|