Remove "FIB Entries" from NDN host options
refs: #2912
Change-Id: I4474c7c0aad3b4c6066f096c78934f561a2bf070
diff --git a/bin/minindnedit b/bin/minindnedit
index fa5d071..4299590 100755
--- a/bin/minindnedit
+++ b/bin/minindnedit
@@ -207,14 +207,12 @@
self.rootFrame = master
n = Notebook(self.rootFrame)
self.propFrame = Frame(n)
- self.fibFrame = Frame(n)
# NDN
self.nfdFrame = NfdFrame(n, self.prefValues)
self.nlsrFrame = NlsrFrame(n,self.prefValues)
n.add(self.propFrame, text='Properties')
- n.add(self.fibFrame, text='FIB Entries')
n.add(self.nfdFrame, text=self.nfdFrame.frameLabel)
n.add(self.nlsrFrame, text=self.nlsrFrame.frameLabel)
@@ -268,45 +266,12 @@
else:
self.startEntry= Entry(self.propFrame)
- ### TAB 2
- # FIB Entries
- self.fibEntries = 0
- Label(self.fibFrame, text="FIB Entry:").grid(row=0, column=0, sticky=E)
- self.fibButton = Button( self.fibFrame, text='Add', command=self.addEntry)
- self.fibButton.grid(row=0, column=1)
-
- self.fibFrame = VerticalScrolledTable(self.fibFrame, rows=0, columns=2, title='FIB Entries')
- self.fibFrame.grid(row=1, column=0, sticky='nswe', columnspan=2)
- self.fibTableFrame = self.fibFrame.interior
- self.fibTableFrame.addRow(value=['Prefix','Next Hop'], readonly=True)
-
- fibList = []
- if 'fibEntries' in self.prefValues:
- fibList = self.prefValues['fibEntries']
- for fibEntr in fibList:
- if isinstance( fibEntr, tuple ):
- self.fibTableFrame.addRow(value=fibEntr)
- else:
- self.fibTableFrame.addRow(value=[fibEntr,''])
-
- def addEntry( self ):
- self.fibTableFrame.addRow()
-
def apply(self):
- fibEntries = []
- for row in range(self.fibTableFrame.rows):
- if (len(self.fibTableFrame.get(row, 0)) > 0 and row > 0):
- if(len(self.fibTableFrame.get(row, 1)) > 0):
- fibEntries.append((self.fibTableFrame.get(row, 0), self.fibTableFrame.get(row, 1)))
- else:
- fibEntries.append(self.fibTableFrame.get(row, 0))
-
results = {'cpu': self.cpuEntry.get(),
'cache': self.cacheEntry.get(),
'mem': self.memEntry.get(),
'hostname':self.hostnameEntry.get(),
'startCommand':self.startEntry.get(),
- 'fibEntries':fibEntries,
'nfd': self.nfdFrame.getValues(),
'nlsr': self.nlsrFrame.getValues()
}
@@ -749,16 +714,6 @@
self.template_file = old_template_file
- def parseFibEntries ( self, fibEntries ):
- "Parse FIB Entries for write"
- result=''
-
- for fibEntry in fibEntries:
- entry = ','.join(map(str, fibEntry))
- result += entry + ' '
-
- return result
-
def buildTemplate( self ): #COPIA Mini-NDN para criar Template
"Generate template"
@@ -788,9 +743,6 @@
if 'mem' in hOpts:
mem=float(hOpts['mem'])/100
template.write('mem=' + repr(mem) + ' ')
- if 'fibEntries' in hOpts:
- customFib = self.parseFibEntries(hOpts['fibEntries'])
- template.write(customFib)
if 'nlsr' in hOpts:
values = hOpts['nlsr']
@@ -834,10 +786,6 @@
if 'cache' in rOpts:
template.write('cache=' + rOpts['cache'] + ' ')
hasOpt='True'
- if 'fibEntries' in rOpts:
- customFib = self.parseFibEntries(rOpts['fibEntries'])
- template.write(customFib)
- hasOpt='True'
if hasOpt == 'False':
template.write('_')
@@ -1488,8 +1436,6 @@
widget[ 'text' ] = name
if len(hostBox.result['cache']) > 0:
newHostOpts['cache'] = hostBox.result['cache']
- if len(hostBox.result['fibEntries']) > 0:
- newHostOpts['fibEntries'] = hostBox.result['fibEntries']
newHostOpts['nlsr'] = hostBox.nlsrFrame.getValues()
newHostOpts['nfd'] = hostBox.nfdFrame.getValues()
@@ -1516,8 +1462,6 @@
widget[ 'text' ] = name
if len(hostBox.result['cache']) > 0:
newRouterOpts['cache'] = hostBox.result['cache']
- if len(hostBox.result['fibEntries']) > 0:
- newRouterOpts['fibEntries'] = hostBox.result['fibEntries']
self.routerOpts[name] = newRouterOpts
print 'New host details for ' + name + ' = ' + str(newRouterOpts)
diff --git a/ndn/ndn_host.py b/ndn/ndn_host.py
index 0bed247..15bf245 100644
--- a/ndn/ndn_host.py
+++ b/ndn/ndn_host.py
@@ -103,12 +103,11 @@
self.peerList = {}
- def config(self, fib=None, app=None, cache=None, **params):
+ def config(self, app=None, cache=None, **params):
r = Node.config(self, **params)
- self.setParam(r, 'app', fib=fib) # why is this not app=app, to be investigated
- self.setParam(r, 'fib', app=app) # and this fib=fib
+ self.setParam(r, 'app', app=app)
self.setParam(r, 'cache', cache=cache)
return r
@@ -138,12 +137,11 @@
self.peerList = {}
- def config(self, fib=None, app=None, cpu=None, cores=None, cache=None, **params):
+ def config(self, app=None, cpu=None, cores=None, cache=None, **params):
r = CPULimitedHost.config(self,cpu,cores, **params)
- self.setParam(r, 'app', fib=fib) #????? shoud it be app=app
- self.setParam(r, 'fib', app=app)
+ self.setParam(r, 'app', app=app)
self.setParam(r, 'cache', cache=cache)
return r