IPv6 addresses in mysql databases

  • Follow


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


0 Replies
283 Views

(page loaded in 0.011 seconds)

Similiar Articles:







7/25/2012 12:46:49 PM


Reply: