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

Method intf

mininet/node.py:485–499  ·  view source on GitHub ↗

Return our interface object with given string name, default intf if name is falsy (None, empty string, etc). or the input intf arg. Having this fcn return its arg for Intf objects makes it easier to construct functions with flexible input args for inter

( self, intf=None )

Source from the content-addressed store, hash-verified

483 return None
484
485 def intf( self, intf=None ):
486 """Return our interface object with given string name,
487 default intf if name is falsy (None, empty string, etc).
488 or the input intf arg.
489
490 Having this fcn return its arg for Intf objects makes it
491 easier to construct functions with flexible input args for
492 interfaces (those that accept both string names and Intf objects).
493 """
494 if not intf:
495 return self.defaultIntf()
496 elif isinstance( intf, BaseString):
497 return self.nameToIntf[ intf ]
498 else:
499 return intf
500
501 def connectionsTo( self, node):
502 "Return [ intf1, intf2... ] for all intfs that connect self to node."

Callers 7

setMACMethod · 0.95
setIPMethod · 0.95
IPMethod · 0.95
MACMethod · 0.95
intfIsUpMethod · 0.95
testLocalPingMethod · 0.80
testExternalPingMethod · 0.80

Calls 1

defaultIntfMethod · 0.95

Tested by 2

testLocalPingMethod · 0.64
testExternalPingMethod · 0.64