#LyX 2.1 created this file. For more info see http://www.lyx.org/
\lyxformat 474
\begin_document
\begin_header
\textclass docbook
\use_default_options false
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman default
\font_sans default
\font_typewriter default
\font_math auto
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\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
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\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>5.0</revnumber> <date>2015-02-20</date> <authorinitials>PB<
/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 utiltity 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 "freshmeat / ipv6calc"
target "http://freshmeat.net/projects/ipv6calc/"

\end_inset

 page (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 0.98.0 (released 2015-02-21)
\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 Subsection
Included databases
\end_layout

\begin_layout Standard
If not disabled during compiling 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-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 IP anonymization)
\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
GeoIP IPv4, IPv6 (since 0.90.0, req.
 GeoIP >= 1.4.5)
\end_layout

\begin_layout Itemize
IP2Location IPv4, IPv6
\end_layout

\begin_layout Itemize
DB-IP.com (since 0.98.0), based on local Berkeley DB files generated from downloade
d CSV files
\end_layout

\begin_layout Itemize
\begin_inset Quotes eld
\end_inset

External
\begin_inset Quotes erd
\end_inset

 (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.
\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 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 - 2015 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"

\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 CVS at 
\begin_inset CommandInset href
LatexCommand href
name "DeepSpace6"
target "http://www.deepspace6.net/"

\end_inset

: 
\begin_inset CommandInset href
LatexCommand href
name "DeepSpace6 / CVS instructions"
target "http://www.deepspace6.net/sections/cvs.html"

\end_inset


\end_layout

\begin_layout Itemize
Via web interface to CVS at 
\begin_inset CommandInset href
LatexCommand href
name "DeepSpace6"
target "http://www.deepspace6.net/"

\end_inset

: 
\begin_inset CommandInset href
LatexCommand href
name "DeepSpace6 / CVS web interface"
target "http://cvs.deepspace6.net/view/ipv6calc/"

\end_inset


\end_layout

\begin_layout Subsection
Releases
\end_layout

\begin_layout Subsubsection
as tar.gz
\end_layout

\begin_layout Itemize
Via FTP at 
\begin_inset CommandInset href
LatexCommand href
name "DeepSpace6"
target "http://www.deepspace6.net/"

\end_inset

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

\end_inset


\end_layout

\begin_layout Itemize
Via FTP at 
\begin_inset CommandInset href
LatexCommand href
name "ftp://ftp.bieringer.de/pub/linux/IPv6/ipv6calc/"
target "ftp://ftp.bieringer.de/pub/linux/IPv6/ipv6calc/"

\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"

\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"

\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 geoip
\end_layout

\begin_layout Code

--without ip2location
\end_layout

\begin_layout Code

--without dbip
\end_layout

\begin_layout Code

--without external
\end_layout

\begin_layout Code

--without shared
\end_layout

\begin_layout Subsubsection
as RPM
\end_layout

\begin_layout Standard
Currently only on 
\begin_inset CommandInset href
LatexCommand href
name "rpmfind / ipv6calc"
target "http://www.rpmfind.net/linux/rpm2html/search.php?query=ipv6calc"

\end_inset

, but there are plans to publish at least source RPMS on 
\begin_inset CommandInset href
LatexCommand href
name "DeepSpace6"
target "http://www.deepspace6.net/"

\end_inset

 some day.
\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 21 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 / Package / ipv6calc"
target "https://admin.fedoraproject.org/pkgdb/package/ipv6calc/"

\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 on
 RHEL 4.
\end_layout

\begin_layout Itemize
RHEL/CentOS 5 has the package included by default (but an rather old version
 - there are plans to provide newer releases via EPEL, too)
\end_layout

\begin_layout Itemize
RHEL/CentOS 6/7: available since September 2014 on 
\begin_inset CommandInset href
LatexCommand href
name "FedoraProject / EPEL"
target "https://fedoraproject.org/wiki/EPEL"

\end_inset

 EPEL
\end_layout

\begin_layout Standard
CentOS 5/6/7 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
\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"

\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/"

\end_inset


\end_layout

\begin_layout Subsubsection
NetBSD
\end_layout

\begin_layout Standard
See here for more: 
\begin_inset CommandInset href
LatexCommand href
name "http://www.netbsd.org/packages/net/ipv6calc/"
target "http://www.netbsd.org/packages/net/ipv6calc/"

\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.freebsd.org/cgi/cvsweb.cgi/ports/net/ipv6calc/"
target "http://www.freebsd.org/cgi/cvsweb.cgi/ports/net/ipv6calc/"

\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"

\end_inset

), 
\begin_inset CommandInset href
LatexCommand href
name "http://www.freshports.org/net-mgmt/ipv6calc/"
target "http://www.freshports.org/net-mgmt/ipv6calc/"

