| |||||||||||||||||||||||||||||||
|
|->if you really want to put cidr nets in mysql, then you can either use |->inet_aton or between depending how you store the networks. |-> |->you can have {network, mask, action} columns, in which case you can use |-> |->query = select action where '%s' & mask = network & mask |-> |->an alternative is to store {start, end, action} where start and end are |->the first and last IP in "binary" form (a 32 bits integer). then you can |->use between. |-> |->In both cases, you'll have a problem with hostnames (inet_aton error). |->you can "prevent" this using a REGEXP call. but then it's too much, |->isn't it? |-> |->if what you want is the ability to manage the infos in mysql, then do |->that but dump the table (periodically or at update time). After seeing whats involved with that, I prefer to keep it simple and a flat text file is as simple as it gets. That file changes so rarely its not worth the effort to store it into a database. Thanks for the info though. Keith
| ||||||||||||||||||||||||||||||
© 2004-2008 readlist.com