Wireshark-dev: [Wireshark-dev] Dissector global variable
From: Hans Glück <[email protected]>
Date: Fri, 27 Jun 2008 11:57:42 +0000 (GMT)

I´m writing a dissector and I want to implement "error recovery mode"/"flow control", therefor I need two gloabl variables where I can store some values (-> "next_expected_frame_to_be_recieved" and "next_expected_frame_to_be_send"). 
I declared them at the beginning of my c-file: 
static guint8 next_expected_frame_to_be_recieved = 0; 
static guint8 next_expected_frame_to_be_send = 0; 

And I set value of this variables in my dissector code: 
static void dissect_mux27010(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){ 
    if (received_successful()) { 

My problem is: Every time I click in Wireshark at packet the value is increased e.g. 
click first packet -> next_expected_frame_to_be_recieved == 1 
click second packet -> next_expected_frame_to_be_recieved == 2 
click first packet -> next_expected_frame_to_be_recieved == 3 
click second packet -> next_expected_frame_to_be_recieved == 4 

But what I want is that the variables are increased step-by-step/ ordered (if packet n is an ACK -> increase; if packet n+1 is an ACK -> increase...) 
How can I realize this? 

Thanks for any advice. 

Gesendet von Yahoo! Mail.
Dem pfiffigeren Posteingang.