Пример #1
0
    def run(self):
        # counter to timeout split horzion
        checkround = 0

        # the follwing is like the RIP protocol
        # like Bellman-Ford-Algorithmus
        smsgwglobals.wislogger.debug("ROUTER: Starting")

        # 1. request routing
        # if we could not get anything, shit happens
        Helper.requestrouting(initial=True)

        # 2. startup update timer
        while not self.e.isSet():

            # starting router run
            smsgwglobals.wislogger.debug("ROUTER: Starting router run")

            # raise timeouts
            smsgwglobals.wislogger.debug("ROUTER: Starting raise obsolete")
            wisglobals.rdb.raise_obsolete()

            # check local table if there are obsoletes
            smsgwglobals.wislogger.debug("ROUTER: Starting delete obsolete")
            wisglobals.rdb.delete_routing()

            # send out table
            smsgwglobals.wislogger.debug("ROUTER: Starting sending table")
            Helper.receiverouting()

            # remove dead direcly connected
            smsgwglobals.wislogger.debug("ROUTER: Starting delete directly")
            if checkround == 4:
                checkround == 0
                Helper.checkrouting()
            else:
                checkround = checkround + 1

            smsgwglobals.wislogger.debug("ROUTER: Starting sleep")

            time.sleep(25)

            smsgwglobals.wislogger.debug("ROUTER: Finishing router run")

        smsgwglobals.wislogger.debug("ROUTER: Stopped")
Пример #2
0
    def run(self):
        # counter to timeout split horzion
        checkround = 0

        # the follwing is like the RIP protocol
        # like Bellman-Ford-Algorithmus
        smsgwglobals.wislogger.debug("ROUTER: Starting")

        # 1. request routing
        # if we could not get anything, shit happens
        Helper.requestrouting(initial=True)

        # 2. startup update timer
        while not self.e.isSet():

            # starting router run
            smsgwglobals.wislogger.debug("ROUTER: Starting router run")

            # raise timeouts
            smsgwglobals.wislogger.debug("ROUTER: Starting raise obsolete")
            wisglobals.rdb.raise_obsolete()

            # check local table if there are obsoletes
            smsgwglobals.wislogger.debug("ROUTER: Starting delete obsolete")
            wisglobals.rdb.delete_routing()

            # send out table
            smsgwglobals.wislogger.debug("ROUTER: Starting sending table")
            Helper.receiverouting()

            # remove dead direcly connected
            smsgwglobals.wislogger.debug("ROUTER: Starting delete directly")
            if checkround == 4:
                checkround == 0
                Helper.checkrouting()
            else:
                checkround = checkround + 1

            smsgwglobals.wislogger.debug("ROUTER: Starting sleep")

            time.sleep(25)

            smsgwglobals.wislogger.debug("ROUTER: Finishing router run")

        smsgwglobals.wislogger.debug("ROUTER: Stopped")