How do I do that?
Right now, IPv6 will not be used, but I need to design the application to make it IPv6-ready. It is necessary to store IP addresses and CIDR blocks (also BGP NLRI, but this is another story) in a MySQL database. I've alway used an INT for IPv4 + a TINYINT for masklen, but IPv6 is 128 bit.
What approach will be best for that? 2xBIGINT
? CHAR(16)
for binary storage? CHAR(39)
for text storage? 8xSMALLINT
in a dedicated table?
What would you recommend?