\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/"

\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

\end_layout

\begin_layout Code

--enable-dbip           Enable db-ip.com support (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-geoip          Enable GeoIP support (default: disabled) 
\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
\end_layout

\begin_layout Code

                                     (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-headers=DIR        GeoIP include files location
\end_layout

\begin_layout Code

--with-geoip-headers-fallback   GeoIP include files from internal fallback
 location
\end_layout

\begin_layout Code

                                 (only usable with dynamic load option)
 
\end_layout

\begin_layout Code

--with-geoip-lib=DIR            GeoIP library location
\end_layout

\begin_layout Code

--with-geoip-static             Explicitly link GeoIP statically (default=no)
\end_layout

\begin_layout Code

--with-geoip-dynamic            Enable use of dynamic loading of GeoIP library
 (default=no)
\end_layout

\begin_layout Code

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

\begin_layout Code

--with-geoip-dyn-lib=NAME       Use specified GeoIP dynamic library, default:
 libGeoIP.so.1
\end_layout

\begin_layout Code

--with-geoip-ipv6-compat        Use IPv6 interface of GeoIP in compatibility
 mode (supporting 1.4.5) 
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code

--with-dbip-db=DIR      Use specified db-ip.com database directory, default:
\end_layout

\begin_layout Code

                          /usr/share/DBIP
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code

--with-external-db=DIR  Use specified external database directory, default:
\end_layout

\begin_layout Code

                          /usr/share/ipv6calc/db 
\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 and IP2Location support
\end_layout

\begin_layout Code

   -g|--geoip          : enable GeoIP support
\end_layout

\begin_layout Code

   --geoip-dyn|-G      : switch to dynamic library loading of GeoIP
\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

   -d|--dbip           : enable db-ip.com support
\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

   --geoip-ipv6-compat : enable GeoIP IPv6 compatibility mode
\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 Section
Mailling 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"

\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"

\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 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 
\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 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
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code

Capabilities: GeoIP(dyn-load) IP2Location(dyn-load) DBIP External DB_AS_REG(Buil
tIn) DB_CC_REG(BuiltIn) DB_IPV4_REG(BuiltIn) DB_IPV6_REG(BuiltIn) DB_IEEE(BuiltI
n)
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code

GeoIP support enabled, compiled with include file version: 1.4.8
\end_layout

\begin_layout Code

GeoIP support by dynamic library load, compiled with IPv4 & IPv6 support
\end_layout

\begin_layout Code

GeoIP configured dynamic library file and detected version: libGeoIP.so.1
 1.5.1
\end_layout

\begin_layout Code

GeoIP available databases: Country4=1 Country6=1 ASN4=1 ASN6=1 City4=1 City6=1
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code

IP2Location support enabled, compiled with include file version: 6.0.2
\end_layout

\begin_layout Code

IP2Location support enabled, compiled with API version: 4.0.0
\end_layout

\begin_layout Code

IP2Location support by dynamic library load
\end_layout

\begin_layout Code

IP2Location configured dynamic library file and detected version: libIP2Location.
so LIBARY-NOT-LOADED
\end_layout

\begin_layout Code

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

\begin_layout Code

\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

\end_layout

\begin_layout Code

DB features: 0x33037fff
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code

GeoIP: features available/implemented: 0x00033ff0/0x00033ff0 (100%)
\end_layout

\begin_layout Code

GeoIP: info of available databases in directory: /usr/share/GeoIP (max:
 31)
\end_layout

\begin_layout Code

GeoIP: GeoIP Country Edition            :[ 1] /usr/share/GeoIP/GeoIP.dat
               (GEO-106FREE 20140805 Build 1 Copyright (c) 2014 MaxMind
 Inc All Rights Reserved)
\end_layout

\begin_layout Code

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)
\end_layout

\begin_layout Code

GeoIP: GeoIP ASNum Edition              :[ 9] /usr/share/GeoIP/GeoIPASNum.dat
          (GEO-117 20140217 Build 1 Copyright (c) 2014 MaxMind Inc All Rights
 Reserved)
\end_layout

\begin_layout Code

GeoIP: GeoIP Country V6 Edition         :[12] /usr/share/GeoIP/GeoIPv6.dat
             (GEO-106FREE 20150203 Build 1 Copyright (c) 2015 MaxMind Inc
 All Rights Reserved)
\end_layout

\begin_layout Code

GeoIP: GeoIP ASNum V6 Edition           :[21] /usr/share/GeoIP/GeoIPASNumv6.dat
        (GEO-117 20150210 Build 1 Copyright (c) 2015 MaxMind Inc All Rights
 Reserved)
\end_layout

\begin_layout Code

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)
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code

