Wireshark-dev: Re: [Wireshark-dev] Number of packets
From: Artur Gontijo <arturgontijo@xxxxxxxxx>
Date: Mon, 13 Jun 2011 12:12:38 -0300
Hi Jeff,

the second doubt I've implemented following your instructions and I think that it's working! Thx! =)

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. =/

[]'s
Artur Gontijo

On Thu, Jun 9, 2011 at 4:43 PM, Jeff Morriss <jeff.morriss.ws@gmail.com> wrote:
Artur Gontijo wrote:
Hi guys,

I have 2 doubt:

1 - How can I know the number of packets that was opened?

I'm not aware of a way to do that (unless you only want to count how many packets came to your dissector).


2 - How can I know when user opens another file? (I want to free some memory before the user opened a new file)

Register an initialization routing with register_init_routine().  This is not called when the file is closed but rather when a (new) file is opened which is often what you want.
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
           mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe



--
"Somos capazes de nos defender de grandes ataques, mas não de um simples elogio." - Sigmund Freud