IP Math anyone?

Chris Gonnerman chris.gonnerman at usa.net
Tue Feb 27 08:38:56 EST 2001


You neglected to tell us where to download your class from, or to attach
the source.  I at least would like to see it.

----- Original Message -----
From: "Tino Wildenhain" <tino at wildenhain.de>
Subject: Re: IP Math anyone?
> Hi Timothy,
>
> for teaching I made a class for this.
>
> you can instantiate it with a=ip('192.168.0.254/24') or
> a=ip('192.168.0.254','255.255.255.0') just using a=ip('192.168.0.254')
> would assign a appropriate subnet mask for this class (class B results in
> /16 or 255.255.0.0)
>
> Since IP-adresses are only 32bit non signed integers, they are internally
> represented
> like that.
> If you make a class like that you can simply add the support to add
> integers to
> it according to the subnet-mask you use.
>
> Regards
> Tino






More information about the Python-list mailing list