IP2Location: features available/implemented: 0x00000000/0x00000000 (NONE)
\end_layout

\begin_layout Code

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

\begin_layout Code

IP2Location: IPv4 Country               : /usr/share/IP2Location/IP-COUNTRY.BIN
    (LIBRARY-NOT-LOADED)
\end_layout

\begin_layout Code

IP2Location: IPv6 Country               : /usr/share/IP2Location/IPV6-COUNTRY.BIN
  (LIBRARY-NOT-LOADED)
\end_layout

\begin_layout Code

IP2Location: NO available databases found in directory: /usr/share/IP2Location
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code

db-ip.com: features available/implemented: 0x03003cc0/0x03003cc0 (100%)
\end_layout

\begin_layout Code

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

\begin_layout Code

DBIP: IPv4 CountryCode           : /usr/share/DBIP/ipv6calc-dbip-ipv4-country.db
 (DBIP-1/20150101, created: 20150124-152244 UTC)
\end_layout

\begin_layout Code

DBIP: IPv6 CountryCode           : /usr/share/DBIP/ipv6calc-dbip-ipv6-country.db
 (DBIP-2/20150101, created: 20150124-152244 UTC)
\end_layout

\begin_layout Code

DBIP: IPv4 City/Region/CountryCode: /usr/share/DBIP/ipv6calc-dbip-ipv4-city.db
 (DBIP-3/20150101, created: 20150124-152300 UTC)
\end_layout

\begin_layout Code

DBIP: IPv6 City/Region/CountryCode: /usr/share/DBIP/ipv6calc-dbip-ipv6-city.db
 (DBIP-4/20150101, created: 20150124-152300 UTC)
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code

External: features available/implemented: 0x300000cc/0x300000cc (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              : /usr/share/ipv6calc/db/ipv6calc-external-
ipv4-registry.db (EXTDB-1/AFRINIC/20150215 APNIC/20150213 ARIN/20150215 IANA/2014
1014 LACNIC/20150213 RIPENCC/20150214, created: 20150215-170218 UTC)
\end_layout

\begin_layout Code

External: IPv6 Registry              : /usr/share/ipv6calc/db/ipv6calc-external-
ipv6-registry.db (EXTDB-2/AFRINIC/20150215 APNIC/20150213 ARIN/20150215 IANA/2014
0520 LACNIC/20150213 RIPENCC/20150214, created: 20150215-170924 UTC)
\end_layout

\begin_layout Code

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)
\end_layout

\begin_layout Code

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)
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code

