diff options
author | Guy Harris <guy@alum.mit.edu> | 2002-06-07 10:11:41 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2002-06-07 10:11:41 +0000 |
commit | 4f9508837a66205c3132624297e724e6dbefd482 (patch) | |
tree | f5e00b306053bd03c54de27712976a9f4ded3e70 /packet-atalk.c | |
parent | 1b72ef68e6acc8800a2c0a5a719e48aaf5d54c79 (diff) | |
download | wireshark-4f9508837a66205c3132624297e724e6dbefd482.tar.gz wireshark-4f9508837a66205c3132624297e724e6dbefd482.tar.bz2 wireshark-4f9508837a66205c3132624297e724e6dbefd482.zip |
Add "show_fragment_seq_tree()", which is like "show_fragment_tree()",
but for stuff reassembled with "fragment_add_seq()" or
"fragment_add_seq_check()".
Add a "fragment tag" string to the "fragment_items", so that packets
with fragmentation errors can be properly flagged as having "Illegal
fragments" or "Illegal segments" depending on the term used with the
protocol in question.
Make all the dissectors that can use "show_fragment_tree()" or
"show_fragment_seq_tree()", and don't already use them, do so.
svn path=/trunk/; revision=5644
Diffstat (limited to 'packet-atalk.c')
-rw-r--r-- | packet-atalk.c | 82 |
1 files changed, 18 insertions, 64 deletions
diff --git a/packet-atalk.c b/packet-atalk.c index 00f75712e8..84b50c5dcb 100644 --- a/packet-atalk.c +++ b/packet-atalk.c @@ -2,7 +2,7 @@ * Routines for AppleTalk packet disassembly: LLAP, DDP, NBP, ATP, ASP, * RTMP. * - * $Id: packet-atalk.c,v 1.73 2002/06/04 07:03:44 guy Exp $ + * $Id: packet-atalk.c,v 1.74 2002/06/07 10:11:38 guy Exp $ * * Simon Wilkinson <sxw@dcs.ed.ac.uk> * @@ -287,6 +287,19 @@ static gint ett_ddp = -1; static gint ett_llap = -1; static gint ett_pstring = -1; +fragment_items atp_frag_items = { + &ett_atp_segment, + &ett_atp_segments, + &hf_atp_segments, + &hf_atp_segment, + &hf_atp_segment_overlap, + &hf_atp_segment_overlap_conflict, + &hf_atp_segment_multiple_tails, + &hf_atp_segment_too_long_segment, + &hf_atp_segment_error, + "segments" +}; + static dissector_table_t ddp_dissector_table; static dissector_handle_t data_handle; @@ -646,67 +659,6 @@ dissect_nbp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { return; } -static void -show_fragments(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - fragment_data *fd_head) -{ - guint32 offset; - fragment_data *fd; - proto_tree *ft; - proto_item *fi; - - fi = proto_tree_add_item(tree, hf_atp_segments, tvb, 0, -1, FALSE); - ft = proto_item_add_subtree(fi, ett_atp_segments); - offset = 0; - for (fd = fd_head->next; fd != NULL; fd = fd->next){ - if (fd->flags & (FD_OVERLAP|FD_OVERLAPCONFLICT|FD_MULTIPLETAILS|FD_TOOLONGFRAGMENT) ) { - /* - * This segment has some flags set; create a subtree for it and - * display the flags. - */ - proto_tree *fet = NULL; - proto_item *fei = NULL; - int hf; - - if (fd->flags & (FD_OVERLAPCONFLICT|FD_MULTIPLETAILS|FD_TOOLONGFRAGMENT) ) { - hf = hf_atp_segment_error; - } else { - hf = hf_atp_segment; - } - fei = proto_tree_add_none_format(ft, hf, tvb, offset, fd->len, - "Frame:%u payload:%u-%u", - fd->frame, offset, offset+fd->len-1); - fet = proto_item_add_subtree(fei, ett_atp_segment); - if (fd->flags&FD_OVERLAP) - proto_tree_add_boolean(fet, hf_atp_segment_overlap, tvb, 0, 0, TRUE); - if (fd->flags&FD_OVERLAPCONFLICT) { - proto_tree_add_boolean(fet, hf_atp_segment_overlap_conflict, tvb, 0, 0, - TRUE); - } - if (fd->flags&FD_MULTIPLETAILS) { - proto_tree_add_boolean(fet, hf_atp_segment_multiple_tails, tvb, 0, 0, - TRUE); - } - if (fd->flags&FD_TOOLONGFRAGMENT) { - proto_tree_add_boolean(fet, hf_atp_segment_too_long_segment, tvb, 0, 0, - TRUE); - } - } else { - /* - * Nothing of interest for this segment. - */ - proto_tree_add_text (ft, tvb, offset, fd->len, - "Frame:%u payload:%u-%u", - fd->frame, offset, offset+fd->len-1); - } - offset += fd->len; - } - if (fd_head->flags & (FD_OVERLAPCONFLICT|FD_MULTIPLETAILS|FD_TOOLONGFRAGMENT) ) { - if (check_col(pinfo->cinfo, COL_INFO)) - col_set_str(pinfo->cinfo, COL_INFO, "[Illegal segments]"); - } -} - /* ----------------------------- ATP protocol cf. inside appletalk chap. 9 desegmentation from packet-ieee80211.c @@ -860,8 +812,10 @@ dissect_atp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { tvb_set_child_real_data_tvbuff(tvb, new_tvb); add_new_data_source(pinfo, new_tvb, "Reassembled ATP"); /* Show all fragments. */ - if (tree) - show_fragments(new_tvb, pinfo, atp_tree, fd_head); + if (tree) { + show_fragment_seq_tree(fd_head, &atp_frag_items, + atp_tree, pinfo, new_tvb); + } } else new_tvb = tvb_new_subset(tvb, ATP_HDRSIZE -1, -1, -1); |