netmask arithmetic?

D

Dan Stromberg

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?

Thanks!
 
C

Christos TZOTZIOY Georgiou

Dan said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,221
Messages
2,571,133
Members
47,748
Latest member
LyleMondra

Latest Threads

Top