]> git.ipfire.org Git - location/libloc.git/blobdiff - man/location.txt
man: Document export command
[location/libloc.git] / man / location.txt
index 853051188050df511ba79db07d1d122a38a5c7bc..b3ae6a3e85ecb3e843dd9642dcd87338b79312fc 100644 (file)
@@ -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.