IPv6 support roadmap

Usage
Although the global transition to IPv6 is coming very slowly, it will be necessary to support the new IP format in the future. MediaWiki will require changes to IP.php and some of the block/checkuser code. Possible schema changes are likely to get the indexing to work well.

Current code
A number of functions have been added for IPv6 support for blocks:
 * - expands IPs and set them to all-caps
 * - creates an IPv6 octet from an integer
 * - creates an IPv6 octet from an integer

Additionally, there a some new validation functions which use some IPv6 validation regexps:

Some of the current functions for IPv4 now check for IPv6 IPs and return output from the correct function if an IPv6 IP is given. Additionally, they all avoid the use of native bit functions and operations due to their 32 bit limits. Using them will cause garbage or invalid output.

Storage issues
For consistency,  should be used when storing and checking against IPs in the database. This function expands "::" abbreviations, removes leading bloc zeroes, and sets to all caps IPv6 addresses (other addresses or strings are return as is).

However the issue of indexing and performance remains. Currently, we have:

In tables.sql.

This is problematic as IPv6 addresses, when padded out, are 32 characters, rather than 8 for IPv4. Not only would it simply be a partial index (which in some cases is fine), but it would be misleading, for example as the set of all column's starting with 'F' will consist of some that differ by a factor of 2^96, which is misleading and would lead to unneeded evaluations for range queries (i.e. start < x < end) if the index were used.

Possible solutions

 * 1) Add 24 zeros in front of all current ipb_range_start and ipb_range_end values of character length < 32. Drop the index and recreate it as
 * 2) Add an ipb_type column, with a default value of "4". IPv6 IP blocks will have a value of "6" when they are blocked. When checking if a user is blocked, a condition will be added to the range queries that the type must be of the user's.
 * 3) Use different range fields for IPv6, like  and  . Append all ipv6 IPs with "ipv6-".