我在UDP上开发了一个自定义解剖器,它使用PDCP层PDU RFC 2507选择性重复ARQ机制进行分段和重组。 我的留言包含 消息的开头
continuation of message and
end of message
消息不按顺序发送,并且基于序列号和消息ID我需要重新组装。 我不知道我是否应该使用 对话或
add_fragment_seq_next or
add_fragment_seq_check
请建议。我长期困扰这个
为什么我的代码不起作用?碎片本身不成功,因此重组不起作用。请提出建议!
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. Please Help