parameters: (self)
docstring: !
          Update function
          @param self this object
          @return none
docstring_summary: !
          Update function
docstring_tokens: ! Update function
function: def update(self):
          """!
          Update function
          @param self this object
          @return none
          """
          node = ns.network.NodeList.GetNode(self.node_index)
          ipv4 = node.GetObject(ns.internet.Ipv4.GetTypeId())
          routing = ipv4.GetRoutingProtocol()
          if routing is None:
              return
  
          routing_protocols = [] # list of (protocol, type_string, priority)
  
          if isinstance(routing, ns.internet.Ipv4StaticRouting):
              ipv4_routing = routing_protocols.append((routing, "static", 0))
          elif isinstance(routing, ns.internet.Ipv4ListRouting):
              list_routing = routing
              for rI in range(list_routing.GetNRoutingProtocols()):
                  routing, prio = list_routing.GetRoutingProtocol(rI)
                  if isinstance(routing, ns.internet.Ipv4StaticRouting):
                      routing_protocols.append((routing, "static", prio))
                  elif isinstance(routing, ns.internet.Ipv4GlobalRouting):
                      routing_protocols.append((routing, "global", prio))
          if not routing_protocols:
              return
  
          self.table_model.clear()
          for route_proto, type_string, prio in routing_protocols:
              for routeI in range(route_proto.GetNRoutes()):
                  route = route_proto.GetRoute(routeI)
                  tree_iter = self.table_model.append()
                  netdevice = ipv4.GetNetDevice(route.GetInterface())
                  if netdevice is None:
                      interface_name = 'lo'
                  else:
                      interface_name = ns.core.Names.FindName(netdevice)
                      if not interface_name:
                          interface_name = "(interface %i)" % route.GetInterface()
                  self.table_model.set(tree_iter,
                                       self.COLUMN_DESTINATION, str(route.GetDest()),
                                       self.COLUMN_NEXT_HOP, str(route.GetGateway()),
                                       self.COLUMN_INTERFACE, interface_name,
                                       self.COLUMN_TYPE, type_string,
                                       self.COLUMN_PRIO, prio)
function_tokens: def update ( self ) : node = ns . network . NodeList . GetNode ( self . node_index ) ipv4 = node . GetObject ( ns . internet . Ipv4 . GetTypeId ( ) ) routing = ipv4 . GetRoutingProtocol ( ) if routing is None : return routing_protocols = [ ] # list of (protocol, type_string, priority) if isinstance ( routing , ns . internet . Ipv4StaticRouting ) : ipv4_routing = routing_protocols . append ( ( routing , "static" , 0 ) ) elif isinstance ( routing , ns . internet . Ipv4ListRouting ) : list_routing = routing for rI in range ( list_routing . GetNRoutingProtocols ( ) ) : routing , prio = list_routing . GetRoutingProtocol ( rI ) if isinstance ( routing , ns . internet . Ipv4StaticRouting ) : routing_protocols . append ( ( routing , "static" , prio ) ) elif isinstance ( routing , ns . internet . Ipv4GlobalRouting ) : routing_protocols . append ( ( routing , "global" , prio ) ) if not routing_protocols : return self . table_model . clear ( ) for route_proto , type_string , prio in routing_protocols : for routeI in range ( route_proto . GetNRoutes ( ) ) : route = route_proto . GetRoute ( routeI ) tree_iter = self . table_model . append ( ) netdevice = ipv4 . GetNetDevice ( route . GetInterface ( ) ) if netdevice is None : interface_name = 'lo' else : interface_name = ns . core . Names . FindName ( netdevice ) if not interface_name : interface_name = "(interface %i)" % route . GetInterface ( ) self . table_model . set ( tree_iter , self . COLUMN_DESTINATION , str ( route . GetDest ( ) ) , self . COLUMN_NEXT_HOP , str ( route . GetGateway ( ) ) , self . COLUMN_INTERFACE , interface_name , self . COLUMN_TYPE , type_string , self . COLUMN_PRIO , prio )