# encoding: UTF-8 # Copyright (c) 2018 António Meireles. All Rights Reserved. require 'tempfile' require 'ipaddr' require 'log4r' # Borrowed from http://stackoverflow.com/questions/1825928/netmask-to-cidr-in-ruby IPAddr.class_eval do def to_cidr to_i.to_s(2).count('1') end end STATIC_NETWORK = <