Home | Trees | Indices | Help |
---|
|
IPint --+ | IP
Class for handling IP Addresses and Networks.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from |
|
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')
|
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')
|
Return netmask as an IP object. >>> IP('10.0.0.0/8').netmask() IP('255.0.0.0')
|
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.'] |
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. |
Called to implement evaluation of self[key]. >>> ip=IP('127.0.0.0/30') >>> for x in ip: ... print str(x) ... 127.0.0.0 127.0.0.1 127.0.0.2 127.0.0.3 >>> print str(ip[2]) 127.0.0.2 >>> print str(ip[-1]) 127.0.0.3
|
Print a representation of the Object. >>> IP('10.0.0.0/8') IP('10.0.0.0/8')
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Wed Jun 9 23:05:09 2010 | http://epydoc.sourceforge.net |