nrvr.util.ipaddress
index
/usr/lib/python2.7/site-packages/nrvr/util/ipaddress.py

nrvr.util.ipaddress - Utilities regarding IP addresses
 
Class provided by this module is IPAddress.
 
Works in Linux and Windows.
 
Idea and first implementation - Leo Baschy <srguiwiz12 AT nrvr DOT com>
 
Contributor - Nora Baschy
 
Public repository - https://github.com/srguiwiz/nrvr-commander
 
Copyright (c) Nirvana Research 2006-2015.
Simplified BSD License

 
Modules
       
re

 
Classes
       
__builtin__.object
IPAddress

 
class IPAddress(__builtin__.object)
    Methods for multiple machines on one subnet.
 
As implemented only supports IPv4.
 
  Class methods defined here:
asInteger(cls, ipaddress) from __builtin__.type
For ipaddress=[10, 123, 45, 67] return 175844675.
 
At the time of this writing, such an integer however is
not accepted as input by other methods of this class.
asList(cls, ipaddress, rangeCheck=False) from __builtin__.type
For ipaddress="10.123.45.67" return mutable [10, 123, 45, 67].
 
If already a list, a copy is made and returned.
asString(cls, ipaddress) from __builtin__.type
For ipaddress=[10, 123, 45, 67] return "10.123.45.67".
asTuple(cls, ipaddress) from __builtin__.type
For ipaddress="10.123.45.67" return immutable (10, 123, 45, 67).
bitAnd(cls, one, other) from __builtin__.type
bitNot(cls, one) from __builtin__.type
bitOr(cls, one, other) from __builtin__.type
nameWithNumber(cls, stem, ipaddress, octets=1, separator='-') from __builtin__.type
For stem="example" and ipaddress="10.123.45.67" return "example-067".
 
If octets=2 return "example-045-067".
numberWithinSubnet(cls, oneInSubnet, otherNumber, netmask='255.255.255.0') from __builtin__.type
For oneInSubnet="10.123.45.67" and otherNumber="89" return [10, 123, 45, 89].
 
For oneInSubnet="10.123.45.67" and otherNumber="89.34" and netmask="255.255.0.0" return [10, 123, 89, 34].

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes defined here:
octetsRegex = <_sre.SRE_Pattern object>