#LyX 2.3 created this file. For more info see http://www.lyx.org/
\lyxformat 544
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass docbook
\use_default_options false
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures true
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry false
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 0
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 0
\use_minted 0
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style english
\dynamic_quotes 0
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Title
The ipv6calc Homepage
\end_layout

\begin_layout Standard
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

<author><firstname>Peter</firstname><surname>Bieringer</surname><affiliation><ad
dress>pb at bieringer dot de</address></affiliation></author>
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

<revhistory> 
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout

<revision> <revnumber>11.0.1</revnumber> <date>2022-12-22</date> <authorinitials>P
B</authorinitials></revision>
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

</revhistory> 
\end_layout

\end_inset


\end_layout

\begin_layout Section
General
\end_layout

\begin_layout Standard
ipv6calc is a small utility written in programming language C to manipulate
 (not only) IPv6 addresses and is able to do other tricky things.
 Intentions were convering a given IPv6 address into compressed format,
 convering a given IPv6 address into the same format like shown in 
\shape italic
/proc/net/if_inet6
\shape default
 and (because it was not difficulty) migrating the Perl program 
\shape italic
ip6_int
\shape default
 into.
 Now only one utility is needed to do a lot.
\end_layout

\begin_layout Standard
This utility was also used in the past to extend features on network-functions-i
pv6 library, used by initscripts-ipv6.
\end_layout

\begin_layout Standard
Note: this tool got also its 
\begin_inset CommandInset href
LatexCommand href
name "freecode.com (former freshmeat, now also EOL) / ipv6calc"
target "http://freecode.com/projects/ipv6calc/"
literal "false"

\end_inset

 page (but this is not maintained by the author)
\end_layout

\begin_layout Subsection
Latest version
\end_layout

\begin_layout Standard
Latest version since last update of this page is 4.0.0
\end_layout

\begin_layout Subsection
Included programs
\end_layout

\begin_layout Itemize
\begin_inset Quotes eld
\end_inset

ipv6calc
\begin_inset Quotes erd
\end_inset

: the main utility
\end_layout

\begin_layout Itemize
\begin_inset Quotes eld
\end_inset

ipv6calcweb
\begin_inset Quotes erd
\end_inset

: CGI wrapper for ipv6calc's address information output
\end_layout

\begin_layout Itemize
\begin_inset Quotes eld
\end_inset

ipv6logconv
\begin_inset Quotes erd
\end_inset

: log converter (IPv4/IPv6)
\end_layout

\begin_layout Itemize
\begin_inset Quotes eld
\end_inset

ipv6loganon
\begin_inset Quotes erd
\end_inset

: log anonymizer (IPv4/IPv6)
\end_layout

\begin_layout Itemize
\begin_inset Quotes eld
\end_inset

ipv6logstats
\begin_inset Quotes erd
\end_inset

: log statistic generator (IPv4/IPv6)
\end_layout

\begin_layout Itemize
\begin_inset Quotes eld
\end_inset

mod_ipv6calc
\begin_inset Quotes erd
\end_inset

: Apache module
\end_layout

\begin_layout Subsection
Included databases
\end_layout

\begin_layout Standard
If not disabled during compiling of the tool, following databases are statically
 included, since version 0.95.0 internally mentioned as 
\begin_inset Quotes eld
\end_inset

BuiltIn
\begin_inset Quotes erd
\end_inset

:
\end_layout

\begin_layout Itemize
IEEE IAB, OUI, OUI-28, OUI-36 databases (for decoding vendor part of MAC/EUI-48/
EUI-64)
\end_layout

\begin_layout Itemize
IPv4 assignment databases from IANA, ARIN, RIPENCC, APNIC, LACNIC, AFRINIC
 (for selecting proper registry in ipv6calcweb.cgi and IPv4 anonymization)
\end_layout

\begin_layout Itemize
IPv6 assignment databases from IANA, ARIN, RIPENCC, APNIC, LACNIC, AFRINIC
 (for selecting proper registry in ipv6calcweb.cgi and IPv6 anonymization)
\end_layout

\begin_layout Itemize
ASN assignment databases from IANA, ARIN, RIPENCC, APNIC, LACNIC, AFRINIC
 (for IPv4/IPv6 anonymization)
\end_layout

\begin_layout Itemize
LISP assignment database for supplying extra info
\end_layout

\begin_layout Subsection
Possible external databases
\end_layout

\begin_layout Standard
If enabled during compiling the tool, following external (but local stored)
 databases can be used
\end_layout

\begin_layout Itemize
\begin_inset CommandInset href
LatexCommand href
name "GeoIP"
target "http://www.maxmind.com/"
literal "false"

\end_inset


\begin_inset Separator latexpar
\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
IPv4 
\begin_inset Quotes eld
\end_inset

legacy
\begin_inset Quotes erd
\end_inset

 (since 0.61.0, released 2006 until 3.0.0 released 2020)
\end_layout

\begin_layout Itemize
IPv6 
\begin_inset Quotes eld
\end_inset

legacy
\begin_inset Quotes erd
\end_inset

 (since 0.90.0, released 2011, req.
 GeoIP >= 1.4.5 until 3.0.0 released 2020)
\end_layout

\begin_layout Itemize
GeoIP2 (native MaxMindDB file support since 2.0.0, release 2019)
\end_layout

\end_deeper
\begin_layout Itemize
\begin_inset CommandInset href
LatexCommand href
name "IP2Location"
target "http://www.ip2location.com/"
literal "false"

\end_inset


\begin_inset Separator latexpar
\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
IPv4 (since 0.60.0, released 2006)
\end_layout

\begin_layout Itemize
IPv6 (since 0.70.0, released 2007, 
\begin_inset CommandInset href
LatexCommand href
name "IP2Location LITE IPv6 Databases"
target "http://lite.ip2location.com/"
literal "false"

\end_inset

 since 0.99.0, released 2015)
\end_layout

\begin_layout Itemize
release 0.99.0 is tested against IP2Location >= 4.0.2
\end_layout

\begin_layout Itemize
release >= 2.0.0 && < 3.0.0 is only working with IP2Location >= 7.0.1
\end_layout

\begin_layout Itemize
release >= 3.0.0 is only working with IP2Location >= 8.2.0
\end_layout

\end_deeper
\begin_layout Itemize
\begin_inset CommandInset href
LatexCommand href
name "DB-IP.com"
target "http://www.db-ip.com/"
literal "false"

\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
(since 0.98.0, released 2015 until 3.0.0 released 2020) based on local Berkeley
 DB files generated from downloaded CSV files
\end_layout

\begin_layout Itemize
native MaxMindDB files (support since 2.0.0, released 2019)
\end_layout

\end_deeper
\begin_layout Itemize
\begin_inset Quotes eld
\end_inset

External
\begin_inset Quotes erd
\end_inset

 (since 0.98.0, released 2015), based on local Berkeley DB files, generated
 from downloaded TXT/XML files (registries assignment databases).
 Supporting IPv4/IPv6 to Registries and IPv4/IPv6 to CountryCode.
 If newer, overruling the related included databases.
\end_layout

\begin_layout Standard
Since version 0.95.0 the tool can be compiled to use dynamically loading of
 library, means the binaries can be also used on systems where IP2Location
 or GeoIP libraries are not existing.
 On such system, the support is simply disabled then and some capabilities/featu
res which requires the databases are disabled.
\end_layout

\begin_layout Standard
Since version 0.97.4 also fallback code for GeoIP and IP2Location is included
 in the source package, means that support of dynamically loading of library
 can be included during compilation without having related development sources
 on the system.
\end_layout

\begin_layout Standard
Since version 2.0.0 MaxMindDB is supported (linked or dynamically loaded)
\end_layout

\begin_layout Standard
Since version 3.0.0 GeoIP(legacy) and db-ip.com(BerkeleyDB) is remoed
\end_layout

\begin_layout Section
License
\end_layout

\begin_layout Standard
The program is published under the GNU GPL version 2.
\end_layout

\begin_layout Section
Copyright
\end_layout

\begin_layout Standard
(C) 2001 - 2021 by Dr.
 Peter Bieringer
\end_layout

\begin_layout Section
Author
\end_layout

\begin_layout Standard
The author of ipv6calc is
\end_layout

\begin_layout Itemize
\begin_inset CommandInset href
LatexCommand href
name "Dr. Peter Bieringer"
target "mailto:pb@bieringer.de"
literal "false"

\end_inset

 with some minor contribution by others
\end_layout

\begin_layout Section
Where to get sources or binaries
\end_layout

\begin_layout Subsection
Latest version of sources
\end_layout

\begin_layout Itemize
Via GitHub (since 2016-09-05) at 
\begin_inset CommandInset href
LatexCommand href
name "GitHub / ipv6calc"
target "https://github.com/pbiering/ipv6calc"
literal "false"

\end_inset


\end_layout

\begin_layout Subsection
Releases
\end_layout

\begin_layout Subsubsection
as tar.gz or zip
\end_layout

\begin_layout Itemize
via HTTPS at 
\begin_inset CommandInset href
LatexCommand href
name "GitHub / ipv6calc / releases"
target "https://github.com/pbiering/ipv6calc/releases"
literal "false"

\end_inset

 
\end_layout

\begin_layout Subsubsection
as tar.gz (signed)
\end_layout

\begin_layout Itemize
from 
\begin_inset CommandInset href
LatexCommand href
name "DeepSpace6"
target "http://www.deepspace6.net/"
literal "false"

\end_inset

 via FTP 
\begin_inset CommandInset href
LatexCommand href
name "DeepSpace6 / anonymous FTP"
target "ftp://ftp.deepspace6.net/pub/ds6/sources/ipv6calc/"
literal "false"

\end_inset

 or HTTP 
\begin_inset CommandInset href
LatexCommand href
name "www.deepspace6.net mapped FTP"
target "http://www.deepspace6.net/ftp/pub/ds6/sources/ipv6calc/"
literal "false"

\end_inset


\end_layout

\begin_layout Itemize
via 
\begin_inset CommandInset href
LatexCommand href
name "ftp.bieringer.de / anonymous FTP"
target "ftp://ftp.bieringer.de/pub/linux/IPv6/ipv6calc/"
literal "false"

\end_inset

 or HTTP at 
\begin_inset CommandInset href
LatexCommand href
name "www.bieringer.de mapped FTP"
target "http://www.bieringer.de/ftp/pub/linux/IPv6/ipv6calc/"
literal "false"

\end_inset


\end_layout

\begin_layout Standard
Since version 0.95.0 packages are signed with new GPG key, also available
 here: 
\begin_inset CommandInset href
LatexCommand href
name "CODE-GPG-KEY-bieringer.de-2013 @ftp.bieringer.de"
target "ftp://ftp.bieringer.de/pub/linux/IPv6/ipv6calc/CODE-GPG-KEY-bieringer.de-2013"
literal "false"

\end_inset

 or 
\begin_inset CommandInset href
LatexCommand href
name "CODE-GPG-KEY-bieringer.de-2013 @ftp.deepspace6.net"
target "ftp://ftp.deepspace6.net/pub/ds6/sources/ipv6calc/CODE-GPG-KEY-bieringer.de-2013"
literal "false"

\end_inset


\end_layout

\begin_layout Code
Key fingerprint: AAB3 8CB7 97C7 50C7 78C6 08C6 DDEB 141D F738 0F61
\end_layout

\begin_layout Code
uid: Peter Bieringer (Code Signing Key 2013) <code@bieringer.de>
\end_layout

\begin_layout Standard
A SPEC file is included, so you can build a RPM from tar.gz using
\end_layout

\begin_layout Code
$ rpmbuild -ta path/to/ipv6calc-$version.tar.gz
\end_layout

\begin_layout Standard
In addition, conditional build options are available (see related configure
 options below):
\end_layout

\begin_layout Code
--without ip2location
\end_layout

\begin_layout Code
--without mmdb (which disables GeoIP v2 and db-ip.com v2)
\end_layout

\begin_layout Code
--without external
\end_layout

\begin_layout Code
--without shared
\end_layout

\begin_layout Code
--without mod_ipv6calc
\end_layout

\begin_layout Subsubsection
as RPM
\end_layout

\begin_layout Standard
Can be searched via 
\begin_inset CommandInset href
LatexCommand href
name "rpmfind / ipv6calc"
target "http://www.rpmfind.net/linux/rpm2html/search.php?query=ipv6calc"
literal "false"

\end_inset

.
\end_layout

\begin_layout Subsection
Ready to use packages for several operating systems:
\end_layout

\begin_layout Subsubsection
Fedora Linux
\end_layout

\begin_layout Standard
Fedora 29 is the current developing platform, so use given hints above to
 create a RPM.
 Since Fedora 7 this package is included by default.
\end_layout

\begin_layout Standard
See also 
\begin_inset CommandInset href
LatexCommand href
name "FedoraProject / Packages / ipv6calc"
target "https://src.fedoraproject.org/rpms/ipv6calc"
literal "false"

\end_inset


\end_layout

\begin_layout Subsubsection
Red Hat Enterprise Linux and clones
\end_layout

\begin_layout Standard
It's tested by the developer that creation of the RPM is working fine starting
 with RHEL 4.
\end_layout

\begin_layout Itemize
Major version 5 has the package included by default (but a rather old version)
\begin_inset Separator latexpar
\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
RPMs of newer releases are available as test builds on koji, see related
 URL in announcements 
\begin_inset CommandInset href
LatexCommand href
name "ipv6calc-announce / list archive"
target "https://lists.deepspace6.net/pipermail/ipv6calc-announce/"
literal "false"

\end_inset


\end_layout

\begin_layout Itemize
*** Untested since version 2.0.0 because OS is out of support ***
\end_layout

\end_deeper
\begin_layout Itemize
Major version 6: available since September 2014 on 
\begin_inset CommandInset href
LatexCommand href
name "FedoraProject / EPEL"
target "https://fedoraproject.org/wiki/EPEL"
literal "false"

\end_inset

, see also 
\begin_inset CommandInset href
LatexCommand href
name "FedoraProject / Packages / ipv6calc"
target "https://src.fedoraproject.org/rpms/ipv6calc"
literal "false"

\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
*** Untested since version 3.0.1 because OS is out of support ***
\end_layout

\end_deeper
\begin_layout Itemize
Major version 7: available since Decenber 2016 on 
\begin_inset CommandInset href
LatexCommand href
name "FedoraProject / EPEL"
target "https://fedoraproject.org/wiki/EPEL"
literal "false"

\end_inset

, see also 
\begin_inset CommandInset href
LatexCommand href
name "FedoraProject / Packages / ipv6calc"
target "https://src.fedoraproject.org/rpms/ipv6calc"
literal "false"

\end_inset


\end_layout

\begin_layout Itemize
Major version 8: available since September 2019 on 
\begin_inset CommandInset href
LatexCommand href
name "FedoraProject / EPEL"
target "https://fedoraproject.org/wiki/EPEL"
literal "false"

\end_inset

, see also 
\begin_inset CommandInset href
LatexCommand href
name "FedoraProject / Packages / ipv6calc"
target "https://src.fedoraproject.org/rpms/ipv6calc"
literal "false"

\end_inset


\end_layout

\begin_layout Standard
CentOS 7 and Rocky 8 are also platforms for regression tests.
\end_layout

\begin_layout Subsubsection
Gentoo/Funtoo
\end_layout

\begin_layout Standard
Package is maintained, nevertheless, Funtoo is used as platform for regression
 tests.
\end_layout

\begin_layout Subsubsection
Ubuntu
\end_layout

\begin_layout Standard
Package is maintained, more information can be found at 
\begin_inset CommandInset href
LatexCommand href
name "https://packages.ubuntu.com/ipv6calc"
target "https://packages.ubuntu.com/ipv6calc"
literal "false"

\end_inset


\end_layout

\begin_layout Subsubsection
Debian GNU/Linux
\end_layout

\begin_layout Standard
Package is maintained, more information can be found at 
\begin_inset CommandInset href
LatexCommand href
name "http://packages.debian.org/ipv6calc"
target "http://packages.debian.org/ipv6calc"
literal "false"

\end_inset


\end_layout

\begin_layout Subsubsection
openSUSE
\end_layout

\begin_layout Standard
Package is maintained, more information can be found at 
\begin_inset CommandInset href
LatexCommand href
name "http://download.opensuse.org/repositories/home:/uebelhacker/"
target "http://download.opensuse.org/repositories/home:/uebelhacker/"
literal "false"

\end_inset


\end_layout

\begin_layout Subsubsection
NetBSD
\end_layout

\begin_layout Standard
See here for more: 
\begin_inset CommandInset href
LatexCommand href
name "ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/net/ipv6calc/README.html"
target "ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/net/ipv6calc/README.html"
literal "false"

\end_inset


\end_layout

\begin_layout Subsubsection
FreeBSD
\end_layout

\begin_layout Standard
See here for more: 
\begin_inset CommandInset href
LatexCommand href
name "http://www.freshports.org/net-mgmt/ipv6calc/"
target "http://www.freshports.org/net-mgmt/ipv6calc/"
literal "false"

\end_inset

 (
\begin_inset CommandInset href
LatexCommand href
name "http://www.freebsd.org/cgi/query-pr.cgi?pr=34441"
target "http://www.freebsd.org/cgi/query-pr.cgi?pr=34441"
literal "false"

\end_inset

)
\end_layout

\begin_layout Subsubsection
OpenBSD
\end_layout

\begin_layout Standard
See here for more: 
\begin_inset CommandInset href
LatexCommand href
name "http://www.openbsd.org/cgi-bin/cvsweb/ports/net/ipv6calc/"
target "http://www.openbsd.org/cgi-bin/cvsweb/ports/net/ipv6calc/"
literal "false"

\end_inset


\end_layout

\begin_layout Section
Configuring & Compiling
\end_layout

\begin_layout Subsection
Configuring
\end_layout

\begin_layout Standard
Following 
\begin_inset Quotes eld
\end_inset

ipc6calc
\begin_inset Quotes erd
\end_inset

 related configure options are currently supported (note: disabling the
 internal databases reduces the size of the resulting binaries/shared library
 a lot):
\end_layout

\begin_layout Code
--disable-dynamic-load  Disable dynamic load of libraries (default: enabled)
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
--disable-db-ieee       Disable build-in IEEE database (default: enabled)
\end_layout

\begin_layout Code
--disable-db-ipv4       Disable build-in IPv4 database (default: enabled)
\end_layout

\begin_layout Code
--disable-db-ipv6       Disable build-in IPv6 database (default: enabled)
\end_layout

\begin_layout Code
--disable-db-as-registry Disable built-in AS-to-Registry database (default:
 enabled)
\end_layout

\begin_layout Code
--disable-db-cc-registry Disable built-in CountryCode-to-Registry database
 (default: enabled) 
\end_layout

\begin_layout Code
--disable-geoip2        Disable MaxMindDB support for GeoIP (default: enabled)
\end_layout

\begin_layout Code
--disable-dbip2         Disable MaxMindDB support for db-ip.com (default:
 enabled) 
\end_layout

\begin_layout Code
--enable-mmdb           Enable MaxMindDB support (GeoIP/db-ip.com) (default:
 disabled) 
\end_layout

\begin_layout Code
--enable-external       Enable external db support (default: disabled) 
\end_layout

\begin_layout Code
--enable-ip2location    Enable IP2Location support (default: disabled)
\end_layout

\begin_layout Code
--enable-mod_ipv6calc   Enable build of mod_ipv6calc for Apache (default:
 disabled) 
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
--with-mmdb-dynamic     Enable use of dynamic loading of MaxMindDB library
 (default=no)
\end_layout

\begin_layout Code
--with-mmdb-headers=DIR MaxMindDB include files location
\end_layout

\begin_layout Code
--with-mmdb-lib=DIR     MaxMindDB library location
\end_layout

\begin_layout Code
--with-mmdb-dyn-lib=NAME Use specified MaxMindDB dynamic library, default:
 libmaxminddb.so.0 
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
--with-ip2location-headers=DIR      IP2Location include files location
\end_layout

\begin_layout Code
--with-ip2location-headers-fallback IP2Location include files from internal
 fallback location (only usable with dynamic load option)              
            
\end_layout

\begin_layout Code
--with-ip2location-lib=FILE         IP2Location library location
\end_layout

\begin_layout Code
--with-ip2location-static           Explicitly link IP2Location statically
 (default=no)
\end_layout

\begin_layout Code
--with-ip2location-dynamic          Enable use of dynamic loading of IP2Location
 library (default=no)
\end_layout

\begin_layout Code
--with-ip2location-db=DIR           Use specified IP2Location database directory
, default: /usr/share/IP2Location
\end_layout

\begin_layout Code
--with-ip2location-dyn-lib=NAME     Use specified IP2Location dynamic library,
 default: libIP2Location.so
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
--with-geoip-db=DIR             Use specified GeoIP database directory,
 default: /usr/share/GeoIP
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
--with-dbip-db=DIR      Use specified db-ip.com database directory, default:
 /usr/share/DBIP
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
--with-external-db=DIR  Use specified external database directory, default:
 /usr/share/ipv6calc/db 
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
--with-apxs=NAME        name of the apxs executable (apxs) 
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
--enable-shared                 Enable shared library build (default: disabled)
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
--enable-bundled-getopt         Enable bundled getopt library (default:
 autoselected)
\end_layout

\begin_layout Code
--enable-bundled-md5            Enable bundled MD5 library (default: autoselecte
d)
\end_layout

\begin_layout Subsection
Compiling
\end_layout

\begin_layout Standard
As usual, use
\end_layout

\begin_layout Code
$ make
\end_layout

\begin_layout Standard
and run tests afterwards using
\end_layout

\begin_layout Code
$ make test
\end_layout

\begin_layout Standard
or at least (e.g.
 if external databases are not available)
\end_layout

\begin_layout Code
$ make test-minimal
\end_layout

\begin_layout Subsection
Configuring & Compiling with Presets
\end_layout

\begin_layout Standard
A shell script is included which can configure and compile with standard
 presets (also used during regression tests):
\end_layout

\begin_layout Code
$ ./autogen.sh -h
\end_layout

\begin_layout Code
Supported options:
\end_layout

\begin_layout Code
   -?|-h|--help        : this help
\end_layout

\begin_layout Code
   -n|--no-make        : stop before running 'make'
\end_layout

\begin_layout Code
   -a|--all            : enable GeoIP/IP2Location/db-ip.com/External/mod_ipv6calc
 support
\end_layout

\begin_layout Code
   -A|--ALL            : enable GeoIP/IP2Location/db-ip.com/External/mod_ipv6calc
 support with dynamic library support
\end_layout

\begin_layout Code
   -m|--mmdb           : enable MaxMindDB support (GeoIP/db-ip.com)
\end_layout

\begin_layout Code
   --mmdb-dyn|-M       : switch to dynamic library loading of MaxMindDB
\end_layout

\begin_layout Code
   --disable-geoip2    : disable MaxMindDB support for GeoIP