BuiltIn: features available/implemented: 0x0000400f/0x0000400f (100%)
\end_layout

\begin_layout Code

BuiltIn: info of available databases
\end_layout

\begin_layout Code

BuiltIn: ASN  : IANA/20140905
\end_layout

\begin_layout Code

BuiltIn: CC   : AFRINIC/20150215 APNIC/20150215 ARIN/20150215 LACNIC/20150213
 RIPENCC/20150214
\end_layout

\begin_layout Code

BuiltIn: IPv4 : AFRINIC/20150215 APNIC/20150215 ARIN/20150215 IANA/20141014
 LACNIC/20150213 RIPENCC/20150214 (created: 20150215-185302 UTC)
\end_layout

\begin_layout Code

BuiltIn: IPv6 : AFRINIC/20150215 APNIC/20150215 ARIN/20150215 IANA/20140520
 LACNIC/20150213 RIPENCC/20150214 (created: 20150215-190001 UTC)
\end_layout

\begin_layout Code

BuiltIn: IEEE : IAB/20150213 OUI/20150213 OUI36/20150213
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code

Database selection or priorization ('->': subsequential calls)
\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
\end_layout

\begin_layout Code

DB_IPV6_AS (IPv6 to AS database): GeoIP
\end_layout

\begin_layout Code

DB_IPV4_CC (IPv4 to CountryCode database): GeoIP->db-ip.com->External
\end_layout

\begin_layout Code

DB_IPV6_CC (IPv6 to CountryCode database): GeoIP->db-ip.com->External
\end_layout

\begin_layout Code

DB_IPV4_COUNTRY (IPv4 to Country database): GeoIP
\end_layout

\begin_layout Code

DB_IPV6_COUNTRY (IPv6 to Country database): GeoIP
\end_layout

\begin_layout Code

DB_IPV4_CITY (IPv4 to City database): GeoIP->db-ip.com
\end_layout

\begin_layout Code

DB_IPV6_CITY (IPv6 to City database): GeoIP->db-ip.com
\end_layout

\begin_layout Code

DB_IPV4_REGION (IPv4 to Region database): GeoIP->db-ip.com
\end_layout

\begin_layout Code

DB_IPV6_REGION (IPv6 to Region database): GeoIP->db-ip.com
\end_layout

\begin_layout Code

DB_IEEE (IEEE/OUI/OUI36 Vendor database): BuiltIn
\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/ipv6calc -v -h
\end_layout

\begin_layout Code

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
\end_layout

\begin_layout Code

Explanation of available(+)/possible(-) feature tokens
\end_layout

\begin_layout Code

GeoIP                 + GeoIPv4 database (provided by GeoIP)
\end_layout

\begin_layout Code

GeoIPv6               + GeoIPv6 database (provided by GeoIP)
\end_layout

\begin_layout Code

IP2Location           - IP2Location IPv4 database
\end_layout

\begin_layout Code

IP2Location6          - IP2Location IPv6 database
\end_layout

\begin_layout Code

DBIPv4                + db-ip.com IPv4 database (provided by db-ip.com)
\end_layout

\begin_layout Code

DBIPv6                + db-ip.com IPv6 database (provided by db-ip.com)
\end_layout

\begin_layout Code

DB_AS_REG             + AS-Number to Registry database (provided by BuiltIn)
\end_layout

\begin_layout Code

DB_IPV4_REG           + IPv4 to Registry database (provided by External,BuiltIn)
\end_layout

\begin_layout Code

DB_IPV6_REG           + IPv6 to Registry database (provided by External,BuiltIn)
\end_layout

\begin_layout Code

DB_IPV4_AS            + IPv4 to AS database (provided by GeoIP)
\end_layout

\begin_layout Code

DB_IPV6_AS            + IPv6 to AS database (provided by GeoIP)
\end_layout

\begin_layout Code

DB_IPV4_CC            + IPv4 to CountryCode database (provided by GeoIP,db-ip.com
,External)
\end_layout

\begin_layout Code

