Python Forum
Counter of the duplicated packets from a pcap file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Counter of the duplicated packets from a pcap file
#5
You have different pieces in play. You should find out where the error is. Is find_dupl() broken, or is it okay and the problem is in duplication_pkg_count()?

First thing is that find_dupl looks odd to me. You're going to the trouble of making a nice Counter object, but then when you're done you're looping over it constantly. Much better it to just call into it.

I think instead of
    return [[s[index] for index, seq in enumerate(tcpSeq)
        if seq == key]
        for (key, value) in counter.items()
        if value > 1]
you could just do:
    return [s for s in tcpSeq if counter[s] > 1]
Also, maybe instead of 'counter' you could use a name like 'seq_count'.
Reply


Messages In This Thread
RE: Counter of the duplicated packets from a pcap file - by bowlofred - Jun-26-2020, 09:11 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Dealing with duplicated data in a CSV file bts001 10 11,693 Sep-06-2021, 12:11 AM
Last Post: SamHobbs
  how to count a retransmission packets from pcap file? salwa17 0 2,858 Jul-04-2020, 11:22 PM
Last Post: salwa17
  How to extract MSS (maximum size segment) from a pcap file ? salwa17 0 1,715 Jun-29-2020, 09:06 AM
Last Post: salwa17
  File Counter Help! jubin3 0 1,589 Jun-14-2020, 03:12 PM
Last Post: jubin3
  Splitting the audio file into smaller packets before transfer using UDP protocol in p MuhammadAli152 0 3,752 May-15-2020, 03:01 PM
Last Post: MuhammadAli152
  hex file to binary or pcap to binary baran01 1 5,732 Dec-11-2019, 10:19 PM
Last Post: Larz60+
  Reading PCAP FIles Variables 5 10,004 Apr-26-2019, 06:05 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020