Committed by
Gerrit Code Review
Fixed Typos
Fixed the issue of LINC not sending traffic through taps. -Solved by creating and bring taps UP before LINC gets started. Change-Id: I145f5357f984befc549ed02cd57b13b7e0f7ff3c
Showing
1 changed file
with
27 additions
and
0 deletions
... | @@ -264,6 +264,9 @@ def startOE( net ): | ... | @@ -264,6 +264,9 @@ def startOE( net ): |
264 | output = quietRun( 'cp -v sys.config %s/rel/linc/releases/1.0/' % lincDir, shell=True ).strip( '\n' ) | 264 | output = quietRun( 'cp -v sys.config %s/rel/linc/releases/1.0/' % lincDir, shell=True ).strip( '\n' ) |
265 | info( output + '\n' ) | 265 | info( output + '\n' ) |
266 | 266 | ||
267 | + info( '*** Adding taps and bring them up...\n' ) | ||
268 | + setupInts( getTaps() ) | ||
269 | + | ||
267 | info( '*** Starting linc OE...\n' ) | 270 | info( '*** Starting linc OE...\n' ) |
268 | output = quietRun( '%s/rel/linc/bin/linc start' % lincDir, shell=True ) | 271 | output = quietRun( '%s/rel/linc/bin/linc start' % lincDir, shell=True ) |
269 | if output: | 272 | if output: |
... | @@ -387,6 +390,30 @@ def findTap( node, port, path=None ): | ... | @@ -387,6 +390,30 @@ def findTap( node, port, path=None ): |
387 | if 'port,%s' % port in intfLine: | 390 | if 'port,%s' % port in intfLine: |
388 | return re.findall( 'tap\d+', intfLine )[ 0 ] | 391 | return re.findall( 'tap\d+', intfLine )[ 0 ] |
389 | 392 | ||
393 | +def getTaps(path = None): | ||
394 | + ''' | ||
395 | + return list of all the tops in sys.config | ||
396 | + ''' | ||
397 | + if path is None: | ||
398 | + lincDir = findDir( 'linc-oe' ) | ||
399 | + if not lincDir: | ||
400 | + error( '***ERROR: Could not find linc-oe in users home directory\n' ) | ||
401 | + return None | ||
402 | + path = '%s/rel/linc/releases/1.0/sys.config' % lincDir | ||
403 | + fd = open( path, 'r', 0 ) | ||
404 | + sys_data = fd.read() | ||
405 | + taps = re.findall( 'tap\d+', sys_data ) | ||
406 | + fd.close() | ||
407 | + return taps | ||
408 | + | ||
409 | +def setupInts(intfs): | ||
410 | + ''' | ||
411 | + add taps and bring them up. | ||
412 | + ''' | ||
413 | + for i in intfs: | ||
414 | + quietRun( 'ip tuntap add dev %s mode tap' %i ) | ||
415 | + quietRun( 'ip link set dev %s up' % i ) | ||
416 | + info( '*** Intf %s set\n' % i ) | ||
390 | 417 | ||
391 | class MininetOE( Mininet ): | 418 | class MininetOE( Mininet ): |
392 | "Mininet with Linc-OE support (starts and stops linc-oe)" | 419 | "Mininet with Linc-OE support (starts and stops linc-oe)" | ... | ... |
-
Please register or login to post a comment