Пример #1
0
    def event_inactive(self):
        """ event_inactive
        
        // TODO : Redaction (here is schcrecv.py)
        
        
        """
        #if the ack-ok was received, no ACK REQ will be received,
        #check for state == "DONE" and return, this means that the ack-ok
        #was send, before the system returns after sending the ack-ok, now it 
        #waits for one inactivity timer before closing session
        if self.state == "DONE":
            return

        # sending sender abort.
        schc_frag = schcmsg.frag_receiver_tx_abort(self.rule, self.dtag)
        """
        Changement à corriger
        args = (schc_frag.packet.get_content(), self.context["devL2Addr"])
        """
        args = (schc_frag.packet.get_content(), '*')
        print("Sent Receiver-Abort.", schc_frag.__dict__)
        print("----------------------- SCHC RECEIVER ABORT SEND  -----------------------")

        if enable_statsct:
            Statsct.set_msg_type("SCHC_RECEIVER_ABORT")
            Statsct.set_header_size(schcmsg.get_sender_header_size(self.rule))
        self.state = "ABORT"
        self.protocol.scheduler.add_event(0,
                                    self.protocol.layer2.send_packet, args)
        # XXX needs to release all resources.
        return
Пример #2
0
 def event_inactive(self):
     # sending sender abort.
     schc_frag = schcmsg.frag_receiver_tx_abort(self.rule, self.dtag)
     args = (schc_frag.packet.get_content(), self.context["devL2Addr"])
     print("Sent Receiver-Abort.", schc_frag.__dict__)
     self.protocol.scheduler.add_event(0, self.protocol.layer2.send_packet,
                                       args)
     # XXX needs to release all resources.
     return
Пример #3
0
    def send_receiver_abort(self):
        # sending Receiver abort.
        self.state = "ABORT"
        schc_frag = schcmsg.frag_receiver_tx_abort(self.rule, self.dtag)
        args = (schc_frag.packet.get_content(), self.context["devL2Addr"])
        print("Sent Receiver-Abort.", schc_frag.__dict__)
        print("----------------------- SCHC RECEIVER ABORT SEND  -----------------------")

        if enable_statsct:
            Statsct.set_msg_type("SCHC_RECEIVER_ABORT")
            #Statsct.set_header_size(schcmsg.get_sender_header_size(self.rule))
        self.protocol.scheduler.add_event(0,
                                    self.protocol.layer2.send_packet, args)