I'm working on an application that uses IPv6 addresses in the
database. For IPv4 addresses, it's pretty simple, you make the data
INTEGER UNSIGNED and use INET_ATON() and INET_NTOA() to translate to
and from the usual text display format.
Is there a common way to handle IPv6 addresses? I'm currently storing
them as BINARY(16) data, and wrote a couple of add-in functions
INET_PTO6() and INET_6TOP() to translate to and from the text display
format.
This works OK but it's klunky, particularly when I do bit masking for
CIDR ranges. Anyone else done this more elegantly?
R's,
John
|
|
0
|
|
|
|
Reply
|
John
|
1/18/2010 3:26:07 AM |
|