DB_IPV6_CC            + IPv6 to CountryCode database (provided by GeoIP,db-ip.com
,External)
\end_layout

\begin_layout Code

DB_IPV4_COUNTRY       + IPv4 to Country database (provided by GeoIP)
\end_layout

\begin_layout Code

DB_IPV6_COUNTRY       + IPv6 to Country database (provided by GeoIP)
\end_layout

\begin_layout Code

DB_IPV4_CITY          + IPv4 to City database (provided by GeoIP,db-ip.com)
\end_layout

\begin_layout Code

DB_IPV6_CITY          + IPv6 to City database (provided by GeoIP,db-ip.com)
\end_layout

\begin_layout Code

DB_IPV4_REGION        + IPv4 to Region database (provided by GeoIP,db-ip.com)
\end_layout

\begin_layout Code

DB_IPV6_REGION        + IPv6 to Region database (provided by GeoIP,db-ip.com)
\end_layout

\begin_layout Code

DB_CC_REG             + CountryCode to Registry database (provided by BuiltIn)
\end_layout

\begin_layout Code

DB_IEEE               + IEEE/OUI/OUI36 Vendor database (provided by BuiltIn)
\end_layout

\begin_layout Code

ANON_ZEROISE          + Anonymization method 'zeroize'
\end_layout

\begin_layout Code

ANON_ANONYMIZE        + Anonymization method 'anonymize'
\end_layout

\begin_layout Code

ANON_KEEP-TYPE-ASN-CC + Anonymization method 'keep-type-asn-cc'
\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
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 Standard
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, productive, teredo
\end_layout

\begin_layout Code

IPv4 address: 80.181.121.64
\end_layout

\begin_layout Code

IPv4 registry[80.181.121.64]: RIPENCC
\end_layout

\begin_layout Code

IPv4 address: 206.73.118.1
\end_layout

\begin_layout Code

IPv4 registry[206.73.118.1]: ARIN
\end_layout

\begin_layout Code

Address type is Teredo and included IPv4 server address is: 80.181.121.64 and
 client port: 4096
\end_layout

\begin_layout Code

IPv4 registry for Teredo server address: ARIN
\end_layout

\begin_layout Code

Registry for address: reserved
\end_layout

\begin_layout Standard
There exists also a machine readable output (e.g.
 used by 'ipv6calcweb.cgi') - in addition, 
\begin_inset CommandInset href
LatexCommand href
name "IP2Location"
target "http://www.ip2location.com/"

\end_inset

 and/or 
\begin_inset CommandInset href
LatexCommand href
name "GeoIP"
target "http://www.maxmind.com/"

\end_inset

 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=unicast,global-unicast,productive,iid-random,iid,iid-local
\end_layout

\begin_layout Code

IPV6_COUNTRYCODE=DE
\end_layout

\begin_layout Code

IPV6_AS_NUM=6724
\end_layout

\begin_layout Code

IPV6_AS_TEXT=AS6724 STRATO STRATO AG
\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

GEOIP_AS_TEXT=AS6724 STRATO STRATO AG
\end_layout

\begin_layout Code

GEOIP_COUNTRY_SHORT=DE
\end_layout

\begin_layout Code

GEOIP_COUNTRY_LONG=Germany
\end_layout

\begin_layout Code

GEOIP_LATITUDE=51.000000
\end_layout

\begin_layout Code

GEOIP_LONGITUDE=9.000000
\end_layout

\begin_layout Code

IP2LOCATION_DATABASE_INFO=IP2L-DB1 20130307 Copyright (c) 2013 IP2Location
 All Rights Reserved
\end_layout

\begin_layout Code

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
\end_layout

\begin_layout Code

IPV6CALC_NAME=ipv6calc
\end_layout

\begin_layout Code

IPV6CALC_VERSION=0.97.0
\end_layout

\begin_layout Code

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

\begin_layout Code

