Table of Contents

Class: CIDR daxfi/iplib.py

A CIDR address.

The representation of a Classless Inter-Domain Routing (CIDR) address.

Methods   
__contains__
__getattr__
__init__
__len__
__repr__
__str__
get_all_valid_ip
get_broadcast_ip
get_first_ip
get_ip
get_ip_number
get_last_ip
get_netmask
get_network_ip
is_valid_ip
set
  __contains__ 
__contains__ ( self,  item )

Return true if the given address in amongst the usable addresses.

  __getattr__ 
__getattr__ ( self,  name )

Called when an attribute lookup has not found the attribute.

Exceptions   
AttributeError, name
  __init__ 
__init__ (
        self,
        ip,
        netmask=None,
        )

  __len__ 
__len__ ( self )

Return the number of usable IP address.

  __repr__ 
__repr__ ( self )

The representation string for this netmask.

  __str__ 
__str__ ( self )

Print this CIDR address.

  get_all_valid_ip 
get_all_valid_ip ( self )

Return a list of IPv4Address objects, one for every usable IP.

WARNING: it's slow and can take a huge amount of memory for subnets with a large number of addresses.

  get_broadcast_ip 
get_broadcast_ip ( self )

Return the broadcast address.

  get_first_ip 
get_first_ip ( self )

Return the first usable IP address.

  get_ip 
get_ip ( self )

Return the given address.

  get_ip_number 
get_ip_number ( self )

Return the number of usable IP addresses.

  get_last_ip 
get_last_ip ( self )

Return the last usable IP address.

  get_netmask 
get_netmask ( self )

Return the netmask.

  get_network_ip 
get_network_ip ( self )

Return the network address.

  is_valid_ip 
is_valid_ip ( self,  ip )

Return true if the given address in amongst the usable addresses.

  set 
set (
        self,
        ip,
        netmask=None,
        )

Set the IP address and the netmask.

Exceptions   
ValueError, 'set: invalid CIDR: "' + str( ip ) + '"'

Table of Contents

This document was automatically generated on Tue Dec 17 17:48:18 2002 by HappyDoc version r1_5