X-Git-Url: http://git.samba.org/samba.git/?p=obnox%2Fwireshark%2Fwip.git;a=blobdiff_plain;f=packet-ip.c;fp=packet-ip.c;h=84d298ae09f1ff4f92441ff17c916178ea6bc7d3;hp=170b49c820561f44efe72d48cec7deba6ddfade3;hb=1247960d017db9e0af85723b702180dab3ff5d35;hpb=e79c4d7ce9e6e304f4c83bd4243875312ab7d352 diff --git a/packet-ip.c b/packet-ip.c index 170b49c820..84d298ae09 100644 --- a/packet-ip.c +++ b/packet-ip.c @@ -1,7 +1,7 @@ /* packet-ip.c * Routines for IP and miscellaneous IP protocol packet disassembly * - * $Id: packet-ip.c,v 1.188 2003/04/20 00:11:28 guy Exp $ + * $Id: packet-ip.c,v 1.189 2003/04/20 08:06:00 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1033,66 +1033,9 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) (iph->ip_off & IP_OFFSET)*8, pinfo->iplen - pinfo->iphdrlen, iph->ip_off & IP_MF); - - if (ipfd_head != NULL) { - /* - * XXX - Now that we're using "fragment_add_check()", so that we don't - * get confused by reused IP IDs, reassembled fragments are - * hashed by the number of the frame in whch they're reassembled, so - * the only one of the frames for which we'll get the frame info - * is the one in which it's reassembled. - * - * That means we can't put the "reassembled in" information into the - * protocol tree or Info column for packets other than the last - * fragment. In order to do that, we'd need to hash the entry into - * the hash table multiple times - or retroactively attach the - * entry to all the other frames with, say, "p_add_proto_data()" - * and use that. (That could only be done by the reassembly code - * in "reassemble.c" if we either guaranteed that no protocol - * doing reassembly attached its own per-protocol data or if - * we added another list of reassembly data to all frames, growing - * the per-frame overhead by one pointer.) - * - * Note that putting it into the Info column doesn't work when - * the file is read in or reprocessed; it works only when the - * capture is filtered. If we switch to a scheme in which the - * column text is generated on the fly, by having the column - * list widget get the text to draw by calling back to a routine - * that would read and re-dissect the packet, that problem would - * go away, although doing so without running the risk of dragging - * the scroll bar causing stalls requires fast random access even - * to gzipped files and fast generation of protocol trees. The - * former can probably be done by saving the string dictionary at - * "checkpoint" locations; the latter may require that we build - * protocol trees using our own code, as "g_node_append()" is - * linear in the length of the list to which it's appending.) - */ - if (pinfo->fd->num == ipfd_head->reassembled_in) { - /* OK, we have the complete reassembled payload. - Allocate a new tvbuff, referring to the reassembled payload. */ - next_tvb = tvb_new_real_data(ipfd_head->data, ipfd_head->datalen, - ipfd_head->datalen); - - /* Add the tvbuff to the list of tvbuffs to which the tvbuff we - were handed refers, so it'll get cleaned up when that tvbuff - is cleaned up. */ - tvb_set_child_real_data_tvbuff(tvb, next_tvb); - - /* Add the defragmented data to the data source list. */ - add_new_data_source(pinfo, next_tvb, "Reassembled IPv4"); - - /* show all fragments */ - update_col_info = !show_fragment_tree(ipfd_head, &ip_frag_items, - ip_tree, pinfo, next_tvb); - } else { - /* We don't have the complete reassembled payload. */ - next_tvb = NULL; - proto_tree_add_uint(ip_tree, hf_ip_reassembled_in, tvb, 0, 0, ipfd_head->reassembled_in); - } - } else { - /* We don't have the complete reassembled payload. */ - next_tvb = NULL; - } + next_tvb = process_reassembled_data(tvb, pinfo, "Reassembled IPv4", + ipfd_head, &ip_frag_items, hf_ip_reassembled_in, &update_col_info, + ip_tree); } else { /* If this is the first fragment, dissect its contents, otherwise just show it as a fragment.