https://bitbucket.org/watchmouse/mysql-udf-ipv6/overview
IPv6 and internationalized domain (IDNA) functions for MySQL
------------------------------------------------------------
======================
IMPORTANT NOTICE:
I'm very happy to see that as of MySQL 5.6.3 functions with an identical API seem to be provided by MySQL, but
with slightly different labels:
inet6_ntop() -> inet6_ntoa()
inet6_pton() -> inet6_atop()
I've created aliases towards the native functions in the latest release of this UDF, with which this
module should now provide you with a valid upgrade path. The native functions also operate on a VARBINARY(16).
When loading the functions in this UDF, all examples in the manual work out of the box on pre-5.6 versions of MySQL:
http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html#function_inet6-ntoa
======================
These are experimental runtime plug-in (UDF) for MySQL
that add basic IPv6 and IDNA functions that MySQL v5 is still lacking:
inet6_ntop and inet6_pton()
idna_to_ascii() and idna_from_ascii()
These files are experimental and provided as-is under a EUPL license.
Pieter Ennes (pieter@watchmouse.com)
Copyright ©2009-2011 WatchMouse
LICENSE
-------
Licensed under the EUPL, Version 1.1 or – as soon they will be approved
by the European Commission - subsequent versions of the EUPL (the "Licence");
You may not use this work except in compliance with the Licence. You may
obtain a copy of the Licence at:
http://ec.europa.eu/idabc/eupl
Unless required by applicable law or agreed to in writing, software
distributed under the Licence is distributed on an "AS IS" basis,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the Licence for the specific language governing permissions and
limitations under the Licence.
Need datatype universal
store IPv4, IPv6, and MAC addresses
_________________________________
Name | Storage Size | Description
cidr | 12 or 24 bytes | IPv4 and IPv6 networks
inet | 12 or 24 bytes | IPv4 and IPv6 hosts and networks
macaddr | 6 bytes | MAC addresses
http://www.postgresql.org/docs/8.2/static/datatype-net-types.html