python implementation of *nix's ipcalc