Table of Contents

Class: Helper pyVC/Helpers/Router.py

This object defines a Helper object for an IP router

This object can be instantiated as: router = Helper(realmachine, networks, subnet = "192.168.1.0/24") realmachine = Machine networks = [Network, ...] subnet is a CIDR format subnet, in the form xxx.xxx.xxx.xxx/xx.

Derives from: pyVC.Helpers.Base

Base Classes   
Base.Helper
Methods   
__del__
__init__
__repr__
__str__
start
stop
  __del__ 
__del__ ( self )

  __init__ 
__init__ (
        self,
        realmachine,
        networks,
        subnet=None,
        **keywords,
        )

  __repr__ 
__repr__ ( self )

  __str__ 
__str__ ( self )

  start 
start ( self )

Starts the IP Router on the real Machine.

This method uses a shared class dictionary, named init, to ensure that enabling IP forwarding is only performed once on a real Machine.

This method also registers self.stop() as an atexit function, to ensure proper cleanup of processes and files.

router.start()

Exceptions   
MachineError, ( 'ERROR: cannot enable routing on architecture %s' %( self.realmachine.platform ), 'norouting', self.realmachine )
  stop 
stop ( self )

Stops the IP router on the real Machine.

This will only disable the NAT rules and not disable IP forwarding.

router.stop()


Table of Contents

This document was automatically generated on Thu Jan 18 11:28:09 2007 by HappyDoc version 2.1