This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Issue with creating array of gsm_old.localValue by Lua Script

0

HI

I think that it is a bug, but i decided to talk about it and if it is so then I will create the bug.

I have a multi chunk frame.

In this frame first chunk has GSM_MAP protocol and inside this protocol there is gsm_old.opCode and inside it there is gsm_old.localValue = 1

In this frame second chunk has GSM_MAP protocol and inside this protocol there is gsm_old.opCode and inside it there is gsm_old.localValue = 2

In this frame second chunk has GSM_MAP protocol and inside this protocol there is gsm_old.errorCode and inside it there is gsm_old.localValue = 3

1 chunk->GSM_MAP->gsm_old.opCode->gsm_old.localValue = 1
2 chunk->GSM_MAP->gsm_old.opCode->gsm_old.localValue = 2
3 chunk->GSM_MAP->gsm_old.errorCode->gsm_old.localValue = 3

I created lua script in which I used dissector table "sctp.ppi" or "gsm_map". And when I get the array of

local gsm_old_localvalue = Field.new ("gsm_old.localValue")

by command

local Gsm_Old_LocaLvalue_Array = { gsm_old_localvalue () }

I get the following array

Gsm_Old_LocalValue_Array[1]=3
Gsm_Old_LocalValue_Array[2]=1
Gsm_Old_LocalValue_Array[3]=2

As you can see the order of gsm_old.localValue is incorrect in array. Because the order should be the following

Gsm_Old_LocalValue_Array[1]=1
Gsm_Old_LocalValue_Array[2]=2
Gsm_Old_LocalValue_Array[3]=3

As we can see this issue happens with gsm_old.localValue that contains in gsm_old.errorCode. In this case the value puts in the first place of the array. If there is not gsm_old.errorCode in every chunk of the one frame then the order of gsm_old.localValue in array is correct.

Can somebody explain me the root cause of this issue?

asked 18 Aug '16, 07:38

domeno's gravatar image

domeno
216611
accept rate: 0%

The problem is the same as in

https://www.wireshark.org/lists/wireshark-users/201111/msg00083.html

I think in new version we have the same problem.

(19 Aug '16, 01:18) domeno