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] Running a function only on first run

From: Graham Bloice <graham.bloice@xxxxxxxxxxxxx>
Date: Tue, 06 Apr 2010 17:58:26 +0100
On 06/04/2010 17:40, Jeremy O'Brien wrote:
Hello,

I'm trying to have Wireshark maintain a list of certain information
from packets as it receives them (using a GHashTable or a GSList, not
sure which yet). The problem I am facing is that the code in my
dissection routine that does this gets run once on each packet as they
are analyzed, but also every time I click on a packet. I understand
this is how Wireshark works, but I was wondering if there was some way
of telling if this is a "first run" analysis or a second-visiting of
the same packet, without maintaining my own variables to keep track of
this for each packet. Does this make sense?


  
Try PINFO_FD_VISITED(pinfo) on the pinfo you have.  Visited gets set after the first pass.

-- 
Regards,

Graham Bloice