MCPcopy Create free account
hub / github.com/mininet/mininet / __init__

Method __init__

mininet/node.py:83–124  ·  view source on GitHub ↗

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 )

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

checkSetupMethod · 0.95
startShellMethod · 0.95
mountPrivateDirsMethod · 0.95
getincrementaldecoderFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected