New functions
diff --git a/mininet/cli.py b/mininet/cli.py
index efb1808..e2c7099 100644
--- a/mininet/cli.py
+++ b/mininet/cli.py
@@ -35,11 +35,12 @@
from mininet.log import info, output, error
from mininet.term import makeTerms
from mininet.util import quietRun, isShellBuiltin, dumpNodeConnections
+from mininet.node import CCNHost
class CLI( Cmd ):
"Simple command-line interface to talk to nodes."
- prompt = 'mininet> '
+ prompt = 'miniccnx> '
def __init__( self, mininet, stdin=sys.stdin, script=None ):
self.mn = mininet
@@ -201,6 +202,16 @@
for node in self.nodelist:
output( '%s: %s\n' %
( node.name, ','.join( node.intfNames() ) ) )
+
+ def do_ccndump(self, _line):
+ "Dump FIB entries"
+ for node in self.nodelist:
+ if 'fib' in node.params:
+ output(node.name + ': ')
+ for name in node.params['fib']:
+ output(str(name) + ' ')
+ output('\n')
+
def do_dump( self, _line ):
"Dump node info."
diff --git a/mininet/conf_parser.py b/mininet/conf_parser.py
index 642b4b1..c9fe119 100644
--- a/mininet/conf_parser.py
+++ b/mininet/conf_parser.py
@@ -2,14 +2,15 @@
class confCCNHost():
- def __init__(self, name, app='', uri_tuples='', cpu=None):
+ def __init__(self, name, app='', uri_tuples='', cpu=None, cores=None):
self.name = name
self.app = app
self.uri_tuples = uri_tuples
self.cpu = cpu
+ self.cores = cores
def __repr__(self):
- return 'Name: ' + self.name + ' App: ' + self.app + ' URIS: ' + str(self.uri_tuples) + ' CPU:' + str(self.cpu)
+ return 'Name: ' + self.name + ' App: ' + self.app + ' URIS: ' + str(self.uri_tuples) + ' CPU:' + str(self.cpu) + ' Cores:' +str(self.cores)
class confCCNLink():
@@ -41,13 +42,17 @@
uris = rest
uri_list=[]
cpu = None
+ cores = None
+
for uri in uris:
if re.match("cpu",uri):
cpu = float(uri.split('=')[1])
+ elif re.match("cores",uri):
+ cores = uri.split('=')[1]
else:
uri_list.append((uri.split(',')[0],uri.split(',')[1]))
- hosts.append(confCCNHost(name , app, uri_list,cpu))
+ hosts.append(confCCNHost(name , app, uri_list,cpu,cores))
return hosts
@@ -68,14 +73,17 @@
uris = rest
uri_list=[]
cpu = None
+ cores = None
for uri in uris:
if re.match("cpu",uri):
cpu = float(uri.split('=')[1])
+ elif re.match("cores",uri):
+ cores = uri.split('=')[1]
else:
uri_list.append((uri.split(',')[0],uri.split(',')[1]))
- routers.append(confCCNHost(name=name , uri_tuples=uri_list, cpu=cpu))
+ routers.append(confCCNHost(name=name , uri_tuples=uri_list, cpu=cpu, cores=cores))
return routers
@@ -104,7 +112,7 @@
arg_name, arg_value = arg.split('=')
key = arg_name
value = arg_value
- if key in ['loss','bw','jitter']:
+ if key in ['loss','bw','jitter','max_queue_size']:
value = int(value)
link_dict[key] = value
diff --git a/mininet/link.py b/mininet/link.py
index 21e18ba..6c9dd7d 100644
--- a/mininet/link.py
+++ b/mininet/link.py
@@ -181,6 +181,7 @@
latency_ms=None, enable_ecn=False, enable_red=False ):
"Return tc commands to set bandwidth"
+
cmds, parent = [], ' root '
if bw and ( bw < 0 or bw > 1000 ):
@@ -232,6 +233,7 @@
def delayCmds( parent, delay=None, jitter=None,
loss=None, max_queue_size=None ):
"Internal method: return tc commands for delay and loss"
+
cmds = []
if delay and delay < 0:
error( 'Negative delay', delay, '\n' )
diff --git a/mininet/node.py b/mininet/node.py
index 99d2cc5..f8ec8c9 100644
--- a/mininet/node.py
+++ b/mininet/node.py
@@ -52,7 +52,7 @@
from mininet.log import info, error, warn, debug
from mininet.util import ( quietRun, errRun, errFail, moveIntf, isShellBuiltin,
- numCores, retry, mountCgroups )
+ numCores, retry, mountCgroups, run )
from mininet.moduledeps import moduleDeps, pathCheck, OVS_KMOD, OF_KMOD, TUN
from mininet.link import Link, Intf, TCIntf
@@ -592,7 +592,8 @@
"Return value of cgroup parameter"
cmd = 'cgget -r %s.%s /%s' % (
resource, param, self.name )
- return int( quietRun( cmd ).split()[ -1 ] )
+
+ return int(quietRun( cmd ).split()[ -1 ] )
def cgroupDel( self ):
"Clean up our cgroup"
@@ -724,7 +725,7 @@
Host.__init__( self, name, **kwargs )
if not CCNHost.inited:
CCNHost.init()
-
+
self.cmd("export CCN_LOCAL_SOCKNAME=/tmp/.sock.ccnx.{0}".format(self.name))
self.cmd("ccndstart")
self.peerList = {}