Hi,
A global variable won't work for two reasons:
1. The capture file is accessed randomly.
2. You might have multiple exchanges you need to follow.
To tackle point 2 you can use conversations. Read about them in
README.developer. To collect and keep track of protocol data across packets
have a look at README.request_response_tracking.
Thanx,
Jaap
Hans Glück wrote:
Hello,
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()) {
next_expected_frame_to_be_recieved++;
}
...
}
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.
Chris