39 @param self this object
40 @param visualizer visualizer object
41 @param node_index the node index
43 InformationWindow.__init__(self)
44 self.
win = Gtk.Dialog(
45 parent=visualizer.window,
46 flags=Gtk.DialogFlags.DESTROY_WITH_PARENT,
47 buttons=(
"_Close", Gtk.ResponseType.CLOSE),
49 self.
win.set_default_size(Gdk.Screen.width() / 2, Gdk.Screen.height() / 2)
51 self.
win.set_title(
"OLSR routing table for node %i" % node_index)
59 sw = Gtk.ScrolledWindow()
61 hscrollbar_policy=Gtk.PolicyType.AUTOMATIC, vscrollbar_policy=Gtk.PolicyType.AUTOMATIC
68 column = Gtk.TreeViewColumn(
71 treeview.append_column(column)
74 column = Gtk.TreeViewColumn(
"Next hop", Gtk.CellRendererText(), text=self.
COLUMN_NEXT_HOP)
75 treeview.append_column(column)
78 column = Gtk.TreeViewColumn(
"Interface", Gtk.CellRendererText(), text=self.
COLUMN_INTERFACE)
79 treeview.append_column(column)
82 column = Gtk.TreeViewColumn(
"Num. Hops", Gtk.CellRendererText(), text=self.
COLUMN_NUM_HOPS)
83 treeview.append_column(column)
102 @param self this object
106 ipv4 = node.GetObject(ns.Ipv4.GetTypeId())
107 olsr = ns3_node.GetObject[ns.olsr.RoutingProtocol]()
112 for route
in olsr.__deref__().GetRoutingTableEntries():
114 netdevice = ipv4.GetNetDevice(route.interface)
115 if netdevice
is None:
116 interface_name =
"lo"
118 interface_name = ns.Names.FindName(netdevice)
119 if not interface_name:
120 interface_name =
"(interface %i)" % route.interface