\end_layout

\begin_layout Code
   --disable-dbip2     : disable MaxMindDB support for db-ip.com
\end_layout

\begin_layout Code
   -i|--ip2location    : enable IP2Location support
\end_layout

\begin_layout Code
   --ip2location-dyn|-I: switch to dynamic library loading of IP2Location
\end_layout

\begin_layout Code
   -e|--external       : enable external database support
\end_layout

\begin_layout Code
   --disable-db-ieee   : disable built-in IEEE database
\end_layout

\begin_layout Code
   --disable-db-ipv4   : disable built-in IPv4 database
\end_layout

\begin_layout Code
   --disable-db-ipv6   : disable built-in IPv6 database
\end_layout

\begin_layout Code
   -S                  : enable shared library mode
\end_layout

\begin_layout Code
   --no-static-build   : skip static build
\end_layout

\begin_layout Code
   --no-test           : skip 'make test'
\end_layout

\begin_layout Code
   --clang             : use 'clang' instead of default (usually 'gcc')
\end_layout

\begin_layout Code
   --m32               : compile for 32-bit
\end_layout

\begin_layout Code
   --relax             : don't stop on compiler warnings
\end_layout

\begin_layout Section
Mailing Lists
\end_layout

\begin_layout Subsection
ipv6calc-announce
\end_layout

\begin_layout Description
Reason: sending announcements of new versions
\end_layout

\begin_layout Description
Traffic: very low
\end_layout

\begin_layout Description
Postings: only moderators are allowed to post
\end_layout

\begin_layout Description
Information: 
\begin_inset CommandInset href
LatexCommand href
name "DeepSpace6 / maillist ipv6calc-announce"
target "http://lists.deepspace6.net/listinfo/ipv6calc-announce"
literal "false"

\end_inset


\end_layout

\begin_layout Subsection
ipv6calc
\end_layout

\begin_layout Description
Reason: discussions
\end_layout

\begin_layout Description
Traffic: low
\end_layout

\begin_layout Description
Postings: subscribers
\end_layout

\begin_layout Description
Information: 
\begin_inset CommandInset href
LatexCommand href
name "DeepSpace6 / maillist ipv6calc"
target "http://lists.deepspace6.net/listinfo/ipv6calc"
literal "false"

\end_inset


\end_layout

\begin_layout Section
Bug Reports
\end_layout

\begin_layout Standard
You can send bug reports to the author himself or subscribe to maillist
 
\begin_inset Quotes eld
\end_inset

ipv6calc
\begin_inset Quotes erd
\end_inset

 and send it to the list.
\end_layout

\begin_layout Section
Features of ipv6calc
\end_layout

\begin_layout Subsection
Description
\end_layout

\begin_layout Standard
The main program named 
\begin_inset Quotes eld
\end_inset

ipv6calc
\begin_inset Quotes erd
\end_inset

 is able to recognize many (not only) IPv6 address formats and depending
 on a selectable action (not required) a selectable output format can be
 specified.
 Also it has the capability to show detailed information of an IPv4/IPv6
 address or anonymize it.
\end_layout

\begin_layout Subsection
List of built-in features
\end_layout

\begin_layout Standard
Option 
\begin_inset Quotes eld
\end_inset

-v
\begin_inset Quotes erd
\end_inset

 shows built-in features, depending on configuration before compiling:
\end_layout

\begin_layout Code
$ ipv6calc -v
\end_layout

\begin_layout Code
ipv6calc: version 3.0.0 GeoIP GeoIPv6 IP2Location IP2Location6 DBIPv4 DBIPv6
 DB_AS_REG DB_IPV4_REG DB_IPV6_REG DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC
 DB_IPV4_COUNTRY DB_IPV6_COUNTRY DB_IPV4_CITY DB_IPV6_CITY DB_IPV4_REGION
 DB_IPV6_REGION DB_CC_REG DB_IEEE DB_IPV4_INFO DB_IPV6_INFO DB_IPV4_GEONAMEID
 DB_IPV6_GEONAMEID ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC ANON_KEEP-T
YPE-GEONAMEID
\end_layout

\begin_layout Standard
Option 
\begin_inset Quotes eld
\end_inset

-v -v
\begin_inset Quotes erd
\end_inset

 (since 0.91.0) shows built-in features and capabilities in detail, depending
 on configuration before compiling:
\end_layout

\begin_layout Code
$ ipv6calc -vv
\end_layout

\begin_layout Code
ipv6calc: version 3.0.0 GeoIP GeoIPv6 IP2Location IP2Location6 DBIPv4 DBIPv6
 DB_AS_REG DB_IPV4_REG DB_IPV6_REG DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC
 DB_IPV4_COUNTRY DB_IPV6_COUNTRY DB_IPV4_CITY DB_IPV6_CITY DB_IPV4_REGION
 DB_IPV6_REGION DB_CC_REG DB_IEEE DB_IPV4_INFO DB_IPV6_INFO DB_IPV4_GEONAMEID
 DB_IPV6_GEONAMEID ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC ANON_KEEP-T
YPE-GEONAMEID
\end_layout

\begin_layout Code
Capabilities: GeoIP2(linked/MaxMindDB) IP2Location(linked) DBIP2(linked/MaxMindD
B) ExternalDatabase DB_AS_REG(BuiltIn) DB_CC_REG(BuiltIn) DB_IPV4_REG(BuiltIn)
 DB_IPV6_REG(BuiltIn) DB_IEEE(BuiltIn)
\end_layout

\begin_layout Code
Internal main     library version: 3.0.0  API: 3.0.0  (built-in)
\end_layout

\begin_layout Code
Internal database library version: 3.0.0  API: 3.0.0  (built-in)
\end_layout

\begin_layout Code
Compiled: Oct 13 2020  19:38:16
\end_layout

\begin_layout Code
MaxMindDB for GeoIP2/DBIP2 support enabled
\end_layout

\begin_layout Code
MaxMindDB dynamic library version (on this system): 1.4.2
\end_layout

\begin_layout Code
GeoIP2 (MaxMindDB) support enabled
\end_layout

\begin_layout Code
GeoIP2 available databases: Country4=1 Country6=1 ASN4=1 ASN6=1 City4=1
 City6=1
\end_layout

\begin_layout Code
IP2Location support enabled, compiled with API version: 8.2.0, dynamically
 linked with version: API=8.2.0 Major=8
\end_layout

\begin_layout Code
IP2Location available databases: Country4=1 Country6=1 ASN4=0 ASN6=0 City4=1
 City6=1
\end_layout

\begin_layout Code
DBIP2 (MaxMindDB) support enabled
\end_layout

\begin_layout Code
DBIP2 available databases: Country4=1 Country6=1 ASN4=1 ASN6=1 City4=1 City6=1
\end_layout

\begin_layout Code
External available databases: Country4=1 Country6=1 IPV4_REG=1 IPV6_REG=1
\end_layout

\begin_layout Code
BuiltIn databases available: ASN_REG=1 IPV4_REG=1 IPV6_REG=1 IEEE=1 CC_REG=1
\end_layout

\begin_layout Code
DB features: 0xff07ffff
\end_layout

\begin_layout Code
GeoIP(MaxMindDB): features available/implemented: 0x03063ff0/0x03063ff0
 (100%)
\end_layout

\begin_layout Code
GeoIP2: info of available databases in directory: /usr/share/GeoIP
\end_layout

\begin_layout Code
GeoIP2: IPv4/v6 CountryCode (FREE)    : [1] GeoLite2-Country.mmdb       
   (GeoLite2-Country Copyright (c) 2019 MaxMind All Rights Reserved, created:
 20191217-195954 UTC)
\end_layout

\begin_layout Code
GeoIP2: IPv4/v6 City (FREE)           : [2] GeoLite2-City.mmdb          
   (GeoLite2-City Copyright (c) 2019 MaxMind All Rights Reserved, created:
 20191217-200126 UTC)
\end_layout

\begin_layout Code
GeoIP2: IPv4/v6 ASN (FREE)            : [3] GeoLite2-ASN.mmdb           
   (GeoLite2-ASN Copyright (c) 2019 MaxMind All Rights Reserved, created:
 20190122-114228 UTC)
\end_layout

\begin_layout Code
GeoIP2: detected best databases FREE    Country4=2    Country6=2    City4=2
    City6=2  
\end_layout

\begin_layout Code
GeoIP2: detected best databases COMM    Country4=0    Country6=0    City4=0
    City6=0  
\end_layout

\begin_layout Code
GeoIP2: selected best databases normal  Country4=2    Country6=2    City4=2
    City6=2  
\end_layout

\begin_layout Code
GeoIP2: selected best databases method: COMM older than 12 months are deselected
 in case of FREE is available
\end_layout

\begin_layout Code
GeoIP2: selected best databases method: COMM/FREE with more features are
 only selected in case not older than 1 months of already found COMM/FREE
\end_layout

\begin_layout Code
IP2Location: features available/implemented: 0x0c003fc0/0x0c003fc0 (100%)
\end_layout

\begin_layout Code
IP2Location: info of available databases in directory: /usr/share/IP2Location
\end_layout

\begin_layout Code
IP2Location: Copyright (c) IP2Location All Rights Reserved
\end_layout

\begin_layout Code
IP2Location: IPv4 Country                                    :[ 49] IP-COUNTRY-S
AMPLE.BIN               (IP2L-DB1 IPv4 IPv6 SAMPLE 20201005)
\end_layout

\begin_layout Code
IP2Location: IPv4 Co/Re/Ci/LaLo/ZI/TZ/IS/Do/Ne/Ar/We/Mo      :[ 68] IP-COUNTRY-R
EGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE-ISP-DOMAIN-NETSPEED-AREACODE-WEAT
HER-MOBILE-SAMPLE.BIN (IP2L-DB20 IPv4 IPv6 SAMPLE 20190129)
\end_layout

\begin_layout Code
IP2Location: IPv4 Co/Re/Ci/LaLo/ZI/TZ/IS/Do/Ne/Ar/We/Mo/El/Us:[ 72] IP-COUNTRY-R
EGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE-ISP-DOMAIN-NETSPEED-AREACODE-WEAT
HER-MOBILE-ELEVATION-USAGETYPE-SAMPLE.BIN (IP2L-DB24 IPv4 IPv6 SAMPLE 20190129)
\end_layout

\begin_layout Code
IP2Location: IPv6 Country                                    :[ 73] IPV6-COUNTRY.
SAMPLE.BIN             (IP2L-DB1 IPv4 IPv6 SAMPLE 20201005)
\end_layout

\begin_layout Code
IP2Location: IPv6 Co/Re/Ci/LaLo/ZI/TZ/IS/Do/Ne/Ar/We/Mo      :[ 92] IPV6-COUNTRY
-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE-ISP-DOMAIN-NETSPEED-AREACODE-WE
ATHER-MOBILE.SAMPLE.BIN (IP2L-DB20 IPv4 IPv6 SAMPLE 20171128)
\end_layout

\begin_layout Code
IP2Location: IPv6 Co/Re/Ci/LaLo/ZI/TZ/IS/Do/Ne/Ar/We/Mo/El/Us:[ 96] IPV6-COUNTRY
-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE-ISP-DOMAIN-NETSPEED-AREACODE-WE
ATHER-MOBILE-ELEVATION-USAGETYPE.SAMPLE.BIN (IP2L-DB24 IPv4 IPv6 SAMPLE 20171128)
\end_layout

\begin_layout Code
IP2Location: IPvx Co/Re/Ci/LattLong/ZIP/TZ                   :[ 35] IPV6-COUNTRY
-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE.BIN (IP2L-DB11 IPv4 IPv6
 20181226)
\end_layout

\begin_layout Code
IP2Location: detected best databases SAMPLE  Country4=49   Country6=73 
  City4=72   City6=96 
\end_layout

\begin_layout Code
IP2Location: detected best databases LITE    Country4=0    Country6=0  
  City4=0    City6=0  
\end_layout

\begin_layout Code
IP2Location: detected best databases COMM    Country4=35   Country6=35 
  City4=35   City6=35 
\end_layout

\begin_layout Code
IP2Location: selected best databases LI->SA* Country4=0    Country6=0  
  City4=0    City6=0  
\end_layout

\begin_layout Code
IP2Location: selected best databases normal  Country4=35   Country6=35 
  City4=35   City6=35 
\end_layout

\begin_layout Code
IP2Location: selected best databases method: * = autoswitch from LITE to
 SAMPLE enabled in case not older than 12 months and having more features
\end_layout

\begin_layout Code
IP2Location: selected best databases method: COMM older than 12 months are
 deselected in case of LITE is available
\end_layout

\begin_layout Code
IP2Location: selected best databases method: COMM/LITE/SAMPLE with more
 features are only selected in case not older than 1 months of already found
 COMM/LITE/SAMPLE
\end_layout

\begin_layout Code
IP2Location: selected best databases method: softlinks: skipped-by-default
\end_layout

\begin_layout Code
db-ip.com(MaxMindDB): features available/implemented: 0x30063ff0/0x30063ff0
 (100%)
\end_layout

\begin_layout Code
DBIP2: info of available databases in directory: /usr/share/DBIP
\end_layout

\begin_layout Code
DBIP2: IPv4/v6 CountryCode (FREE)    : [1] dbip-country-lite.mmdb       
  (DBIP-Country-Lite Copyright (c) 2019 db-ip.com All Rights Reserved, created:
 20190831-232938 UTC)
\end_layout

\begin_layout Code
DBIP2: IPv4/v6 City (FREE)           : [2] dbip-city-lite.mmdb          
  (DBIP-City-Lite Copyright (c) 2019 db-ip.com All Rights Reserved, created:
 20190831-233248 UTC)
\end_layout

\begin_layout Code
DBIP2: IPv4/v6 Location+ISP (COMM)   : [6] dbip-location-isp.mmdb       
  (DBIP-Location-ISP (compat=Enterprise) Copyright (c) 2019 db-ip.com All
 Rights Reserved, created: 20190101-015418 UTC)
\end_layout

\begin_layout Code
DBIP2: detected best databases FREE    Country4=2    Country6=2    City4=2
    City6=2  
\end_layout

\begin_layout Code
DBIP2: detected best databases COMM    Country4=6    Country6=6    City4=6
    City6=6  
\end_layout

\begin_layout Code
DBIP2: selected best databases normal  Country4=6    Country6=6    City4=6
    City6=6  
\end_layout

\begin_layout Code
DBIP2: selected best databases method: COMM older than 12 months are deselected
 in case of FREE is available
\end_layout

\begin_layout Code
DBIP2: selected best databases method: COMM/FREE with more features are
 only selected in case not older than 1 months of already found COMM/FREE
\end_layout

\begin_layout Code
External: features available/implemented: 0xc00180cc/0xc00180cc (100%)
\end_layout

\begin_layout Code
External: info of available databases in directory: /usr/share/ipv6calc/db
\end_layout

\begin_layout Code
External: IPv4 Registry       : ipv6calc-external-ipv4-registry.db      
 (EXTDB-1/AFRINIC/20200904 APNIC/20200903 ARIN/20200903 IANA/20191227 LACNIC/202
00903 LISP/20200318 RIPENCC/20200903, created: 20200904-061346 UTC)
\end_layout

\begin_layout Code
External: IPv6 Registry       : ipv6calc-external-ipv6-registry.db      
 (EXTDB-2/AFRINIC/20200904 APNIC/20200903 ARIN/20200903 IANA/20191106 LACNIC/202
00903 LISP/20200318 RIPENCC/20200903, created: 20200904-063305 UTC)
\end_layout

\begin_layout Code
External: IPv4 CountryCode    : ipv6calc-external-ipv4-countrycode.db   
 (EXTDB-3/AFRINIC/20200904 APNIC/20200903 ARIN/20200903 IANA/20191227 LACNIC/202
00903 LISP/20200318 RIPENCC/20200903, created: 20200904-061347 UTC)
\end_layout

\begin_layout Code
External: IPv6 CountryCode    : ipv6calc-external-ipv6-countrycode.db   
 (EXTDB-4/AFRINIC/20200904 APNIC/20200903 ARIN/20200903 IANA/20191106 LACNIC/202
00903 LISP/20200318 RIPENCC/20200903, created: 20200904-063305 UTC)
\end_layout

\begin_layout Code
BuiltIn: features available/implemented: 0x0001c00f/0x0001c00f (100%)
\end_layout

\begin_layout Code
BuiltIn: info of available databases
\end_layout

\begin_layout Code
BuiltIn: ASN  : IANA/20200518
\end_layout

\begin_layout Code
BuiltIn: CC   : AFRINIC/20201012 APNIC/20201010 ARIN/20201011 LACNIC/20201009
 RIPENCC/20201011
\end_layout

\begin_layout Code
BuiltIn: IPv4 : AFRINIC/20201012 APNIC/20201010 ARIN/20201011 IANA/20191227
 LACNIC/20201009 LISP/20200318 RIPENCC/20201011 (created: 20201012-064251
 UTC)
\end_layout

\begin_layout Code
BuiltIn: IPv6 : AFRINIC/20201012 APNIC/20201010 ARIN/20201011 IANA/20191106
 LACNIC/20201009 LISP/20200318 RIPENCC/20201011 (created: 20201012-070210
 UTC)
\end_layout

\begin_layout Code
BuiltIn: IEEE : IAB/20201012 OUI/20201012 OUI28/20201012 OUI36/20201012
\end_layout

\begin_layout Code
Database selection or priorization ('->': subsequential calls)
\end_layout

\begin_layout Code
Database priorization default: GeoIP(MaxMindDB)->IP2Location->db-ip.com(MaxMindDB
)->GeoIP->db-ip.com->External->BuiltIn
\end_layout

\begin_layout Code
DB_AS_REG (AS-Number to Registry database): BuiltIn
\end_layout

\begin_layout Code
DB_CC_REG (CountryCode to Registry database): BuiltIn
\end_layout

\begin_layout Code
DB_IPV4_REG (IPv4 to Registry database): BuiltIn
\end_layout

\begin_layout Code
DB_IPV6_REG (IPv6 to Registry database): BuiltIn
\end_layout

\begin_layout Code
DB_IPV4_AS (IPv4 to AS database): GeoIP(MaxMindDB)->db-ip.com(MaxMindDB)
\end_layout

\begin_layout Code
DB_IPV6_AS (IPv6 to AS database): GeoIP(MaxMindDB)->db-ip.com(MaxMindDB)
\end_layout

\begin_layout Code
DB_IPV4_CC (IPv4 to CountryCode database): GeoIP(MaxMindDB)->IP2Location->db-ip.c
om(MaxMindDB)->External
\end_layout

\begin_layout Code
DB_IPV6_CC (IPv6 to CountryCode database): GeoIP(MaxMindDB)->IP2Location->db-ip.c
om(MaxMindDB)->External
\end_layout

\begin_layout Code
DB_IPV4_COUNTRY (IPv4 to Country database): GeoIP(MaxMindDB)->IP2Location->db-ip.
com(MaxMindDB)
\end_layout

\begin_layout Code
DB_IPV6_COUNTRY (IPv6 to Country database): GeoIP(MaxMindDB)->IP2Location->db-ip.
com(MaxMindDB)
\end_layout

\begin_layout Code
DB_IPV4_CITY (IPv4 to City database): GeoIP(MaxMindDB)->IP2Location->db-ip.com(Ma
xMindDB)
\end_layout

\begin_layout Code
DB_IPV6_CITY (IPv6 to City database): GeoIP(MaxMindDB)->IP2Location->db-ip.com(Ma
xMindDB)
\end_layout

\begin_layout Code
DB_IPV4_REGION (IPv4 to Region database): GeoIP(MaxMindDB)->IP2Location->db-ip.co
m(MaxMindDB)
\end_layout

\begin_layout Code
DB_IPV6_REGION (IPv6 to Region database): GeoIP(MaxMindDB)->IP2Location->db-ip.co
m(MaxMindDB)
\end_layout

\begin_layout Code
DB_IEEE (IEEE/OUI/OUI28/OUI36 Vendor database): BuiltIn
\end_layout

\begin_layout Code
DB_IPV4_INFO (IPv4 additional information): External->BuiltIn
\end_layout

\begin_layout Code
DB_IPV6_INFO (IPv6 additional information): External->BuiltIn
\end_layout

\begin_layout Code
DB_IPV4_GEONAMEID (IPv4 GeonameID): GeoIP(MaxMindDB)->db-ip.com(MaxMindDB)
\end_layout

\begin_layout Code
DB_IPV6_GEONAMEID (IPv6 GeonameID): GeoIP(MaxMindDB)->db-ip.com(MaxMindDB)
\end_layout

\begin_layout Standard
Option 
\begin_inset Quotes eld
\end_inset

-v -h
\begin_inset Quotes erd
\end_inset

 (since 0.97.4) shows explanation of feature tokens
\end_layout

\begin_layout Code
$ ipv6calc -v -h
\end_layout

\begin_layout Code
ipv6calc: version 3.0.0 GeoIP GeoIPv6 IP2Location IP2Location6 DBIPv4 DBIPv6
 DB_AS_REG DB_IPV4_REG DB_IPV6_REG DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC
 DB_IPV4_COUNTRY DB_IPV6_COUNTRY DB_IPV4_CITY DB_IPV6_CITY DB_IPV4_REGION
 DB_IPV6_REGION DB_CC_REG DB_IEEE DB_IPV4_INFO DB_IPV6_INFO DB_IPV4_GEONAMEID
 DB_IPV6_GEONAMEID ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC ANON_KEEP-T
YPE-GEONAMEID
\end_layout

\begin_layout Code
Explanation of available(x)/possible(o) feature tokens
\end_layout

\begin_layout Code
GeoIP                    x GeoIPv4 database (provided by GeoIP(MaxMindDB))
\end_layout

\begin_layout Code
GeoIPv6                  x GeoIPv6 database (provided by GeoIP(MaxMindDB))
\end_layout

\begin_layout Code
IP2Location              x IP2Location IPv4 database (provided by IP2Location)
\end_layout

\begin_layout Code
IP2Location6             x IP2Location IPv6 database (provided by IP2Location)
\end_layout

\begin_layout Code
DBIPv4                   x db-ip.com IPv4 database (provided by db-ip.com(MaxMindD
B))
\end_layout

\begin_layout Code
DBIPv6                   x db-ip.com IPv6 database (provided by db-ip.com(MaxMindD
B))
\end_layout

\begin_layout Code
DB_AS_REG                x AS-Number to Registry database (provided by BuiltIn)
\end_layout

\begin_layout Code
DB_IPV4_REG              x IPv4 to Registry database (provided by External,Built
In)
\end_layout

\begin_layout Code
DB_IPV6_REG              x IPv6 to Registry database (provided by External,Built
In)
\end_layout

\begin_layout Code
DB_IPV4_AS               x IPv4 to AS database (provided by GeoIP(MaxMindDB),db-
ip.com(MaxMindDB))
\end_layout

