summaryrefslogtreecommitdiff
path: root/packet-clnp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-04-20 08:06:01 +0000
committerGuy Harris <guy@alum.mit.edu>2003-04-20 08:06:01 +0000
commit87dfb09b12cd9d0df1ed278594fb376fb95f769b (patch)
treefef3d18705b10ba52c1f99b6300a70d6d4b7882d /packet-clnp.c
parent56cd2c741b4e2250006fe2e1186becf535ddfc72 (diff)
downloadwireshark-87dfb09b12cd9d0df1ed278594fb376fb95f769b.tar.gz
Pull much of the processing done after a call to "fragment_add_check()"
into a subroutine, for use in other dissectors. Use it in the IPv6 and CLNP dissectors. svn path=/trunk/; revision=7510
Diffstat (limited to 'packet-clnp.c')
-rw-r--r--packet-clnp.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/packet-clnp.c b/packet-clnp.c
index 766b007a25..35f9b1375d 100644
--- a/packet-clnp.c
+++ b/packet-clnp.c
@@ -1,7 +1,7 @@
/* packet-clnp.c
* Routines for ISO/OSI network and transport protocol packet disassembly
*
- * $Id: packet-clnp.c,v 1.71 2003/04/20 00:21:17 guy Exp $
+ * $Id: packet-clnp.c,v 1.72 2003/04/20 08:06:00 guy Exp $
* Laurent Deniel <laurent.deniel@free.fr>
* Ralf Schneider <Ralf.Schneider@t-online.de>
*
@@ -68,6 +68,7 @@ static int hf_clnp_segment_overlap_conflict = -1;
static int hf_clnp_segment_multiple_tails = -1;
static int hf_clnp_segment_too_long_segment = -1;
static int hf_clnp_segment_error = -1;
+static int hf_clnp_reassembled_in = -1;
static int proto_cotp = -1;
static gint ett_cotp = -1;
@@ -1884,27 +1885,9 @@ static void dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
clnp_reassembled_table, segment_offset,
segment_length - cnf_hdr_len,
cnf_type & CNF_MORE_SEGS);
-
- if (fd_head != NULL) {
- /* OK, we have the complete reassembled payload.
- Allocate a new tvbuff, referring to the reassembled payload. */
- next_tvb = tvb_new_real_data(fd_head->data, fd_head->datalen,
- fd_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 CLNP");
-
- update_col_info = !show_fragment_tree(fd_head, &clnp_frag_items,
- clnp_tree, pinfo, next_tvb);
- } else {
- /* We don't have the complete reassembled payload. */
- next_tvb = NULL;
- }
+ next_tvb = process_reassembled_data(tvb, pinfo, "Reassembled CLNP",
+ fd_head, &clnp_frag_items, hf_clnp_reassembled_in, &update_col_info,
+ clnp_tree);
} else {
/* If this is the first segment, dissect its contents, otherwise
just show it as a segment.
@@ -2081,6 +2064,10 @@ void proto_register_clnp(void)
{ &hf_clnp_segments,
{ "CLNP Segments", "clnp.segments", FT_NONE, BASE_DEC, NULL, 0x0,
"CLNP Segments", HFILL }},
+
+ { &hf_clnp_reassembled_in,
+ { "Reassembled CLNP in frame", "clnp.reassembled_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
+ "This CLNP packet is reassembled in this frame", HFILL }}
};
static gint *ett[] = {
&ett_clnp,