def request(self, adapter, npdu): if _debug: WhoIsRouterApplication._debug("request %r %r", adapter, npdu) # save a copy of the request self._request = npdu # forward it along BIPNetworkApplication.request(self, adapter, npdu)
def indication(self, adapter, npdu): if _debug: WhoIsRouterApplication._debug("indication %r %r", adapter, npdu) if isinstance(npdu, IAmRouterToNetwork): print("{} -> {}, {}".format(npdu.pduSource, npdu.pduDestination, npdu.iartnNetworkList)) BIPNetworkApplication.indication(self, adapter, npdu)
def indication(self, adapter, npdu): if _debug: WhoIsRouterApplication._debug("indication %r %r", adapter, npdu) if isinstance(npdu, IAmRouterToNetwork): print("{} -> {}, {}".format(npdu.pduSource, npdu.pduDestination, npdu.iartnNetworkList)) elif isinstance(npdu, InitializeRoutingTableAck): print("{} routing table".format(npdu.pduSource)) for rte in npdu.irtaTable: print(" {} {} {}".format(rte.rtDNET, rte.rtPortID, rte.rtPortInfo)) BIPNetworkApplication.indication(self, adapter, npdu)
def confirmation(self, adapter, npdu): if _debug: WhoIsRouterApplication._debug("confirmation %r %r", adapter, npdu) BIPNetworkApplication.confirmation(self, adapter, npdu)
def response(self, adapter, npdu): if _debug: WhoIsRouterApplication._debug("response %r %r", adapter, npdu) BIPNetworkApplication.response(self, adapter, npdu)
def indication(self, adapter, npdu): if _debug: WhoIsRouterApplication._debug("indication %r %r", adapter, npdu) BIPNetworkApplication.indication(self, adapter, npdu)
def __init__(self, *args): if _debug: WhoIsRouterApplication._debug("__init__ %r", args) BIPNetworkApplication.__init__(self, *args) # keep track of requests to line up responses self._request = None
def __init__(self, *args, **kwargs): if _debug: WhoIsRouterApplication._debug("__init__ %r %r", args, kwargs) BIPNetworkApplication.__init__(self, *args, **kwargs)
def __init__(self, *args): if _debug: WhoIsRouterApplication._debug("__init__ %r", args) BIPNetworkApplication.__init__(self, *args)