Revision c916f3ee mininet/node.py
mininet/node.py | ||
---|---|---|
58 | 58 |
from mininet.util import ( quietRun, errRun, errFail, moveIntf, isShellBuiltin, |
59 | 59 |
numCores, retry, mountCgroups ) |
60 | 60 |
from mininet.moduledeps import moduleDeps, pathCheck, OVS_KMOD, OF_KMOD, TUN |
61 |
from mininet.link import Link, Intf, TCIntf |
|
61 |
from mininet.link import Link, Intf, TCIntf, OVSIntf
|
|
62 | 62 |
from re import findall |
63 | 63 |
from distutils.version import StrictVersion |
64 | 64 |
|
... | ... | |
1145 | 1145 |
return True |
1146 | 1146 |
return self.failMode == 'standalone' |
1147 | 1147 |
|
1148 |
@staticmethod |
|
1149 |
def patchOpts( intf ): |
|
1150 |
"Return OVS patch port options (if any) for intf" |
|
1151 |
if type( intf ) is not OVSIntf: |
|
1152 |
# Ignore if it's not a patch link |
|
1153 |
return '' |
|
1154 |
intf1, intf2 = intf.link.intf1, intf.link.intf2 |
|
1155 |
peer = intf1 if intf1 != intf else intf2 |
|
1156 |
return ( '-- set Interface %s type=patch ' |
|
1157 |
'-- set Interface %s options:peer=%s ' % |
|
1158 |
( intf, intf, peer ) ) |
|
1159 |
|
|
1148 | 1160 |
def start( self, controllers ): |
1149 | 1161 |
"Start up a new OVS OpenFlow switch using ovs-vsctl" |
1150 | 1162 |
if self.inNamespace: |
... | ... | |
1157 | 1169 |
intfs = ' '.join( '-- add-port %s %s ' % ( self, intf ) + |
1158 | 1170 |
'-- set Interface %s ' % intf + |
1159 | 1171 |
'ofport_request=%s ' % self.ports[ intf ] |
1172 |
+ self.patchOpts( intf ) |
|
1160 | 1173 |
for intf in self.intfList() |
1161 | 1174 |
if self.ports[ intf ] and not intf.IP() ) |
1162 | 1175 |
clist = ' '.join( '%s:%s:%d' % ( c.protocol, c.IP(), c.port ) |
Also available in: Unified diff