class documentation

class AddressPool(object):

View In Hierarchy

Address pool class, wrapping an objects.Network object.

This class provides methods to manipulate address pools, backed by objects.Network objects.

Class Method InitializeNetwork Initialize an objects.Network object.
Method __init__ Initialize a new IPv4 address pool from an objects.Network object.
Method Contains Undocumented
Method GenerateFree Returns the first free address of the network.
Method GetExternalReservations Returns a list of all externally reserved addresses.
Method GetFreeAddress Returns the first available address.
Method GetFreeCount Get the count of unused addresses.
Method GetMap Return a textual representation of the network's occupation status.
Method GetReservedCount Get the count of reserved addresses.
Method IsFull Check whether the network is full.
Method IsReserved Checks if the given IP is reserved.
Method Release Release a given address reservation.
Method Reserve Mark an address as used.
Method Update Write address pools back to the network object.
Method Validate Undocumented
Constant FREE Undocumented
Constant RESERVED Undocumented
Instance Variable ext_reservations Undocumented
Instance Variable gateway Undocumented
Instance Variable gateway6 Undocumented
Instance Variable net Undocumented
Instance Variable network Undocumented
Instance Variable network6 Undocumented
Instance Variable reservations Undocumented
Property all_reservations Return a combined map of internal and external reservations.
Method _GetAddrIndex Undocumented
Method _GetSize Undocumented
Method _Mark Undocumented
@classmethod
def InitializeNetwork(cls, net):

Initialize an objects.Network object.

Reserve the network, broadcast and gateway IP addresses.

def __init__(self, network):

Initialize a new IPv4 address pool from an objects.Network object.

Parameters
network:objects.Networkthe network object from which the pool will be generated
def Contains(self, address):

Undocumented

def GenerateFree(self):

Returns the first free address of the network.

Raises
errors.AddressPoolErrorPool is full
def GetExternalReservations(self):

Returns a list of all externally reserved addresses.

def GetFreeAddress(self):

Returns the first available address.

def GetFreeCount(self):

Get the count of unused addresses.

def GetMap(self):

Return a textual representation of the network's occupation status.

def GetReservedCount(self):

Get the count of reserved addresses.

def IsFull(self):

Check whether the network is full.

def IsReserved(self, address, external=False):

Checks if the given IP is reserved.

def Release(self, address, external=False):

Release a given address reservation.

def Reserve(self, address, external=False):

Mark an address as used.

def Update(self):

Write address pools back to the network object.

def Validate(self):

Undocumented

FREE =

Undocumented

Value
bitarray('0')
RESERVED =

Undocumented

Value
bitarray('1')
ext_reservations =

Undocumented

gateway =

Undocumented

gateway6 =

Undocumented

net =

Undocumented

network =

Undocumented

network6 =

Undocumented

reservations =

Undocumented

@property
all_reservations =

Return a combined map of internal and external reservations.

def _GetAddrIndex(self, address):

Undocumented

def _GetSize(self):

Undocumented

def _Mark(self, address, value=True, external=False):

Undocumented