Can anyone suggest any examples of dissectors that combine two tvbs together? because I need to remove some unwanted data before processing. Also, if I remove the unwanted data from the tvb and pass that off to say the eth dissector for further processing would the "Packet Bytes" window be updated with the new tvb or will it display the previous one? asked 16 Feb '13, 17:31 StealthUE edited 16 Feb '13, 20:37 Guy Harris ♦♦ showing 5 of 6 show 1 more comments |
2 Answers:
Figured it out.. When returning the new_tvb I was trying to pass it back into the original tvb eg: tvb = escCharRemove(tvb, pinfo, len, esccharcount); which was causing it to crash it needed to passed into another tvbuff answered 18 Feb '13, 19:21 StealthUE |
Although complicated by various other aspects of the protocol the DNP3 dissector handles something along these lines as Application Layer (AL) messages have a 16 bit CRC every 16 bytes (chunk). The dissector takes the chunks, checks the CRC, and if OK adds them to a new tvb. Have a look at the code following the comment As AL messages can be fragmented over many TCP or UDP packets, these tvb's are reassembled by the fragmentation code, and eventually end up in answered 17 Feb '13, 01:41 grahamb ♦ thanks. I'll have a look through it (17 Feb '13, 14:58) StealthUE need help! ive posted the code i have so far as the next answer cause i couldn't fit it in as a comment. this is what im trying to achieve data in: xx xx xx xx FE FF xx xx data out: xx xx xx xx FF xx xx (17 Feb '13, 18:33) StealthUE
(17 Feb ‘13, 18:33) StealthUE data in: xx xx xx xx FE FF xx xx data out: xx xx xx xx FF xx xx wireshark just crashes. Im guessing im accessing an illegal part of memory but im unable to find the error. Any help on this would be greatly appreciated as im stuck (17 Feb ‘13, 22:19) StealthUE len is equal to the length of the data without the extra bytes and esccharcount is the amount of extra bytes
its still giving me problems…deforming packets and crashing wireshark and displaying a memory map in the terminal (18 Feb ‘13, 14:50) StealthUE I adjusted the size I was using in g_malloc to g_malloc(len * sizeof(int)) and now Im not getting memory issues but every packet that contains the extra data becomes malformed and the extra data is still displayed in the “Packet Bytes” window (18 Feb ‘13, 15:36) StealthUE showing 5 of 6 show 1 more comments |
Combining two tvbuffs doesn't remove data in and of itself.
Do you mean "taking some data from one tvbuff and some data from another tvbuff, and combining them into a third tvbuff"?
Or do you mean "taking one tvbuff, removing some data from it, and putting that into another tvbuff"?
taking one tvbuff, removing some data from it, and putting that into another tvbuff
So are you removing data from the middle of a tvbuff, or just from the beginning or the end?
The data I'm removing will be in the middle of the tvbuff
Hi @guy-harris Above you've asked if the question is "taking some data from one tvbuff and some data from another tvbuff, and combining them into a third tvbuff".
Actually, that is exactly the question I'm looking for an answer. (The only question I've posted few minutes ago.)
Could you please give an idea inside that post?
@barisalis, see my answer in your question