bindings: Version update and ndnSIM-related updates
- Now requiring a customized version of pybindgen (necessary for ndnSIM bindings) - Fixed ndnSIM FIB/CS/PIT visualizer plugins to work with ndnSIM-v2 codebase
This commit is contained in:
@@ -12,8 +12,8 @@ from waflib.Errors import WafError
|
||||
# feature = TaskGen.feature
|
||||
# after = TaskGen.after
|
||||
|
||||
# https://github.com/gjcarneiro/pybindgen
|
||||
REQUIRED_PYBINDGEN_VERSION = '0.17.0.post41+ngd10fa60'
|
||||
# https://github.com/named-data-ndnSIM/pybindgen
|
||||
REQUIRED_PYBINDGEN_VERSION = '0.17.0.post45+ng4806e4f'
|
||||
REQUIRED_PYGCCXML_VERSION = (0, 9, 5)
|
||||
|
||||
RUN_ME=-3
|
||||
|
||||
@@ -3,7 +3,7 @@ import gtk
|
||||
import ns.core
|
||||
import ns.network
|
||||
import ns.internet
|
||||
import ns.ndnSIM
|
||||
from ns.ndnSIM import ndn
|
||||
|
||||
from visualizer.base import InformationWindow
|
||||
|
||||
@@ -53,23 +53,17 @@ class ShowNdnCs(InformationWindow):
|
||||
self.visualizer.remove_information_window(self)
|
||||
|
||||
def update(self):
|
||||
ndnCs = ns.ndnSIM.ndn.ContentStore.GetContentStore (self.node)
|
||||
ndnCs = ndn.L3Protocol.getL3Protocol(self.node).getForwarder().getCs()
|
||||
|
||||
if ndnCs is None:
|
||||
return
|
||||
|
||||
self.table_model.clear()
|
||||
|
||||
values = []
|
||||
item = ndnCs.Begin ()
|
||||
while (item != ndnCs.End ()):
|
||||
values.append (str(item.GetName ()))
|
||||
item = ndnCs.Next (item)
|
||||
|
||||
for value in sorted(values):
|
||||
for item in ndnCs:
|
||||
tree_iter = self.table_model.append()
|
||||
self.table_model.set(tree_iter,
|
||||
self.COLUMN_PREFIX, value)
|
||||
self.COLUMN_PREFIX, item.getName())
|
||||
|
||||
def populate_node_menu(viz, node, menu):
|
||||
menu_item = gtk.MenuItem("Show NDN CS")
|
||||
|
||||
@@ -3,7 +3,7 @@ import gtk
|
||||
import ns.core
|
||||
import ns.network
|
||||
import ns.internet
|
||||
import ns.ndnSIM
|
||||
from ns.ndnSIM import ndn
|
||||
|
||||
from visualizer.base import InformationWindow
|
||||
|
||||
@@ -61,20 +61,18 @@ class ShowNdnFib(InformationWindow):
|
||||
self.visualizer.remove_information_window(self)
|
||||
|
||||
def update(self):
|
||||
ndnFib = ns.ndnSIM.ndn.Fib.GetFib (self.node)
|
||||
|
||||
ndnFib = ndn.L3Protocol.getL3Protocol(self.node).getForwarder().getFib()
|
||||
|
||||
if ndnFib is None:
|
||||
return
|
||||
|
||||
self.table_model.clear()
|
||||
|
||||
item = ndnFib.Begin ()
|
||||
while (item != ndnFib.End ()):
|
||||
|
||||
for item in ndnFib:
|
||||
tree_iter = self.table_model.append()
|
||||
self.table_model.set(tree_iter,
|
||||
self.COLUMN_PREFIX, str(item.GetPrefix()),
|
||||
self.COLUMN_FACE, str(item))
|
||||
item = ndnFib.Next (item)
|
||||
self.COLUMN_PREFIX, str(item.getPrefix()),
|
||||
self.COLUMN_FACE, ", ".join(["%s%d (%d)" % (str(nh.getFace()), nh.getFace().getId(), nh.getCost()) for nh in item.getNextHops()]))
|
||||
|
||||
def populate_node_menu(viz, node, menu):
|
||||
menu_item = gtk.MenuItem("Show NDN FIB")
|
||||
|
||||
@@ -3,7 +3,7 @@ import gtk
|
||||
import ns.core
|
||||
import ns.network
|
||||
import ns.internet
|
||||
import ns.ndnSIM
|
||||
from ns.ndnSIM import ndn
|
||||
|
||||
from visualizer.base import InformationWindow
|
||||
|
||||
@@ -27,7 +27,7 @@ class ShowNdnPit(InformationWindow):
|
||||
if len(node_name) != 0:
|
||||
title += " (" + str(node_name) + ")"
|
||||
|
||||
self.win.set_title (title)
|
||||
self.win.set_title (title)
|
||||
self.visualizer = visualizer
|
||||
self.node_index = node_index
|
||||
|
||||
@@ -42,7 +42,7 @@ class ShowNdnPit(InformationWindow):
|
||||
sw.add(treeview)
|
||||
self.win.vbox.add(sw)
|
||||
self.win.set_default_size(600, 300)
|
||||
|
||||
|
||||
# Dest.
|
||||
column = gtk.TreeViewColumn('Prefix', gtk.CellRendererText(),
|
||||
text=self.COLUMN_PREFIX)
|
||||
@@ -59,22 +59,20 @@ class ShowNdnPit(InformationWindow):
|
||||
def _response_cb(self, win, response):
|
||||
self.win.destroy()
|
||||
self.visualizer.remove_information_window(self)
|
||||
|
||||
|
||||
def update(self):
|
||||
ndnPit = ns.ndnSIM.ndn.Pit.GetPit (self.node)
|
||||
|
||||
ndnPit = ndn.L3Protocol.getL3Protocol(self.node).getForwarder().getPit()
|
||||
|
||||
if ndnPit is None:
|
||||
return
|
||||
|
||||
self.table_model.clear()
|
||||
|
||||
item = ndnPit.Begin ()
|
||||
while (item != ndnPit.End ()):
|
||||
|
||||
for item in ndnPit:
|
||||
tree_iter = self.table_model.append()
|
||||
self.table_model.set(tree_iter,
|
||||
self.COLUMN_PREFIX, str(item.GetPrefix()),
|
||||
self.COLUMN_FACE, str(item))
|
||||
item = ndnPit.Next (item)
|
||||
self.COLUMN_PREFIX, str(item.getName()),
|
||||
self.COLUMN_FACE, str(item.getInterest()))
|
||||
|
||||
def populate_node_menu(viz, node, menu):
|
||||
menu_item = gtk.MenuItem("Show NDN PIT")
|
||||
|
||||
Reference in New Issue
Block a user