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

Why is my code below not working? The fragmentation itself not successful and thus reassembly not working. Please suggest!

switch (stype) {
case 0x00: // Continuation of Message
    msg_seqid = 2;
    rem_length = bctsdu_length;
    proto_tree_add_text(FT_BCnPDU_tree, next_tvb, offset_payload, rem_length, "PDU data : %d", rem_length);
    break;
case 0x01: // Beginning of Message
    msg_seqid = 1;
    proto_tree_add_text(BCnPDU_bom_tree, next_tvb, offset_payload, 2, "PDU Length : 0x%02x (%d)", pdu_len, pdu_len);
    rem_length = tvb_length_remaining(next_tvb, offset_payload);
    rem_length -= 2;
    proto_tree_add_text(BCnPDU_bom_tree, next_tvb, offset_payload, rem_length, "PDU data  : %d ", rem_length);

    break;
case 0x02: // End of Message
    msg_seqid = 3;
    bctsdu_length += 2;
    more_frags = FALSE;
    rem_length = bctsdu_length;
    rem_length -= 2;
    proto_tree_add_text(FT_BCnPDU_tree, next_tvb, offset_payload, rem_length, "PDU data : %d", rem_length);
    disable_CRC = 1;
    break;
case 0x04: // Single Segment Message
    ---- // doesn't need fragment/reassembly
      break;
}

if (msg_seqid == 1 || msg_seqid == 2 || msg_seqid == 3) {
    save_fragmented = pinfo->fragmented;
    pinfo->fragmented = TRUE;
    frag_msg = fragment_add_seq_check(&mns_reassembly_table,
                                      next_tvb,
                                      offset_payload,
                                      pinfo,
                                      mns_seqnum,
                                      NULL,
                                      mns_seqid,
                                      rem_length,
                                      more_frags);
    if (frag_msg) {
        col_append_fstr(pinfo->cinfo, COL_INFO, " mns segment of a FRAGMENT PDU");
    } else {
        col_append_fstr(pinfo->cinfo, COL_INFO, " FRAGMENT NOT DONE ");
    }
}
if (more_frags == FALSE) {
    save_fragmented = pinfo->fragmented;
    pinfo->fragmented = FALSE;

    rass_tvb = process_reassembled_data(next_tvb,
                                        offset_payload,
                                        pinfo,
                                        "Reassembled Message",
                                        frag_msg,
                                        &mns_frag_items,
                                        NULL,
                                        FT_BCnPDU_tree);
    if (rass_tvb) {
        col_append_str(pinfo->cinfo, COL_INFO, "(Message reassembled ) ");
        ALSIGPDU(rass_tvb, pinfo, FT_BCnPDU_tree);
    }
}

I am always getting the FRAGMENT NOT DONE error.

asked 11 Feb '15, 20:18

umar's gravatar image

umar
26222427
accept rate: 0%

edited 17 Feb '15, 02:09


For reference, the answer was given in this wireshark-dev mailing list thread

permanent link

answered 17 Feb '15, 03:22

Pascal%20Quantin's gravatar image

Pascal Quantin
5.5k1060
accept rate: 30%

edited 17 Feb '15, 03:22

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×637
×78
×30

question asked: 11 Feb '15, 20:18

question was seen: 2,073 times

last updated: 17 Feb '15, 03:22

p​o​w​e​r​e​d by O​S​Q​A