\begin_layout Code
DB_IPV6_AS               x IPv6 to AS database (provided by GeoIP(MaxMindDB),db-
ip.com(MaxMindDB))
\end_layout

\begin_layout Code
DB_IPV4_CC               x IPv4 to CountryCode database (provided by GeoIP(MaxMi
ndDB),IP2Location,db-ip.com(MaxMindDB),External)
\end_layout

\begin_layout Code
DB_IPV6_CC               x IPv6 to CountryCode database (provided by GeoIP(MaxMi
ndDB),IP2Location,db-ip.com(MaxMindDB),External)
\end_layout

\begin_layout Code
DB_IPV4_COUNTRY          x IPv4 to Country database (provided by GeoIP(MaxMindDB
),IP2Location,db-ip.com(MaxMindDB))
\end_layout

\begin_layout Code
DB_IPV6_COUNTRY          x IPv6 to Country database (provided by GeoIP(MaxMindDB
),IP2Location,db-ip.com(MaxMindDB))
\end_layout

\begin_layout Code
DB_IPV4_CITY             x IPv4 to City database (provided by GeoIP(MaxMindDB),I
P2Location,db-ip.com(MaxMindDB))
\end_layout

\begin_layout Code
DB_IPV6_CITY             x IPv6 to City database (provided by GeoIP(MaxMindDB),I
P2Location,db-ip.com(MaxMindDB))
\end_layout

\begin_layout Code
DB_IPV4_REGION           x IPv4 to Region database (provided by GeoIP(MaxMindDB)
,IP2Location,db-ip.com(MaxMindDB))
\end_layout

\begin_layout Code
DB_IPV6_REGION           x IPv6 to Region database (provided by GeoIP(MaxMindDB)
,IP2Location,db-ip.com(MaxMindDB))
\end_layout

\begin_layout Code
DB_CC_REG                x CountryCode to Registry database (provided by
 BuiltIn)
\end_layout

\begin_layout Code
DB_IEEE                  x IEEE/OUI/OUI28/OUI36 Vendor database (provided
 by BuiltIn)
\end_layout

\begin_layout Code
DB_IPV4_INFO             x IPv4 additional information (provided by External,Bui
ltIn)
\end_layout

\begin_layout Code
DB_IPV6_INFO             x IPv6 additional information (provided by External,Bui
ltIn)
\end_layout

\begin_layout Code
DB_IPV4_GEONAMEID        x IPv4 GeonameID (provided by GeoIP(MaxMindDB),db-ip.com
(MaxMindDB))
\end_layout

\begin_layout Code
DB_IPV6_GEONAMEID        x IPv6 GeonameID (provided by GeoIP(MaxMindDB),db-ip.com
(MaxMindDB))
\end_layout

\begin_layout Code
ANON_ZEROISE             x Anonymization method 'zeroize'
\end_layout

\begin_layout Code
ANON_ANONYMIZE           x Anonymization method 'anonymize'
\end_layout

\begin_layout Code
ANON_KEEP-TYPE-ASN-CC    x Anonymization method 'keep-type-asn-cc'
\end_layout

\begin_layout Code
ANON_KEEP-TYPE-GEONAMEID x Anonymization method 'keep-type-geonameid'
\end_layout

\begin_layout Standard
Note: since version 0.95.0 the internal layer for database usage was abstracted
 and each database 
\begin_inset Quotes eld
\end_inset

plugin
\begin_inset Quotes erd
\end_inset

 is initialized reporting then its supporting features in binary representation.
 This makes implementation of other external databases easier in the future.
 There are at least plans to create an overlay to built-in databases by
 publishing and use some 
\begin_inset Quotes eld
\end_inset

precompiled
\begin_inset Quotes erd
\end_inset

 newer databases replacing the need of recompilation for updated built-in
 databases.
\end_layout

\begin_layout Subsection
Examples
\end_layout

\begin_layout Subsubsection
Conversion
\end_layout

\begin_layout Standard
A simple example is the conversion of an IPv6 address to a DNS PTR query
 string:
\end_layout

\begin_layout Code
$ ipv6calc --out revnibbles.arpa 2001:db8::1
\end_layout

\begin_layout Code
No input type specified, try autodetection...found type: ipv6addr
\end_layout

\begin_layout Code
1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.
\end_layout

\begin_layout Standard
Like you see, input format was autodetected.
 And the given example can be extended because ipv6calc also understands
 netmask / prefix length values:
\end_layout

\begin_layout Code
$ ipv6calc -q --out revnibbles.arpa 2001:db8::1/64
\end_layout

\begin_layout Code
0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.
\end_layout

\begin_layout Standard
Also you've also learnt now that switch '-q' (quiet) suppresses informational
 messages.
 You can use this now to start a DNS PTR query using:
\end_layout

\begin_layout Code
$ dig PTR `./ipv6calc -q --out revnibbles.arpa 2001:db8::1/64`
\end_layout

\begin_layout Standard
But ipv6calc can do many more for you! Next example shows you the extraction
 of the IPv4 address contained in a 6to4 IPv6 address:
\end_layout

\begin_layout Code
$ ipv6calc -q --action conv6to4 --in ipv6 2002:c0a8:fb61::1 --out ipv4
\end_layout

\begin_layout Code
192.168.251.97
\end_layout

\begin_layout Standard
This also works vice-versa:
\end_layout

\begin_layout Code
$ ipv6calc -q --action conv6to4 --in ipv4 192.168.251.97 --out ipv6
\end_layout

\begin_layout Code
2002:c0a8:fb61::
\end_layout

\begin_layout Standard
There are many more features already implemented, if you miss one, send
 a note.
\end_layout

\begin_layout Subsubsection
Information
\end_layout

\begin_layout Standard
Depending on available databases output can vary.
\end_layout

\begin_layout Paragraph
Information about a simple IPv6 address:
\end_layout

\begin_layout Code
$ ipv6calc -q -i 3ffe:ffff::210:a4ff:fe01:2345
\end_layout

\begin_layout Code
Address type: unicast, 6bone, global-unicast, productive
\end_layout

\begin_layout Code
Address type has SLA: 0000
\end_layout

\begin_layout Code
Registry for address: reserved
\end_layout

\begin_layout Code
Interface identifier: 0210:a4ff:fe01:2345
\end_layout

\begin_layout Code
EUI-48/MAC address: 00:10:a4:01:23:45
\end_layout

\begin_layout Code
MAC is a global unique one
\end_layout

\begin_layout Code
MAC is an unicast one
\end_layout

\begin_layout Code
OUI is: XIRCOM
\end_layout

\begin_layout Paragraph
Information about a Teredo IPv6 address:
\end_layout

\begin_layout Code
$ ipv6calc -q -i 3ffe:831f:ce49:7601:8000:efff:af4a:86BF
\end_layout

\begin_layout Code
Address type: unicast, 6bone, global-unicast, teredo
\end_layout

\begin_layout Code
Country Code: IT
\end_layout

\begin_layout Code
Registry for address: 6BONE
\end_layout

\begin_layout Code
IPv4 address: 80.181.121.64 (TEREDO-CLIENT)
\end_layout

\begin_layout Code
IPv4 address type: unicast, global
\end_layout

\begin_layout Code
Autonomous System Information for [80.181.121.64]: AS3269 ASN-IBSNAZ
\end_layout

\begin_layout Code
Country Code for [80.181.121.64]: IT 
\end_layout

\begin_layout Code
...
\end_layout

\begin_layout Paragraph
Information about a LISP address
\end_layout

\begin_layout Code
$ ipv6calc -q -i 153.16.26.80
\end_layout

\begin_layout Code
IPv4 address: 153.16.26.80
\end_layout

\begin_layout Code
IPv4 address type: unicast, global, lisp
\end_layout

\begin_layout Code
...
\end_layout

\begin_layout Code
IPv4 registry: ARIN(LISP#cbc-xtr) 
\end_layout

\begin_layout Code
...
\end_layout

\begin_layout Paragraph
Machine readable output
\end_layout

\begin_layout Standard
There exists also a machine readable output (e.g.
 used by 'ipv6calcweb.cgi') - in addition, database related information can
 be displayed, if databases are located on the system and supported.
\end_layout

\begin_layout Code
$ ipv6calc -q -i -m 2a01:238:423d:8800:85b3:9e6b:3019:8909  
\end_layout

\begin_layout Code
IPV6=2a01:0238:423d:8800:85b3:9e6b:3019:8909
\end_layout

\begin_layout Code
IPV6_ANON=a909:16fa:9091:a448:a909:4941:0000:0007
\end_layout

\begin_layout Code
IPV6_TYPE=ipv6,unicast,global-unicast,productive,iid-random,iid,iid-local
\end_layout

\begin_layout Code
IPV6_COUNTRYCODE=DE
\end_layout

\begin_layout Code
IPV6_COUNTRYCODE_SOURCE=GeoIP(MaxMindDB)
\end_layout

\begin_layout Code
IPV6_AS_NUM=6724
\end_layout

\begin_layout Code
IPV6_AS_SOURCE=GeoIP(MaxMindDB)
\end_layout

\begin_layout Code
IPV6_GEONAME_ID=2921044
\end_layout

\begin_layout Code
IPV6_GEONAME_ID_SOURCE=GeoIP(MaxMindDB)
\end_layout

\begin_layout Code
IPV6_GEONAME_ID_TYPE=Country
\end_layout

\begin_layout Code
IPV6_REGISTRY=RIPENCC
\end_layout

\begin_layout Code
SLA=8800
\end_layout

\begin_layout Code
IID=85b3:9e6b:3019:8909
\end_layout

\begin_layout Code
EUI64_SCOPE=local-random
\end_layout

\begin_layout Code
IP2LOCATION_COUNTRY_SHORT=DE
\end_layout

\begin_layout Code
IP2LOCATION_COUNTRY_LONG=Germany
\end_layout

\begin_layout Code
IP2LOCATION_REGION=Berlin
\end_layout

\begin_layout Code
IP2LOCATION_CITY=Berlin
\end_layout

\begin_layout Code
IP2LOCATION_ZIPCODE=10178
\end_layout

\begin_layout Code
IP2LOCATION_LATITUDE=52.524368
\end_layout

\begin_layout Code
IP2LOCATION_LONGITUDE=13.410530
\end_layout

\begin_layout Code
IP2LOCATION_TIMEZONE=+01:00
\end_layout

\begin_layout Code
GEOIP2_CONTINENT_SHORT=EU
\end_layout

\begin_layout Code
GEOIP2_CONTINENT_LONG=Europe
\end_layout

\begin_layout Code
GEOIP2_COUNTRY_SHORT=DE
\end_layout

\begin_layout Code
GEOIP2_COUNTRY_LONG=Germany
\end_layout

\begin_layout Code
GEOIP2_LATITUDE=51.000000
\end_layout

\begin_layout Code
GEOIP2_LONGITUDE=9.000000
\end_layout

\begin_layout Code
GEOIP2_RADIUS=100
\end_layout

\begin_layout Code
GEOIP2_TIMEZONE_NAME=Europe/Berlin
\end_layout

\begin_layout Code
GEOIP2_AS_NUM=6724
\end_layout

\begin_layout Code
GEOIP2_AS_ORGNAME=Strato AG
\end_layout

\begin_layout Code
GEOIP2_GEONAME_ID_COUNTRY=2921044
\end_layout

\begin_layout Code
GEOIP2_GEONAME_ID_CONTINENT=6255148
\end_layout

\begin_layout Code
DBIP2_CONTINENT_SHORT=EU
\end_layout

\begin_layout Code
DBIP2_CONTINENT_LONG=Europe
\end_layout

\begin_layout Code
DBIP2_COUNTRY_SHORT=DE
\end_layout

\begin_layout Code
DBIP2_COUNTRY_LONG=Germany
\end_layout

\begin_layout Code
DBIP2_REGION=Berlin
\end_layout

\begin_layout Code
DBIP2_CITY=Berlin (Charlottenburg-Wilmersdorf)
\end_layout

\begin_layout Code
DBIP2_ZIPCODE=10587
\end_layout

\begin_layout Code
DBIP2_LATITUDE=52.523900
\end_layout

\begin_layout Code
DBIP2_LONGITUDE=13.321400
\end_layout

\begin_layout Code
DBIP2_WEATHERSTATIONCODE=GMXX8538
\end_layout

\begin_layout Code
DBIP2_TIMEZONE_NAME=Europe/Berlin
\end_layout

\begin_layout Code
DBIP2_AS_NUM=6724
\end_layout

\begin_layout Code
DBIP2_AS_ORGNAME=Strato AG
\end_layout

\begin_layout Code
DBIP2_ISP=Strato Rechenzentrum
\end_layout

\begin_layout Code
DBIP2_NETSPEED=Corporate
\end_layout

\begin_layout Code
DBIP2_GEONAME_ID=3336294
\end_layout

\begin_layout Code
DBIP2_GEONAME_ID_REGION=2950157
\end_layout

\begin_layout Code
DBIP2_GEONAME_ID_COUNTRY=2921044
\end_layout

\begin_layout Code
DBIP2_GEONAME_ID_CONTINENT=6255148
\end_layout

\begin_layout Code
EXTERNAL_COUNTRY_SHORT=DE
\end_layout

\begin_layout Code
IP2LOCATION_DATABASE_INFO=IP2L-DB11 IPv4 IPv6 20181226 Copyright (c) 2018
 IP2Location All Rights Reserved
\end_layout

\begin_layout Code
GEOIP2_DATABASE_INFO=GeoLite2-City Copyright (c) 2019 MaxMind All Rights
 Reserved, created: 20191217-200126 UTC / GeoLite2-ASN Copyright (c) 2019
 MaxMind All Rights Reserved, created: 20190122-114228 UTC
\end_layout

\begin_layout Code
DBIP2_DATABASE_INFO=DBIP-Location-ISP (compat=Enterprise) Copyright (c)
 2019 db-ip.com All Rights Reserved, created: 20190101-015418 UTC
\end_layout

\begin_layout Code
EXTERNAL_DATABASE_INFO=EXTDB-4/AFRINIC/20200904 APNIC/20200903 ARIN/20200903
 IANA/20191106 LACNIC/20200903 LISP/20200318 RIPENCC/20200903, created:
 20200904-063305 UTC
\end_layout

\begin_layout Code
BUILTIN_DATABASE_INFO=IPv6-REG:AFRINIC/20201012 APNIC/20201010 ARIN/20201011
 IANA/20191106 LACNIC/20201009 LISP/20200318 RIPENCC/20201011
\end_layout

\begin_layout Code
IPV6CALC_NAME=ipv6calc
\end_layout

\begin_layout Code
IPV6CALC_VERSION=3.0.0
\end_layout

\begin_layout Code
IPV6CALC_COPYRIGHT="(P) & (C) 2001-2020 by Peter Bieringer <pb (at) bieringer.de>
"
\end_layout

\begin_layout Code
IPV6CALC_OUTPUT_VERSION=21
\end_layout

\begin_layout Code
IPV6CALC_SETTINGS_ANON="set=keep-type-asn-cc,mask-ipv6=56,mask-ipv4=24,mask-eui6
4=40,mask-mac=24,method=keep-type-asn-cc"
\end_layout

\begin_layout Code
IPV6CALC_FEATURES="GeoIP GeoIPv6 IP2Location IP2Location6 DBIPv4 DBIPv6
 DB_AS_REG DB_IPV4_REG DB_IPV6_REG DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC
 DB_IPV4_COUNTRY DB_IPV6_COUNTRY DB_IPV4_CITY DB_IPV6_CITY DB_IPV4_REGION
 DB_IPV6_REGION DB_CC_REG DB_IEEE DB_IPV4_INFO DB_IPV6_INFO DB_IPV4_GEONAMEID
 DB_IPV6_GEONAMEID ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC ANON_KEEP-T
YPE-GEONAMEID"
\end_layout

\begin_layout Code
IPV6CALC_CAPABILITIES="GeoIP2(linked/MaxMindDB) IP2Location(linked) DBIP2(linked
/MaxMindDB) ExternalDatabase DB_AS_REG(BuiltIn) DB_CC_REG(BuiltIn) DB_IPV4_REG(B
uiltIn) DB_IPV6_REG(BuiltIn) DB_IEEE(BuiltIn)"
\end_layout

\begin_layout Paragraph*
Special machine readable output options (>= 0.99.0)
\end_layout

\begin_layout Subparagraph
Output filter by selecting a token (>= 0.99.0)
\end_layout

\begin_layout Standard
Using option --mrst <TOKEN> (Machine Readable Select Token) can be used
 to display only a selected token
\end_layout

\begin_layout Code
$ ipv6calc -q -i --mrst IPV6_TYPE 2a01:238:423d:8800:85b3:9e6b:3019:8909
 
\end_layout

\begin_layout Code
IPV6_TYPE=unicast,global-unicast,productive,iid-random,iid,iid-local
\end_layout

\begin_layout Subparagraph
Output filter by matching token (>= 0.99.0)
\end_layout

\begin_layout Standard
Using option --mrmt <TOKEN> (Machine Readable Match Token) can be used to
 display only matching tokens
\end_layout

\begin_layout Code
$ ipv6calc -q -i --mrmt IP2LOCATION 2a01:238:423d:8800:85b3:9e6b:3019:8909
 
\end_layout

\begin_layout Code
IP2LOCATION_COUNTRY_SHORT=DE
\end_layout

\begin_layout Code
IP2LOCATION_COUNTRY_LONG=Germany
\end_layout

\begin_layout Code
IP2LOCATION_REGION=Berlin
\end_layout

\begin_layout Code
IP2LOCATION_CITY=Berlin
\end_layout

\begin_layout Code
IP2LOCATION_ZIPCODE=10178
\end_layout

\begin_layout Code
IP2LOCATION_LATITUDE=52.524368
\end_layout

\begin_layout Code
IP2LOCATION_LONGITUDE=13.410530
\end_layout

\begin_layout Code
IP2LOCATION_TIMEZONE_NAME=+01:00
\end_layout

\begin_layout Code
IP2LOCATION_DATABASE_INFO=IP2L-DB11 IPv6 20181226 Copyright (c) 2018 IP2Location
 All Rights Reserved
\end_layout

\begin_layout Subparagraph
Output filter by selecting a value of a token token (>= 0.99.0)
\end_layout

\begin_layout Standard
Using option --mrtvo <TOKEN> (Machine Readable Token Value Only) can be
 used to display only thevalue of a selected token
\end_layout

\begin_layout Code
$ ipv6calc -q -i --mrtvo IPV6_TYPE 2a01:238:423d:8800:85b3:9e6b:3019:8909
 
\end_layout

\begin_layout Code
unicast,global-unicast,productive,iid-random,iid,iid-local
\end_layout

\begin_layout Subparagraph
Output adjustment by unconditional quoting of values (>= 0.99.0)
\end_layout

\begin_layout Standard
Using option --mrqva (Machine Readable Quote Values Always) can be used
 to quote values always of a selected token
\end_layout

\begin_layout Code
$ ipv6calc -q -i --mrqva --mrtvo IPV6_TYPE 2a01:238:423d:8800:85b3:9e6b:3019:890
9 
\end_layout

\begin_layout Code
"unicast,global-unicast,productive,iid-random,iid,iid-local"
\end_layout

\begin_layout Subparagraph
Output adjustment by unconditional disabling quoted values (>= 0.99.0)
\end_layout

\begin_layout Standard
Using option --mrqvn (Machine Readable Quote Values Never) can be used to
 never quote values of a selected token
\end_layout

\begin_layout Code
$ ipv6calc -q -i --mrqvn --mrst IPV6_AS_TEXT 2a01:238:423d:8800:85b3:9e6b:3019:8
909 
\end_layout

\begin_layout Code
IPV6_AS_TEXT=AS6724 STRATO AG
\end_layout

\begin_layout Subparagraph
Output adjustment by unconditional print token in case of empty value (>=
 0.99.0)
\end_layout

\begin_layout Standard
Using option --mrstpq (Machine Readable Select Token Print Always) can be
 used to print always token/value regardless it's contained
\end_layout

\begin_layout Code
$ ipv6calc -q -i --mrqva --mrstpa IPV4 2a01:238:423d:8800:85b3:9e6b:3019:8909
 
\end_layout

\begin_layout Code
IPV4=""
\end_layout

\begin_layout Code
$ ipv6calc -q -i --mrqva --mrst IPV4 2a01:238:423d:8800:85b3:9e6b:3019:8909
 
\end_layout

\begin_layout Code
(no output)
\end_layout

\begin_layout Subsubsection
Filter mode
\end_layout

\begin_layout Standard
\begin_inset Quotes eld
\end_inset

ipv6calc
\begin_inset Quotes erd
\end_inset

 can run in filter mode to be able to extract from a huge list of IPv4/IPv6
 addresses ones which are interesting or ones which are not interesting
 (see printout of online help below).
\end_layout

\begin_layout Standard
Filter tokens are the ones which are listed on 
\begin_inset Quotes eld
\end_inset

TYPE
\begin_inset Quotes erd
\end_inset

 lines shown in 
\begin_inset Quotes eld
\end_inset

-m -i
\begin_inset Quotes erd
\end_inset

 information mode.
\end_layout

\begin_layout Standard
Example for searching for Teredo addresses:
\end_layout

\begin_layout Code
$ cat ip.bieringer.de-log.201310 | awk '{ print $1 }' | sort | uniq | ipv6calc
 -A filter -E teredo
\end_layout

\begin_layout Code
2001:0:9d38:90d7:34f7:1a26:8599:e079
\end_layout

\begin_layout Standard
For more information see below
\end_layout

\begin_layout Standard
Note: since version 0.95.0 '-A filter' is optional if option '-E <filter expressio
n>' is given (autoselected action).
\end_layout

\begin_layout Subsubsection
Test mode
\end_layout

\begin_layout Standard
Since 0.99.2 a test mode ('-A test', autoselected in case 'test_*' options
 are given) is implemented for address prefix or range
\end_layout

\begin_layout Standard
For more information see below
\end_layout

\begin_layout Subsection
Option style
\end_layout

\begin_layout Standard
Since version 0.40 new-style option handling was introduced, using
\end_layout

\begin_layout Itemize
--in <inputtype>
\end_layout

\begin_layout Itemize
--out <outputtype>
\end_layout

\begin_layout Itemize
--action <actiontype>
\end_layout

\begin_layout Standard
and many more conversions were added.
 A built-in check matrix should prevent misconversions.
\end_layout

\begin_layout Standard
Up to version 0.39, only old-style options (aka 
\begin_inset Quotes eld
\end_inset

shortcut
\begin_inset Quotes erd
\end_inset

 options).
 They are one-in-all options, specifying input/action/output in one token.
 Internally this options will be converted into new-style options.
\end_layout

\begin_layout Subsection
Online help
\end_layout

\begin_layout Standard
Online help always shows the currently implemented features.
\end_layout

\begin_layout Subsubsection
Main online help:
\end_layout

\begin_layout Standard
External database options only appear if compiled with related support.
\end_layout

