WHOIS inquiries and CIDR calculations

Hi,

The idea is to auto-feed a firewall with network addresses/ranges in the CIDR format, based on IP addresses from the logs.

  • read the log
  • extract the ip address
  • do a WHOIS lookup forth address to get the range
  • calculate the CIDR address

Anyone done this?