Ethereal-dev: [Ethereal-dev] de-fragmentation code question

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Rich Coe <Richard.Coe@xxxxxxxxxx>
Date: Fri, 14 Oct 2005 11:21:17 -0500
I finally got the framentation code added.

My question is why does it only work in tethereal and not in ethereal ?

	dlen = 4 + tvb_get_ntohl(tvb, offset);
	len = tvb_reported_length_remaining(tvb, offset);

	flags = tvb_get_guint8(tvb, offset + 5);
	more = (0 == (0x2 & flags));        /* more Fragments */
	tid = (pinfo->destport << 1) | (0x1 & flags);
	fd_head = fragment_add_seq_next(tvb, offset, pinfo, tid,
		dcm_fragment_table, dcm_reassembled_table, dlen, more);
/*
	next_tvb = process_reassembled_data(tvb, offset, pinfo,
	    "Reassembled DCM", fd_head, &dcm_frag_items, NULL, tf);
*/
	if (fd_head) {
	    if (pinfo->fd->num == fd_head->reassembled_in) {
		if (NULL != fd_head->next) {
		    next_tvb = tvb_new_real_data(fd_head->data,
			fd_head->len, fd_head->len);
		    tvb_set_child_real_data_tvbuff(tvb, next_tvb);
		    add_new_data_source(pinfo, next_tvb, "Reassembled DCM");
		    if (tree) 
			show_fragment_seq_tree(fd_head, &dcm_frag_items,
			    dcm_tree, pinfo, next_tvb);
		} else {
		    next_tvb = tvb_new_subset(tvb, offset, dlen, dlen);
		}
	    } else {
		if (dcm_tree)
		    proto_tree_add_uint(dcm_tree, hf_dcm_reassembled_in, tvb,
			 offset, dlen, fd_head->reassembled_in);
	    }
	}
	if (NULL != next_tvb)
	    dissect_dcm_data(next_tvb, dcm_tree, dcm_data);

-- 
Rich Coe		richard.coe@xxxxxxxxxx
General Electric Healthcare Technologies
Global Software Platforms, Computer Technology Team