\begin_layout Code
$ ipv6calc -h
\end_layout

\begin_layout Code
ipv6calc: version 3.0.0 GeoIP GeoIPv6 IP2Location IP2Location6 DBIPv4 DBIPv6
 DB_AS_REG DB_IPV4_REG DB_IPV6_REG DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC
 DB_IPV4_COUNTRY DB_IPV6_COUNTRY DB_IPV4_CITY DB_IPV6_CITY DB_IPV4_REGION
 DB_IPV6_REGION DB_CC_REG DB_IEEE DB_IPV4_INFO DB_IPV6_INFO DB_IPV4_GEONAMEID
 DB_IPV6_GEONAMEID ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC ANON_KEEP-T
YPE-GEONAMEID
\end_layout

\begin_layout Code
(P) & (C) 2001-2020 by Peter Bieringer <pb (at) bieringer.de>
\end_layout

\begin_layout Code
This program formats and calculates IPv6/IPv4/MAC addresses and can do many
 more tricky things
\end_layout

\begin_layout Code
  [-d|--debug <debug value>] : debug value (bitwise like)
\end_layout

\begin_layout Code
                                can also be set by IPV6CALC_DEBUG environment
 value
\end_layout

\begin_layout Code
  [-v|--version [-v [-v]]]   : version information (2 optional detail levels)
\end_layout

\begin_layout Code
  [-v|--version -h]          : explanation of feature tokens
\end_layout

\begin_layout Code
  [-V|--verbose]             : be more verbose
\end_layout

\begin_layout Code
  [-h|--help|-?]             : this online help
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
  [--disable-ip2location           ] : IP2Location support disabled
\end_layout

\begin_layout Code
  [--db-ip2location-disable        ] : IP2Location support disabled
\end_layout

\begin_layout Code
  [--db-ip2location-dir <directory>] : IP2Location database directory (default:
 /usr/share/IP2Location)
\end_layout

\begin_layout Code
  [--db-ip2location-only-type <TYPE>]: IP2Location database only selected
 type (1-120)
\end_layout

\begin_layout Code
  [--db-ip2location-allow-softlinks] : IP2Location database softlinks allowed
\end_layout

\begin_layout Code
     by default they are ignored because it is hard to autodetect COMM/LITE/SAMP
LE
\end_layout

\begin_layout Code
  [--db-ip2location-lite-to-sample-autoswitch-max-delta-months <MONTHS>]:
\end_layout

\begin_layout Code
     autoswitch from LITE to SAMPLE databases if possible and delta is not
 more than 12 months (0=disabled)
\end_layout

\begin_layout Code
  [--db-ip2location-comm-to-lite-switch-min-delta-months <MONTHS>]:
\end_layout

\begin_layout Code
     switch from COMM to LITE databases if possible and delta more than
 12 months (0=disabled)
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
  [--disable-geoip2                ] : GeoIP(MaxMindDB) support disabled
\end_layout

\begin_layout Code
  [--db-geoip2-disable             ] : GeoIP(MaxMindDB) support disabled
\end_layout

\begin_layout Code
  [--db-geoip2-dir      <directory>] : GeoIP(MaxMindDB) database directory
 (default: /usr/share/GeoIP)
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
  [--disable-dbip2                 ] : db-ip.com(MaxMindDB) support disabled
\end_layout

\begin_layout Code
  [--db-dbip2-disable              ] : db-ip.com(MaxMindDB) support disabled
\end_layout

\begin_layout Code
  [--db-dbip2-dir       <directory>] : db-ip.com(MaxMindDB) database directory
 (default: /usr/share/DBIP)
\end_layout

\begin_layout Code
  [--db-dbip2-only-type <TYPE>]      : db-ip.com(MaxMindDB) database only
 selected type (1-6)
\end_layout

\begin_layout Code
  [--db-dbip2-comm-to-free-switch-min-delta-months <MONTHS>]:
\end_layout

\begin_layout Code
     switch from COMM to FREE databases if possible and delta more than
 12 months (0=disabled)
\end_layout

\begin_layout Code
  [--disable-external              ] : External support disabled
\end_layout

\begin_layout Code
 
\end_layout

\begin_layout Code
  [--db-external-disable           ] : External support disabled
\end_layout

\begin_layout Code
  [--db-external-dir    <directory>] : External database directory (default:
 /usr/share/ipv6calc/db)
\end_layout

\begin_layout Code
  [--disable-builtin               ] : BuiltIn support disabled
\end_layout

\begin_layout Code
  [--db-builtin-disable            ] : BuiltIn support disabled
\end_layout

\begin_layout Code
  
\end_layout

\begin_layout Code
  [--db-priorization <entry1>[:...]] : Database priorization order list (overwrites
 default)
\end_layout

\begin_layout Code
                                         colon separated: GeoIP GeoIP2 IP2Locati
on DBIP DBIP2 External BuiltIn
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
Hint: all long options can be predefined from environment by using
\end_layout

\begin_layout Code
  prefix: IPV6CALC_ and  conversion: '-' -> '_' and lowercase -> uppercase
\end_layout

\begin_layout Code
  example for options with values   : --db-dbip2-dir=<DIR>  ->  environment:
 IPV6CALC_DB_DBIP2_DIR=<DIR>
\end_layout

\begin_layout Code
  example for options without values: --db-dbip2-disable    ->  environment:
 IPV6CALC_DB_DBIP2_DISABLE=1
\end_layout

\begin_layout Code
                                                                       
       on|off|0|1 is supported
\end_layout

\begin_layout Code
  [-q|--quiet]               : be more quiet (auto-enabled in pipe mode)
\end_layout

\begin_layout Code
  [-f|--flush]               : flush each line in pipe mode
\end_layout

\begin_layout Code
 Usage with new style options:
\end_layout

\begin_layout Code
  [--in|-I <input type>]   : specify input  type
\end_layout

\begin_layout Code
                             (default: autodetect)
\end_layout

\begin_layout Code
  [--out|-O <output type>] : specify output type
\end_layout

\begin_layout Code
                             (sometimes: autodetect)
\end_layout

\begin_layout Code
  [--action|-A <action>]   : specify action
\end_layout

\begin_layout Code
                             (default: format conversion, sometimes: autodetect)
\end_layout

\begin_layout Code
  [<format option> ...] : specify format options
\end_layout

\begin_layout Code
  <input data> [...]    : input data
\end_layout

\begin_layout Code
  Available input  types:  [-m] -I|--in     -?|-h|--help
\end_layout

\begin_layout Code
  Available output types:  [-m] -O|--out    -?|-h|--help
\end_layout

\begin_layout Code
  Available action types:  [-m] -A|--action -?|-h|--help
\end_layout

\begin_layout Code
  Special filter action :  -E -?|-h|--help
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
 Other usage:
\end_layout

\begin_layout Code
  --showinfo|-i [--machine_readable|-m] : show information about input data
\end_layout

\begin_layout Code
  --showinfo|-i --mrqva                 : Machine Readable Quote Values
 Always
\end_layout

\begin_layout Code
  --showinfo|-i --mrqvn                 : Machine Readable Quote Values
 Never
\end_layout

\begin_layout Code
  --showinfo|-i --mrst <TOKEN>          : Machine Readable Select Token
\end_layout

\begin_layout Code
  --showinfo|-i --mrstpa <TOKEN>        : Machine Readable Select Token
 Print Always
\end_layout

\begin_layout Code
  --showinfo|-i --mrmt <TOKENPREFIX>    : Machine Readable Match Token Prefix
\end_layout

\begin_layout Code
  --showinfo|-i --mrmts <TOKENSUFFIX>   : Machine Readable Match Token Suffix
\end_layout

\begin_layout Code
  --showinfo|-i --mrtvo <TOKEN>         : Machine Readable Token Value Only
\end_layout

\begin_layout Code
  --showinfo|-i --show-tokens           : show available tokens (aka types)
 on '-m'
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
 Usage with shortcut options: <shortcut option> [<format option> ...] <input
 data>
\end_layout

\begin_layout Code
  for more information and available format options use: <shortcut option>
 -?|-h|--help
\end_layout

\begin_layout Code
  -r|--addr2ip6_int (-O revnibbles.int)
\end_layout

\begin_layout Code
  -r|--addr_to_ip6int (-O revnibbles.int)
\end_layout

\begin_layout Code
  -a|--addr2ip6_arpa (-O revnibbles.arpa)
\end_layout

\begin_layout Code
  -a|--addr_to_ip6arpa (-O revnibbles.arpa)
\end_layout

\begin_layout Code
  -b|--addr_to_bitstring (-O bitstring)
\end_layout

\begin_layout Code
     --addr2compaddr (--printcompressed)
\end_layout

\begin_layout Code
     --addr_to_compressed (--printcompressed)
\end_layout

\begin_layout Code
     --addr2uncompaddr (--printuncompressed)
\end_layout

\begin_layout Code
     --addr_to_uncompressed (--printuncompressed)
\end_layout

\begin_layout Code
     --addr_to_base85 (-I ipv6addr -O base85)
\end_layout

\begin_layout Code
     --base85_to_addr (-I base85 -O ipv6addr)
\end_layout

\begin_layout Code
     --mac_to_eui64 (-I mac -O eui64)
\end_layout

\begin_layout Code
     --addr2fulluncompaddr (--printfulluncompressed)
\end_layout

\begin_layout Code
     --addr_to_fulluncompressed (--printfulluncompressed)
\end_layout

\begin_layout Code
     --addr2if_inet6 (-I ipv6addr -O ifinet6)
\end_layout

\begin_layout Code
     --addr_to_ifinet6 (-I ipv6addr -O ifinet6)
\end_layout

\begin_layout Code
     --if_inet62addr (-I ifinet6 -O ipv6addr --printcompressed)
\end_layout

\begin_layout Code
     --ifinet6_to_compressed (-I ifinet6 -O ipv6addr --printcompressed)
\end_layout

\begin_layout Code
     --eui64_to_privacy (-I iid_token -O iid_token -A genprivacyiid)
\end_layout

\begin_layout Code
     --ipv4_to_6to4addr (-I ipv4 -O ipv6addr -A conv6to4)
\end_layout

\begin_layout Code
     --addr2cc (-A addr2cc)
\end_layout

\begin_layout Subsubsection
Database options
\end_layout

\begin_layout Itemize
each internal/external database can be disabled by option
\end_layout

\begin_layout Itemize
directory of database files can be given via related option
\end_layout

\begin_layout Itemize
databases requiring external library the library file can be given in case
 of dynamic load and linking
\end_layout

\begin_layout Itemize
for geolocation databases specific file can be selected (see --db-<PROVIDER>-onl
y-type <TYPE>)
\end_layout

\begin_layout Paragraph
IP2Location
\end_layout

\begin_layout Standard
IP2location database directory can contain a bunch of files, the best ones
 are selected automatically (since 0.99.0).
 
\begin_inset Quotes eld
\end_inset

Best
\begin_inset Quotes erd
\end_inset

 can be controlled via two options:
\end_layout

\begin_layout Itemize
--db-ip2location-lite-to-sample-autoswitch-max-delta-months <MONTHS>: switches
 from LITE to SAMPLE databases in case of
\begin_inset Separator latexpar
\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
existing SAMPLE database
\end_layout

\begin_layout Itemize
SAMPLE database not older than default/given MONTHS than the LITE database
\end_layout

\begin_layout Itemize
IP address is in range of SAMPLE database (IPv4: 0.0.0.0-99.255.255.255, IPv6:
 2a04::/16)
\end_layout

\begin_layout Itemize
autoswitch can be disabled by using MONTHS=0
\end_layout

\begin_layout Itemize
reason for implementation: show maximum possible IP2Location features
\end_layout

\end_deeper
\begin_layout Itemize
--db-ip2location-comm-to-lite-switch-min-delta-months <MONTHS>: switches
 from COMMercial to LITE databases in case of
\begin_inset Separator latexpar
\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
existing LITE database
\end_layout

\begin_layout Itemize
COMMercial database is default/given MONTHS older than the LITE database
\end_layout

\begin_layout Itemize
switch can be disabled by using MONTHS=0
\end_layout

\begin_layout Itemize
reason for implementation: avoid using old COMMercial databases
\end_layout

\end_deeper
\begin_layout Itemize
--db-ip2location-only-type <TYPE>: only selects databases of given type
\begin_inset Separator latexpar
\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
reason for implementation: be able to select a specific database type
\end_layout

\end_deeper
\begin_layout Itemize
--db-ip2location-allow-softlinks: allow softlinked IP2Location database
 files
\begin_inset Separator latexpar
\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
by default, softlinked database files are skipped, because it's hard to
 detect whether one is COMMercial, LITE or SAMPLE
\end_layout

\end_deeper
\begin_layout Code

\end_layout

\begin_layout Standard
use 
\begin_inset Quotes eld
\end_inset

ipv6calc -vv
\begin_inset Quotes erd
\end_inset

 or 
\begin_inset Quotes eld
\end_inset

ipv6calc -vvv
\begin_inset Quotes erd
\end_inset

 for verification, which databases are selected finally.
\end_layout

\begin_layout Subsubsection
Input-type options
\end_layout

\begin_layout Code
$ ipv6calc --in -?
\end_layout

\begin_layout Code
ipv6calc: version 2.1.1 GeoIP GeoIPv6 IP2Location IP2Location6 DBIPv4 DBIPv6
 DB_AS_REG DB_IPV4_REG DB_IPV6_REG DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC
 DB_IPV4_COUNTRY DB_IPV6_COUNTRY DB_IPV4_CITY DB_IPV6_CITY DB_IPV4_REGION
 DB_IPV6_REGION DB_CC_REG DB_IEEE DB_IPV4_INFO DB_IPV6_INFO DB_IPV4_GEONAMEID
 DB_IPV6_GEONAMEID ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC ANON_KEEP-T
YPE-GEONAMEID
\end_layout

\begin_layout Code
(P) & (C) 2001-2019 by Peter Bieringer <pb (at) bieringer.de>
\end_layout

\begin_layout Code
 Available input types:
\end_layout

\begin_layout Code
  auto            : automatic detection
\end_layout

\begin_layout Code
  revnibbles.int  : dot separated nibbles reverse, ending with ip6.int.
\end_layout

\begin_layout Code
  revnibbles.arpa : dot separated nibbles reverse, ending with ip6.arpa.
\end_layout

\begin_layout Code
  bitstring       : bitstring labes, ending with ip6.arpa.
\end_layout

\begin_layout Code
  ipv6addr        : IPv6 address
\end_layout

\begin_layout Code
  ipv6literal     : IPv6 address in literal
\end_layout

\begin_layout Code
  ipv4addr        : IPv4 address
\end_layout

\begin_layout Code
  ipv4hex         : IPv4 in hexdecimal format
\end_layout

\begin_layout Code
  ipv4revhex      : IPv4 in byte-reversed hexdecimal format
\end_layout

\begin_layout Code
  mac             : MAC address (48 bits)
\end_layout

\begin_layout Code
  eui64           : EUI-64 identifier (64 bits)
\end_layout

\begin_layout Code
  base85          : Base-85 string
\end_layout

\begin_layout Code
  ifinet6         : Like line in /proc/net/if_inet6
\end_layout

\begin_layout Code
  iid+token       : Interface identifier and token
\end_layout

\begin_layout Code
  ipv6logconv     : ipv6logconv (currently not supported)
\end_layout

\begin_layout Code
  prefix+mac      : IPv6 prefix and a MAC address
\end_layout

\begin_layout Code
  asn             : Autonomous System Number
\end_layout

\begin_layout Subsubsection
Output-type options:
\end_layout

\begin_layout Code
$ ipv6calc --out -?
\end_layout

\begin_layout Code
ipv6calc: version 2.1.1 GeoIP GeoIPv6 IP2Location IP2Location6 DBIPv4 DBIPv6
 DB_AS_REG DB_IPV4_REG DB_IPV6_REG DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC
 DB_IPV4_COUNTRY DB_IPV6_COUNTRY DB_IPV4_CITY DB_IPV6_CITY DB_IPV4_REGION
 DB_IPV6_REGION DB_CC_REG DB_IEEE DB_IPV4_INFO DB_IPV6_INFO DB_IPV4_GEONAMEID
 DB_IPV6_GEONAMEID ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC ANON_KEEP-T
YPE-GEONAMEID
\end_layout

\begin_layout Code
(P) & (C) 2001-2019 by Peter Bieringer <pb (at) bieringer.de>
\end_layout

\begin_layout Code
 Available output types:
\end_layout

\begin_layout Code
  revnibbles.int  : dot separated nibbles reverse, ending with ip6.int.
\end_layout

\begin_layout Code
  revnibbles.arpa : dot separated nibbles reverse, ending with ip6.arpa.
\end_layout

\begin_layout Code
  bitstring       : bitstring labes, ending with ip6.arpa.
\end_layout

\begin_layout Code
  ipv6addr        : IPv6 address
\end_layout

\begin_layout Code
  ipv4addr        : IPv4 address
\end_layout

\begin_layout Code
  mac             : MAC address (48 bits)
\end_layout

\begin_layout Code
  eui64           : EUI-64 identifier (64 bits)
\end_layout

\begin_layout Code
  base85          : Base-85 string
\end_layout

\begin_layout Code
  ifinet6         : Like line in /proc/net/if_inet6
\end_layout

\begin_layout Code
  iid             : Interface identifier
\end_layout

\begin_layout Code
  iid+token       : Interface identifier and token
\end_layout

\begin_layout Code
  addrtype        : Address type
\end_layout

\begin_layout Code
  ouitype         : OUI (IEEE) type
\end_layout

\begin_layout Code
  ipv6addrtype    : IPv6 address type
\end_layout

\begin_layout Code
  any             : any type (currently not supported)
\end_layout

\begin_layout Code
  revipv4         : reverse IPv4, ending with in-addr.arpa
\end_layout

\begin_layout Code
  ipv4hex         : IPv4 in hexdecimal format
\end_layout

\begin_layout Code
  octal           : IP address in escaped octal format
\end_layout

\begin_layout Code
  hex             : IP address in hexadecimal format
\end_layout

\begin_layout Code
  ipv6literal     : IPv6 address in literal
\end_layout

\begin_layout Code

\end_layout

\begin_layout Standard
For examples and available format options use:
\end_layout

\begin_layout Code
$ ipv6calc -O|--out <type> --examples
\end_layout

\begin_layout Subsubsection
Action-type options: 
\end_layout

\begin_layout Code
$ ipv6calc --action -?
\end_layout

\begin_layout Code
ipv6calc: version 3.3.0 GeoIP GeoIPv6 IP2Location IP2Location6 DBIPv4 DBIPv6
 DB_AS_REG DB_IPV4_REG DB_IPV6_REG DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC
 DB_IPV4_COUNTRY DB_IPV6_COUNTRY DB_IPV4_CITY DB_IPV6_CITY DB_IPV4_REGION
 DB_IPV6_REGION DB_CC_REG DB_IEEE DB_IPV4_INFO DB_IPV6_INFO DB_IPV4_GEONAMEID
 DB_IPV6_GEONAMEID DB_IPV4_DUMP_CC DB_IPV6_DUMP_CC ANON_ZEROISE ANON_ANONYMIZE
 ANON_KEEP-TYPE-ASN-CC ANON_KEEP-TYPE-GEONAMEID (P) & (C) 2001-2021 by Peter
 Bieringer <pb (at) bieringer.de>
\end_layout

\begin_layout Code
 Available action types:
\end_layout

\begin_layout Code
  auto             : Automatic selection of action (default)
\end_layout

\begin_layout Code
  geneui64         : Converts a MAC address to an EUI-64 address
\end_layout

\begin_layout Code
  conv6to4         : Converts IPv4 address <-> 6to4 IPv6 address (prefix)
\end_layout

\begin_layout Code
  convnat64        : Converts IPv4 address <-> NAT64 IPv6 address
\end_layout

\begin_layout Code
  ipv6tomac        : Extracts MAC of an IPv6 address (if detected)
\end_layout

\begin_layout Code
  ipv6toeui64      : Extracts EUI64 of an IPv6 address (if detected)
\end_layout

\begin_layout Code
  genprivacyiid    : Generates a privacy interface ID out of a given one
 (arg1) and a token (arg2)
\end_layout

\begin_layout Code
  prefixmac2ipv6   : Generates an IPv6 address out of a prefix and a MAC
 address
\end_layout

\begin_layout Code
  anonymize        : Anonymize IPv4/IPv6 address without loosing much informatio
n
\end_layout

\begin_layout Code
  6rd_local_prefix : Calculate the 6rd prefix from given IPv6 prefix (&
 relay prefix) and IPv4
\end_layout

\begin_layout Code
                      Options:
\end_layout

\begin_layout Code
                       --6rd_prefix ...
 (required)
\end_layout

\begin_layout Code
                       --6rd_relay_prefix ...
 (optional)
\end_layout

\begin_layout Code
  6rd_extract_ipv4 : Extract from 6rd address the include IPv4 address
\end_layout

\begin_layout Code
                      Options:
\end_layout

\begin_layout Code
                       --6rd_prefixlength ...
 (required)
\end_layout

\begin_layout Code
  filter           : Filter addresses related to filter options
\end_layout

\begin_layout Code
  test             : Test address against given prefix or address
\end_layout

\begin_layout Code
                      Options:
\end_layout

\begin_layout Code
                       --test_prefix ...
 (optional)
\end_layout

\begin_layout Code
                       --test_gt ...
 (optional)
\end_layout

\begin_layout Code
                       --test_ge ...
 (optional)
\end_layout

\begin_layout Code
                       --test_lt ...
 (optional)
\end_layout

\begin_layout Code
                       --test_le ...
 (optional)
\end_layout

\begin_layout Code
  addr2cc          : Converts IPv4/IPv6 address into Country Code
\end_layout

\begin_layout Code
  dbdump           : Dump Database 
\end_layout

\begin_layout Subsubsection
Special action 
\begin_inset Quotes eld
\end_inset

filter
\begin_inset Quotes erd
\end_inset

:
\end_layout

\begin_layout Standard
Special action 
\begin_inset Quotes eld
\end_inset

filter
\begin_inset Quotes erd
\end_inset

 can be used especially in pipe mode to filter IP addresses related to their
 type and since 0.99.0 also related to database results (CountryCode, ASN
 or Registry).
\end_layout

\begin_layout Code
$ ipv6calc --action filter -h
\end_layout

\begin_layout Code
ipv6calc: version 2.1.1 GeoIP GeoIPv6 IP2Location IP2Location6 DBIPv4 DBIPv6
 DB_AS_REG DB_IPV4_REG DB_IPV6_REG DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC
 DB_IPV4_COUNTRY DB_IPV6_COUNTRY DB_IPV4_CITY DB_IPV6_CITY DB_IPV4_REGION
 DB_IPV6_REGION DB_CC_REG DB_IEEE DB_IPV4_INFO DB_IPV6_INFO DB_IPV4_GEONAMEID
 DB_IPV6_GEONAMEID ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC ANON_KEEP-T
