Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] Number of packets

From: Jakub Zawadzki <darkjames-ws@xxxxxxxxxxxx>
Date: Mon, 13 Jun 2011 17:37:29 +0200
Hi,

On Mon, Jun 13, 2011 at 12:12:38PM -0300, Artur Gontijo wrote:
> about the firts one, how can I count how many packets came to my dissector?
> I tried to increment a global variable, but if the user scroll down the
> dissected packets the value of this variable keep increasing. =/

smth like:
    if (!PINFO_FD_VISITED(pinfo))
        count++; 

But if you want to know total numbers of packets you should be
interested in register_postdissector() and in handler smth like:
   total_count = MAX(total_count, PINFO_FD_NUM(pinfo));