netmask arithmetic?

Christos TZOTZIOY Georgiou tzot at sil-tec.gr
Mon Feb 28 03:32:56 EST 2005


On Sat, 26 Feb 2005 09:50:41 GMT, rumours say that Roel Schroeven
<rschroev_nospam_ml at fastmail.fm> might have written:

>Dan Stromberg wrote:
>> Before I go and reinvent the wheel, does anyone already have python code
>> that can do netmask arithmetic - for example, determining if a list of
>> hostnames are on subnets described by a list of networks+netmasks like:
>> 
>> 128.200.34.0/24
>> 128.195.16.128/25
>> 
>> ...and so on?

[Roel]
>http://pynms.sourceforge.net/ipv4.html

Damn... when I'd searched I didn't find anything, so I reinvented the wheel in

http://www.sil-tec.gr/~tzot/python/IPv4_Utils-0.35.linux-i586.tar.gz

It seems that ipv4 from pynms almost matches the functionality of my module,
except for a function (included_nets): given two hosts/nets, find the minimal
set of networks that include both hosts/nets.  Just in case Dan needs such a
function.
-- 
TZOTZIOY, I speak England very best.
"Be strict when sending and tolerant when receiving." (from RFC1958)
I really should keep that in mind when talking with people, actually...



More information about the Python-list mailing list