Hi,
When i use customed dissector to parse data field in LLC, I found the dissector not be called. Can anyone help me about how to make it work? thx
qos-llc-data-proto = Proto ("qos-llc-data", "qos test llc data", "protocol qos test llc data")
…..
qos-llc-data-proto.fields = { f-llc-u8-type, f-llc-u16-sequence, f-llc-u32-tick, f-llc-u8-priority, f-llc-bytes-data }
function qos-llc-data-proto.dissector(buffer,pinfo,tree)
{
…
}
local my-dsap = 68
local llc-table = DissectorTable.get("llc.dsap")
llc-table:add(68, qos-llc-data-proto)
asked 28 Jul ‘14, 08:20
wireshark_xg
1●2●2●3
accept rate: 0%
edited 28 Jul ‘14, 08:51
grahamb ♦
19.8k●3●30●206
I assume your code example is fake, rather than from the real script code, since it uses illegal variable names. (dashes are illegal in names) But the general concept of the script appears ok.
Some basic questions:
Do you know that your script is actually being loaded at all? For example if you put a syntactic error in it does wireshark error trying to load it, or if you put a print statement in it does it print when wireshark loads?
Is your packet the right kind of packet for that “llc.dsap” table - I don’t know anything about LLC packets, but it appears that “llc.dsap” table only gets looked up for specific xDLC packets, for control information types. It looks like your example packet in the capture above is the right type, but I don’t know for sure.
Can you post the capture file somewhere? Like on cloudshark or someplace public?
Hi Hadriel, Sorry for not describe it clearly.
1.Following is detailed code.
2 From picture, you can find size of LLC packet is 1052, so i want to parse its data field as above code. I don’t how to add my dissector to it or how to parse it. I already use similar dissector and add it to port of UDP, and it can works well.
What kind of error did you try to introduce in the dissector? The error needs to be a syntactic Lua error, as opposed to just accessing an invalid/non-existent function (for example). Because during load the script is parsed by the Lua interpreter, but the dissector function code isn’t actually executed yet until later. So the error needs to be something fundamentally invalid in Lua language. For example, just put the word “foobar” on a line, even outside the dissector function… like at the top of your script.
If the script file itself isn’t being loaded, how did you try loading it? Did you put it in the appropriate plugins directory to be auto-loaded, or are you trying to load it using
dofile()
, or what?It’s used for I and UI frames, rather than S frames or UI frames other than UI frames.
“Control field: I” indicates that it’s an I frame, so, yes, it’s the right type, at least in Wireshark 1.10 and later (I don’t know whether earlier versions supported it only for U frames).
Which version of Wireshark is this?
Thank you for your reply. If i add some error line outside dissector function, when wireshark is started, there is error reported. But if i just add error line into dissector function, there is no error reported. As you said, dissector function is executed when parse real network data. So it means that my dissector is not executed really. So my question is it how to parse LLC data field in my case.
I find the reason why dissector not call. When reading source code of wireshark, i found following code.
From above code, if XDCL is information, then dsap dissector will called. But from ftype of my frame, it is one XDCL_S which means Supervisory frame. So dsap dissector will not call. So the question is how to parse data filed of LLC. I don’t how to add my dissector after parse LLC? In the page http://wiki.wireshark.org/Lua/Dissectors, it gives examples. But which type can be used in my case? thx
To quote IEEE Std 802.2-2008 section 5.4.2.2 “Supervisory format commands and responses”:
Therefore, there is nothing to hand to a dissector - there IS no data field in an S frame! - so we don’t call dissectors for S frames.