YPE-GEONAMEID
\end_layout

\begin_layout Code
 Filter given addresses from stdin by filter expression, e.g.
\end_layout

\begin_layout Code
  echo '2001:db8::1' | ipv6calc [-A filter] -E iid-local
\end_layout

\begin_layout Code
  echo '2001:db8::1' | ipv6calc [-A filter] -E iid-local,global-unicast
\end_layout

\begin_layout Code
  echo '2001:db8::1' | ipv6calc [-A filter] -E ^iid-random
\end_layout

\begin_layout Code
 (note: since version 0.95.0 '-A filter' is autoselected if option '-E <filter
 expression>' is given)
\end_layout

\begin_layout Code
 negation of filter expression with prefix: ^
\end_layout

\begin_layout Code
  IPv6 address filter tokens:
\end_layout

\begin_layout Code
   ipv6  unknown unicast multicast anycast loopback link-local site-local
 compat-v4 mapped reserved unique-local-unicast anonymized-iid anonymized-prefix
 6to4 6bone global-unicast unspecified solicited-node productive 6to4-microsoft
 teredo orchid link-local-teredo nat64 iid-random iid iid-local iid-global
 iid-teredo iid-eui48 iid-eui64 iid-isatap iid-includes-ipv4
\end_layout

\begin_layout Code
  IPv4 address filter tokens:
\end_layout

\begin_layout Code
   ipv4  any unicast multicast anycast broadcast loopback unspecified unknown
 reserved zeroconf site-local anonymized anonymized-geonameid global 6to4relay
 lisp lisp-proxyegresstunnelrouter-anycast lisp-mapresolver-anycast
\end_layout

\begin_layout Code
  IPv4/v6 address filter tokens based on databases:
\end_layout

\begin_layout Code
   [^][ipv4.|ipv6.]db.cc=<CC>|unknown (Country Code [2 chars])
\end_layout

\begin_layout Code
   [^][ipv4.|ipv6.]db.asn=<ASN>|unknown (Autonomous System Number)
\end_layout

\begin_layout Code
   [^][ipv4.|ipv6.]db.reg=<REGISTRY>
\end_layout

\begin_layout Code
    Registry tokens: 6BONE IANA APNIC ARIN RIPENCC LACNIC AFRINIC 6TO4 reserved
 unknown
\end_layout

\begin_layout Code
  IPv4/v6 address filter tokens based on address/mask:
\end_layout

\begin_layout Code
   [^]ipv4.addr=<IPV4-ADDRESS>[<PREFIX-LENGTH>]
\end_layout

\begin_layout Code
   [^]ipv6.addr=<IPV6-ADDRESS>[<PREFIX-LENGTH>]
\end_layout

\begin_layout Code
  IPv4/v6 address filter tokens based on address ranges (<=|<|>|>=):
\end_layout

\begin_layout Code
   [^]ipv4.addr(<=|<|>|>=)<IPV4-ADDRESS>
\end_layout

\begin_layout Code
   [^]ipv6.addr(<=|<|>|>=)<IPV6-ADDRESS>
\end_layout

\begin_layout Code
   as alternative in case <|> creating problems also supported: =(le|lt|gt|ge)=:
\end_layout

\begin_layout Code
   [^]ipv4.addr=(le|lt|gt|ge)=<IPV4-ADDRESS>
\end_layout

\begin_layout Code
   [^]ipv6.addr=(le|lt|gt|ge)=<IPV6-ADDRESS>
\end_layout

\begin_layout Code
  EUI-48/MAC address filter tokens:
\end_layout

\begin_layout Code
    IMPLEMENTATION MISSING
\end_layout

\begin_layout Code
  EUI-64 address filter tokens:
\end_layout

\begin_layout Code
    IMPLEMENTATION MISSING
\end_layout

\begin_layout Standard
Example for some filter expressions:
\end_layout

\begin_layout Code
$ cat ip.bieringer.de-log.201504 | ipv6calc -E ipv6.db.cc=DE | wc -l
\end_layout

\begin_layout Code
5068
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
$ cat ip.bieringer.de-log.201504 | ipv6calc -E ipv6.db.cc=US | wc -l
\end_layout

\begin_layout Code
305
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
$ cat ip.bieringer.de-log.201504 | ipv6calc -E ipv6.db.reg=ARIN | wc -l
\end_layout

\begin_layout Code
306
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
$ cat ip.bieringer.de-log.201504 | ipv6calc -E iid-random | wc -l
\end_layout

\begin_layout Code
4806
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
$ cat ip.bieringer.de-log.201504 | ipv6calc -E ipv6.db.cc=US,iid-random | wc
 -l
\end_layout

\begin_layout Code
16
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
$ cat ip.bieringer.de-log.201504 | ipv6calc -A filter -E ipv6.db.cc=US,iid-random,ipv
4.db.cc=US | wc -l
\end_layout

\begin_layout Code
1842
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
$ cat ip.bieringer.de-log.201504 | ipv6calc -A filter -E db.asn=8767 | wc -l
\end_layout

\begin_layout Code
2363
\end_layout

\begin_layout Code
$ cat ip.bieringer.de-log.201504 | ipv6calc -A filter -E ipv6.db.asn=8767 | wc
 -l
\end_layout

\begin_layout Code
1452
\end_layout

\begin_layout Code
$ cat ip.bieringer.de-log.201504 | ipv6calc -A filter -E ipv4.db.asn=8767 | wc
 -l
\end_layout

\begin_layout Code
911
\end_layout

\begin_layout Standard
Example for searching for addresses in a specific range (supported since
 0.99.2):
\end_layout

\begin_layout Code
$ cat ip.bieringer.de-log.201609 | awk '{ print $1 }' | sort | uniq | ipv6calc
 -E ipv6.addr=ge=2002::,ipv6.addr=lt=2003::
\end_layout

\begin_layout Code
2002:2518:0:1:2:3:4:5
\end_layout

\begin_layout Code
...
\end_layout

\begin_layout Code
2002:d950:0:1:2:3:4:5
\end_layout

\begin_layout Subsubsection
Special action 
\begin_inset Quotes eld
\end_inset

test
\begin_inset Quotes erd
\end_inset

:
\end_layout

\begin_layout Standard
Special action 
\begin_inset Quotes eld
\end_inset

test
\begin_inset Quotes erd
\end_inset

 (since 0.99.2) can be used in command line or pipe mode (single address only)
 to test IP addresses related to a given prefix or range .
\end_layout

\begin_layout Code
$ ipv6calc -A test -?
\end_layout

\begin_layout Code
ipv6calc: version 2.1.1 GeoIP GeoIPv6 IP2Location IP2Location6 DBIPv4 DBIPv6
 DB_AS_REG DB_IPV4_REG DB_IPV6_REG DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC
 DB_IPV4_COUNTRY DB_IPV6_COUNTRY DB_IPV4_CITY DB_IPV6_CITY DB_IPV4_REGION
 DB_IPV6_REGION DB_CC_REG DB_IEEE DB_IPV4_INFO DB_IPV6_INFO DB_IPV4_GEONAMEID
 DB_IPV6_GEONAMEID ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC ANON_KEEP-T
YPE-GEONAMEID
\end_layout

\begin_layout Code
 Test given address(es) against supported tests:
\end_layout

\begin_layout Code
  --test_prefix <PREFIX>       : inside a prefix
\end_layout

\begin_layout Code
  --test_gt|--test_ge <ADDRESS>: greater(/equal) than an address
\end_layout

\begin_layout Code
  --test_lt|--test_le <ADDRESS>: less(/equal) than an address
\end_layout

\begin_layout Code
 Test given address(es) from stdin, e.g.
\end_layout

\begin_layout Code
  echo '2001:db8::1' | ipv6calc [-A test] --test_prefix 2001:db8::/32
\end_layout

\begin_layout Code
  echo '2001:db8::1' | ipv6calc [-A test] --test_prefix 2001:db9::/32
\end_layout

\begin_layout Code
 Single address test, return code: 0=inside/matching 1=outside/not-matching
 2=uncomparable
\end_layout

\begin_layout Code
  ipv6calc [-A test] --test_prefix 2001:db8::/32 2001:db8::1
\end_layout

\begin_layout Code
  ipv6calc [-A test] --test_prefix 2001:db9::/32 2001:db8::1
\end_layout

\begin_layout Code
  ipv6calc [-A test] --test_ge 2001:db8:: --test_le 2001:db8:ffff:ffff:ffff:ffff
:ffff:ffff 2001:db8::1
\end_layout

\begin_layout Code
  ipv6calc [-A test] --test_ge 2001:db9:: --test_le 2001:db9:ffff:ffff:ffff:ffff
:ffff:ffff 2001:db8::1
\end_layout

\begin_layout Code
  ipv6calc [-A test] --test_ge 2001:db9:: --test_lt 2001:dba:: 2001:db8::1
\end_layout

\begin_layout Code
  ipv6calc [-A test] --test_ge 2001:db8:: --test_lt 2001:db9:: 2001:db8::1
\end_layout

\begin_layout Standard
Example for command line mode:
\end_layout

\begin_layout Code
$ ipv6calc --test_ge 2001:db8:: --test_le 2001:db8:ffff:ffff:ffff:ffff:ffff:ffff
 2001:db8::1; echo $?
\end_layout

\begin_layout Code
no input type specified, try autodetection...found type: ipv6addr
\end_layout

\begin_layout Code
no output type specified, try autodetection...found type: ipv6addr
\end_layout

\begin_layout Code
2001:db8::1   greater/equal than 2001:db8::  less/equal than 2001:db8:ffff:ffff:
ffff:ffff:ffff:ffff
\end_layout

\begin_layout Code
0
\end_layout

\begin_layout Standard
Example for command line mode (quiet):
\end_layout

\begin_layout Code
$ ipv6calc -q --test_ge 2001:db8:: --test_le 2001:db8:ffff:ffff:ffff:ffff:ffff:f
fff 2001:db8::1; echo $?
\end_layout

\begin_layout Code
2001:db8::1   greater/equal than 2001:db8::  less/equal than 2001:db8:ffff:ffff:
ffff:ffff:ffff:ffff
\end_layout

\begin_layout Code
0
\end_layout

\begin_layout Standard
Example for pipe mode:
\end_layout

\begin_layout Code
$ echo -e "1.2.3.4
\backslash
n1.2.4.4" | ipv6calc --test_prefix 1.2.3.0/24
\end_layout

\begin_layout Code
1.2.3.4   inside 1.2.3.0/24
\end_layout

\begin_layout Code
1.2.4.4   NOT inside 1.2.3.0/24
\end_layout

\begin_layout Subsubsection
Special action 
\begin_inset Quotes eld
\end_inset

conv6to4
\begin_inset Quotes erd
\end_inset

:
\end_layout

\begin_layout Standard
Special action 
\begin_inset Quotes eld
\end_inset

conv6to4
\begin_inset Quotes erd
\end_inset

 (since at least 0.99.1) can be used in command line or pipe mode to convert
 6to4-IPv6 in IPv4 addresses and vice versa.
\end_layout

\begin_layout Code
$ ipv6calc: version 3.2.1 DB_AS_REG DB_IPV4_REG DB_IPV6_REG DB_CC_REG DB_IEEE
 DB_IPV4_INFO DB_IPV6_INFO ANON_ZEROISE ANON_ANONYMIZE
\end_layout

\begin_layout Code
  Convert IPv4 to 6to4 prefix / extract IPv4 from 6to4 prefix
\end_layout

\begin_layout Code
   ipv6calc -A conv6to4 192.0.2.1          -> 2002:c000:201::
\end_layout

\begin_layout Code
   ipv6calc -A conv6to4 192.0.2.1/24       -> 2002:c000:200::/40
\end_layout

\begin_layout Code
   ipv6calc -A conv6to4 192.0.2.0/24       -> 2002:c000:200::/40
\end_layout

\begin_layout Code
   ipv6calc -A conv6to4 2002:c000:201::    -> 192.0.2.1
\end_layout

\begin_layout Code
   ipv6calc -A conv6to4 2002:c000:201::/40 -> 192.0.2.0/24
\end_layout

\begin_layout Code
  See '-O ipv4 -h' or '-O ipv6 -h' for optional output modifications
\end_layout

\begin_layout Code
  Can also be used in PIPE mode to convert a list of IP addresses/networks
\end_layout

\begin_layout Code

\end_layout

\begin_layout Standard
Example for command line mode:
\end_layout

\begin_layout Code
$ ipv6calc -q -A conv6to4 192.0.2.1
\end_layout

\begin_layout Code
2002:c000:201::
\end_layout

\begin_layout Code

\end_layout

\begin_layout Standard
Example for pipe mode:
\end_layout

\begin_layout Code
echo -e "1.2.3.4
\backslash
n1.2.4.4" | ipv6calc -A conv6to4
\end_layout

\begin_layout Code
2002:102:304::
\end_layout

\begin_layout Code
2002:102:404::
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
$ echo -e "1.2.3.0/24
\backslash
n1.2.4.0/24" | ipv6calc -A conv6to4
\end_layout

\begin_layout Code
2002:102:300::/40
\end_layout

\begin_layout Code
2002:102:400::/40
\end_layout

\begin_layout Subsubsection
Special action 
\begin_inset Quotes eld
\end_inset

dbdump
\begin_inset Quotes erd
\end_inset

:
\end_layout

\begin_layout Standard
Since version 3.3.0, action 
\begin_inset Quotes eld
\end_inset

dbdump
\begin_inset Quotes erd
\end_inset

 is provided
\end_layout

\begin_layout Itemize
Version >= 3.3.0: database 
\begin_inset Quotes eld
\end_inset

External
\begin_inset Quotes erd
\end_inset

, type: IPv4/IPv6 addresses, suppported filter: CountryCode
\end_layout

\begin_layout Standard
Precondition: created/updated 
\begin_inset Quotes eld
\end_inset

External
\begin_inset Quotes erd
\end_inset

 database
\end_layout

\begin_layout Code
$ /usr/share/ipv6calc/tools/ipv6calc-db-update.sh
\end_layout

\begin_layout Code
...
\end_layout

\begin_layout Standard
Precondition: active 
\begin_inset Quotes eld
\end_inset

database dump
\begin_inset Quotes erd
\end_inset

 support
\end_layout

\begin_layout Code
$ ipv6calc -vv 2>&1 | grep -E '(DB_IPV4_DUMP_CC|DB_IPV6_DUMP_CC)'
\end_layout

\begin_layout Code
ipv6calc: version 3.3.0 GeoIP GeoIPv6 IP2Location IP2Location6 DBIPv4 DBIPv6
 DB_AS_REG DB_IPV4_REG DB_IPV6_REG DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC
 DB_IPV4_COUNTRY DB_IPV6_COUNTRY DB_IPV4_CITY DB_IPV6_CITY DB_IPV4_REGION
 DB_IPV6_REGION DB_CC_REG DB_IEEE DB_IPV4_INFO DB_IPV6_INFO DB_IPV4_GEONAMEID
 DB_IPV6_GEONAMEID DB_IPV4_DUMP_CC DB_IPV6_DUMP_CC ANON_ZEROISE ANON_ANONYMIZE
 ANON_KEEP-TYPE-ASN-CC ANON_KEEP-TYPE-GEONAMEID 
\end_layout

\begin_layout Code
DB_IPV4_DUMP_CC (IPv4 Database Dump by CountryCode): External
\end_layout

\begin_layout Code
DB_IPV6_DUMP_CC (IPv6 Database Dump by CountryCode): External 
\end_layout

\begin_layout Standard
Precondition: recognized 
\begin_inset Quotes eld
\end_inset

External
\begin_inset Quotes erd
\end_inset

 database
\end_layout

\begin_layout Code
$ ipv6calc -vv 2>&1 | grep -E '(External: IPv.
 CountryCode)'
\end_layout

\begin_layout Code
External: IPv4 CountryCode    : ipv6calc-external-ipv4-countrycode.db   
 (EXTDB-3/AFRINIC/20210919 APNIC/20210917 ARIN/20210919 IANA/20210205 LACNIC/202
10918 LISP/20200318 RIPENCC/20210918, created: 20210919-152957 UTC)
\end_layout

\begin_layout Code
External: IPv6 CountryCode    : ipv6calc-external-ipv6-countrycode.db   
 (EXTDB-4/AFRINIC/20210919 APNIC/20210917 ARIN/20210919 IANA/20191106 LACNIC/202
10918 LISP/20200318 RIPENCC/20210918, created: 20210919-155049 UTC) 
\end_layout

\begin_layout Standard
Usage Example: dump all IPv4 networks which have not 
\begin_inset Quotes eld
\end_inset

unknown
\begin_inset Quotes erd
\end_inset

 CountryCode
\end_layout

\begin_layout Code
$ ipv6calc -A dbdump -E ^ipv4.db.cc=unknown
\end_layout

\begin_layout Code
# 'External' database dump (with 121894 entries) start with filter IPv4
 && CountryCode(s): ^unknown (suppress this line with option '-q')
\end_layout

\begin_layout Code
1.0.0.0/24
\end_layout

\begin_layout Code
1.0.1.0/24
\end_layout

\begin_layout Code
...
\end_layout

\begin_layout Code
# 'External' database dump finished displaying 121894 entries with filter
 IPv4 && CountryCode(s): ^unknown (suppress this line with option '-q')
 
\end_layout

\begin_layout Standard
Usage Example: dump all IPv6 networks of a given CountryCode 
\end_layout

\begin_layout Code
$ ipv6calc -A dbdump -E ipv6.db.cc=VN
\end_layout

\begin_layout Code
# 'External' database dump (with 56097 entries) start with filter IPv6 &&
 CountryCode(s): VN (suppress this line with option '-q')
\end_layout

\begin_layout Code
2001:7fa:6::/28
\end_layout

\begin_layout Code
2001:dc8::/28 
\end_layout

\begin_layout Code
...
\end_layout

\begin_layout Code
# 'External' database dump finished displaying 344 entries with filter IPv6
 && CountryCode(s): VN (suppress this line with option '-q') 
\end_layout

\begin_layout Standard
Usage Example: dump all IPv4 networks of two given CountryCodes
\end_layout

\begin_layout Code
$ ipv6calc -A dbdump -E ipv4.db.cc=VN,ipv4.db.cc=CN
\end_layout

\begin_layout Code
# 'External' database dump (with 121894 entries) start with filter IPv4
 && CountryCode(s): VN CN (suppress this line with option '-q')
\end_layout

\begin_layout Code
1.0.1.0/24
\end_layout

\begin_layout Code
1.0.2.0/23 
\end_layout

\begin_layout Code
...
\end_layout

\begin_layout Code
# 'External' database dump finished displaying 4631 entries with filter
 IPv4 && CountryCode(s): VN CN (suppress this line with option '-q') 
\end_layout

\begin_layout Standard
Usage Example: dump all IPv4 networks of a given CountryCode incl.
 automatic conversion into 6to4 addresses
\end_layout

\begin_layout Code
$ ipv6calc -A dbdump -E ipv4.db.cc=VN -I ipv4 -O ipv6to4
\end_layout

\begin_layout Code
# 'External' database dump (with 121894 entries) start with filter IPv4
 && CountryCode(s): VN (output format: 6to4) (suppress this line with option
 '-q')
\end_layout

\begin_layout Code
2002:134::/30
\end_layout

\begin_layout Code
2002:e00:1000::/36 
\end_layout

\begin_layout Code
...
\end_layout

\begin_layout Code
# 'External' database dump finished displaying 569 entries with filter IPv4
 && CountryCode(s): VN (output format: 6to4) (suppress this line with option
 '-q') 
\end_layout

\begin_layout Standard
Usage Example: dump all IPv6to4 networks of a given CountryCode in 
\begin_inset Quotes eld
\end_inset

ipset restore
\begin_inset Quotes erd
\end_inset

 compatible format and create/update 
\begin_inset Quotes eld
\end_inset

ipset
\begin_inset Quotes erd
\end_inset

 (related 
\begin_inset Quotes eld
\end_inset

sudo
\begin_inset Quotes erd
\end_inset

 command whitelist have to be created in advance)
\end_layout

\begin_layout Code
$ ipv6calc -A dbdump -E ipv4.db.cc=VN -I ipv4 -O ipv6to4 -q --print-ipset
 Net_VN_IPv6to4 >/path/to/ipset-Net_VN_IPv6to4.txt
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
$ sudo ipset restore -f /path/to/ipset-Net_VN_IPv6to4.txt
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
$ sudo ipset list Net_VN_IPv6to4 -t
\end_layout

\begin_layout Code
Name: Net_VN_IPv6to4
\end_layout

\begin_layout Code
Type: hash:net
\end_layout

\begin_layout Code
Revision: 7
\end_layout

\begin_layout Code
Header: family inet6 hashsize 1024 maxelem 65536 bucketsize 12 initval 0x30b0bda
f
\end_layout

\begin_layout Code
Size in memory: 41344
\end_layout

\begin_layout Code
References: 0
\end_layout

\begin_layout Code
Number of entries: 723 
\end_layout

\begin_layout Standard
Hint: try also helper script for 'ipset' management
\end_layout

\begin_layout Code
$ tools/ipv6calc-create-update-ipset.sh
\end_layout

\begin_layout Section
Webserver log conversion helper program "ipv6logconv"
\end_layout

\begin_layout Standard
This program parses address tokens of a given webserver logfile and converts
 them to special strings, useful for statistics (e.g.
 created by using "analog").
\end_layout

\begin_layout Subsection
Supported options
\end_layout

\begin_layout Code
$ ipv6logconv -h
\end_layout

\begin_layout Code
ipv6logconv: version 2.1.1 CONV_REG CONV_IEEE
\end_layout

\begin_layout Code
(P) & (C) 2002-2019 by Peter Bieringer <pb (at) bieringer.de>
\end_layout

\begin_layout Code
This program converts IPv4/IPv6 addresses in HTTP server log files
\end_layout

\begin_layout Code
  [-d|--debug <debug value>] : debug value (bitwise like)
\end_layout

\begin_layout Code
                                can also be set by IPV6CALC_DEBUG environment
 value
\end_layout

\begin_layout Code
  [-v|--version [-v [-v]]]   : version information (2 optional detail levels)
\end_layout

\begin_layout Code
  [-v|--version -h]          : explanation of feature tokens
\end_layout

\begin_layout Code
  [-V|--verbose]             : be more verbose
\end_layout

\begin_layout Code
  [-h|--help|-?]             : this online help
\end_layout

\begin_layout Code
 Performance options:
\end_layout

\begin_layout Code
  [-n|--nocache]            : disable caching
\end_layout

\begin_layout Code
  [-c|--cachelimit <value>] : set cache limit
\end_layout

\begin_layout Code
                               default: 20
\end_layout

\begin_layout Code
                               maximum: 200
\end_layout

\begin_layout Code
 Output options:
