IP Math anyone?

Timothy Grant tjg at exceptionalminds.com
Tue Feb 27 14:08:30 EST 2001


Thanks to all of you who made this thread much more
enlightening than expected! As I expected, it is a somewhat
complex problem, for which I will probably throw together a
class with a nice interface but internals of which are a crude
hack, and then refine the internals as time allows.


On Tue, Feb 27, 2001 at 07:38:56AM -0600, Chris Gonnerman wrote:
> 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

-- 
Stand Fast,
    tjg.

Timothy Grant                         tjg at exceptionalminds.com
Red Hat Certified Engineer            www.exceptionalminds.com
Avalon Technology Group, Inc.         <><       (503) 246-3630
>>>>>>>>>>>>>Linux, because rebooting is *NOT* normal<<<<<<<<<
>>>>This machine was last rebooted:  41 days 23:20 hours ago<<




More information about the Python-list mailing list