<!DOCTYPE article  PUBLIC "-//OASIS//DTD DocBook V4.2//EN"
 [ <!ENTITY % output.print.png "IGNORE">
<!ENTITY % output.print.pdf "IGNORE">
<!ENTITY % output.print.eps "IGNORE">
<!ENTITY % output.print.bmp "IGNORE">
 ]>

<!-- SGML file was created by LyX 2.1.2
  See http://www.lyx.org/ for more information -->
<article lang="en">
<articleinfo>
<title>The ipv6calc Homepage</title>
<author><firstname>Peter</firstname><surname>Bieringer</surname><affiliation><address>pb at bieringer dot de</address></affiliation></author>
<revhistory> 
<revision> <revnumber>5.0</revnumber> <date>2015-02-20</date> <authorinitials>PB</authorinitials></revision>
</revhistory> </articleinfo><sect1>
<title>General</title>
<para>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 /proc/net/if_inet6 and (because it was not difficulty) migrating the Perl program ip6_int into. Now only one utiltity is needed to do a lot.</para>
<para>This utility was also used in the past to extend features on network-functions-ipv6 library, used by initscripts-ipv6.</para>
<para>Note: this tool got also its <ulink url="http://freshmeat.net/projects/ipv6calc/">freshmeat / ipv6calc</ulink> page (not maintained by the author)</para><sect2>
<title>Latest version</title>
<para>Latest version since last update of this page is 0.98.0 (released 2015-02-21)</para></sect2><sect2>
<title>Included programs</title>
<itemizedlist>
<listitem><para>&ldquo;ipv6calc&rdquo;: the main utility</para></listitem><listitem><para>&ldquo;ipv6calcweb&rdquo;: CGI wrapper for ipv6calc's address information output</para></listitem><listitem><para>&ldquo;ipv6logconv&rdquo;: log converter (IPv4/IPv6)</para></listitem><listitem><para>&ldquo;ipv6loganon&rdquo;: log anonymizer (IPv4/IPv6)</para></listitem><listitem><para>&ldquo;ipv6logstats&rdquo;: log statistic generator (IPv4/IPv6)</para></listitem></itemizedlist></sect2><sect2>
<title>Included databases</title>
<para>If not disabled during compiling the tool, following databases are statically included, since version 0.95.0 internally mentioned as &ldquo;BuiltIn&rdquo;:</para><itemizedlist>
<listitem><para>IEEE IAB, OUI, OUI-36 databases (for decoding vendor part of MAC/EUI-48/EUI-64)</para></listitem><listitem><para>IPv4 assignment databases from IANA, ARIN, RIPENCC, APNIC, LACNIC, AFRINIC (for selecting proper registry in ipv6calcweb.cgi and IPv4 anonymization)</para></listitem><listitem><para>IPv6 assignment databases from IANA, ARIN, RIPENCC, APNIC, LACNIC, AFRINIC (for selecting proper registry in ipv6calcweb.cgi and IPv6 anonymization)</para></listitem><listitem><para>ASN assignment databases from IANA, ARIN, RIPENCC, APNIC, LACNIC, AFRINIC (for IP anonymization)</para></listitem></itemizedlist></sect2><sect2>
<title>Possible external databases</title>
<para>If enabled during compiling the tool, following external (but local stored) databases can be used</para><itemizedlist>
<listitem><para>GeoIP IPv4, IPv6 (since 0.90.0, req. GeoIP &gt;= 1.4.5)</para></listitem><listitem><para>IP2Location IPv4, IPv6</para></listitem><listitem><para>DB-IP.com (since 0.98.0), based on local Berkeley DB files generated from downloaded CSV files</para></listitem><listitem><para>&ldquo;External&rdquo; (since 0.98.0), 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.</para></listitem></itemizedlist><para>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/features which requires the databases are disabled.</para></sect2></sect1><sect1>
<title>License</title>
<para>The program is published under the GNU GPL version 2.</para></sect1><sect1>
<title>Copyright</title>
<para>(C) 2001 - 2015 by Dr. Peter Bieringer</para></sect1><sect1>
<title>Author</title>
<para>The author of ipv6calc is</para><itemizedlist>
<listitem><para><ulink url="mailto:pb@bieringer.de">Dr. Peter Bieringer</ulink> with some minor contribution by others</para></listitem></itemizedlist></sect1><sect1>
<title>Where to get sources or binaries</title>
<sect2>
<title>Latest version of sources</title>
<itemizedlist>
<listitem><para>Via CVS at <ulink url="http://www.deepspace6.net/">DeepSpace6</ulink>: <ulink url="http://www.deepspace6.net/sections/cvs.html">DeepSpace6 / CVS instructions</ulink></para></listitem><listitem><para>Via web interface to CVS at <ulink url="http://www.deepspace6.net/">DeepSpace6</ulink>: <ulink url="http://cvs.deepspace6.net/view/ipv6calc/">DeepSpace6 / CVS web interface</ulink></para></listitem></itemizedlist></sect2><sect2>
<title>Releases</title>
<sect3>
<title>as tar.gz</title>
<itemizedlist>
<listitem><para>Via FTP at <ulink url="http://www.deepspace6.net/">DeepSpace6</ulink>: <ulink url="ftp://ftp.deepspace6.net/pub/ds6/sources/ipv6calc/">DeepSpace6 / anonymous FTP</ulink></para></listitem><listitem><para>Via FTP at <ulink url="ftp://ftp.bieringer.de/pub/linux/IPv6/ipv6calc/">ftp://ftp.bieringer.de/pub/linux/IPv6/ipv6calc/</ulink></para></listitem></itemizedlist><para>Since version 0.95.0 packages are signed with new GPG key, also available here: <ulink url="ftp://ftp.bieringer.de/pub/linux/IPv6/ipv6calc/CODE-GPG-KEY-bieringer.de-2013">CODE-GPG-KEY-bieringer.de-2013 @ftp.bieringer.de</ulink> or <ulink url="ftp://ftp.deepspace6.net/pub/ds6/sources/ipv6calc/CODE-GPG-KEY-bieringer.de-2013">CODE-GPG-KEY-bieringer.de-2013 @ftp.deepspace6.net</ulink></para><screen>
<![CDATA[Key fingerprint: AAB3 8CB7 97C7 50C7 78C6 08C6 DDEB 141D F738 0F61
uid: Peter Bieringer (Code Signing Key 2013) <code@bieringer.de>
]]></screen><para>A SPEC file is included, so you can build a RPM from tar.gz using</para><screen>
<![CDATA[$ rpmbuild -ta path/to/ipv6calc-$version.tar.gz
]]></screen><para>In addition, conditional build options are available (see related configure options below):</para><screen>
<![CDATA[--without geoip
--without ip2location
--without dbip
--without external
--without shared
]]></screen></sect3><sect3>
<title>as RPM</title>
<para>Currently only on <ulink url="http://www.rpmfind.net/linux/rpm2html/search.php?query=ipv6calc">rpmfind / ipv6calc</ulink>, but there are plans to publish at least source RPMS on <ulink url="http://www.deepspace6.net/">DeepSpace6</ulink> some day.</para></sect3></sect2><sect2>
<title>Ready to use packages for several operating systems:</title>
<sect3>
<title>Fedora Linux</title>
<para>Fedora 21 is the current developing platform, so use given hints above to create a RPM. Since Fedora 7 this package is included by default.</para>
<para>See also <ulink url="https://admin.fedoraproject.org/pkgdb/package/ipv6calc/">FedoraProject / Package / ipv6calc</ulink></para></sect3><sect3>
<title>Red Hat Enterprise Linux and clones</title>
<para>It's tested by the developer that creation of the RPM is working fine on RHEL 4.</para><itemizedlist>
<listitem><para>RHEL/CentOS 5 has the package included by default (but an rather old version - there are plans to provide newer releases via EPEL, too)</para></listitem><listitem><para>RHEL/CentOS 6/7: available since September 2014 on <ulink url="https://fedoraproject.org/wiki/EPEL">FedoraProject / EPEL</ulink> EPEL</para></listitem></itemizedlist><para>CentOS 5/6/7 are also platforms for regression tests.</para></sect3><sect3>
<title>Gentoo/Funtoo</title>
<para>Package is maintained, nevertheless, Funtoo is used as platform for regression tests.</para></sect3><sect3>
<title>Ubuntu</title>
<para>Package is maintained</para></sect3><sect3>
<title>Debian GNU/Linux</title>
<para>Package is maintained, more information can be found at <ulink url="http://packages.debian.org/ipv6calc">http://packages.debian.org/ipv6calc</ulink></para></sect3><sect3>
<title>openSUSE</title>
<para>Package is maintained, more information can be found at <ulink url="http://download.opensuse.org/repositories/home:/uebelhacker/">http://download.opensuse.org/repositories/home:/uebelhacker/</ulink></para></sect3><sect3>
<title>NetBSD</title>
<para>See here for more: <ulink url="http://www.netbsd.org/packages/net/ipv6calc/">http://www.netbsd.org/packages/net/ipv6calc/</ulink></para></sect3><sect3>
<title>FreeBSD</title>
<para>See here for more: <ulink url="http://www.freebsd.org/cgi/cvsweb.cgi/ports/net/ipv6calc/">http://www.freebsd.org/cgi/cvsweb.cgi/ports/net/ipv6calc/</ulink> (<ulink url="http://www.freebsd.org/cgi/query-pr.cgi?pr=34441">http://www.freebsd.org/cgi/query-pr.cgi?pr=34441</ulink>), <ulink url="http://www.freshports.org/net-mgmt/ipv6calc/">http://www.freshports.org/net-mgmt/ipv6calc/</ulink></para></sect3><sect3>
<title>OpenBSD</title>
<para>See here for more: <ulink url="http://www.openbsd.org/cgi-bin/cvsweb/ports/net/ipv6calc/">http://www.openbsd.org/cgi-bin/cvsweb/ports/net/ipv6calc/</ulink></para></sect3></sect2></sect1><sect1>
<title>Configuring &amp; Compiling</title>
<sect2>
<title>Configuring</title>
<para>Following &ldquo;ipc6calc&rdquo; related configure options are currently supported (note: disabling the internal databases reduces the size of the resulting binaries/shared library a lot):</para><screen>
<![CDATA[--disable-dynamic-load  Disable dynamic load of libraries (default: enabled)

--disable-db-ieee       Disable build-in IEEE database (default: enabled)
--disable-db-ipv4       Disable build-in IPv4 database (default: enabled)
--disable-db-ipv6       Disable build-in IPv6 database (default: enabled)

--enable-dbip           Enable db-ip.com support (default: disabled)
--enable-external       Enable external db support (default: disabled) 
--enable-ip2location    Enable IP2Location support (default: disabled)
--enable-geoip          Enable GeoIP support (default: disabled) 

--with-ip2location-headers=DIR      IP2Location include files location
--with-ip2location-headers-fallback IP2Location include files from internal fallback location
                                     (only usable with dynamic load option) 
--with-ip2location-lib=FILE         IP2Location library location
--with-ip2location-static           Explicitly link IP2Location statically (default=no)
--with-ip2location-dynamic          Enable use of dynamic loading of IP2Location library (default=no)
--with-ip2location-db=DIR           Use specified IP2Location database directory, default: /usr/share/IP2Location
--with-ip2location-dyn-lib=NAME     Use specified IP2Location dynamic library, default: libIP2Location.so

--with-geoip-headers=DIR        GeoIP include files location
--with-geoip-headers-fallback   GeoIP include files from internal fallback location
                                 (only usable with dynamic load option) 
--with-geoip-lib=DIR            GeoIP library location
--with-geoip-static             Explicitly link GeoIP statically (default=no)
--with-geoip-dynamic            Enable use of dynamic loading of GeoIP library (default=no)
--with-geoip-db=DIR             Use specified GeoIP database directory, default: /usr/share/GeoIP
--with-geoip-dyn-lib=NAME       Use specified GeoIP dynamic library, default: libGeoIP.so.1
--with-geoip-ipv6-compat        Use IPv6 interface of GeoIP in compatibility mode (supporting 1.4.5) 

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

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

--enable-shared                 Enable shared library build (default: disabled)

--enable-bundled-getopt         Enable bundled getopt library (default: autoselected)
--enable-bundled-md5            Enable bundled MD5 library (default: autoselected)
]]></screen></sect2><sect2>
<title>Compiling</title>
<para>As usual, use</para><screen>
<![CDATA[$ make
]]></screen><para>and run tests afterwards using</para><screen>
<![CDATA[$ make test
]]></screen><para>or at least (e.g. if external databases are not available)</para><screen>
<![CDATA[$ make test-minimal
]]></screen></sect2><sect2>
<title>Configuring &amp; Compiling with Presets</title>
<para>A shell script is included which can configure and compile with standard presets (also used during regression tests):</para><screen>
<![CDATA[$ ./autogen.sh -h
Supported options:
   -?|-h|--help        : this help
   -n|--no-make        : stop before running 'make'
   -a|--all            : enable GeoIP and IP2Location support
   -g|--geoip          : enable GeoIP support
   --geoip-dyn|-G      : switch to dynamic library loading of GeoIP
   -i|--ip2location    : enable IP2Location support
   --ip2location-dyn|-I: switch to dynamic library loading of IP2Location
   -d|--dbip           : enable db-ip.com support
   -e|--external       : enable external database support 
   --disable-db-ieee   : disable built-in IEEE database
   --disable-db-ipv4   : disable built-in IPv4 database
   --disable-db-ipv6   : disable built-in IPv6 database
   --geoip-ipv6-compat : enable GeoIP IPv6 compatibility mode
   -S                  : enable shared library mode
   -no-static-build    : skip static build
   --no-test           : skip 'make test' 
]]></screen></sect2></sect1><sect1>
<title>Mailling Lists</title>
<sect2>
<title>ipv6calc-announce</title>
<variablelist>
<varlistentry><term>Reason:</term><listitem><para>sending announcements of new versions</para></listitem></varlistentry><varlistentry><term>Traffic:</term><listitem><para>very low</para></listitem></varlistentry><varlistentry><term>Postings:</term><listitem><para>only moderators are allowed to post</para></listitem></varlistentry><varlistentry><term>Information:</term><listitem><para><ulink url="http://lists.deepspace6.net/listinfo/ipv6calc-announce">DeepSpace6 / maillist ipv6calc-announce</ulink></para></listitem></varlistentry></variablelist></sect2><sect2>
<title>ipv6calc</title>
<variablelist>
<varlistentry><term>Reason:</term><listitem><para>discussions</para></listitem></varlistentry><varlistentry><term>Traffic:</term><listitem><para>low</para></listitem></varlistentry><varlistentry><term>Postings:</term><listitem><para>subscribers</para></listitem></varlistentry><varlistentry><term>Information:</term><listitem><para><ulink url="http://lists.deepspace6.net/listinfo/ipv6calc">DeepSpace6 / maillist ipv6calc</ulink></para></listitem></varlistentry></variablelist></sect2></sect1><sect1>
<title>Bug Reports</title>
<para>You can send bug reports to the author himself or subscribe to maillist &ldquo;ipv6calc&rdquo; and send it to the list.</para></sect1><sect1>
<title>Features of ipv6calc</title>
<sect2>
<title>Description</title>
<para>The main program named &ldquo;ipv6calc&rdquo; 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.</para></sect2><sect2>
<title>List of built-in features</title>
<para>Option &ldquo;-v&rdquo; shows built-in features, depending on configuration before compiling:</para><screen>
<![CDATA[$ ipv6calc -v
ipv6calc: version 0.98.0 GeoIP GeoIPv6 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 ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC 
]]></screen><para>Option &ldquo;-v -v&rdquo; (since 0.91.0) shows built-in features and capabilities in detail, depending on configuration before compiling:</para><screen>
<![CDATA[$ ipv6calc -vv
ipv6calc: version 0.98.0 GeoIP GeoIPv6 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 ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC

Capabilities: GeoIP(dyn-load) IP2Location(dyn-load) DBIP External DB_AS_REG(BuiltIn) DB_CC_REG(BuiltIn) DB_IPV4_REG(BuiltIn) DB_IPV6_REG(BuiltIn) DB_IEEE(BuiltIn)

GeoIP support enabled, compiled with include file version: 1.4.8
GeoIP support by dynamic library load, compiled with IPv4 & IPv6 support
GeoIP configured dynamic library file and detected version: libGeoIP.so.1 1.5.1
GeoIP available databases: Country4=1 Country6=1 ASN4=1 ASN6=1 City4=1 City6=1

IP2Location support enabled, compiled with include file version: 6.0.2
IP2Location support enabled, compiled with API version: 4.0.0
IP2Location support by dynamic library load
IP2Location configured dynamic library file and detected version: libIP2Location.so LIBARY-NOT-LOADED
IP2Location available databases: Country4=1 Country6=1 ASN4=0 ASN6=0 City4=0 City6=0

BuiltIn databases available: ASN_REG=1 IPV4_REG=1 IPV6_REG=1 IEEE=1 CC_REG=1

DB features: 0x33037fff

GeoIP: features available/implemented: 0x00033ff0/0x00033ff0 (100%)
GeoIP: info of available databases in directory: /usr/share/GeoIP (max: 31)
GeoIP: GeoIP Country Edition            :[ 1] /usr/share/GeoIP/GeoIP.dat               (GEO-106FREE 20140805 Build 1 Copyright (c) 2014 MaxMind Inc All Rights Reserved)
GeoIP: GeoIP City Edition, Rev 1        :[ 2] /usr/share/GeoIP/GeoIPCity.dat           (GEO-533LITE 20150203 Build 1 Copyright (c) 2015 MaxMind Inc All Rights Reserved)
GeoIP: GeoIP ASNum Edition              :[ 9] /usr/share/GeoIP/GeoIPASNum.dat          (GEO-117 20140217 Build 1 Copyright (c) 2014 MaxMind Inc All Rights Reserved)
GeoIP: GeoIP Country V6 Edition         :[12] /usr/share/GeoIP/GeoIPv6.dat             (GEO-106FREE 20150203 Build 1 Copyright (c) 2015 MaxMind Inc All Rights Reserved)
GeoIP: GeoIP ASNum V6 Edition           :[21] /usr/share/GeoIP/GeoIPASNumv6.dat        (GEO-117 20150210 Build 1 Copyright (c) 2015 MaxMind Inc All Rights Reserved)
GeoIP: GeoIP City Edition V6, Rev 1     :[30] /usr/share/GeoIP/GeoIPCityv6.dat         (GEO-536LITE 20150204 Build 1 Copyright (c) 2015 MaxMind Inc All Rights Reserved)

IP2Location: features available/implemented: 0x00000000/0x00000000 (NONE)
IP2Location: info of available databases in directory: /usr/share/IP2Location
IP2Location: IPv4 Country               : /usr/share/IP2Location/IP-COUNTRY.BIN    (LIBRARY-NOT-LOADED)
IP2Location: IPv6 Country               : /usr/share/IP2Location/IPV6-COUNTRY.BIN  (LIBRARY-NOT-LOADED)
IP2Location: NO available databases found in directory: /usr/share/IP2Location

db-ip.com: features available/implemented: 0x03003cc0/0x03003cc0 (100%)
DBIP: info of available databases in directory: /usr/share/DBIP
DBIP: IPv4 CountryCode           : /usr/share/DBIP/ipv6calc-dbip-ipv4-country.db (DBIP-1/20150101, created: 20150124-152244 UTC)
DBIP: IPv6 CountryCode           : /usr/share/DBIP/ipv6calc-dbip-ipv6-country.db (DBIP-2/20150101, created: 20150124-152244 UTC)
DBIP: IPv4 City/Region/CountryCode: /usr/share/DBIP/ipv6calc-dbip-ipv4-city.db (DBIP-3/20150101, created: 20150124-152300 UTC)
DBIP: IPv6 City/Region/CountryCode: /usr/share/DBIP/ipv6calc-dbip-ipv6-city.db (DBIP-4/20150101, created: 20150124-152300 UTC)

External: features available/implemented: 0x300000cc/0x300000cc (100%)
External: info of available databases in directory: /usr/share/ipv6calc/db
External: IPv4 Registry              : /usr/share/ipv6calc/db/ipv6calc-external-ipv4-registry.db (EXTDB-1/AFRINIC/20150215 APNIC/20150213 ARIN/20150215 IANA/20141014 LACNIC/20150213 RIPENCC/20150214, created: 20150215-170218 UTC)
External: IPv6 Registry              : /usr/share/ipv6calc/db/ipv6calc-external-ipv6-registry.db (EXTDB-2/AFRINIC/20150215 APNIC/20150213 ARIN/20150215 IANA/20140520 LACNIC/20150213 RIPENCC/20150214, created: 20150215-170924 UTC)
External: IPv4 CountryCode           : /usr/share/ipv6calc/db/ipv6calc-external-ipv4-countrycode.db (EXTDB-3/AFRINIC/20150215 APNIC/20150213 ARIN/20150215 IANA/20141014 LACNIC/20150213 RIPENCC/20150214, created: 20150215-170219 UTC)
External: IPv6 CountryCode           : /usr/share/ipv6calc/db/ipv6calc-external-ipv6-countrycode.db (EXTDB-4/AFRINIC/20150215 APNIC/20150213 ARIN/20150215 IANA/20140520 LACNIC/20150213 RIPENCC/20150214, created: 20150215-170924 UTC)

BuiltIn: features available/implemented: 0x0000400f/0x0000400f (100%)
BuiltIn: info of available databases
BuiltIn: ASN  : IANA/20140905
BuiltIn: CC   : AFRINIC/20150215 APNIC/20150215 ARIN/20150215 LACNIC/20150213 RIPENCC/20150214
BuiltIn: IPv4 : AFRINIC/20150215 APNIC/20150215 ARIN/20150215 IANA/20141014 LACNIC/20150213 RIPENCC/20150214 (created: 20150215-185302 UTC)
BuiltIn: IPv6 : AFRINIC/20150215 APNIC/20150215 ARIN/20150215 IANA/20140520 LACNIC/20150213 RIPENCC/20150214 (created: 20150215-190001 UTC)
BuiltIn: IEEE : IAB/20150213 OUI/20150213 OUI36/20150213

Database selection or priorization ('->': subsequential calls)
DB_AS_REG (AS-Number to Registry database): BuiltIn
DB_CC_REG (CountryCode to Registry database): BuiltIn
DB_IPV4_REG (IPv4 to Registry database): BuiltIn
DB_IPV6_REG (IPv6 to Registry database): BuiltIn
DB_IPV4_AS (IPv4 to AS database): GeoIP
DB_IPV6_AS (IPv6 to AS database): GeoIP
DB_IPV4_CC (IPv4 to CountryCode database): GeoIP->db-ip.com->External
DB_IPV6_CC (IPv6 to CountryCode database): GeoIP->db-ip.com->External
DB_IPV4_COUNTRY (IPv4 to Country database): GeoIP
DB_IPV6_COUNTRY (IPv6 to Country database): GeoIP
DB_IPV4_CITY (IPv4 to City database): GeoIP->db-ip.com
DB_IPV6_CITY (IPv6 to City database): GeoIP->db-ip.com
DB_IPV4_REGION (IPv4 to Region database): GeoIP->db-ip.com
DB_IPV6_REGION (IPv6 to Region database): GeoIP->db-ip.com
DB_IEEE (IEEE/OUI/OUI36 Vendor database): BuiltIn
]]></screen><para>Option &ldquo;-v -h&rdquo; (since 0.97.4) shows explanation of feature tokens</para><screen>
<![CDATA[$ ./ipv6calc/ipv6calc -v -h
ipv6calc: version 0.98.0 GeoIP GeoIPv6 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 ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC
Explanation of available(+)/possible(-) feature tokens
GeoIP                 + GeoIPv4 database (provided by GeoIP)
GeoIPv6               + GeoIPv6 database (provided by GeoIP)
IP2Location           - IP2Location IPv4 database
IP2Location6          - IP2Location IPv6 database
DBIPv4                + db-ip.com IPv4 database (provided by db-ip.com)
DBIPv6                + db-ip.com IPv6 database (provided by db-ip.com)
DB_AS_REG             + AS-Number to Registry database (provided by BuiltIn)
DB_IPV4_REG           + IPv4 to Registry database (provided by External,BuiltIn)
DB_IPV6_REG           + IPv6 to Registry database (provided by External,BuiltIn)
DB_IPV4_AS            + IPv4 to AS database (provided by GeoIP)
DB_IPV6_AS            + IPv6 to AS database (provided by GeoIP)
DB_IPV4_CC            + IPv4 to CountryCode database (provided by GeoIP,db-ip.com,External)
DB_IPV6_CC            + IPv6 to CountryCode database (provided by GeoIP,db-ip.com,External)
DB_IPV4_COUNTRY       + IPv4 to Country database (provided by GeoIP)
DB_IPV6_COUNTRY       + IPv6 to Country database (provided by GeoIP)
DB_IPV4_CITY          + IPv4 to City database (provided by GeoIP,db-ip.com)
DB_IPV6_CITY          + IPv6 to City database (provided by GeoIP,db-ip.com)
DB_IPV4_REGION        + IPv4 to Region database (provided by GeoIP,db-ip.com)
DB_IPV6_REGION        + IPv6 to Region database (provided by GeoIP,db-ip.com)
DB_CC_REG             + CountryCode to Registry database (provided by BuiltIn)
DB_IEEE               + IEEE/OUI/OUI36 Vendor database (provided by BuiltIn)
ANON_ZEROISE          + Anonymization method 'zeroize'
ANON_ANONYMIZE        + Anonymization method 'anonymize'
ANON_KEEP-TYPE-ASN-CC + Anonymization method 'keep-type-asn-cc'
]]></screen><para>Note: since version 0.95.0 the internal layer for database usage was abstracted and each database &ldquo;plugin&rdquo; 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 &ldquo;precompiled&rdquo; newer databases replacing the need of recompilation for updated built-in databases.</para></sect2><sect2>
<title>Examples</title>
<sect3>
<title>Conversion</title>
<para>A simple example is the conversion of an IPv6 address to a DNS PTR query string:</para><screen>
<![CDATA[$ ipv6calc --out revnibbles.arpa 2001:db8::1
No input type specified, try autodetection...found type: ipv6addr
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.
]]></screen><para>Like you see, input format was autodetected. And the given example can be extended because ipv6calc also understands netmask / prefix length values:</para><screen>
<![CDATA[$ ipv6calc -q --out revnibbles.arpa 2001:db8::1/64
0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.
]]></screen><para>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:</para><screen>
<![CDATA[$ dig PTR `./ipv6calc -q --out revnibbles.arpa 2001:db8::1/64`
]]></screen><para>But ipv6calc can do many more for you! Next example shows you the extraction of the IPv4 address contained in a 6to4 IPv6 address:</para><screen>
<![CDATA[$ ipv6calc -q --action conv6to4 --in ipv6 2002:c0a8:fb61::1 --out ipv4
192.168.251.97
]]></screen><para>This also works vice-versa:</para><screen>
<![CDATA[$ ipv6calc -q --action conv6to4 --in ipv4 192.168.251.97 --out ipv6
2002:c0a8:fb61::
]]></screen><para>There are many more features already implemented, if you miss one, send a note.</para></sect3><sect3>
<title>Information</title>
<para>Information about a simple IPv6 address:</para><screen>
<![CDATA[$ ipv6calc -q -i 3ffe:ffff::210:a4ff:fe01:2345
Address type: unicast, 6bone, global-unicast, productive
Address type has SLA: 0000
Registry for address: reserved
Interface identifier: 0210:a4ff:fe01:2345
EUI-48/MAC address: 00:10:a4:01:23:45
MAC is a global unique one
MAC is an unicast one
OUI is: XIRCOM
]]></screen><para>Information about a Teredo IPv6 address:</para><screen>
<![CDATA[$ ipv6calc -q -i 3ffe:831f:ce49:7601:8000:efff:af4a:86BF
Address type: unicast, 6bone, global-unicast, productive, teredo
IPv4 address: 80.181.121.64
IPv4 registry[80.181.121.64]: RIPENCC
IPv4 address: 206.73.118.1
IPv4 registry[206.73.118.1]: ARIN
Address type is Teredo and included IPv4 server address is: 80.181.121.64 and client port: 4096
IPv4 registry for Teredo server address: ARIN
Registry for address: reserved
]]></screen><para>There exists also a machine readable output (e.g. used by 'ipv6calcweb.cgi') - in addition, <ulink url="http://www.ip2location.com/">IP2Location</ulink> and/or <ulink url="http://www.maxmind.com/">GeoIP</ulink> information can be displayed, if databases are located on the system and supported.</para><screen>
<![CDATA[$ ipv6calc -q -i -m 2a01:238:423d:8800:85b3:9e6b:3019:8909  
IPV6=2a01:0238:423d:8800:85b3:9e6b:3019:8909
IPV6_ANON=a909:16fa:9091:a448:a909:4941:0000:0007
IPV6_TYPE=unicast,global-unicast,productive,iid-random,iid,iid-local
IPV6_COUNTRYCODE=DE
IPV6_AS_NUM=6724
IPV6_AS_TEXT=AS6724 STRATO STRATO AG
IPV6_REGISTRY=RIPENCC
SLA=8800
IID=85b3:9e6b:3019:8909
EUI64_SCOPE=local-random
IP2LOCATION_COUNTRY_SHORT=DE
IP2LOCATION_COUNTRY_LONG=GERMANY
GEOIP_AS_TEXT=AS6724 STRATO STRATO AG
GEOIP_COUNTRY_SHORT=DE
GEOIP_COUNTRY_LONG=Germany
GEOIP_LATITUDE=51.000000
GEOIP_LONGITUDE=9.000000
IP2LOCATION_DATABASE_INFO=IP2L-DB1 20130307 Copyright (c) 2013 IP2Location All Rights Reserved
GEOIP_DATABASE_INFO=GEO-106FREE 20140506 Build 1 Copyright (c) 2014 MaxMind Inc All Rights Reserved / GEO-117 20130306 Build 1 Copyright (c) 2013 MaxMind Inc All Rights Reserved / GEO-536LITE 20140506 Build 1 Copyright (c) 2014 MaxMind Inc All Rights Reserved
IPV6CALC_NAME=ipv6calc
IPV6CALC_VERSION=0.97.0
IPV6CALC_COPYRIGHT="(P) & (C) 2001-2014 by Peter Bieringer <pb (at) bieringer.de>"
IPV6CALC_OUTPUT_VERSION=7
IPV6CALC_SETTINGS_ANON="set=keep-type-asn-cc,mask-ipv6=56,mask-ipv4=24,mask-eui64=40,mask-mac=24,method=keep-type-asn-cc"
IPV6CALC_FEATURES="IP2Location(dyn-load) GeoIP(dyn-load) GeoIPv6 ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC DB_AS DB_IPV4 DB_IPV6 DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC DB_CC_REG DB_IEEE"
]]></screen></sect3><sect3>
<title>Filter mode</title>
<para>&ldquo;ipv6calc&rdquo; 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).</para>
<para>Filter tokens are the ones which are listed on &ldquo;TYPE&rdquo; lines shown in &ldquo;-m -i&rdquo; information mode.</para>
<para>Example for searching for Teredo addresses:</para><screen>
<![CDATA[$ cat ip.bieringer.de-log.201310 | awk '{ print $1 }' | sort | uniq | ipv6calc -A filter -E teredo
2001:0:9d38:90d7:34f7:1a26:8599:e079
]]></screen><para>Note: since version 0.95.0 '-A filter' is optional if option '-E &lt;filter expression&gt;' is given (autoselected action).</para></sect3></sect2><sect2>
<title>Option style</title>
<para>Since version 0.40 new-style option handling was introduced, using</para><itemizedlist>
<listitem><para>--in &lt;inputtype&gt;</para></listitem><listitem><para>--out &lt;outputtype&gt;</para></listitem><listitem><para>--action &lt;actiontype&gt;</para></listitem></itemizedlist><para>and many more conversions were added. A built-in check matrix should prevent misconversions.</para>
<para>Up to version 0.39, only old-style options (aka &ldquo;shortcut&rdquo; options). They are one-in-all options, specifying input/action/output in one token. Internally this options will be converted into new-style options.</para></sect2><sect2>
<title>Online help</title>
<para>Online help always shows the currently implemented features.</para><sect3>
<title>Main online help:</title>
<para>IP2Location and GeoIP options only appear if compiled with such support.</para><screen>
<![CDATA[$ ipv6calc -h
ipv6calc: version 0.98.0 GeoIP GeoIPv6 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 ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC
(P) & (C) 2001-2015 by Peter Bieringer <pb (at) bieringer.de>
This program formats and calculates IPv6/IPv4/MAC addresses and can do many more tricky things
  [-d|--debug <debug value>] : debug value (bitwise like)
                                can also be set by IPV6CALC_DEBUG environment value
  [-v|--version [-v [-v]]]   : version information (2 optional detail levels)
  [-v|--version -h]          : explanation of feature tokens
  [-V|--verbose]             : be more verbose
  [-h|--help|-?]             : this online help
  [--disable-ip2location           ] : IP2Location support disabled
  [--db-ip2location-disable        ] : IP2Location support disabled
  [--db-ip2location-dir <directory>] : IP2Location database directory (default: /usr/share/IP2Location)
  [--db-ip2location-lib <file>     ] : IP2Location library file (default: libIP2Location.so)
  [--disable-geoip                 ] : GeoIP support disabled
  [--db-geoip-disable              ] : GeoIP support disabled
  [--db-geoip-dir       <directory>] : GeoIP database directory (default: /usr/share/GeoIP)
  [--db-geoip-lib       <file>     ] : GeoIP library file (default: libGeoIP.so.1)
  [--disable-dbip                  ] : db-ip.com support disabled
  [--db-dbip-disable               ] : db-ip.com support disabled
  [--db-dbip-dir        <directory>] : db-ip.com database directory (default: /usr/share/DBIP)
  [--disable-external              ] : External support disabled
  [--db-external-disable           ] : External support disabled
  [--db-external-dir    <directory>] : External database directory (default: /usr/share/ipv6calc/db)
  [--disable-builtin               ] : BuiltIn support disabled
  [--db-builtin-disable            ] : BuiltIn support disabled
  [-q|--quiet]               : be more quiet (auto-enabled in pipe mode)
  [-f|--flush]               : flush each line in pipe mode

 Usage with new style options:
  [--in|-I <input type>]   : specify input  type
                             (default: autodetect)
  [--out|-O <output type>] : specify output type
                             (sometimes: autodetect)
  [--action|-A <action>]   : specify action
                             (default: format conversion, sometimes: autodetect)
  [<format option> ...] : specify format options
  <input data> [...]    : input data
  Available input  types:  [-m] -I|--in     -?|-h|--help
  Available output types:  [-m] -O|--out    -?|-h|--help
  Available action types:  [-m] -A|--action -?|-h|--help

Other usage:
  --showinfo|-i [--machine_readable|-m] : show information about input data
  --showinfo|-i --show_types            : show available types on '-m'

Usage with shortcut options: <shortcut option> [<format option> ...] <input data>
  for more information and available format options use: <shortcut option> -?|-h|--help
  -r|--addr2ip6_int (-O revnibbles.int)
  -r|--addr_to_ip6int (-O revnibbles.int)
  -a|--addr2ip6_arpa (-O revnibbles.arpa)
  -a|--addr_to_ip6arpa (-O revnibbles.arpa)
  -b|--addr_to_bitstring (-O bitstring)
     --addr2compaddr (--printcompressed)
     --addr_to_compressed (--printcompressed)
     --addr2uncompaddr (--printuncompressed)
     --addr_to_uncompressed (--printuncompressed)
     --addr_to_base85 (-I ipv6addr -O base85)
     --base85_to_addr (-I base85 -O ipv6addr)
     --mac_to_eui64 (-I mac -O eui64)
     --addr2fulluncompaddr (--printfulluncompressed)
     --addr_to_fulluncompressed (--printfulluncompressed)
     --addr2if_inet6 (-I ipv6addr -O ifinet6)
     --addr_to_ifinet6 (-I ipv6addr -O ifinet6)
     --if_inet62addr (-I ifinet6 -O ipv6addr --printcompressed)
     --ifinet6_to_compressed (-I ifinet6 -O ipv6addr --printcompressed)
     --eui64_to_privacy (-I iid_token -O iid_token -A genprivacyiid)
     --ipv4_to_6to4addr (-I ipv4 -O ipv6addr -A conv6to4)
]]></screen></sect3><sect3>
<title>Input-type options</title>
<screen>
<![CDATA[$ ipv6calc --in -?
ipv6calc: version 0.97.0 IP2Location GeoIP GeoIPv6 DB_AS DB_IPV4 DB_IPV6 DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC DB_CC_REG DB_IEEE ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC
(P) & (C) 2001-2014 by Peter Bieringer <pb (at) bieringer.de>

 Available input types:
  auto            : automatic detection
  revnibbles.int  : dot separated nibbles reverse, ending with ip6.int.
  revnibbles.arpa : dot separated nibbles reverse, ending with ip6.arpa.
  bitstring       : bitstring labes, ending with ip6.arpa.
  ipv6addr        : IPv6 address
  ipv6literal     : IPv6 address in literal
  ipv4addr        : IPv4 address
  ipv4hex         : IPv4 in hexdecimal format
  ipv4revhex      : IPv4 in byte-reversed hexdecimal format
  mac             : MAC address (48 bits)
  eui64           : EUI-64 identifier (64 bits)
  base85          : Base-85 string
  ifinet6         : Like line in /proc/net/if_inet6
  iid+token       : Interface identifier and token
  ipv6logconv     : ipv6logconv (currently not supported)
  prefix+mac      : IPv6 prefix and a MAC address
  asn             : Autonomous System Number
]]></screen></sect3><sect3>
<title>Output-type options:</title>
<screen>
<![CDATA[$ ipv6calc --out -?
ipv6calc: version 0.97.0 IP2Location GeoIP GeoIPv6 DB_AS DB_IPV4 DB_IPV6 DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC DB_CC_REG DB_IEEE ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC
(P) & (C) 2001-2014 by Peter Bieringer <pb (at) bieringer.de>

 Available output types:
  revnibbles.int  : dot separated nibbles reverse, ending with ip6.int.
  revnibbles.arpa : dot separated nibbles reverse, ending with ip6.arpa.
  bitstring       : bitstring labes, ending with ip6.arpa.
  ipv6addr        : IPv6 address
  ipv4addr        : IPv4 address
  mac             : MAC address (48 bits)
  eui64           : EUI-64 identifier (64 bits)
  base85          : Base-85 string
  ifinet6         : Like line in /proc/net/if_inet6
  iid             : Interface identifier
  iid+token       : Interface identifier and token
  addrtype        : Address type
  ouitype         : OUI (IEEE) type
  ipv6addrtype    : IPv6 address type
  any             : any type (currently not supported)
  revipv4         : reverse IPv4, ending with in-addr.arpa
  ipv4hex         : IPv4 in hexdecimal format
  octal           : IP address in escaped octal format
  hex             : IP address in hexadecimal format
  ipv6literal     : IPv6 address in literal

 For examples and available format options use:
    -O|--out <type> --examples
]]></screen></sect3><sect3>
<title>Action-type options: </title>
<screen>
<![CDATA[$ ipv6calc --action -?
ipv6calc: version 0.97.0 IP2Location GeoIP GeoIPv6 DB_AS DB_IPV4 DB_IPV6 DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC DB_CC_REG DB_IEEE ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC
(P) & (C) 2001-2014 by Peter Bieringer <pb (at) bieringer.de>

 Available action types:
  auto             : Automatic selection of action (default)
  geneui64         : Converts a MAC address to an EUI-64 address
  conv6to4         : Converts IPv4 address <-> 6to4 IPv6 address (prefix)
  genprivacyiid    : Generates a privacy interface ID out of a given one (arg1) and a token (arg2)
  prefixmac2ipv6   : Generates an IPv6 address out of a prefix and a MAC address
  anonymize        : Anonymize IPv4/IPv6 address without loosing much information
  6rd_local_prefix : Calculate the 6rd prefix from given IPv6 prefix & relay prefix and IPv4
                      Required options:
                       --6rd_prefix ...
                       --6rd_relay_prefix ...
  filter           : Filter addresses related to filter options
]]></screen><para>Special action &ldquo;filter&rdquo;:</para><screen>
<![CDATA[
$ ipv6calc --action filter -h
ipv6calc: version 0.97.0 IP2Location GeoIP GeoIPv6 DB_AS DB_IPV4 DB_IPV6 DB_IPV4_AS DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC DB_CC_REG DB_IEEE ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC

 Filter given addresses from stdout by filter expression, e.g.
  echo '2001:db8::1' | ipv6calc [-A filter] -E iid-local
  echo '2001:db8::1' | ipv6calc [-A filter] -E iid-local,global-unicast
  echo '2001:db8::1' | ipv6calc [-A filter] -E ^iid-randomy

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

  IPv6 address filter tokens:
   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

  IPv4 address filter tokens:
   ipv4  any unicast multicast anycast broadcast loopback unspecified unknown reserved zeroconf site-local anonymized global 6to4relay

  EUI-48/MAC address filter tokens:
    IMPLEMENTATION MISSING

  EUI-64 address filter tokens:
    IMPLEMENTATION MISSING
]]></screen></sect3></sect2></sect1><sect1>
<title>Webserver log conversion helper program "ipv6logconv"</title>
<para>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").</para><sect2>
<title>Supported options</title>
<screen>
<![CDATA[$ ipv6logconv -h
ipv6logconv: version 0.97.0 CONV_REG CONV_IEEE
(P) & (C) 2002-2014 by Peter Bieringer <pb (at) bieringer.de>
 General:
  [-d|--debug <debug value>] : debug value (bitwise like)
  [-q|--quiet] : be more quiet
  [-n|--nocache] : disable caching
  [-c|--cachelimit <value>] : set cache limit
                               default: 20
                               maximum: 200
 Output:
  [--out <output type>] : specify output type
   addrtype       : Address type
   ouitype        : OUI (IEEE) type
   ipv6addrtype   : IPv6 address type
   any            : any type
 Takes data from stdin, proceed it to stdout
]]></screen></sect2><sect2>
<title>Examples</title>
<para>A demonstration about which kind of statistics are possible to produce is shown at <ulink url="http://www.ipv6.bieringer.de/">http://www.ipv6.bieringer.de/</ulink> (IPv6 only).</para></sect2><sect2>
<title>Usage</title>
<para>Example:</para><screen>
<![CDATA[$ echo "2002:50b5:7940:0000:0000:0000:50b5:7940 - -" | ipv6logconv -q --out any
RIPENCC.6to4.global-unicast.ipv6-addr.addrtype.ipv6calc
]]></screen><para>See more examples inside the package.</para></sect2></sect1><sect1>
<title>Webserver log anonymization helper program "ipv6loganon"</title>
<para>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 distribution should use 'ipv6loganon' to anonymize their log files.</para>
<para>Since version 0.94.0 internally also IID anonymization is possible without loosing any information for &ldquo;ipv6logstats&rdquo;.</para>
<para>Since version 0.95.0 internally also prefix anonymization is possible without loosing any information for &ldquo;ipv6logstats&rdquo;.</para><sect2>
<title>Anonymization details</title>
<sect3>
<title>Method &ldquo;zeroize&rdquo;</title>
<para>The anonymizer would keep as much information as possible for IPv6 address types.</para>
<para>Client-side IID would be anonymized by</para><itemizedlist>
<listitem><para>EUI-48 based: serial number would be zero'ed, keeping OID</para></listitem><listitem><para>EUI-64 based: serial number would be zero'ed, keeping OID</para></listitem><listitem><para>ISATAP: client IPv4 address would be anonymized by given IPv4 mask</para></listitem><listitem><para>TEREDO: client IPv4 address would be anonymized by given IPv4 mask, client port would be zero'ed</para></listitem><listitem><para>6to4(Microsoft): client IPv4 address would be anonymized by given IPv4 mask</para></listitem><listitem><para>local: whole IID would be zero'ed</para></listitem></itemizedlist><para>Client-side SLA would be anonymized by </para><itemizedlist>
<listitem><para>SLA would be zero'ed</para></listitem></itemizedlist><para>Prefix would be anonymized by</para><itemizedlist>
<listitem><para>6to4: client IPv4 address would be anonymized by given IPv4 mask</para></listitem></itemizedlist><para>Compat/Mapped IPv4 addresses would be anonymized by</para><itemizedlist>
<listitem><para>IPv4 address would be anonymized by given IPv4 mask</para></listitem></itemizedlist></sect3><sect3>
<title>Method &ldquo;anonmize&rdquo;</title>
<para>The anonymizer would keep as much information as possible for the IID of an IPv6 address.</para>
<para>Description from libipv6addr.h:</para><screen>
<![CDATA[ * IID anonymization is done by replacing with related information (64-bit)
 * xxxx:xxxx:xxxx:xxxC  (C = 4-bit checksum)
 *
 * a9p9 4941 0000 000C  -> RFC 4941 anonymized privacy extension Interface ID
 *
 * a9p9 4291 4xxx xxxC  -> RFC 4291 anonymized EUI-48 Interface ID, xxx xxx = converted OUI
 * a9p9 4291 5xxx xxxC  -> RFC 4291 anonymized EUI-48 Interface ID, xxx xxx = converted mapped IAB/OUI-36
 * a9p9 4291 6xxx xxxC  -> RFC 4291 anonymized EUI-64 Interface ID, xxx xxx = converted OUI
 * a9p9 4291 7xxx xxxC  -> RFC 4291 anonymized EUI-64 Interface ID, xxx xxx = converted mapped IAB/OUI-36
 * a9p9 4291 8xxx xxxC  -> RFC 4291 embedded anonymized IPv4 address, xxx xxx = first 24 bit of included (anonymized) IPv4 address
 * a9p9 4291 c02d 5d1C  -> RFC 4291 Chapter 2.5.1 anonymized static Interface ID
 *
 * a9p9 5214 4xxx xxxC  -> RFC 5214 anonymized ISATAP Interface ID, xxx xxx = first 24 bit of included (anonymized) IPv4 address (local scope)
 * a9p9 5214 5xxx xxxC  -> RFC 5214 anonymized ISATAP Interface ID, xxx xxx = first 24 bit of included (anonymized) IPv4 address (global scope)
 * a9p9 5214 cxx0 000C  -> RFC 5214 anonymized ISATAP Interface ID, xx      = first  8 bit of included vendor ID (local scope)
 * a9p9 5214 dxx0 000C  -> RFC 5214 anonymized ISATAP Interface ID, xx      = first  8 bit of included vendor ID (global scope)
 * a9p9 5214 exxx xxxC  -> RFC 5214 anonymized ISATAP Interface ID, xxx xxx = first 24 bit of included extension ID (local scope)
 * a9p9 5214 fxxx xxxC  -> RFC 5214 anonymized ISATAP Interface ID, xxx xxx = first 24 bit of included extension ID (global scope)
 *
 * a9p9 4843 0000 000C  -> RFC 4843 anonymized ORCHID hash
]]></screen><para>Depending on given mask, the part of the prefix will be replaced:</para><screen>
<![CDATA[ * SLA/NLA prefix part anonymization is done by replacing with pattern a909a909
 *   p = number of nibbles anonymized
]]></screen></sect3><sect3>
<title>Method &ldquo;keep-type-asn-cc&rdquo;</title>
<para>In addition to &ldquo;anonymize&rdquo; (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).</para>
<para>Description from libipv6addr.h:</para><screen>
<![CDATA[ * Prefix anonymization in case of method=kp: p=0x0f
 * a909:ccca:aaaa:aaaC  (C = 4-bit checksum)
 *                      ccc      -> 10-bit Country Code mapping [A-Z]*[A-Z0-9] (936)
 *                                   0x3FF = unknown country
 *                                   0x000-0x3A7: c1= c / 36, c2 = c % 36
 *                      aaaaaaaa -> 32-bit ASN
]]></screen><para>Description from libipv4addr.h:</para><screen>
<![CDATA[ *  Global IPv4 addresses are anoymized by storing country code and AS number
 *   and using prefix of experimental range (240-255.x.y.z)
 *
 *  3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 
 *  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
 *  1 1 1 1
 * |p p p p|
 *  Prefix                
 *    0xF
 *
 * Pariy Bit (odd parity)
 *         |P|
 *
 * Mapping of Country Code
 *           |c c c c c c c c c c|
 *            10-bit Country Code mapping [A-Z]*[A-Z0-9] (936)
 *            0x3FF = unknown country
 *            0x000-0x3A7: c1= c / 36, c2 = c % 36
 *
 * Mapping of ASN <= 65535
 *                                0|a a a a a a a a a a a a a a a a|
 *                                    16-bit ASN
 *
 * Mapping of ASN >= 65536, ASN & 0xE000 == 0 (12-bit LSB is ok) 
 *                                1|r r r|0|l l l l l l l l l l l l|
 *                                           13-bit LSB of ASN
 *
 * Mapping of ASN >= 65536, ASN & 0xE000 != 0 (12-bit LSB overflow) => unspecified
 *                                1|r r r|1|0 0 0 0 0 0 0 0 0 0 0 0|
 *
 * Mapping of ASN registry for ASN >= 65536
 *                                  0 0 0 = "unknown ASN registry"
 *                                  0 1 0 = APNIC
 *                                  0 1 1 = RIPE
 *                                  1 0 0 = LACNIC
 *                                  1 0 1 = AFRINIC
 *                                  1 1 0 = ARIN
]]></screen></sect3></sect2><sect2>
<title>Supported log file formats</title>
<para>Currently native supported log files:</para><itemizedlist>
<listitem><para>Apache log file format, 1st token is IPv4 or IPv6 address</para></listitem></itemizedlist><para>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'.</para></sect2><sect2>
<title>Supported options</title>
<screen>
<![CDATA[$ ipv6loganon -h
ipv6loganon: version 0.97.0 ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC
(P) & (C) 2007-2014 by Peter Bieringer <pb (at) bieringer.de>

This program anonymizes IPv4/IPv6 addresses in e.g. HTTP server log files

  [-d|--debug <debug value>] : debug value (bitwise like)
                                can also be set by IPV6CALC_DEBUG environment value
  [-v|--version [-v [-v]]]   : version information (2 optional verbose levels)
  [-h|--help|-?]             : this online help

  [--db-ip2location-disable        ] : IP2Location support disabled
  [--db-ip2location-dir <directory>] : IP2Location database directory (default: /usr/share/IP2Location)
  [--db-ip2location-lib <file>]      : IP2Location library file (default: libIP2Location.so)

  [--db-geoip-disable              ] : GeoIP support disabled
  [--db-geoip-dir       <directory>] : GeoIP database directory (default: /usr/share/GeoIP)
  [--db-geoip-lib       <file>]      : GeoIP library file (default: libGeoIP.so.1)

  [-w|--write]               : write output to file instead of stdout
  [-a|--append]              : append output to file instead of stdout
  [-f|--flush]               : flush output after each line
  [-V|--verbose]             : be verbose
  [-n|--nocache]             : disable caching
  [-c|--cachelimit <value>]  : set cache limit
                               default: 20
                               maximum: 200

  Shortcut for anonymization presets:
   --anonymize-standard (default)
   --anonymize-careful
   --anonymize-paranoid

  Supported methods [--anonymize-method METHOD]:
   anonymize : reliable anonymization, keep as much type information as possible
   zeroize   : simple zeroizing according to given masks, probably loose type information
   keep-type-asn-cc: special reliable anonymization, keep type & Autonomous System Number and CountryCode

  Available presets (shortcut names) [--anonymize-preset PRESET-NAME]:
   anonymize-standard   (as): mask-ipv6= 56 mask-ipv4=24 mask-eui64=40 mask-mac=24 mask-autoadjust=yes method=anonymize
   anonymize-careful    (ac): mask-ipv6= 48 mask-ipv4=20 mask-eui64=24 mask-mac=24 mask-autoadjust=yes method=anonymize
   anonymize-paranoid   (ap): mask-ipv6= 40 mask-ipv4=16 mask-eui64= 0 mask-mac=24 mask-autoadjust=no  method=anonymize
   zeroize-standard     (zs): mask-ipv6= 56 mask-ipv4=24 mask-eui64=40 mask-mac=24 mask-autoadjust=yes method=zeroize
   zeroize-careful      (zc): mask-ipv6= 48 mask-ipv4=20 mask-eui64=24 mask-mac=24 mask-autoadjust=yes method=zeroize
   zeroize-paranoid     (zp): mask-ipv6= 40 mask-ipv4=16 mask-eui64= 0 mask-mac=24 mask-autoadjust=no  method=zeroize
   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

  Custom control:
  --mask-ipv4  <bits>     : mask IPv4 address [0-32] (even if occurs in IPv6 address)
  --mask-ipv6  <bits>     : mask IPv6 prefix [0-64] (only applied to related address types)
  --mask-eui64 <bits>     : mask EUI-64 address or IPv6 interface identifier [0-64]
  --mask-mac   <bits>     : mask MAC address [0-48]
  --mask-autoadjust yes|no: autoadjust mask to keep type/vendor information regardless of less given mask

 Takes data from stdin, outputs the processed data to stdout (default)
]]></screen></sect2><sect2>
<title>Usage</title>
<sect3>
<title>Offline anonymization</title>
<screen>
<![CDATA[$ cat /path/to/http_log | ./ipv6loganon >/path/to/http_log_anonymized
]]></screen></sect3><sect3>
<title>On-the-fly online anonymization for Apache Webserver</title>
<para>(Supported since 0.90.0)</para>
<para>Adjust or add (note: more than one CustomLog directive is supported by Apache) httpd.conf like following:</para><screen>
<![CDATA[CustomLog "|/usr/local/bin/ipv6loganon -a -f /var/log/httpd/access_log" combined
]]></screen><para>In case of &ldquo;cronolog&rdquo; is used on the system, configure like this:</para><itemizedlist>
<listitem><para>Apache version &lt; 2.4:</para></listitem></itemizedlist><screen>
<![CDATA[CustomLog "|/usr/bin/ipv6loganon -f |/usr/sbin/cronolog /var/log/httpd/access.log-%Y%m%d" combined 
]]></screen><itemizedlist>
<listitem><para>Apache version &gt;= 2.4:</para></listitem></itemizedlist><screen>
<![CDATA[CustomLog "|$/usr/bin/ipv6loganon -f |/usr/sbin/cronolog /var/log/httpd/access.log-%Y%m%d" combined 
]]></screen></sect3></sect2></sect1><sect1>
<title>External database update helper scripts</title>
<para>The &ldquo;tools&rdquo; subdirectory contains helper scripts for updating external databases.</para><sect2>
<title>IP2Location</title>
<screen>
<![CDATA[$ /usr/share/ipv6calc/tools/IP2Location-update.sh -h
Usage: IP2Location-update.sh [-D <dir>]
	-D <dir>	database directory (optional)

	database directory: /usr/share/IP2Location (default: /usr/share/IP2Location)

	it honors externally defined environment value: IP2LOCATION_DAT_DIR

 this script will download data from ip2location.com
 into given/set database directory

 Samples:
 IP2LOCATION_DAT_URL_BASE_SAMPLE=http://www.ip2location.com/downloads
 IP2LOCATION_DAT_FILES_SAMPLE=20
 (create also softlink to IP-COUNTRY.BIN if not existing)

 With authentication (requires login/password in $HOME/.ip2location) and a valid subscription
 IP2LOCATION_DAT_URL_BASE=http://www.ip2location.com/download?login=@LOGIN@&password=@PASSWORD@
 IP2LOCATION_DAT_FILES=IPV6BIN
]]></screen></sect2><sect2>
<title>GeoIP</title>
<screen>
<![CDATA[$ /usr/share/ipv6calc/tools/GeoIP-update.sh -h
Usage: GeoIP-update.sh [-D <dir>]
	-D <dir>	database directory (optional)

	database directory: /usr/share/GeoIP (default: /usr/share/GeoIP)

	it honors externally defined environment value: GEOIP_DAT_DIR

 this script will download data from geolite.maxmind.com (GeoIP)
 into given/set database directory

 GEOIP_DAT_URL_BASE=http://geolite.maxmind.com/download/geoip/database/
 GEOIP_DAT_FILES=GeoLiteCountry/GeoIP.dat.gz GeoIPv6.dat.gz GeoLiteCity.dat.gz GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz asnum/GeoIPASNum.dat.gz asnum/GeoIPASNumv6.dat.gz
]]></screen></sect2><sect2>
<title>DB-IP.com</title>
<screen>
<![CDATA[$ /usr/share/ipv6calc/tools/DBIP-update.sh -h
Usage: DBIP-update.sh [-s] [-D <dir>]
	-s		skip download
	-D <dir>	database directory (optional)

	database directory: /usr/share/DBIP (default: /usr/share/DBIP)

 it honors externally defined environment value: DBIP_DAT_DIR

 this script (and its helper scripts) will download data from
 DB-IP.com (free versions) and generate Berkeley DB files for ipv6calc
 "DBIP" database support

 DBIP_DAT_URL_BASE=http://download.db-ip.com/free/
 DBIP_DAT_FILES=dbip-country-%Y-%m.csv.gz dbip-city-%Y-%m.csv.gz
]]></screen></sect2><sect2>
<title>External</title>
<screen>
<![CDATA[$ /usr/share/ipv6calc/tools/ipv6calc-db-update.sh -h
Usage: ipv6calc-db-update.sh [-s] [-u] [-D <dir>]
	-s		skip download
	-u		unconditional update
	-D <dir>        database directory (optional)

	database directory: /usr/share/ipv6calc/db (default: /usr/share/ipv6calc/db)

	it honors externally defined environment value: IPV6CALC_DAT_DIR

	this script (and its helper scripts) will download data from
	registries and generate Berkeley DB files for ipv6calc
	"external" database support
]]></screen></sect2></sect1><sect1>
<title>Perl CGI wrapper program "ipv6calcweb.cgi"</title>
<para>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. </para><sect2>
<title>Examples</title>
<para>A demonstration about which kind of output is possible to produce is shown at</para><itemizedlist>
<listitem><para><ulink url="http://ip.bieringer.de/">http://ip.bieringer.de/</ulink> (IPv4/IPv6)</para></listitem><listitem><para><ulink url="http://www.ipv6.bieringer.de/">http://www.ipv6.bieringer.de/</ulink> (IPv6 only)</para></listitem><listitem><para><ulink url="http://mirrors.bieringer.de/">http://mirrors.bieringer.de/</ulink> (IPv4/IPv6)</para></listitem><listitem><para><ulink url="http://www.sixxs.net/tools/ipv6calc/">http://www.sixxs.net/tools/ipv6calc/</ulink> (IPv4/IPv6)</para></listitem></itemizedlist></sect2></sect1><sect1>
<title>Webserver log statistics helper program "ipv6logstats"</title>
<para>This program parses a given webserver logfile and count addresses, useful for time period statistics.</para>
<para>Since version 0.95.0 it has extended output, adding a date/time line and statistics by Country Code and ASN (if required databases are available).</para><sect2>
<title>Supported options</title>
<screen>
<![CDATA[$ ./ipv6logstats -h
ipv6logstats: version 0.97.0 STAT_REG STAT_CC STAT_AS
(P) & (C) 2003-2014 by Peter Bieringer <pb (at) bieringer.de>

 Takes web server log data (or any other data which has IPv4/v6 address in first column)
   from stdin and print statistics table/list (depending on option) to stdout

  [-d|--debug <debug value>] : debug value (bitwise like)
                                can also be set by IPV6CALC_DEBUG environment value
  [-v|--version [-v [-v]]]   : version information (2 optional verbose levels)
  [-h|--help|-?]             : this online help

  [--db-ip2location-disable        ] : IP2Location support disabled
  [--db-ip2location-dir <directory>] : IP2Location database directory (default: /usr/share/IP2Location)
  [--db-ip2location-lib <file>]      : IP2Location library file (default: libIP2Location.so)

  [--db-geoip-disable              ] : GeoIP support disabled
  [--db-geoip-dir       <directory>] : GeoIP database directory (default: /usr/share/GeoIP)
  [--db-geoip-lib       <file>]      : GeoIP library file (default: libGeoIP.so.1)

  [-u|--unknown]             : print unknown IP addresses to stderr
  [-c|--columns]             : print statistics in columns (1)
  [-n|--noheader]            : don't print header in columns mode (1)
  [-o|--onlyheader]          : print only header in columns mode (1)
  [-p|--prefix <token>]      : print token as prefix (1)
  [-q|--quiet]               : be more quiet
  [-s|--simple]              : disable extended statistic (CountryCode/ASN)

 (1) unsupported for CountryCode & ASN statistics
]]></screen></sect2><sect2>
<title>Usage</title>
<para>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.</para><sect3>
<title>Line-by-line output</title>
<para>The example shows output version 3.0, which </para><screen>
<![CDATA[$ zcat ip.bieringer.de-log.201*.gz | ipv6logstats
]]></screen><para>Header section, since output version 3.0 (&gt;= 0.95.0) additional lines starting with '*3*' and '*DateTime' and '*UnixTime' included</para><screen>
<![CDATA[*Version             3.0
*DateTime: 2013:11:03 08:57:01+0000 GMT
*UnixTime: 1383469021
*3*DB-Info: DB features: 0x0000133f
*3*DB-Info: GeoIP: features: 0x00000330
*3*DB-Info: GeoIP: info of available databases in directory: /usr/share/GeoIP (max: 31)
*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)
*3*DB-Info: GeoIP: GeoIP ASNum Edition              :[ 9] /usr/share/GeoIP/GeoIPASNum.dat          (GEO-117 20130902 Build 1 Copyright (c) 2013 MaxMind Inc All Rights Reserved)
*3*DB-Info: GeoIP: GeoIP Country V6 Edition         :[12] /usr/share/GeoIP/GeoIPv6.dat             (GEO-106FREE 20131001 Build 1 Copyright (c) 2013 MaxMind Inc All Rights Reserved)
*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)
*3*DB-Info: GeoIP: GeoIP Large Country V6 Edition   :[18] /usr/share/GeoIP/GeoIPv6.dat             (GEO-106FREE 20131001 Build 1 Copyright (c) 2013 MaxMind Inc All Rights Reserved)
*3*DB-Info: GeoIP: GeoIP ASNum V6 Edition           :[21] /usr/share/GeoIP/GeoIPASNumv6.dat        (GEO-117 20130306 Build 1 Copyright (c) 2013 MaxMind Inc All Rights Reserved)
*3*DB-Info: IP2Location: features: 0x00000300
*3*DB-Info: IP2Location: info of available databases in directory: /usr/share/IP2Location
*3*DB-Info: IP2Location: IPv4 Country               : /usr/share/IP2Location/IP-COUNTRY.BIN    (IP2L-DB20 20130411 Copyright (c) 2013 IP2Location All Rights Reserved)
*3*DB-Info: IP2Location: IPv6 Country               : /usr/share/IP2Location/IPV6-COUNTRY.BIN  (IP2L-DB1 20131025 Copyright (c) 2013 IP2Location All Rights Reserved)
*3*DB-Info: BuiltIn: features: 0x0000100f
*3*DB-Info: BuiltIn: info of available databases
*3*DB-Info: BuiltIn: ASN  : IANA/20130730
*3*DB-Info: BuiltIn: CC   : AFRINIC/20130806 APNIC/20130805 ARIN/20130805 LACNIC/20130805 RIPENCC/20130805
*3*DB-Info: BuiltIn: IPv4 : AFRINIC/20131014 APNIC/20131014 ARIN/20131014 IANA/20130520 LACNIC/20131014 RIPENCC/20131014
*3*DB-Info: BuiltIn: IPv6 : AFRINIC/20131015 APNIC/20131014 ARIN/20131014 IANA/20130215 LACNIC/20131014 RIPENCC/20131014
*3*DB-Info: BuiltIn: IEEE : IAB/20131015 OUI/20131015 OUI36/20131015
]]></screen><para>Simple statistics section</para><screen>
<![CDATA[ALL                  108525
IPv4                 46233
IPv6                 62292
UNKNOWN              0
IPv4/APNIC           2397
IPv4/ARIN            3525
IPv4/RIPE            40198
IPv4/LACNIC          97
IPv4/UNKNOWN         16
IPv6/6bone           0
IPv6/IANA            0
IPv6/APNIC           129
IPv6/ARIN            839
IPv6/RIPE            61074
IPv6/LACNIC          0
IPv6/RESERVED        0
IPv6/UNKNOWN         0
IPv6/6to4/IANA       0
IPv6/6to4/APNIC      0
IPv6/6to4/ARIN       16
IPv6/6to4/RIPE       51
IPv6/6to4/LACNIC     0
IPv6/6to4/RESERVED   0
IPv6/6to4/UNKNOWN    0
IPv6/Teredo/IANA     0
IPv6/Teredo/APNIC    63
IPv6/Teredo/ARIN     0
IPv6/Teredo/RIPE     90
IPv6/Teredo/LACNIC   30
IPv6/Teredo/RESERVED 0
IPv6/Teredo/UNKNOWN  0
IPv6/NAT64/IANA      0
IPv6/NAT64/APNIC     0
IPv6/NAT64/ARIN      0
IPv6/NAT64/RIPE      0
IPv6/NAT64/LACNIC    0
IPv6/NAT64/RESERVED  0
IPv6/NAT64/UNKNOWN   0
IPv6/IID/Global      1436
IPv6/IID/Random      58198
IPv6/IID/Manual      2055
IPv6/IID/ISATAP      353
IPv6/IID/Unknown     0
]]></screen><para>External database supported output since output version 3.0 (&gt;= 0.95.0)</para><itemizedlist>
<listitem><para>Country Code / Proto</para></listitem></itemizedlist><screen>
<![CDATA[...
*3*CC-code-proto/DE/ALL   96450
*3*CC-code-proto/DE/IPv4  36486
*3*CC-code-proto/DE/IPv6  59964 
*3*CC-code-proto-list/DE  96450 36486 59964
...
]]></screen><itemizedlist>
<listitem><para>Proto / Country Code (&ldquo;ALL&rdquo; line contains: ALL IPv4 IPv6)</para></listitem></itemizedlist><screen>
<![CDATA[...
*3*CC-proto-code/ALL/DE   96450
*3*CC-proto-code/IPv4/DE  36486
*3*CC-proto-code/IPv6/DE  59964
...
*3*CC-proto-code-list/ALL  108525 46483 62042
]]></screen><itemizedlist>
<listitem><para>Autonomous System number / Proto</para></listitem></itemizedlist><screen>
<![CDATA[...
*3*AS-num-proto/8767/ALL   6054
*3*AS-num-proto/8767/IPv4  2705
*3*AS-num-proto/8767/IPv6  3349
*3*AS-num-proto-list/8767  6054 2705 3349
...
]]></screen><itemizedlist>
<listitem><para>Proto / Autonomous System number (&ldquo;ALL&rdquo; line contains: ALL IPv4 IPv6)</para></listitem></itemizedlist><screen>
<![CDATA[...
*3*AS-proto-num/ALL/8767   6054
*3*AS-proto-num/IPv4/8767  2705
*3*AS-proto-num/IPv6/8767  3349
...
*3*AS-proto-num-list/ALL  108525 46483 62042
]]></screen></sect3><sect3>
<title>Column output</title>
<para>Column output does not support version 3 extension, only simple statistics with a header line:</para><screen>
<![CDATA[$ zcat ip.bieringer.de-log.201*.gz | ipv6logstats -q -c 
 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/NAT64/UNKNOWN IPv6/IID/Global IPv6/IID/Random IPv6/IID/Manual IPv6/IID/ISATAP IPv6/IID/Unknown
 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
]]></screen><para>An optional prefix token can be given (&ldquo;-p &lt;prefix&gt;&rdquo;) 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 (&ldquo;-n&rdquo;).</para><screen>
<![CDATA[$ zcat ip.bieringer.de-log.201*.gz | ipv6logstats -q -c -n -p ALL
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 
]]></screen></sect3></sect2><sect2>
<title>Examples</title>
<para>A demonstration with real data is available at <ulink url="http://mirrors.bieringer.de/stats/timeline.html">http://mirrors.bieringer.de/stats/timeline.html</ulink>.</para></sect2></sect1><sect1>
<title>History</title>
<para>Major extensions/changes are listed here</para><sect2>
<title>2015</title>
<itemizedlist>
<listitem><para>Add support for DB-IP.com (by generated Berkeley DB files)</para></listitem><listitem><para>Add support for &ldquo;External&rdquo; database files (generated Berkeley DB files), superseeding (if newer) built-in IPv4/IPv6-&gt;Registry and adding IPv4/IPv6-&gt;CountryCode support</para></listitem></itemizedlist></sect2><sect2>
<title>2014</title>
<itemizedlist>
<listitem><para>Shared library mode supported (reduces size of binaries)</para></listitem></itemizedlist></sect2><sect2>
<title>2013</title>
<itemizedlist>
<listitem><para>Prefix and IID anonymization methods</para></listitem><listitem><para>Support of dynamic load of GeoIP and IP2Location libraries</para></listitem><listitem><para>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.</para></listitem></itemizedlist></sect2><sect2>
<title>2011</title>
<itemizedlist>
<listitem><para>ipv6calc/ipv6calcweb.cgi: enable included GeoIP support with IPv6 (usable with GeoIP &gt;= 1.4.5)</para></listitem><listitem><para>ipv6calc: extend for 6rd support (--action 6rd_local_prefix --6rd_prefix &lt;PREFIX&gt; --6rd_relay_prefix &lt;RELAY_PREFIX&gt;)</para></listitem><listitem><para>ipv6calc: enable stdin support for bulk transformation</para></listitem><listitem><para>ipv6calc: add support for NAT64 address type</para></listitem><listitem><para>ipv6calc: add option &ldquo;forceprefix &lt;LENGTH&gt;&rdquo; to print prefix of an address without a given prefix length</para></listitem><listitem><para>ipv6loganon: extend for pipe usage (e.g. in Apache log file directive) and write/append to specified file</para></listitem><listitem><para>General: add configure options to disable built-in databases (reduce binary size a lot, e.g. for embedded devices)</para></listitem></itemizedlist></sect2><sect2>
<title>2010 and older</title>
<para>TODO</para></sect2></sect1></article>