File: README.Debian

package info (click to toggle)
python-ipcalc 0.3-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, squeeze, wheezy
  • size: 68 kB
  • ctags: 44
  • sloc: python: 418; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 753 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
ipcalc for Debian
-----------------

This module allows you to perform IP subnet calculations, there is support for both IPv4 and IPv6 CIDR notation.

Example Usage: 

>>> from ipcalc import IP, Network
>>> for x in Network('172.16.42.0/30'):
...     print str(x)
...
172.16.42.0
172.16.42.1
172.16.42.2
172.16.42.3
>>> subnet = Network('2001:beef:babe::/48')
>>> print str(subnet.network())
2001:beef:babe:0000:0000:0000:0000:0000
>>> print str(subnet.netmask())
ffff:ffff:ffff:0000:0000:0000:0000:0000
>>> '192.168.42.23' in Network('192.168.42.0/24')
True
>>> long(IP('fe80::213:ceff:fee8:c937'))
338288524927261089654168587652869703991L
>>> IP('127.1.2') == '127.1.0.2'
True

 -- MEZGANI Ali <mezgani@linuxmail.org>  Wed, 17 Jun 2009 01:33:25 +0200