ipv6calc is a small utility written in programming languate C to manipulate (not only) IPv6 addresses. Intentions were convering a given IPv6 address into compressed format, convering a given IPv6 address into the same format like shown in /proc/net/if_inet6 and (because it was not difficulty) migrating the Perl program ip6_int into. Now only one utiltity is needed to do a lot.
This utility is also used to extend features on network-functions-ipv6 library, used by initscripts-ipv6.
Note: this tool got also its freshmeat / ipv6calc page (not maintained by the author)
Hint: take also a look at the Advanced Network Management Laboratory / IPv6 Address Oracle if you want to learn more about IPv6 addresses.
Via CVS at DeepSpace6: DeepSpace6 / CVS instructions
Via web interface to CVS at DeepSpace6: DeepSpace6 / CVS web interface
Via FTP at DeepSpace6: DeepSpace6 / anonymous FTP
A SPEC file is included, so you can build a RPM from source tarball using
$ rpmbuild -ta path/to/ipv6calc-$version.tar.gz |
Currently only on rpmfind / ipv6calc, but there are plans to publish at least source RPMS on DeepSpace6 some day.
Red Hat Linux (currently version 7.3) is the developing platform, so use given hints above to create a RPM.
Linux Mandrake is very similar to Red Hat Linux, therefore a rebuild should work, too.
Package is maintained, more information can be found at http://packages.debian.org/ipv6calc
sending announcements of new versions
very low
only moderators are allowed to post
You can send bug reports to the author himself or subscribe to maillist "ipv6calc" and send it to the list.
The main program named "ipv6calc" is able to recognice many (not only) IPv6 address formats and depending on a selectable action (not required) a selectable output format can be specified.
A simple example is the conversion of an IPv6 address to a DNS PTR query string:
$ ./ipv6calc --out revnibbles.arpa 3ffe:ffff::1 No input type specified, try autodetection...found type: ipv6addr 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.f.f.f.f.e.f.f.3.ip6.arpa. |
Like you see, input format was autodetected. And given example can be extended because ipv6calc also understands netmask / prefix length values:
$ ./ipv6calc -q --out revnibbles.arpa 3ffe:ffff::1/64 0.0.0.0.0.0.0.0.f.f.f.f.e.f.f.3.ip6.arpa. |
Also you've learnt now that switch "-q" (quiet) suppresses informational messages. You can use this now to start a DNS PTR query using:
$ dig PTR `./ipv6calc -q --out revnibbles.arpa 3ffe:ffff::1/64` |
But ipv6calc can do many more for you! Next example shows you the extraction of the IPv4 address contained in a 6to4 IPv6 address:
$ ./ipv6calc -q --action conv6to4 --in ipv6 2002:c0a8:fb61::1 --out ipv4 192.168.251.97 |
This also works vice-versa:
$ ./ipv6calc -q --action conv6to4 --in ipv4 192.168.251.97 --out ipv6 2002:c0a8:fb61:: |
There are many more features already implemented, if you miss one, send a note.
Since version 0.40 new-style option handling was introduced, using
--in <inputtype>
--out <outputtype>
--action <actiontype>
and many more conversions were added. A built-in check matrix should prevent misconversions.
Up to version 0.39, only old-style options (which perhaps - but it's not sure - are going obsolete in the future) were available. They are one-in-all options, specifying input/action/output in one token. Internally this options will be converted into new-style options.
Online help always shows the currently implemented features.
$ ./ipv6calc -? ipv6calc: version 0.46 (P) & (C) 2001-2003 by Peter Bieringer <pb (at) bieringer.de> General: [-d|--debug <debug value>] : debug value (bitwise like) [-q|--quiet] : be more quiet Usage with new style options: [--in <input type>] : specify input type (default: autodetect) [--out <output type>] : specify output type (sometimes: autodetect) [--action <action>] : specify action (default: format conversion, sometimes: autodetect) [<format option> ...] : specify format options <input data> [...] : input data Available input types: --in -?|-h|--help Available output types: --out -?|-h|--help Available action types: --action -?|-h|--help Other usage: --showinfo|-i [--machine_readable|-m] : show information about input data --showinfo|-i --show_types : show available types on '-m' To see old-style option use: --printoldoptions |
Input-type options
$ ./ipv6calc --in -? ipv6calc: version 0.46 (P) & (C) 2001-2003 by Peter Bieringer <pb (at) bieringer.de> Available input types: auto : automatic detection revnibbles.int : dot separated nibbles reverse, ending with ip6.int. revnibbles.arpa: dot separated nibbles reverse, ending with ip6.arpa. bitstring : bitstring labes, ending with ip6.arpa. ipv6addr : IPv6 address ipv4addr : IPv4 address mac : MAC address (48 bits) base85 : Base-85 string ifinet6 : Like line in /proc/net/if_inet6 iid+token : Interface identifier and token ipv6logconv : ipv6logconv (currently not supported) prefix+mac : IPv6 prefix and a MAC address |
Output-type options:
$ ./ipv6calc --out -? ipv6calc: version 0.46 (P) & (C) 2001-2003 by Peter Bieringer <pb (at) bieringer.de> Available output types: revnibbles.int : dot separated nibbles reverse, ending with ip6.int. revnibbles.arpa: dot separated nibbles reverse, ending with ip6.arpa. bitstring : bitstring labes, ending with ip6.arpa. ipv6addr : IPv6 address ipv4addr : IPv4 address mac : MAC address (48 bits) eui64 : EUI-64 identifier (64 bits) base85 : Base-85 string ifinet6 : Like line in /proc/net/if_inet6 iid : Interface identifier iid+token : Interface identifier and token addrtype : Address type ouitype : OUI (IEEE) type ipv6addrtype : IPv6 address type any : any type (currently not supported) revipv4 : reverse IPv4, ending with in-addr.arpa octal : IP address in escaped octal format For examples and available format options use: --out <type> --examples |
Action-type options:
$ ./ipv6calc --action -? ipv6calc: version 0.45 (P) & (C) 2001-2002 by Peter Bieringer <pb (at) bieringer.de> Available action types: auto : Automatic selection of action (default) geneui64 : Converts a MAC address to an EUI-64 address conv6to4 : Converts IPv4 address <-> 6to4 IPv6 address (prefix) genprivacyiid : Generates a privacy interface ID out of a given one and a token prefixmac2ipv6: Generates an IPv6 address out of a prefix and a MAC address |
Because of historical issues, there exists also a support of the old-styled options:
$ ./ipv6calc --printoldoptions ipv6calc: version 0.45 (P) & (C) 2001-2002 by Peter Bieringer <pb (at) bieringer.de> Usage with old style (shortcut) options (going obsolete): <shortcut option> [<format option> ...] <input data> [...] --addr2ip6_int --addr_to_ip6int --addr2ip6_arpa --addr_to_ip6arpa --addr_to_bitstring --addr2compaddr --addr_to_compressed --addr2uncompaddr --addr_to_uncompressed --addr_to_base85 --base85_to_addr --mac_to_eui64 --addr2fulluncompaddr --addr_to_fulluncompressed --addr2if_inet6 --addr_to_ifinet6 --if_inet62addr --ifinet6_to_compressed --eui64_to_privacy --ipv4_to_6to4addr |
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").
A demonstration about which kind of statistics are possible to produce is shown at http://www.ipv6.bieringer.de/ (IPv6 only).
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.
A demonstration about which kind of output is possible to produce is shown at
http://www.ipv6.bieringer.de/ (IPv6 only)
http://ipv6.aerasec.de/index2.html (IPv4/IPv6)
http://www.sixxs.net/tools/ipv6calc/ (IPv4/IPv6)
This program parses a given webserver logfile and count addresses, useful for time period statistics.