Hi,

My table looks like this:
ipv4addr (INT, PK)
status (INT)

status: 0 = free 1 = used

I'm trying to get free IP addresses by only giving CIDR (0 to 32) or
netmask (0.0.0.0 to 255.255.255.255).

The output should be one of them:
1. <start IP>
2. <start IP> <CIDR>
3. <start IP <Netmask>
4. <start IP> <end IP>

Let's say I have ipv4addr from 3232235520 to 3232235775 and 3232235525 is used.
I try SELECT with CIDR 25. I get 3232235648 as answer, because
3232235520-3232235647 is used (one used address).

Is this kind of SELECT query even possible?

Currently I SELECT all free addresses and run them in separate
function in PHP. But it would be nice to run the whole thing in DB for
effeciency.

--
Pekka Järvinen

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to