IPV6CALC_OUTPUT_VERSION=7
\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="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_A
S DB_IPV4_CC DB_IPV6_CC DB_CC_REG DB_IEEE"
\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
Note: since version 0.95.0 '-A filter' is optional if option '-E <filter expressio
n>' is given (autoselected action).
\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
IP2Location and GeoIP options only appear if compiled with such support.
\end_layout

\begin_layout Code

$ ipv6calc -h
\end_layout

\begin_layout Code

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
\end_layout

\begin_layout Code

(P) & (C) 2001-2015 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

  [--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

  [--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

  [--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

  [--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

  [-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

\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

\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 --show_types            : show available 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 Subsubsection
Input-type options
\end_layout

\begin_layout Code

$ ipv6calc --in -?
\end_layout

\begin_layout Code

ipv6calc: version 0.97.0 IP2Location GeoIP GeoIPv6 DB_AS DB_IPV4 DB_IPV6 DB_IPV4_A
S DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC DB_CC_REG DB_IEEE ANON_ZEROISE ANON_ANONYMIZE
 ANON_KEEP-TYPE-ASN-CC
\end_layout

\begin_layout Code

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

\begin_layout Code

\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 0.97.0 IP2Location GeoIP GeoIPv6 DB_AS DB_IPV4 DB_IPV6 DB_IPV4_A
S DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC DB_CC_REG DB_IEEE ANON_ZEROISE ANON_ANONYMIZE
 ANON_KEEP-TYPE-ASN-CC
\end_layout

\begin_layout Code

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

\begin_layout Code

\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 Code

 For examples and available format options use:
\end_layout

\begin_layout Code

    -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 0.97.0 IP2Location GeoIP GeoIPv6 DB_AS DB_IPV4 DB_IPV6 DB_IPV4_A
S DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC DB_CC_REG DB_IEEE ANON_ZEROISE ANON_ANONYMIZE
 ANON_KEEP-TYPE-ASN-CC
\end_layout

\begin_layout Code

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

\begin_layout Code

\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

  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

                      Required options:
\end_layout

\begin_layout Code

                       --6rd_prefix ...
\end_layout

\begin_layout Code

                       --6rd_relay_prefix ...
\end_layout

\begin_layout Code

  filter           : Filter addresses related to filter options
\end_layout

\begin_layout Standard
Special action 
\begin_inset Quotes eld
\end_inset

filter
\begin_inset Quotes erd
\end_inset

:
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code

$ ipv6calc --action filter -h
\end_layout

\begin_layout Code

ipv6calc: version 0.97.0 IP2Location GeoIP GeoIPv6 DB_AS DB_IPV4 DB_IPV6 DB_IPV4_A
S DB_IPV6_AS DB_IPV4_CC DB_IPV6_CC DB_CC_REG DB_IEEE ANON_ZEROISE ANON_ANONYMIZE
 ANON_KEEP-TYPE-ASN-CC
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code

 Filter given addresses from stdout 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-randomy
\end_layout

\begin_layout Code

\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

\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

\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 global 6to4relay
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code

  EUI-48/MAC address filter tokens:
\end_layout

\begin_layout Code

    IMPLEMENTATION MISSING
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code

  EUI-64 address filter tokens:
\end_layout

\begin_layout Code

    IMPLEMENTATION MISSING
\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 0.97.0 CONV_REG CONV_IEEE
\end_layout

\begin_layout Code

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

\begin_layout Code

 General:
\end_layout

\begin_layout Code

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

\begin_layout Code

  [-q|--quiet] : be more quiet
\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:
\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/"

\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

 *                                   0x3FF = unknown country
\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 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 0.97.0 ANON_ZEROISE ANON_ANONYMIZE ANON_KEEP-TYPE-ASN-CC
\end_layout

\begin_layout Code

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

\begin_layout Code

\end_layout

\begin_layout Code

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

\begin_layout Code

\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 verbose levels)
\end_layout

\begin_layout Code

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

\begin_layout Code

\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

\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

\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

\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

\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

\end_layout

\begin_layout Code

  Available presets (shortcut names) [--anonymize-preset 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

\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

\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 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>]
\end_layout

\begin_layout Code

	-D <dir>	database directory (optional)
\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

 Samples:
\end_layout

\begin_layout Code

 IP2LOCATION_DAT_URL_BASE_SAMPLE=http://www.ip2location.com/downloads
\end_layout

\begin_layout Code

 IP2LOCATION_DAT_FILES_SAMPLE=20
\end_layout

\begin_layout Code

 (create also softlink to IP-COUNTRY.BIN if not existing)
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code

 With authentication (requires login/password in $HOME/.ip2location) and
 a valid subscription
\end_layout

\begin_layout Code

 IP2LOCATION_DAT_URL_BASE=http://www.ip2location.com/download?login=@LOGIN@&passwo
rd=@PASSWORD@
\end_layout

\begin_layout Code

 IP2LOCATION_DAT_FILES=IPV6BIN
\end_layout

\begin_layout Subsection
GeoIP
\end_layout

\begin_layout Code

$ /usr/share/ipv6calc/tools/GeoIP-update.sh -h
\end_layout

\begin_layout Code

Usage: GeoIP-update.sh [-D <dir>]
\end_layout

\begin_layout Code

	-D <dir>	database directory (optional)
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code

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

\begin_layout Code

\end_layout

\begin_layout Code

	it honors externally defined environment value: GEOIP_DAT_DIR
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code

 this script will download data from geolite.maxmind.com (GeoIP)
\end_layout

\begin_layout Code

 into given/set database directory
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code

 GEOIP_DAT_URL_BASE=http://geolite.maxmind.com/download/geoip/database/
\end_layout

\begin_layout Code

 GEOIP_DAT_FILES=GeoLiteCountry/GeoIP.dat.gz GeoIPv6.dat.gz GeoLiteCity.dat.gz
 GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz asnum/GeoIPASNum.dat.gz asnum/GeoIPASNumv6.d
at.gz
\end_layout

\begin_layout Subsection
DB-IP.com
\end_layout

\begin_layout Code

$ /usr/share/ipv6calc/tools/DBIP-update.sh -h
\end_layout

\begin_layout Code

Usage: DBIP-update.sh [-s] [-D <dir>]
\end_layout

\begin_layout Code

	-s		skip download
\end_layout

\begin_layout Code

	-D <dir>	database directory (optional)
\end_layout

\begin_layout Code

\end_layout

\begin_layout Code

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

\begin_layout Code

\end_layout

\begin_layout Code

 it honors externally defined environment value: DBIP_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

 DB-IP.com (free versions) and generate Berkeley DB files for ipv6calc
\end_layout

\begin_layout Code

 "DBIP" database support
\end_layout

\begin_layout Code

\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-%Y-%m.csv.gz dbip-city-%Y-%m.csv.gz
\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.de/"
target "http://ip.bieringer.de/"

\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/"

\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/"

\end_inset

 (IPv4/IPv6)
\end_layout

\begin_layout Itemize
\begin_inset CommandInset href
LatexCommand href
name "http://www.sixxs.net/tools/ipv6calc/"
target "http://www.sixxs.net/tools/ipv6calc/"

\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 0.97.0 STAT_REG STAT_CC STAT_AS
\end_layout

\begin_layout Code

(P) & (C) 2003-2014 by Peter Bieringer <pb (at) bieringer.de>
\end_layout

\begin_layout Code

\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

\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 verbose levels)
\end_layout

\begin_layout Code

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

\begin_layout Code

\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

\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

\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|--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

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

\begin_layout Code

  [-s|--simple]              : disable extended statistic (CountryCode/ASN)
\end_layout

\begin_layout Code

\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"

\end_inset

.
\end_layout

\begin_layout Section
History
\end_layout

\begin_layout Standard
Major extensions/changes are listed here
\end_layout

\begin_layout Subsection
2015
\end_layout

\begin_layout Itemize
Add support for DB-IP.com (by generated Berkeley DB files)
\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
\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
2010 and older
\end_layout

\begin_layout Standard
TODO
\end_layout

\end_body
\end_document