\end_layout

\begin_layout Code
  [--out <output type>] : specify output type
\end_layout

\begin_layout Code
   addrtype       : Address type
\end_layout

\begin_layout Code
   ouitype        : OUI (IEEE) type
\end_layout

\begin_layout Code
   ipv6addrtype   : IPv6 address type
\end_layout

\begin_layout Code
   any            : any type
\end_layout

\begin_layout Code
 Takes data from stdin, proceed it to stdout
\end_layout

\begin_layout Subsection
Examples
\end_layout

\begin_layout Standard
A demonstration about which kind of statistics are possible to produce is
 shown at 
\begin_inset CommandInset href
LatexCommand href
name "http://www.ipv6.bieringer.de/"
target "http://www.ipv6.bieringer.de/"
literal "false"

\end_inset

 (IPv6 only).
\end_layout

\begin_layout Subsection
Usage
\end_layout

\begin_layout Standard
Example:
\end_layout

\begin_layout Code
$ echo "2002:50b5:7940:0000:0000:0000:50b5:7940 - -" | ipv6logconv -q --out
 any
\end_layout

\begin_layout Code
RIPENCC.6to4.global-unicast.ipv6-addr.addrtype.ipv6calc
\end_layout

\begin_layout Standard
See more examples inside the package.
\end_layout

\begin_layout Section
Webserver log anonymization helper program "ipv6loganon"
\end_layout

\begin_layout Standard
On autoconfiguration, the interface part of an IPv6 address is based on
 the MAC address of the network interface card (NIC).
 This address is used for outgoing requests, if privacy option (RFC3041
 / RFC4941) is not enabled.
 This results in many privacy related information on web- or mail-server
 log files.
 Administrators, which won't (be allowed to) store such information over
 time, but still do not want to loose information about address type distributio
n should use 'ipv6loganon' to anonymize their log files.
\end_layout

\begin_layout Standard
Since version 0.94.0 internally also IID anonymization is possible without
 loosing any information for 
\begin_inset Quotes eld
\end_inset

ipv6logstats
\begin_inset Quotes erd
\end_inset

.
\end_layout

\begin_layout Standard
Since version 0.95.0 internally also prefix anonymization is possible without
 loosing any information for 
\begin_inset Quotes eld
\end_inset

ipv6logstats
\begin_inset Quotes erd
\end_inset

.
\end_layout

\begin_layout Subsection
Anonymization details
\end_layout

\begin_layout Subsubsection
Method 
\begin_inset Quotes eld
\end_inset

zeroize
\begin_inset Quotes erd
\end_inset


\end_layout

\begin_layout Standard
The anonymizer would keep as much information as possible for IPv6 address
 types.
\end_layout

\begin_layout Standard
Client-side IID would be anonymized by
\end_layout

\begin_layout Itemize
EUI-48 based: serial number would be zero'ed, keeping OID
\end_layout

\begin_layout Itemize
EUI-64 based: serial number would be zero'ed, keeping OID
\end_layout

\begin_layout Itemize
ISATAP: client IPv4 address would be anonymized by given IPv4 mask
\end_layout

\begin_layout Itemize
TEREDO: client IPv4 address would be anonymized by given IPv4 mask, client
 port would be zero'ed
\end_layout

\begin_layout Itemize
6to4(Microsoft): client IPv4 address would be anonymized by given IPv4 mask
\end_layout

\begin_layout Itemize
local: whole IID would be zero'ed
\end_layout

\begin_layout Standard
Client-side SLA would be anonymized by 
\end_layout

\begin_layout Itemize
SLA would be zero'ed
\end_layout

\begin_layout Standard
Prefix would be anonymized by
\end_layout

\begin_layout Itemize
6to4: client IPv4 address would be anonymized by given IPv4 mask
\end_layout

\begin_layout Standard
Compat/Mapped IPv4 addresses would be anonymized by
\end_layout

\begin_layout Itemize
IPv4 address would be anonymized by given IPv4 mask
\end_layout

\begin_layout Subsubsection
Method 
\begin_inset Quotes eld
\end_inset

anonmize
\begin_inset Quotes erd
\end_inset


\end_layout

\begin_layout Standard
The anonymizer would keep as much information as possible for the IID of
 an IPv6 address.
\end_layout

\begin_layout Standard
Description from libipv6addr.h:
\end_layout

\begin_layout Code
 * IID anonymization is done by replacing with related information (64-bit)
\end_layout

\begin_layout Code
 * xxxx:xxxx:xxxx:xxxC  (C = 4-bit checksum)
\end_layout

\begin_layout Code
 *
\end_layout

\begin_layout Code
 * a9p9 4941 0000 000C  -> RFC 4941 anonymized privacy extension Interface
 ID
\end_layout

\begin_layout Code
 *
\end_layout

\begin_layout Code
 * a9p9 4291 4xxx xxxC  -> RFC 4291 anonymized EUI-48 Interface ID, xxx
 xxx = converted OUI
\end_layout

\begin_layout Code
 * a9p9 4291 5xxx xxxC  -> RFC 4291 anonymized EUI-48 Interface ID, xxx
 xxx = converted mapped IAB/OUI-36
\end_layout

\begin_layout Code
 * a9p9 4291 6xxx xxxC  -> RFC 4291 anonymized EUI-64 Interface ID, xxx
 xxx = converted OUI
\end_layout

\begin_layout Code
 * a9p9 4291 7xxx xxxC  -> RFC 4291 anonymized EUI-64 Interface ID, xxx
 xxx = converted mapped IAB/OUI-36
\end_layout

\begin_layout Code
 * a9p9 4291 8xxx xxxC  -> RFC 4291 embedded anonymized IPv4 address, xxx
 xxx = first 24 bit of included (anonymized) IPv4 address
\end_layout

\begin_layout Code
 * a9p9 4291 c02d 5d1C  -> RFC 4291 Chapter 2.5.1 anonymized static Interface
 ID
\end_layout

\begin_layout Code
 *
\end_layout

\begin_layout Code
 * a9p9 5214 4xxx xxxC  -> RFC 5214 anonymized ISATAP Interface ID, xxx
 xxx = first 24 bit of included (anonymized) IPv4 address (local scope)
\end_layout

\begin_layout Code
 * a9p9 5214 5xxx xxxC  -> RFC 5214 anonymized ISATAP Interface ID, xxx
 xxx = first 24 bit of included (anonymized) IPv4 address (global scope)
\end_layout

\begin_layout Code
 * a9p9 5214 cxx0 000C  -> RFC 5214 anonymized ISATAP Interface ID, xx 
     = first  8 bit of included vendor ID (local scope)
\end_layout

\begin_layout Code
 * a9p9 5214 dxx0 000C  -> RFC 5214 anonymized ISATAP Interface ID, xx 
     = first  8 bit of included vendor ID (global scope)
\end_layout

\begin_layout Code
 * a9p9 5214 exxx xxxC  -> RFC 5214 anonymized ISATAP Interface ID, xxx
 xxx = first 24 bit of included extension ID (local scope)
\end_layout

\begin_layout Code
 * a9p9 5214 fxxx xxxC  -> RFC 5214 anonymized ISATAP Interface ID, xxx
 xxx = first 24 bit of included extension ID (global scope)
\end_layout

\begin_layout Code
 *
\end_layout

\begin_layout Code
 * a9p9 4843 0000 000C  -> RFC 4843 anonymized ORCHID hash
\end_layout

\begin_layout Standard
Depending on given mask, the part of the prefix will be replaced:
\end_layout

\begin_layout Code
 * SLA/NLA prefix part anonymization is done by replacing with pattern a909a909
\end_layout

\begin_layout Code
 *   p = number of nibbles anonymized
\end_layout

\begin_layout Subsubsection
Method 
\begin_inset Quotes eld
\end_inset

keep-type-asn-cc
\begin_inset Quotes erd
\end_inset


\end_layout

\begin_layout Standard
In addition to 
\begin_inset Quotes eld
\end_inset

anonymize
\begin_inset Quotes erd
\end_inset

 (of IID) this method anonymizes also the prefix of an IPv6 address or a
 whole IPv4 address by keeping ASN (Autonomous System Number, Country Code
 and Type).
\end_layout

\begin_layout Standard
Description from libipv6addr.h:
\end_layout

\begin_layout Code
 * Prefix anonymization in case of method=kp: p=0x0f
\end_layout

\begin_layout Code
 * a909:ccca:aaaa:aaaC  (C = 4-bit checksum)
\end_layout

\begin_layout Code
 *                      ccc      -> 10-bit Country Code mapping [A-Z]*[A-Z0-9]
 (936)
\end_layout

\begin_layout Code
 *                                   0x3FD = LISP
\end_layout

\begin_layout Code
 *                                   0x3FE = unknown country
\end_layout

\begin_layout Code
 *                                   0x3FF - 16 + REGISTRY_6BONE && ASN=0
 = 6bone 
\end_layout

\begin_layout Code
 *                                   0x000-0x3A7: c1= c / 36, c2 = c % 36
\end_layout

\begin_layout Code
 *                      aaaaaaaa -> 32-bit ASN
\end_layout

\begin_layout Standard
Description from libipv4addr.h:
\end_layout

\begin_layout Code
 *  Global IPv4 addresses are anoymized by storing country code and AS number
\end_layout

\begin_layout Code
 *   and using prefix of experimental range (240-255.x.y.z)
\end_layout

\begin_layout Code
 *
\end_layout

\begin_layout Code
 *  3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 
\end_layout

\begin_layout Code
 *  1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
\end_layout

\begin_layout Code
 *  1 1 1 1
\end_layout

\begin_layout Code
 * |p p p p|
\end_layout

\begin_layout Code
 *  Prefix                
\end_layout

\begin_layout Code
 *    0xF
\end_layout

\begin_layout Code
 *
\end_layout

\begin_layout Code
 * Pariy Bit (odd parity)
\end_layout

\begin_layout Code
 *         |P|
\end_layout

\begin_layout Code
 *
\end_layout

\begin_layout Code
 * Mapping of Country Code
\end_layout

\begin_layout Code
 *           |c c c c c c c c c c|
\end_layout

\begin_layout Code
 *            10-bit Country Code mapping [A-Z]*[A-Z0-9] (936)
\end_layout

\begin_layout Code
 *            0x3FF = unknown country
\end_layout

\begin_layout Code
 *            0x000-0x3A7: c1= c / 36, c2 = c % 36
\end_layout

\begin_layout Code
 *
\end_layout

\begin_layout Code
 * Mapping of ASN <= 65535
\end_layout

\begin_layout Code
 *                                0|a a a a a a a a a a a a a a a a|
\end_layout

\begin_layout Code
 *                                    16-bit ASN
\end_layout

\begin_layout Code
 *
\end_layout

\begin_layout Code
 * Mapping of ASN >= 65536, ASN & 0xE000 == 0 (12-bit LSB is ok) 
\end_layout

\begin_layout Code
 *                                1|r r r|0|l l l l l l l l l l l l|
\end_layout

\begin_layout Code
 *                                           13-bit LSB of ASN
\end_layout

\begin_layout Code
 *
\end_layout

\begin_layout Code
 * Mapping of ASN >= 65536, ASN & 0xE000 != 0 (12-bit LSB overflow) => unspecifi
ed
\end_layout

\begin_layout Code
 *                                1|r r r|1|0 0 0 0 0 0 0 0 0 0 0 0|
\end_layout

\begin_layout Code
 *
\end_layout

\begin_layout Code
 * Mapping of ASN registry for ASN >= 65536
\end_layout

\begin_layout Code
 *                                  0 0 0 = "unknown ASN registry"
\end_layout

\begin_layout Code
 *                                  0 1 0 = APNIC
\end_layout

\begin_layout Code
 *                                  0 1 1 = RIPE
\end_layout

\begin_layout Code
 *                                  1 0 0 = LACNIC
\end_layout

\begin_layout Code
 *                                  1 0 1 = AFRINIC
\end_layout

\begin_layout Code
 *                                  1 1 0 = ARIN
\end_layout

\begin_layout Code
 * Mapping of LISP
\end_layout

\begin_layout Code
 *                                1|r r r|1|1|0 0 0 0 0 0 0 0 0 0 0| 
\end_layout

\begin_layout Subsubsection
Method 
\begin_inset Quotes eld
\end_inset

keep-type-geonameid
\begin_inset Quotes erd
\end_inset


\end_layout

\begin_layout Standard
In difference to keep-type-asn-cc this method anonymizes the prefix of an
 IPv6 address or a whole IPv4 address by keeping the GeonameID and Type.
\end_layout

\begin_layout Standard
Description from libipv6addr.h:
\end_layout

\begin_layout Code
 * a909:sssg:gggg:gggC  (C = 4-bit checksum)
\end_layout

\begin_layout Code
 *                      sss      -> 10-bit source mapping
\end_layout

\begin_layout Code
 *                                   GeonameID source information
\end_layout

\begin_layout Code
 *                                   0x000 = unknown
\end_layout

\begin_layout Code
 *                                   0x001 = continent  (prio: lowest)
\end_layout

\begin_layout Code
 *                                   0x002 = country
\end_layout

\begin_layout Code
 *                                   0x003 = state/prov
\end_layout

\begin_layout Code
 *                                   0x004 = district
\end_layout

\begin_layout Code
 *                                   0x005 = city       (prio: highest)
\end_layout

\begin_layout Code
 *                                   0x006 = (reserved)
\end_layout

\begin_layout Code
 *                                   0x007 = LISP
\end_layout

\begin_layout Code
 *                                   0x0r.
 = registry
\end_layout

\begin_layout Code
 *                               -> 2 leftmost bit are |0 1|
\end_layout

\begin_layout Code
 *                      gggggggg -> 32-bit GeonameID
\end_layout

\begin_layout Code
 *                                   0x11800 = LISP
\end_layout

\begin_layout Standard
Description from libipv4addr.h:
\end_layout

\begin_layout Code
 * IPv4 address anonymization type "keep-type-geonameid"
\end_layout

\begin_layout Code
 *  Global IPv4 addresses are anonymized by storing GeonameID
\end_layout

\begin_layout Code
 *   and using prefix of experimental range (240-255.x.y.z)
\end_layout

\begin_layout Code
 *
\end_layout

\begin_layout Code
 *  3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
\end_layout

\begin_layout Code
 *  1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
\end_layout

\begin_layout Code
 *  1 1 1 1
\end_layout

\begin_layout Code
 * |p p p p|
\end_layout

\begin_layout Code
 *  Prefix
\end_layout

\begin_layout Code
 *    0xF
\end_layout

\begin_layout Code
 *
\end_layout

\begin_layout Code
 * Parity Bit (even parity)
\end_layout

\begin_layout Code
 *         |P|
\end_layout

\begin_layout Code
 *
\end_layout

\begin_layout Code
 * Mapping of GeonameID source
\end_layout

\begin_layout Code
 *           |s s s|
\end_layout

\begin_layout Code
 *            3-bit GeonameID source information
\end_layout

\begin_layout Code
 *            0 0 0 (0x0) = unknown
\end_layout

\begin_layout Code
 *            0 0 1 (0x1) = continent  (prio: lowest)
\end_layout

\begin_layout Code
 *            0 1 0 (0x2) = country
\end_layout

\begin_layout Code
 *            0 1 1 (0x3) = state/prov
\end_layout

\begin_layout Code
 *            1 0 0 (0x4) = district
\end_layout

\begin_layout Code
 *            1 0 1 (0x5) = city       (prio: highest)
\end_layout

\begin_layout Code
 *            1 1 0 (0x6) = (reserved)
\end_layout

\begin_layout Code
 *            1 1 1 (0x7) = LISP
\end_layout

\begin_layout Code
 *
\end_layout

\begin_layout Code
 * Mapping of GeonameID (limited to IDs < 2^24, in worst case ID from source
 with lower prio is used)
\end_layout

\begin_layout Code
 *                 |g g g g g g g g g g g g g g g g g g g g g g g g|
\end_layout

\begin_layout Code
 *
\end_layout

\begin_layout Code
 * Mapping of LISP registry
\end_layout

\begin_layout Code
 *                                  0 0 0 = "unknown ASN registry"
\end_layout

\begin_layout Code
 *                                  0 1 0 = APNIC
\end_layout

\begin_layout Code
 *                                  0 1 1 = RIPE
\end_layout

\begin_layout Code
 *                                  1 0 0 = LACNIC
\end_layout

\begin_layout Code
 *                                  1 0 1 = AFRINIC
\end_layout

\begin_layout Code
 *                                  1 1 0 = ARIN
\end_layout

\begin_layout Code
 *                 |0 0 0 0 0 0 0 1 r r r 1 1 0 0 0 0 0 0 0 0 0 0 0|
\end_layout

\begin_layout Subsection
Supported log file formats
\end_layout

\begin_layout Standard
Currently native supported log files:
\end_layout

\begin_layout Itemize
Apache log file format, 1st token is IPv4 or IPv6 address
\end_layout

\begin_layout Standard
There are plans to support also mail server log files sometimes in the future,
 but because of different formats, this would be probably done by a Perl
 program which parses the log file and a (cached) 'ip6calc' call with action
 'anonymize'.
\end_layout

\begin_layout Subsection
Supported options
\end_layout

\begin_layout Code
$ ipv6loganon -h
\end_layout

\begin_layout Code
ipv6loganon: version 2.1.1 ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC
 ANON_KEEP-TYPE-GEONAMEID
\end_layout

\begin_layout Code
(P) & (C) 2007-2019 by Peter Bieringer <pb (at) bieringer.de>
\end_layout

\begin_layout Code
This program anonymizes IPv4/IPv6 addresses in e.g.
 HTTP server log files
\end_layout

\begin_layout Code
  [-d|--debug <debug value>] : debug value (bitwise like)
\end_layout

\begin_layout Code
                                can also be set by IPV6CALC_DEBUG environment
 value
\end_layout

\begin_layout Code
  [-v|--version [-v [-v]]]   : version information (2 optional detail levels)
\end_layout

\begin_layout Code
  [-v|--version -h]          : explanation of feature tokens
\end_layout

\begin_layout Code
  [-V|--verbose]             : be more verbose
\end_layout

\begin_layout Code
  [-h|--help|-?]             : this online help
\end_layout

\begin_layout Code
  [-q|--quiet]               : be more quiet
\end_layout

\begin_layout Code
  [--disable-ip2location           ] : IP2Location support disabled
\end_layout

\begin_layout Code
  [--db-ip2location-disable        ] : IP2Location support disabled
\end_layout

\begin_layout Code
  [--db-ip2location-dir <directory>] : IP2Location database directory (default:
 /usr/share/IP2Location)
\end_layout

\begin_layout Code
  [--db-ip2location-lib <file>     ] : IP2Location library file (default:
 libIP2Location.so)
\end_layout

\begin_layout Code
  [--db-ip2location-only-type <TYPE>]: IP2Location database only selected
 type (1-120)
\end_layout

\begin_layout Code
  [--db-ip2location-allow-softlinks] : IP2Location database softlinks allowed
\end_layout

\begin_layout Code
     by default they are ignored because it is hard to autodetect COMM/LITE/SAMP
LE
\end_layout

\begin_layout Code
  [--db-ip2location-lite-to-sample-autoswitch-max-delta-months <MONTHS>]:
\end_layout

\begin_layout Code
     autoswitch from LITE to SAMPLE databases if possible and delta is not
 more than 12 months (0=disabled)
\end_layout

\begin_layout Code
  [--db-ip2location-comm-to-lite-switch-min-delta-months <MONTHS>]:
\end_layout

\begin_layout Code
     switch from COMM to LITE databases if possible and delta more than
 12 months (0=disabled)
\end_layout

\begin_layout Code
  [--disable-geoip                 ] : GeoIP support disabled
\end_layout

\begin_layout Code
  [--db-geoip-disable              ] : GeoIP support disabled
\end_layout

\begin_layout Code
  [--db-geoip-dir       <directory>] : GeoIP database directory (default:
 /usr/share/GeoIP)
\end_layout

\begin_layout Code
  [--db-geoip-lib       <file>     ] : GeoIP library file (default: libGeoIP.so.1)
\end_layout

\begin_layout Code
  [--db-mmdb-lib       <file>      ] : MaxMindDB library file (default:
 libmaxminddb.so.0)
\end_layout

\begin_layout Code
  [--disable-geoip2                ] : GeoIP (MaxMindDB) support disabled
\end_layout

\begin_layout Code
  [--db-geoip2-disable             ] : GeoIP (MaxMindDB) support disabled
\end_layout

\begin_layout Code
  [--db-geoip2-dir      <directory>] : GeoIP (MaxMindDB) database directory
 (default: /usr/share/GeoIP)
\end_layout

\begin_layout Code
  [--disable-dbip2                 ] : db-ip.com (MaxMindDB) support disabled
\end_layout

\begin_layout Code
  [--db-dbip2-disable              ] : db-ip.com (MaxMindDB) support disabled
\end_layout

\begin_layout Code
  [--db-dbip2-dir       <directory>] : db-ip.com (MaxMindDB) database directory
 (default: /usr/share/DBIP)
\end_layout

\begin_layout Code
  [--db-dbip2-only-type <TYPE>]      : db-ip.com (MaxMindDB) database only
 selected type (1-10)
\end_layout

\begin_layout Code
  [--db-dbip2-comm-to-free-switch-min-delta-months <MONTHS>]:
\end_layout

\begin_layout Code
     switch from COMM to FREE databases if possible and delta more than
 12 months (0=disabled)
\end_layout

\begin_layout Code
  [--disable-dbip                  ] : db-ip.com support disabled
\end_layout

\begin_layout Code
  [--db-dbip-disable               ] : db-ip.com support disabled
\end_layout

\begin_layout Code
  [--db-dbip-dir        <directory>] : db-ip.com database directory (default:
 /usr/share/DBIP)
\end_layout

\begin_layout Code
  [--db-dbip-only-type <TYPE>]       : db-ip.com database only selected type
 (1-10)
\end_layout

\begin_layout Code
  [--db-dbip-comm-to-free-switch-min-delta-months <MONTHS>]:
\end_layout

\begin_layout Code
     switch from COMM to FREE databases if possible and delta more than
 12 months (0=disabled)
\end_layout

\begin_layout Code
  [--disable-external              ] : External support disabled
\end_layout

\begin_layout Code
  [--db-external-disable           ] : External support disabled
\end_layout

\begin_layout Code
  [--db-external-dir    <directory>] : External database directory (default:
 /usr/share/ipv6calc/db)
\end_layout

\begin_layout Code
  [--disable-builtin               ] : BuiltIn support disabled
\end_layout

\begin_layout Code
  [--db-builtin-disable            ] : BuiltIn support disabled
\end_layout

\begin_layout Code
  [--db-priorization <entry1>[:...]] : Database priorization order list (overwrites
 default)
\end_layout

\begin_layout Code
                                         colon separated: GeoIP GeoIP2 IP2Locati
