aptdetector/network/parser/parse_pcap.py
def retrieve_packet(self, ack_seq):
        """packet reassmbler

        read all packets till now and reassmble a packet
        based on it's ack sequence number

        Args:
            ack_seq (int): ack sequence number
        Returns:
            the whole packet that were reassembled
        """
        if ack_seq <= self.last_ack_seq:
            return None

        self.last_ack_seq = ack_seq
        data = []
        new_buf = []
        for packet in self.receive_buf:
            if packet.seq < ack_seq:
                data.append(packet)
            else:
                new_buf.append(packet)
        self.receive_buf = new_buf
        if len(data) <= 1:
            return data
        data.sort(key=lambda pct: pct.seq)
        new_data = []
        last_packet_seq = None
        for packet in data:
            if packet.seq != last_packet_seq:
                last_packet_seq = packet.seq
                new_data.append(packet)
        return new_data
packet reassmbler

        read all packets till now and reassmble a packet
        based on it's ack sequence number

        Args:
            ack_seq (int): ack sequence number
        Returns:
            the whole packet that were reassembled
        
packet reassmbler
read all packets till now and reassmble a packet
based on it's ack sequence number
packet reassmbler read all packets till now and reassmble a packet based on it ' s ack sequence number
def retrieve_packet(self, ack_seq):
        if ack_seq <= self.last_ack_seq:
            return None
        self.last_ack_seq = ack_seq
        data = []
        new_buf = []
        for packet in self.receive_buf:
            if packet.seq < ack_seq:
                data.append(packet)
            else:
                new_buf.append(packet)
        self.receive_buf = new_buf
        if len(data) <= 1:
            return data
        data.sort(key=lambda pct: pct.seq)
        new_data = []
        last_packet_seq = None
        for packet in data:
            if packet.seq != last_packet_seq:
                last_packet_seq = packet.seq
                new_data.append(packet)
        return new_data
def retrieve_packet ( self , ack_seq ) : if ack_seq <= self . last_ack_seq : return None self . last_ack_seq = ack_seq data = [ ] new_buf = [ ] for packet in self . receive_buf : if packet . seq < ack_seq : data . append ( packet ) else : new_buf . append ( packet ) self . receive_buf = new_buf if len ( data ) <= 1 : return data data . sort ( key = lambda pct : pct . seq ) new_data = [ ] last_packet_seq = None for packet in data : if packet . seq != last_packet_seq : last_packet_seq = packet . seq new_data . append ( packet ) return new_data
packet reassmbler
read all packets till now and reassmble a packet
based on it's ack sequence number
packet reassmbler read all packets till now and reassmble a packet based on it ' s ack sequence number
"""packet reassmbler

        read all packets till now and reassmble a packet
        based on it's ack sequence number

        Args:
            ack_seq (int): ack sequence number
        Returns:
            the whole packet that were reassembled
        """
the whole packet that were reassembled
the whole packet that were reassembled
self
ack_seq
ack sequence number
ack sequence number