From 7fc9b99b46f218a7fc10a2eaabed8e1b836fa523 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 15 Jun 2020 16:31:19 +0000 Subject: [PATCH] man: Document export command Fixes: #12437 Signed-off-by: Michael Tremer --- man/location.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/man/location.txt b/man/location.txt index 8530511..b3ae6a3 100644 --- a/man/location.txt +++ b/man/location.txt @@ -5,6 +5,7 @@ location - Query the location database == SYNOPSIS [verse] +`location export --directory=DIR [--format=FORMAT] [--family=ipv6|ipv4] [ASN|CC ...]` `location get-as ASN [ASN...]` `location list-countries [--show-name] [--show-continent]` `location list-networks-by-as ASN` @@ -37,6 +38,15 @@ or countries. == COMMANDS +'export --directory=DIR [--format=FORMAT] [--family=ipv6|ipv4] [ASN|CC ...]':: + This command exports the whole database into the given directory. + + + The output can be filtered by only exporting a certain address family, or by passing + a list of country codes and/or ASNs. The default is to export all known countries. + + + The output format can be chosen with the '--format' parameter. For possible formats, + please see below. + 'get-as ASN [ASN...]':: This command returns the name of the owning organisation of the Autonomous System. @@ -104,6 +114,17 @@ The 'location' command will normally exit with code zero. If there has been a problem and the requested action could not be performed, the exit code is unequal to zero. +== FORMATS +Some commands allow specifying the output format. This is helpful if the exported +data should be imported into a packet filter for example. +The following formats are understood: + + * 'list' (default): Just lists all networks, one per line + * 'ipset': For ipset + * 'nftables': For nftables + * 'xt_geoip': Returns a list of networks to be loaded into the + xt_geoip kernel module + == HOW IT WORKS The downloader checks a DNS record for the latest version of the database. It will then try to download a file with that version from a mirror server. -- 2.47.3