on DBIP DBIP2 External BuiltIn
\end_layout

\begin_layout Code
  [-w|--write]               : write output to file instead of stdout
\end_layout

\begin_layout Code
  [-a|--append]              : append output to file instead of stdout
\end_layout

\begin_layout Code
  [-f|--flush]               : flush output after each line
\end_layout

\begin_layout Code
  [-V|--verbose]             : be verbose
\end_layout

\begin_layout Code
  [-n|--nocache]             : disable caching
\end_layout

\begin_layout Code
  [-c|--cachelimit <value>]  : set cache limit
\end_layout

\begin_layout Code
                               default: 20
\end_layout

\begin_layout Code
                               maximum: 200
\end_layout

\begin_layout Code
  Shortcut for anonymization presets:
\end_layout

\begin_layout Code
   --anonymize-standard (default)
\end_layout

\begin_layout Code
   --anonymize-careful
\end_layout

\begin_layout Code
   --anonymize-paranoid
\end_layout

\begin_layout Code
  Supported methods [--anonymize-method METHOD]:
\end_layout

\begin_layout Code
   anonymize : reliable anonymization, keep as much type information as
 possible
\end_layout

\begin_layout Code
   zeroize   : simple zeroizing according to given masks, probably loose
 type information
\end_layout

\begin_layout Code
   keep-type-asn-cc: special reliable anonymization, keep type & Autonomous
 System Number and CountryCode
\end_layout

\begin_layout Code
   keep-type-geonameid: special reliable anonymization, keep type & GeonameID
\end_layout

\begin_layout Code
  Available presets (shortcut names) [--anonymize-preset|ap PRESET-NAME]:
\end_layout

\begin_layout Code
   anonymize-standard   (as): mask-ipv6= 56 mask-ipv4=24 mask-eui64=40 mask-mac=
24 mask-autoadjust=yes method=anonymize
\end_layout

\begin_layout Code
   anonymize-careful    (ac): mask-ipv6= 48 mask-ipv4=20 mask-eui64=24 mask-mac=
24 mask-autoadjust=yes method=anonymize
\end_layout

\begin_layout Code
   anonymize-paranoid   (ap): mask-ipv6= 40 mask-ipv4=16 mask-eui64= 0 mask-mac=
24 mask-autoadjust=no  method=anonymize
\end_layout

\begin_layout Code
   zeroize-standard     (zs): mask-ipv6= 56 mask-ipv4=24 mask-eui64=40 mask-mac=
24 mask-autoadjust=yes method=zeroize
\end_layout

\begin_layout Code
   zeroize-careful      (zc): mask-ipv6= 48 mask-ipv4=20 mask-eui64=24 mask-mac=
24 mask-autoadjust=yes method=zeroize
\end_layout

\begin_layout Code
   zeroize-paranoid     (zp): mask-ipv6= 40 mask-ipv4=16 mask-eui64= 0 mask-mac=
24 mask-autoadjust=no  method=zeroize
\end_layout

\begin_layout Code
   keep-type-asn-cc     (kp): mask-ipv6= 56 mask-ipv4=24 mask-eui64=40 mask-mac=
24 mask-autoadjust=yes method=keep-type-asn-cc
\end_layout

\begin_layout Code
   keep-type-geonameid  (kg): mask-ipv6= 56 mask-ipv4=24 mask-eui64=40 mask-mac=
24 mask-autoadjust=yes method=keep-type-geonameid
\end_layout

\begin_layout Code
  Custom control:
\end_layout

\begin_layout Code
  --mask-ipv4  <bits>     : mask IPv4 address [0-32] (even if occurs in
 IPv6 address)
\end_layout

\begin_layout Code
  --mask-ipv6  <bits>     : mask IPv6 prefix [0-64] (only applied to related
 address types)
\end_layout

\begin_layout Code
  --mask-eui64 <bits>     : mask EUI-64 address or IPv6 interface identifier
 [0-64]
\end_layout

\begin_layout Code
  --mask-mac   <bits>     : mask MAC address [0-48]
\end_layout

\begin_layout Code
  --mask-autoadjust yes|no: autoadjust mask to keep type/vendor information
 regardless of less given mask
\end_layout

\begin_layout Code
 Takes data from stdin, outputs the processed data to stdout (default)
\end_layout

\begin_layout Subsection
Usage
\end_layout

\begin_layout Subsubsection
Offline anonymization
\end_layout

\begin_layout Code
$ cat /path/to/http_log | ./ipv6loganon >/path/to/http_log_anonymized
\end_layout

\begin_layout Subsubsection
On-the-fly online anonymization for Apache Webserver
\end_layout

\begin_layout Quotation
Note: since 0.91.1 also a module for Apache Webserver is available (see below)
 supporting anonymized logging
\end_layout

\begin_layout Standard
(Supported since 0.90.0)
\end_layout

\begin_layout Standard
Adjust or add (note: more than one CustomLog directive is supported by Apache)
 httpd.conf like following:
\end_layout

\begin_layout Code
CustomLog "|/usr/local/bin/ipv6loganon -a -f /var/log/httpd/access_log"
 combined
\end_layout

\begin_layout Standard
In case of 
\begin_inset Quotes eld
\end_inset

cronolog
\begin_inset Quotes erd
\end_inset

 is used on the system, configure like this:
\end_layout

\begin_layout Itemize
Apache version < 2.4:
\end_layout

\begin_layout Code
CustomLog "|/usr/bin/ipv6loganon -f |/usr/sbin/cronolog /var/log/httpd/access.log
-%Y%m%d" combined 
\end_layout

\begin_layout Itemize
Apache version >= 2.4:
\end_layout

\begin_layout Code
CustomLog "|$/usr/bin/ipv6loganon -f |/usr/sbin/cronolog /var/log/httpd/access.lo
g-%Y%m%d" combined 
\end_layout

\begin_layout Section
External database update helper scripts
\end_layout

\begin_layout Standard
The 
\begin_inset Quotes eld
\end_inset

tools
\begin_inset Quotes erd
\end_inset

 subdirectory contains helper scripts for updating external databases.
\end_layout

\begin_layout Subsection
IP2Location
\end_layout

\begin_layout Code
$ /usr/share/ipv6calc/tools/IP2Location-update.sh -h
\end_layout

\begin_layout Code
Usage: IP2Location-update.sh [-D <dir>] [-n] [-s]
\end_layout

\begin_layout Code
	-D <dir>	database destination directory (optional)
\end_layout

\begin_layout Code
	-n		no action (dry-run)
\end_layout

\begin_layout Code
	-s		skip already successfully downloaded files
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
	database directory: /usr/share/IP2Location (default: /usr/share/IP2Location)
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
	it honors externally defined environment value: IP2LOCATION_DAT_DIR
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
 this script will download data from ip2location.com
\end_layout

\begin_layout Code
  into given/set database directory
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
 Sample databases:
\end_layout

\begin_layout Code
  IP2LOCATION_DAT_FILES_SAMPLE=IPv4:20 IPv6:20 IPv4:24 IPv6:24
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
 Lite (free) databases:
\end_layout

\begin_layout Code
  IP2LOCATION_DAT_FILES_LITE_FREE=IPv4:1 IPv6:1
\end_layout

\begin_layout Code
 
\end_layout

\begin_layout Code
 With authentication (requires login/password in /home/compile/.ip2location)
 and a valid subscription
\end_layout

\begin_layout Code
  IP2LOCATION_DAT_FILES_LITE=
\end_layout

\begin_layout Code
 
\end_layout

\begin_layout Code
 Credentials must be defined in $HOME/.ip2location by
\end_layout

\begin_layout Code
  login=IP2LOCATION-LOGIN
\end_layout

\begin_layout Code
  password=IP2LOCATION-PASSWORD
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
 In addition settings from above can be overwritten by setting related variables
\end_layout

\begin_layout Subsection
GeoIP
\end_layout

\begin_layout Standard
Just note that old database format (version 1) is no longer supported for
 free download, ipv6calc >= 2.0.0 supports also MaxMindDB format, ipv6calc
 >= 3.0.0 drops legacy download capability
\end_layout

\begin_layout Code
$ /usr/share/ipv6calc/tools/GeoIP-update.sh -h
\end_layout

\begin_layout Code
Usage: GeoIP-update.sh [-D <dir>] [-v] [-s] [-L] [-G]
\end_layout

\begin_layout Code
	-s		skip download
\end_layout

\begin_layout Code
	-D <dir>	database directory (optional)
\end_layout

\begin_layout Code
	-v		verbose
\end_layout

\begin_layout Code
	database directory: @GEOIP2_DB@ (default: @GEOIP2_DB@)
\end_layout

\begin_layout Code
	it honors externally defined environment value:
\end_layout

\begin_layout Code
		prio 1: GEOIP_DAT_DIR
\end_layout

\begin_layout Code
		prio 2: IPV6CALC_DB_GEOIP2_DIR
\end_layout

\begin_layout Code
 adjust /etc/GeoIP.conf in advance:
\end_layout

\begin_layout Code
   EditionIDs GeoLite2-Country GeoLite2-City GeoLite2-ASN
\end_layout

\begin_layout Code
   (in case a valid license key exists, add key and extend EditionIDs related)
\end_layout

\begin_layout Code
   see also https://dev.maxmind.com/geoip/geoipupdate/
\end_layout

\begin_layout Subsection
DB-IP.com
\end_layout

\begin_layout Standard
Since ipv6calc >= 2.0.0 supports also MaxMindDB format, so download of CSV
 files and converting them into BerkeleyDB format is no longer required.
\end_layout

\begin_layout Code
$ /usr/share/ipv6calc/tools/DBIP-update.sh -h
\end_layout

\begin_layout Code
Usage: DBIP-update.sh [-v] [-s] [-D <dir>] [-U <url>] [-T <type>]
\end_layout

\begin_layout Code
	-s		skip download
\end_layout

\begin_layout Code
	-v		verbose
\end_layout

\begin_layout Code
	-D <dir>	database directory (optional)
\end_layout

\begin_layout Code
	-U <url>	use URL to download full database
\end_layout

\begin_layout Code
	-T <type>	set type of via URL downloaded file
\end_layout

\begin_layout Code
                          MMDB: country|isp|location|*location-isp*
\end_layout

\begin_layout Code
			  CSV : isp|location|*full*
\end_layout

\begin_layout Code
	database directory: /usr/share/DBIP (default: /usr/share/DBIP)
\end_layout

\begin_layout Code
 it honors externally defined environment value:
\end_layout

\begin_layout Code
	prio 1: DBIP_DAT_DIR
\end_layout

\begin_layout Code
	prio 2: IPV6CALC_DB_DBIP2_DIR
\end_layout

\begin_layout Code
 this script will download data from
\end_layout

\begin_layout Code
 DB-IP.com (default: free versions) the MaxMindDB (mmdb) files DB files for
 ipv6calc
\end_layout

\begin_layout Code
 "DBIP" database support
\end_layout

\begin_layout Code
 DBIP_DAT_URL_BASE=http://download.db-ip.com/free/
\end_layout

\begin_layout Code
 DBIP_DAT_FILES=dbip-country-lite-%Y-%m.mmdb.gz dbip-city-lite-%Y-%m.mmdb.gz
\end_layout

\begin_layout Code
 in case -U <url> (take URL from subscription e-mail) is provided, it downloads
 the database
\end_layout

\begin_layout Code
  use -T <type> in case it's not "location-isp"
\end_layout

\begin_layout Subsection
External
\end_layout

\begin_layout Code
$ /usr/share/ipv6calc/tools/ipv6calc-db-update.sh -h
\end_layout

\begin_layout Code
Usage: ipv6calc-db-update.sh [-s] [-u] [-D <dir>]
\end_layout

\begin_layout Code
	-s		skip download
\end_layout

\begin_layout Code
	-u		unconditional update
\end_layout

\begin_layout Code
	-D <dir>        database directory (optional)
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
	database directory: /usr/share/ipv6calc/db (default: /usr/share/ipv6calc/db)
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
	it honors externally defined environment value: IPV6CALC_DAT_DIR
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
	this script (and its helper scripts) will download data from
\end_layout

\begin_layout Code
	registries and generate Berkeley DB files for ipv6calc
\end_layout

\begin_layout Code
	"external" database support
\end_layout

\begin_layout Section
Perl CGI wrapper program "ipv6calcweb.cgi"
\end_layout

\begin_layout Standard
Because calling C programs directly as CGI isn't really recommended (too
 much security troubles all the time), I wrote a small wrapper utility which
 calls "ipv6calc" to get information about client and server address for
 displaying on a web page.
 
\end_layout

\begin_layout Subsection
Examples
\end_layout

\begin_layout Standard
A demonstration about which kind of output is possible to produce is shown
 at
\end_layout

\begin_layout Itemize
\begin_inset CommandInset href
LatexCommand href
name "http://ip.bieringer.net/"
target "http://ip.bieringer.net/"
literal "false"

\end_inset

 (IPv4/IPv6)
\end_layout

\begin_layout Itemize
\begin_inset CommandInset href
LatexCommand href
name "http://www.ipv6.bieringer.de/"
target "http://www.ipv6.bieringer.de/"
literal "false"

\end_inset

 (IPv6 only)
\end_layout

\begin_layout Itemize
\begin_inset CommandInset href
LatexCommand href
name "http://mirrors.bieringer.de/"
target "http://mirrors.bieringer.de/"
literal "false"

\end_inset

 (IPv4/IPv6)
\end_layout

\begin_layout Section
Webserver log statistics helper program "ipv6logstats"
\end_layout

\begin_layout Standard
This program parses a given webserver logfile and count addresses, useful
 for time period statistics.
\end_layout

\begin_layout Standard
Since version 0.95.0 it has extended output, adding a date/time line and statistic
s by Country Code and ASN (if required databases are available).
\end_layout

\begin_layout Subsection
Supported options
\end_layout

\begin_layout Code
$ ipv6logstats -h
\end_layout

\begin_layout Code
ipv6logstats: version 2.1.1 STAT_REG STAT_CC STAT_AS
\end_layout

\begin_layout Code
(P) & (C) 2003-2019 by Peter Bieringer <pb (at) bieringer.de>
\end_layout

\begin_layout Code
 Takes web server log data (or any other data which has IPv4/v6 address
 in first column)
\end_layout

\begin_layout Code
   from stdin and print statistics table/list (depending on option) to stdout
\end_layout

\begin_layout Code
  [-d|--debug <debug value>] : debug value (bitwise like)
\end_layout

\begin_layout Code
                                can also be set by IPV6CALC_DEBUG environment
 value
\end_layout

\begin_layout Code
  [-v|--version [-v [-v]]]   : version information (2 optional detail levels)
\end_layout

\begin_layout Code
  [-v|--version -h]          : explanation of feature tokens
\end_layout

\begin_layout Code
  [-V|--verbose]             : be more verbose
\end_layout

\begin_layout Code
  [-h|--help|-?]             : this online help
\end_layout

\begin_layout Code
  [-q|--quiet]               : be more quiet
\end_layout

\begin_layout Code
  [--disable-ip2location           ] : IP2Location support disabled
\end_layout

\begin_layout Code
  [--db-ip2location-disable        ] : IP2Location support disabled
\end_layout

\begin_layout Code
  [--db-ip2location-dir <directory>] : IP2Location database directory (default:
 /usr/share/IP2Location)
\end_layout

\begin_layout Code
  [--db-ip2location-lib <file>     ] : IP2Location library file (default:
 libIP2Location.so)
\end_layout

\begin_layout Code
  [--db-ip2location-only-type <TYPE>]: IP2Location database only selected
 type (1-120)
\end_layout

\begin_layout Code
  [--db-ip2location-allow-softlinks] : IP2Location database softlinks allowed
\end_layout

\begin_layout Code
     by default they are ignored because it is hard to autodetect COMM/LITE/SAMP
LE
\end_layout

\begin_layout Code
  [--db-ip2location-lite-to-sample-autoswitch-max-delta-months <MONTHS>]:
\end_layout

\begin_layout Code
     autoswitch from LITE to SAMPLE databases if possible and delta is not
 more than 12 months (0=disabled)
\end_layout

\begin_layout Code
  [--db-ip2location-comm-to-lite-switch-min-delta-months <MONTHS>]:
\end_layout

\begin_layout Code
     switch from COMM to LITE databases if possible and delta more than
 12 months (0=disabled)
\end_layout

\begin_layout Code
  [--disable-geoip                 ] : GeoIP support disabled
\end_layout

\begin_layout Code
  [--db-geoip-disable              ] : GeoIP support disabled
\end_layout

\begin_layout Code
  [--db-geoip-dir       <directory>] : GeoIP database directory (default:
 /usr/share/GeoIP)
\end_layout

\begin_layout Code
  [--db-geoip-lib       <file>     ] : GeoIP library file (default: libGeoIP.so.1)
\end_layout

\begin_layout Code
  [--db-mmdb-lib       <file>      ] : MaxMindDB library file (default:
 libmaxminddb.so.0)
\end_layout

\begin_layout Code
  [--disable-geoip2                ] : GeoIP (MaxMindDB) support disabled
\end_layout

\begin_layout Code
  [--db-geoip2-disable             ] : GeoIP (MaxMindDB) support disabled
\end_layout

\begin_layout Code
  [--db-geoip2-dir      <directory>] : GeoIP (MaxMindDB) database directory
 (default: /usr/share/GeoIP)
\end_layout

\begin_layout Code
  [--disable-dbip2                 ] : db-ip.com (MaxMindDB) support disabled
\end_layout

\begin_layout Code
  [--db-dbip2-disable              ] : db-ip.com (MaxMindDB) support disabled
\end_layout

\begin_layout Code
  [--db-dbip2-dir       <directory>] : db-ip.com (MaxMindDB) database directory
 (default: /usr/share/DBIP)
\end_layout

\begin_layout Code
  [--db-dbip2-only-type <TYPE>]      : db-ip.com (MaxMindDB) database only
 selected type (1-10)
\end_layout

\begin_layout Code
  [--db-dbip2-comm-to-free-switch-min-delta-months <MONTHS>]:
\end_layout

\begin_layout Code
     switch from COMM to FREE databases if possible and delta more than
 12 months (0=disabled)
\end_layout

\begin_layout Code
  [--disable-dbip                  ] : db-ip.com support disabled
\end_layout

\begin_layout Code
  [--db-dbip-disable               ] : db-ip.com support disabled
\end_layout

\begin_layout Code
  [--db-dbip-dir        <directory>] : db-ip.com database directory (default:
 /usr/share/DBIP)
\end_layout

\begin_layout Code
  [--db-dbip-only-type <TYPE>]       : db-ip.com database only selected type
 (1-10)
\end_layout

\begin_layout Code
  [--db-dbip-comm-to-free-switch-min-delta-months <MONTHS>]:
\end_layout

\begin_layout Code
     switch from COMM to FREE databases if possible and delta more than
 12 months (0=disabled)
\end_layout

\begin_layout Code
  [--disable-external              ] : External support disabled
\end_layout

\begin_layout Code
  [--db-external-disable           ] : External support disabled
\end_layout

\begin_layout Code
  [--db-external-dir    <directory>] : External database directory (default:
 /usr/share/ipv6calc/db)
\end_layout

\begin_layout Code
  [--disable-builtin               ] : BuiltIn support disabled
\end_layout

\begin_layout Code
  [--db-builtin-disable            ] : BuiltIn support disabled
\end_layout

\begin_layout Code
  [--db-priorization <entry1>[:...]] : Database priorization order list (overwrites
 default)
\end_layout

\begin_layout Code
                                         colon separated: GeoIP GeoIP2 IP2Locati
on DBIP DBIP2 External BuiltIn
\end_layout

\begin_layout Code
  [-u|--unknown]             : print unknown IP addresses to stderr
\end_layout

\begin_layout Code
  [-c|--columns]             : print statistics in columns (1)
\end_layout

\begin_layout Code
  [-N|--column-numbers]      : print column numbers
\end_layout

\begin_layout Code
  [-n|--noheader]            : don't print header in columns mode (1)
\end_layout

\begin_layout Code
  [-o|--onlyheader]          : print only header in columns mode (1)
\end_layout

\begin_layout Code
  [-p|--prefix <token>]      : print token as prefix (1)
\end_layout

\begin_layout Code
  [-s|--simple]              : disable extended statistic (CountryCode/ASN)
\end_layout

\begin_layout Code
 (1) unsupported for CountryCode & ASN statistics
\end_layout

\begin_layout Subsection
Usage
\end_layout

\begin_layout Standard
There are a README and some helper scripts available in the package how
 to use this program and how to generate a graph using Gnuplot.
\end_layout

\begin_layout Subsubsection
Line-by-line output
\end_layout

\begin_layout Standard
The example shows output version 3.0, which 
\end_layout

\begin_layout Code
$ zcat ip.bieringer.de-log.201*.gz | ipv6logstats
\end_layout

\begin_layout Standard
Header section, since output version 3.0 (>= 0.95.0) additional lines starting
 with '*3*' and '*DateTime' and '*UnixTime' included
\end_layout

\begin_layout Code
*Version             3.0
\end_layout

\begin_layout Code
*DateTime: 2013:11:03 08:57:01+0000 GMT
\end_layout

\begin_layout Code
*UnixTime: 1383469021
\end_layout

\begin_layout Code
*3*DB-Info: DB features: 0x0000133f
\end_layout

\begin_layout Code
*3*DB-Info: GeoIP: features: 0x00000330
\end_layout

\begin_layout Code
*3*DB-Info: GeoIP: info of available databases in directory: /usr/share/GeoIP
 (max: 31)
\end_layout

\begin_layout Code
*3*DB-Info: GeoIP: GeoIP Country Edition            :[ 1] /usr/share/GeoIP/GeoIP.
dat               (GEO-106FREE 20130903 Build 1 Copyright (c) 2013 MaxMind
 Inc All Rights Reserved)
\end_layout

\begin_layout Code
*3*DB-Info: GeoIP: GeoIP ASNum Edition              :[ 9] /usr/share/GeoIP/GeoIP
ASNum.dat          (GEO-117 20130902 Build 1 Copyright (c) 2013 MaxMind Inc
 All Rights Reserved)
\end_layout

\begin_layout Code
*3*DB-Info: GeoIP: GeoIP Country V6 Edition         :[12] /usr/share/GeoIP/GeoIP
v6.dat             (GEO-106FREE 20131001 Build 1 Copyright (c) 2013 MaxMind
 Inc All Rights Reserved)
\end_layout

\begin_layout Code
*3*DB-Info: GeoIP: GeoIP Large Country Edition      :[17] /usr/share/GeoIP/GeoIP.
dat               (GEO-106FREE 20130903 Build 1 Copyright (c) 2013 MaxMind
 Inc All Rights Reserved)
\end_layout

\begin_layout Code
*3*DB-Info: GeoIP: GeoIP Large Country V6 Edition   :[18] /usr/share/GeoIP/GeoIP
v6.dat             (GEO-106FREE 20131001 Build 1 Copyright (c) 2013 MaxMind
 Inc All Rights Reserved)
