Hi,
I have written a plugin to parse a new protocol called DASH in wireshark.
For packets which are fragmented, I have the following piece of code:
/* Multiple packets in response - last_packet_flag field is the last packet flag */
if(((block_number == 0) && (last_packet_flag == 0)) ||(block_number > 0))
{
pkt->fragmented = TRUE;
frag_msg = fragment_add_seq_check(tvb, packet_field_offset, pkt,
msgid, /* ID for fragments belonging together */
msg_fragment_table, /* list of message fragments */
msg_reassembled_table, /* list of reassembled messages */
block_number, /* fragment sequence number */
tvb_length_remaining(tvb, packet_field_offset), /* fragment length - to the end */
last_packet_flag); /* More fragments? */
new_tvb = process_reassembled_data(tvb, packet_field_offset, pkt,
"Reassembled OQTP Message",
frag_msg,
&msg_frag_items,
NULL,
oqtp_tree);
/* Reassembled */
if (frag_msg)
{
col_append_str(pkt->cinfo, COL_INFO,
"(Reassembled OQTP Response)");
}
else
{
/* Not last packet of reassembled short message */
col_append_fstr(pkt->cinfo, COL_INFO,
"(OQTP fragment %u)", block_number);
}
if (new_tvb) /* take it all */
{
next_tvb = new_tvb;
}
else
{
/* make a new subset */
next_tvb = tvb_new_subset(tvb, packet_field_offset, -1, -1);
}
}
Doing this way, I am getting a DISSECTOR BUG.
Kindly help what might have gone wrong?
Regards,
Darshan