name: name of node inNamespace: in network namespace? privateDirs: list of private directory strings or tuples params: Node parameters (see config() for details)
( self, name, inNamespace=True, **params )
| 81 | portBase = 0 # Nodes always start with eth0/port0, even in OF 1.0 |
| 82 | |
| 83 | def __init__( self, name, inNamespace=True, **params ): |
| 84 | """name: name of node |
| 85 | inNamespace: in network namespace? |
| 86 | privateDirs: list of private directory strings or tuples |
| 87 | params: Node parameters (see config() for details)""" |
| 88 | |
| 89 | # Make sure class actually works |
| 90 | self.checkSetup() |
| 91 | |
| 92 | self.name = params.get( 'name', name ) |
| 93 | self.privateDirs = params.get( 'privateDirs', [] ) |
| 94 | self.inNamespace = params.get( 'inNamespace', inNamespace ) |
| 95 | |
| 96 | # Python 3 complains if we don't wait for shell exit |
| 97 | self.waitExited = params.get( 'waitExited', Python3 ) |
| 98 | |
| 99 | # Stash configuration parameters for future reference |
| 100 | self.params = params |
| 101 | |
| 102 | # dict of port numbers to interfacse |
| 103 | self.intfs = {} |
| 104 | |
| 105 | # dict of interfaces to port numbers |
| 106 | # todo: replace with Port objects, eventually ? |
| 107 | self.ports = {} |
| 108 | |
| 109 | self.nameToIntf = {} # dict of interface names to Intfs |
| 110 | |
| 111 | # Make pylint happy |
| 112 | ( self.shell, self.execed, self.pid, self.stdin, self.stdout, |
| 113 | self.lastPid, self.lastCmd, self.pollOut ) = ( |
| 114 | None, None, None, None, None, None, None, None ) |
| 115 | self.waiting = False |
| 116 | self.readbuf = '' |
| 117 | |
| 118 | # Incremental decoder for buffered reading |
| 119 | self.decoder = getincrementaldecoder() |
| 120 | |
| 121 | # Start command interpreter shell |
| 122 | self.master, self.slave = None, None # pylint |
| 123 | self.startShell() |
| 124 | self.mountPrivateDirs() |
| 125 | |
| 126 | # File descriptor to node mapping support |
| 127 | # Class variables and methods |
nothing calls this directly
no test coverage detected