\end_layout

\begin_layout Code
*3*DB-Info: GeoIP: GeoIP ASNum V6 Edition           :[21] /usr/share/GeoIP/GeoIP
ASNumv6.dat        (GEO-117 20130306 Build 1 Copyright (c) 2013 MaxMind Inc
 All Rights Reserved)
\end_layout

\begin_layout Code
*3*DB-Info: IP2Location: features: 0x00000300
\end_layout

\begin_layout Code
*3*DB-Info: IP2Location: info of available databases in directory: /usr/share/IP
2Location
\end_layout

\begin_layout Code
*3*DB-Info: IP2Location: IPv4 Country               : /usr/share/IP2Location/IP-
COUNTRY.BIN    (IP2L-DB20 20130411 Copyright (c) 2013 IP2Location All Rights
 Reserved)
\end_layout

\begin_layout Code
*3*DB-Info: IP2Location: IPv6 Country               : /usr/share/IP2Location/IPV
6-COUNTRY.BIN  (IP2L-DB1 20131025 Copyright (c) 2013 IP2Location All Rights
 Reserved)
\end_layout

\begin_layout Code
*3*DB-Info: BuiltIn: features: 0x0000100f
\end_layout

\begin_layout Code
*3*DB-Info: BuiltIn: info of available databases
\end_layout

\begin_layout Code
*3*DB-Info: BuiltIn: ASN  : IANA/20130730
\end_layout

\begin_layout Code
*3*DB-Info: BuiltIn: CC   : AFRINIC/20130806 APNIC/20130805 ARIN/20130805
 LACNIC/20130805 RIPENCC/20130805
\end_layout

\begin_layout Code
*3*DB-Info: BuiltIn: IPv4 : AFRINIC/20131014 APNIC/20131014 ARIN/20131014
 IANA/20130520 LACNIC/20131014 RIPENCC/20131014
\end_layout

\begin_layout Code
*3*DB-Info: BuiltIn: IPv6 : AFRINIC/20131015 APNIC/20131014 ARIN/20131014
 IANA/20130215 LACNIC/20131014 RIPENCC/20131014
\end_layout

\begin_layout Code
*3*DB-Info: BuiltIn: IEEE : IAB/20131015 OUI/20131015 OUI36/20131015
\end_layout

\begin_layout Standard
Simple statistics section
\end_layout

\begin_layout Code
ALL                  108525
\end_layout

\begin_layout Code
IPv4                 46233
\end_layout

\begin_layout Code
IPv6                 62292
\end_layout

\begin_layout Code
UNKNOWN              0
\end_layout

\begin_layout Code
IPv4/APNIC           2397
\end_layout

\begin_layout Code
IPv4/ARIN            3525
\end_layout

\begin_layout Code
IPv4/RIPE            40198
\end_layout

\begin_layout Code
IPv4/LACNIC          97
\end_layout

\begin_layout Code
IPv4/UNKNOWN         16
\end_layout

\begin_layout Code
IPv6/6bone           0
\end_layout

\begin_layout Code
IPv6/IANA            0
\end_layout

\begin_layout Code
IPv6/APNIC           129
\end_layout

\begin_layout Code
IPv6/ARIN            839
\end_layout

\begin_layout Code
IPv6/RIPE            61074
\end_layout

\begin_layout Code
IPv6/LACNIC          0
\end_layout

\begin_layout Code
IPv6/RESERVED        0
\end_layout

\begin_layout Code
IPv6/UNKNOWN         0
\end_layout

\begin_layout Code
IPv6/6to4/IANA       0
\end_layout

\begin_layout Code
IPv6/6to4/APNIC      0
\end_layout

\begin_layout Code
IPv6/6to4/ARIN       16
\end_layout

\begin_layout Code
IPv6/6to4/RIPE       51
\end_layout

\begin_layout Code
IPv6/6to4/LACNIC     0
\end_layout

\begin_layout Code
IPv6/6to4/RESERVED   0
\end_layout

\begin_layout Code
IPv6/6to4/UNKNOWN    0
\end_layout

\begin_layout Code
IPv6/Teredo/IANA     0
\end_layout

\begin_layout Code
IPv6/Teredo/APNIC    63
\end_layout

\begin_layout Code
IPv6/Teredo/ARIN     0
\end_layout

\begin_layout Code
IPv6/Teredo/RIPE     90
\end_layout

\begin_layout Code
IPv6/Teredo/LACNIC   30
\end_layout

\begin_layout Code
IPv6/Teredo/RESERVED 0
\end_layout

\begin_layout Code
IPv6/Teredo/UNKNOWN  0
\end_layout

\begin_layout Code
IPv6/NAT64/IANA      0
\end_layout

\begin_layout Code
IPv6/NAT64/APNIC     0
\end_layout

\begin_layout Code
IPv6/NAT64/ARIN      0
\end_layout

\begin_layout Code
IPv6/NAT64/RIPE      0
\end_layout

\begin_layout Code
IPv6/NAT64/LACNIC    0
\end_layout

\begin_layout Code
IPv6/NAT64/RESERVED  0
\end_layout

\begin_layout Code
IPv6/NAT64/UNKNOWN   0
\end_layout

\begin_layout Code
IPv6/IID/Global      1436
\end_layout

\begin_layout Code
IPv6/IID/Random      58198
\end_layout

\begin_layout Code
IPv6/IID/Manual      2055
\end_layout

\begin_layout Code
IPv6/IID/ISATAP      353
\end_layout

\begin_layout Code
IPv6/IID/Unknown     0
\end_layout

\begin_layout Standard
External database supported output since output version 3.0 (>= 0.95.0)
\end_layout

\begin_layout Itemize
Country Code / Proto
\end_layout

\begin_layout Code
...
\end_layout

\begin_layout Code
*3*CC-code-proto/DE/ALL   96450
\end_layout

\begin_layout Code
*3*CC-code-proto/DE/IPv4  36486
\end_layout

\begin_layout Code
*3*CC-code-proto/DE/IPv6  59964 
\end_layout

\begin_layout Code
*3*CC-code-proto-list/DE  96450 36486 59964
\end_layout

\begin_layout Code
...
\end_layout

\begin_layout Itemize
Proto / Country Code (
\begin_inset Quotes eld
\end_inset

ALL
\begin_inset Quotes erd
\end_inset

 line contains: ALL IPv4 IPv6)
\end_layout

\begin_layout Code
...
\end_layout

\begin_layout Code
*3*CC-proto-code/ALL/DE   96450
\end_layout

\begin_layout Code
*3*CC-proto-code/IPv4/DE  36486
\end_layout

\begin_layout Code
*3*CC-proto-code/IPv6/DE  59964
\end_layout

\begin_layout Code
...
\end_layout

\begin_layout Code
*3*CC-proto-code-list/ALL  108525 46483 62042
\end_layout

\begin_layout Itemize
Autonomous System number / Proto
\end_layout

\begin_layout Code
...
\end_layout

\begin_layout Code
*3*AS-num-proto/8767/ALL   6054
\end_layout

\begin_layout Code
*3*AS-num-proto/8767/IPv4  2705
\end_layout

\begin_layout Code
*3*AS-num-proto/8767/IPv6  3349
\end_layout

\begin_layout Code
*3*AS-num-proto-list/8767  6054 2705 3349
\end_layout

\begin_layout Code
...
\end_layout

\begin_layout Itemize
Proto / Autonomous System number (
\begin_inset Quotes eld
\end_inset

ALL
\begin_inset Quotes erd
\end_inset

 line contains: ALL IPv4 IPv6)
\end_layout

\begin_layout Code
...
\end_layout

\begin_layout Code
*3*AS-proto-num/ALL/8767   6054
\end_layout

\begin_layout Code
*3*AS-proto-num/IPv4/8767  2705
\end_layout

\begin_layout Code
*3*AS-proto-num/IPv6/8767  3349
\end_layout

\begin_layout Code
...
\end_layout

\begin_layout Code
*3*AS-proto-num-list/ALL  108525 46483 62042
\end_layout

\begin_layout Subsubsection
Column output
\end_layout

\begin_layout Standard
Column output does not support version 3 extension, only simple statistics
 with a header line:
\end_layout

\begin_layout Code
$ zcat ip.bieringer.de-log.201*.gz | ipv6logstats -q -c 
\end_layout

\begin_layout Code
 IPv4 IPv6 UNKNOWN IPv4/APNIC IPv4/ARIN IPv4/RIPE IPv4/LACNIC IPv4/UNKNOWN
 IPv6/6bone IPv6/IANA IPv6/APNIC IPv6/ARIN IPv6/RIPE IPv6/LACNIC IPv6/RESERVED
 IPv6/UNKNOWN IPv6/6to4/IANA IPv6/6to4/APNIC IPv6/6to4/ARIN IPv6/6to4/RIPE
 IPv6/6to4/LACNIC IPv6/6to4/RESERVED IPv6/6to4/UNKNOWN IPv6/Teredo/IANA
 IPv6/Teredo/APNIC IPv6/Teredo/ARIN IPv6/Teredo/RIPE IPv6/Teredo/LACNIC
 IPv6/Teredo/RESERVED IPv6/Teredo/UNKNOWN IPv6/NAT64/IANA IPv6/NAT64/APNIC
 IPv6/NAT64/ARIN IPv6/NAT64/RIPE IPv6/NAT64/LACNIC IPv6/NAT64/RESERVED IPv6/NAT6
4/UNKNOWN IPv6/IID/Global IPv6/IID/Random IPv6/IID/Manual IPv6/IID/ISATAP
 IPv6/IID/Unknown
\end_layout

\begin_layout Code
 46233 62292 0 2397 3525 40198 97 16 0 0 129 839 61074 0 0 0 0 0 16 51 0
 0 0 0 63 0 90 30 0 0 0 0 0 0 0 0 0 1436 58198 2055 353 0
\end_layout

\begin_layout Standard
An optional prefix token can be given (
\begin_inset Quotes eld
\end_inset

-p <prefix>
\begin_inset Quotes erd
\end_inset

) to create e.g.
 in a for-loop one line per month and put month in front of statistics,
 also the header line can be suppressed (
\begin_inset Quotes eld
\end_inset

-n
\begin_inset Quotes erd
\end_inset

).
\end_layout

\begin_layout Code
$ zcat ip.bieringer.de-log.201*.gz | ipv6logstats -q -c -n -p ALL
\end_layout

\begin_layout Code
ALL  46233 62292 0 2397 3525 40198 97 16 0 0 129 839 61074 0 0 0 0 0 16
 51 0 0 0 0 63 0 90 30 0 0 0 0 0 0 0 0 0 1436 58198 2055 353 0 
\end_layout

\begin_layout Subsection
Examples
\end_layout

\begin_layout Standard
A demonstration with real data is available at 
\begin_inset CommandInset href
LatexCommand href
name "http://mirrors.bieringer.de/stats/timeline.html"
target "http://mirrors.bieringer.de/stats/timeline.html"
literal "false"

\end_inset

.
\end_layout

\begin_layout Section
Apache web server module 
\begin_inset Quotes eld
\end_inset

mod_ipv6calc
\begin_inset Quotes erd
\end_inset


\end_layout

\begin_layout Standard
This Apache web server module (since version 0.99.1, released 2015) interfaces
 with internal ipv6calc library to support
\end_layout

\begin_layout Itemize
Client IP address anonymization 
\begin_inset Quotes eld
\end_inset

on-the-fly
\begin_inset Quotes erd
\end_inset

, exported to IPV6CALC_CLIENT_IP_ANON
\begin_inset Separator latexpar
\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
depending on the configured anonymization method 3rd party database is required
\end_layout

\end_deeper
\begin_layout Itemize
Country code of client IP address, exported to IPV6CALC_CLIENT_COUNTRYCODE
\begin_inset Separator latexpar
\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
requires 3rd party database: GeoIP or IP2Location or DB-IP.com
\end_layout

\end_deeper
\begin_layout Itemize
Autonomous System Number (ASN) of client IP address, exported to IPV6CALC_CLIENT
_ASN
\begin_inset Separator latexpar
\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
requires 3rd party database: GeoIP
\end_layout

\end_deeper
\begin_layout Itemize
Registry of client IP address, exported to IPV6CALC_CLIENT_REGISTRY
\begin_inset Separator latexpar
\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
requires internal or 
\begin_inset Quotes eld
\end_inset

external
\begin_inset Quotes erd
\end_inset

 database
\end_layout

\end_deeper
\begin_layout Itemize
Configured IP address anonymization method, exported to IPV6CALC_ANON_METHOD
\end_layout

\begin_layout Subsection
Installation
\end_layout

\begin_layout Standard
Install compiled Apache module 
\begin_inset Quotes eld
\end_inset

mod_ipv6calc
\begin_inset Quotes erd
\end_inset

 to Apache's module directory
\end_layout

\begin_layout Standard
Install included default configuration file 
\begin_inset Quotes eld
\end_inset

ipv6calc.conf
\begin_inset Quotes erd
\end_inset

 to Apache's config directory (usually conf.d)
\end_layout

\begin_layout Subsection
Configuration
\end_layout

\begin_layout Standard
Enable in 
\begin_inset Quotes eld
\end_inset

ipv6calc.conf
\begin_inset Quotes erd
\end_inset

 loading of module
\end_layout

\begin_layout Code
LoadModule ipv6calc_module modules/mod_ipv6calc.so
\end_layout

\begin_layout Standard
Enable module itself 
\end_layout

\begin_layout Code
ipv6calcEnable                         on
\end_layout

\begin_layout Standard
Adjust configuration settings, if needed (see examples in 
\begin_inset Quotes eld
\end_inset

ipv6calc.conf
\begin_inset Quotes erd
\end_inset

)
\end_layout

\begin_layout Standard
Review predefined log format
\end_layout

\begin_layout Code
LogFormat "%{IPV6CALC_CLIENT_IP_ANON}e 
\backslash
"%{IPV6CALC_CLIENT_COUNTRYCODE}e/%{IPV6CALC_CLIENT_ASN}e/%{IPV6CALC_CLIENT_REGIS
TRY}e/%{IPV6CALC_ANON_METHOD}e
\backslash
" %u %t 
\backslash
"%r
\backslash
" %>s %b 
\backslash
"%{Referer}i
\backslash
" 
\backslash
"%{User-Agent}i
\backslash
"" combined_anon
\end_layout

\begin_layout Standard
Enable custom log with anonymized information, using the predefined LogFormat
\end_layout

\begin_layout Code
CustomLog logs/access_anon_log combined_anon
\end_layout

\begin_layout Standard
Restart Apache web server, check error_log for any issues
\end_layout

\begin_layout Subsection
Result
\end_layout

\begin_layout Standard
The new log file contains anonymized requests like
\end_layout

\begin_layout Code
252.176.92.172 "CN/23724/APNIC/keep-type-asn-cc" - [25/Jul/2015:13:20:25 +0200]
 "GET / HTTP/1.1" 200 3569 "-" "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://w
ww.baidu.com/search/spider.html)"
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
a909:390a:909a:81d9:a909:4291:c02d:5d1d "CZ/43037/RIPENCC/keep-type-asn-cc"
 - [25/Jul/2015:12:59:00 +0200] "GET /robots.txt HTTP/1.1" 200 33 "-" "Mozilla/5.0
 (compatible; SeznamBot/3.2; +http://fulltext.sblog.cz/)" 
\end_layout

\begin_layout Subsection
Post-analysis in case of anonymization method 
\begin_inset Quotes eld
\end_inset

keep-type-asn-cc
\begin_inset Quotes erd
\end_inset


\end_layout

\begin_layout Standard
In case 
\begin_inset Quotes eld
\end_inset

keep-type-asn-cc
\begin_inset Quotes erd
\end_inset

 is configured and also working (required databases are available), related
 information of anonymized IP addresses can be retrieved using 
\begin_inset Quotes eld
\end_inset

ipv6calc
\begin_inset Quotes erd
\end_inset

 or 
\begin_inset Quotes eld
\end_inset

ipv6logstats
\begin_inset Quotes erd
\end_inset

.
\end_layout

\begin_layout Code
$ ipv6calc -q -m -i 252.176.92.172
\end_layout

\begin_layout Code
IPV4=252.176.92.172
\end_layout

\begin_layout Code
IPV4_TYPE=unicast,anonymized,global
\end_layout

\begin_layout Code
IPV4_AS_NUM=23724
\end_layout

\begin_layout Code
IPV4_COUNTRYCODE=CN
\end_layout

\begin_layout Code
IPV4_REGISTRY=APNIC 
\end_layout

\begin_layout Code
...
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code
$ ipv6calc -q -m -i a909:390a:909a:81d9:a909:4291:c02d:5d1d
\end_layout

\begin_layout Code
IPV6=a909:390a:909a:81d9:a909:4291:c02d:5d1d
\end_layout

\begin_layout Code
IPV6_TYPE=unicast,anonymized-iid,anonymized-prefix,global-unicast,productive,iid
,iid-local
\end_layout

\begin_layout Code
IPV6_COUNTRYCODE=CZ
\end_layout

\begin_layout Code
IPV6_AS_NUM=43037
\end_layout

\begin_layout Code
IPV6_REGISTRY=RIPENCC
\end_layout

\begin_layout Code
...
\end_layout

\begin_layout Section
History
\end_layout

\begin_layout Standard
Major extensions/changes are listed here
\end_layout

\begin_layout Subsection
2021
\end_layout

\begin_layout Itemize
add support for compressed IPv4 addresses like 10/8 (>= 3.1.0)
\end_layout

\begin_layout Itemize
add support for octal representation of IPv4 addresses (>= 3.3.0)
\end_layout

\begin_layout Itemize
add Database Dump action (>= 3.3.0)
\end_layout

\begin_layout Subsection
2020
\end_layout

\begin_layout Itemize
drop GeoIP(legacy) support (>= 3.0.0)
\end_layout

\begin_layout Itemize
drop db-ip.com(BerkeleyDB) support (>= 3.0.0)
\end_layout

\begin_layout Subsection
2019
\end_layout

\begin_layout Itemize
add OUI-28 support (>= 2.2.0)
\end_layout

\begin_layout Itemize
add action 
\begin_inset Quotes eld
\end_inset

addr2cc
\begin_inset Quotes erd
\end_inset

 (can be used as replacement for geoiplookup) (>= 2.1.0)
\end_layout

\begin_layout Itemize
enable 
\begin_inset Quotes eld
\end_inset

geonameid
\begin_inset Quotes erd
\end_inset

 also in mod_ipv6calc (>= 2.1.0)
\end_layout

\begin_layout Itemize
add anonymization method 
\begin_inset Quotes eld
\end_inset

keep-type-geonameid
\begin_inset Quotes erd
\end_inset

 (>= 2.1.0)
\end_layout

\begin_layout Itemize
add support for MaxMindDB (GeoIP, db-ip.com) (>= 2.0.0)
\end_layout

\begin_layout Itemize
drop support of IP2Location libraries < 7.0.1 (>= 2.0.0)
\end_layout

\begin_layout Subsection
2017
\end_layout

\begin_layout Itemize
add support for LISP detection
\end_layout

\begin_layout Itemize
add support for non-free versions 
\begin_inset CommandInset href
LatexCommand href
name "DB-IP.com"
target "http://www.db-ip.com/"
literal "false"

\end_inset

 databases
\end_layout

\begin_layout Itemize
finally release 1.0.0 after 16 year of development
\end_layout

\begin_layout Subsection
2016
\end_layout

\begin_layout Itemize
implement action 'test' and extend action 'filter' with support of address
 ranges (>= 0.99.2)
\end_layout

\begin_layout Subsection
2015
\end_layout

\begin_layout Itemize
Introduce mod_ipv6calc for Apache web server (>= 0.99.1)
\end_layout

\begin_layout Itemize
Add support for 
\begin_inset CommandInset href
LatexCommand href
name "DB-IP.com"
target "http://www.db-ip.com/"
literal "false"

\end_inset

 databases (by generated Berkeley DB files) (>= 0.98.0)
\end_layout

\begin_layout Itemize
Add support for 
\begin_inset Quotes eld
\end_inset

External
\begin_inset Quotes erd
\end_inset

 database files (generated Berkeley DB files), superseeding (if newer) built-in
 IPv4/IPv6->Registry and adding IPv4/IPv6->CountryCode support (>= 0.98.0)
\end_layout

\begin_layout Itemize
Extend filter options with support of CountryCode, ASN or Registry (>= 0.99.0)
\end_layout

\begin_layout Itemize
Add support for 
\begin_inset CommandInset href
LatexCommand href
name "IP2Location LITE"
target "http://lite.ip2location.com/"
literal "false"

\end_inset

 databases (>= 0.99.0), add configurable IP2Location database autoselection
 support
\end_layout

\begin_layout Subsection
2014
\end_layout

\begin_layout Itemize
Shared library mode supported (reduces size of binaries)
\end_layout

\begin_layout Subsection
2013
\end_layout

\begin_layout Itemize
Prefix and IID anonymization methods
\end_layout

\begin_layout Itemize
Support of dynamic load of GeoIP and IP2Location libraries
\end_layout

\begin_layout Itemize
Specifying dedicated GeoIP and IP2Location database files is now replaced
 by specifying dedicated database directories to make especially for GeoIP
 use of more database files.
\end_layout

\begin_layout Subsection
2011
\end_layout

\begin_layout Itemize
ipv6calc/ipv6calcweb.cgi: enable included GeoIP support with IPv6 (usable
 with GeoIP >= 1.4.5)
\end_layout

\begin_layout Itemize
ipv6calc: extend for 6rd support (--action 6rd_local_prefix --6rd_prefix
 <PREFIX> --6rd_relay_prefix <RELAY_PREFIX>)
\end_layout

\begin_layout Itemize
ipv6calc: enable stdin support for bulk transformation
\end_layout

\begin_layout Itemize
ipv6calc: add support for NAT64 address type
\end_layout

\begin_layout Itemize
ipv6calc: add option 
\begin_inset Quotes eld
\end_inset

forceprefix <LENGTH>
\begin_inset Quotes erd
\end_inset

 to print prefix of an address without a given prefix length
\end_layout

\begin_layout Itemize
ipv6loganon: extend for pipe usage (e.g.
 in Apache log file directive) and write/append to specified file
\end_layout

\begin_layout Itemize
General: add configure options to disable built-in databases (reduce binary
 size a lot, e.g.
 for embedded devices)
\end_layout

\begin_layout Subsection
2002-2010
\end_layout

\begin_layout Standard
See 
\begin_inset CommandInset href
LatexCommand href
name "ChangeLog@GitHub"
target "https://raw.githubusercontent.com/pbiering/ipv6calc/master/ChangeLog"
literal "false"

\end_inset

 for now
\end_layout

\begin_layout Subsection
2001
\end_layout

\begin_layout Itemize
Start of development
\end_layout

\end_body
\end_document
