Home | Trees | Index | Help |
---|
Package PyFoam :: Package ThirdParty :: Module IPy :: Class IP |
|
IPint
--+
|
IP
Method Summary | |
---|---|
Emulate numeric objects through network aggregation | |
Called to implement evaluation of self[key]. | |
Print a representation of the Object. | |
Return the broadcast (last) address of a network as an IP object. | |
Return the base (first) address of a network as an IP object. | |
Return netmask as an IP object. | |
Return the value for reverse lookup/PTR records as RfC 2317 look alike. | |
Return a list with values forming the reverse lookup. | |
Inherited from IPint | |
Create an instance of an IP object. | |
Called by comparison operations. | |
Called to implement membership test operators. | |
Called for the key object for dictionary operations, and by the built-in function hash() Should return a 32-bit integer usable as a hash value for dictionary operations. | |
Return the length of an subnet. | |
All IPy objects should evaluate to true in boolean context. | |
Dispatch to the prefered String Representation. | |
Return the first / base / network addess as an (long) integer. | |
Return a description of the IP type ('PRIVATE', 'RESERVERD', etc). | |
Return the length of an subnet. | |
Check if two IP address ranges overlap. | |
Returns Network Prefixlen. | |
Return a string representation as a binary value. | |
Return a string representation in compressed format using '::' Notation. | |
Return a string representation in decimal format. | |
Return a string representation in the non mangled format. | |
Return a string representation in hex format in lower case. | |
Return netmask as an string. | |
Return a string representation in the usual format. | |
Return the IP version of this Object. | |
Prints Prefixlen/Netmask. |
Method Details |
---|
__add__(self,
other)
Emulate numeric objects through network aggregation
|
__getitem__(self,
key)
Called to implement evaluation of self[key].
|
__repr__(self)
Print a representation of the Object.
|
broadcast(self)Return the broadcast (last) address of a network as an IP object. The same as IP[-1].>>> IP('10.0.0.0/8').broadcast() IP('10.255.255.255')
|
net(self)Return the base (first) address of a network as an IP object. The same as IP[0].>>> IP('10.0.0.0/8').net() IP('10.0.0.0')
|
netmask(self)Return netmask as an IP object.>>> IP('10.0.0.0/8').netmask() IP('255.0.0.0')
|
reverseName(self)Return the value for reverse lookup/PTR records as RfC 2317 look alike. RfC 2317 is an ugly hack which only works for sub-/24 e.g. not for /23. Do not use it. Better set up a Zone for every address. See reverseName for a way to arcive that.>>> print IP('195.185.1.1').reverseName() 1.1.185.195.in-addr.arpa. >>> print IP('195.185.1.0/28').reverseName() 0-15.1.185.195.in-addr.arpa. |
reverseNames(self)Return a list with values forming the reverse lookup.>>> IP('213.221.113.87/32').reverseNames() ['87.113.221.213.in-addr.arpa.'] >>> IP('213.221.112.224/30').reverseNames() ['224.112.221.213.in-addr.arpa.', '225.112.221.213.in-addr.arpa.', '226.112.221.213.in-addr.arpa.', '227.112.221.213.in-addr.arpa.'] >>> IP('127.0.0.0/24').reverseNames() ['0.0.127.in-addr.arpa.'] >>> IP('127.0.0.0/23').reverseNames() ['0.0.127.in-addr.arpa.', '1.0.127.in-addr.arpa.'] >>> IP('127.0.0.0/16').reverseNames() ['0.127.in-addr.arpa.'] >>> IP('127.0.0.0/15').reverseNames() ['0.127.in-addr.arpa.', '1.127.in-addr.arpa.'] >>> IP('128.0.0.0/8').reverseNames() ['128.in-addr.arpa.'] >>> IP('128.0.0.0/7').reverseNames() ['128.in-addr.arpa.', '129.in-addr.arpa.'] |
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Mon Jan 22 23:52:48 2007 | http://epydoc.sf.net |