aboutsummaryrefslogtreecommitdiffstats
path: root/packet-wtp.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2002-06-07 10:11:41 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2002-06-07 10:11:41 +0000
commit72e79b3d9d6d2617bf52d4b7fa7a9568f201a70b (patch)
treef5e00b306053bd03c54de27712976a9f4ded3e70 /packet-wtp.c
parent07b820fdcfeb9ce826dcba6f7f69a495c2d01014 (diff)
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5644 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-wtp.c')
-rw-r--r--packet-wtp.c85
1 files changed, 16 insertions, 69 deletions
diff --git a/packet-wtp.c b/packet-wtp.c
index 6be5a3f24d..bb6cbe51ca 100644
--- a/packet-wtp.c
+++ b/packet-wtp.c
@@ -2,7 +2,7 @@
*
* Routines to dissect WTP component of WAP traffic.
*
- * $Id: packet-wtp.c,v 1.34 2002/06/04 07:03:47 guy Exp $
+ * $Id: packet-wtp.c,v 1.35 2002/06/07 10:11:41 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -189,6 +189,19 @@ static gint ett_header = ETT_EMPTY;
static gint ett_wsp_fragments = ETT_EMPTY;
static gint ett_wtp_fragment = ETT_EMPTY;
+fragment_items wtp_frag_items = {
+ &ett_wtp_fragment,
+ &ett_wsp_fragments,
+ &hf_wtp_fragments,
+ &hf_wtp_fragment,
+ &hf_wtp_fragment_overlap,
+ &hf_wtp_fragment_overlap_conflict,
+ &hf_wtp_fragment_multiple_tails,
+ &hf_wtp_fragment_too_long_fragment,
+ &hf_wtp_fragment_error,
+ "fragments"
+};
+
/* Handle for WSP dissector */
static dissector_handle_t wsp_handle;
@@ -225,73 +238,6 @@ static char retransmission_indicator(unsigned char octet)
}
}
-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_wtp_fragments, tvb, 0, -1, FALSE);
- ft = proto_item_add_subtree(fi, ett_wsp_fragments);
- offset = 0;
- for (fd=fd_head->next; fd; fd=fd->next){
- if (fd->flags & (FD_OVERLAP|FD_OVERLAPCONFLICT
- |FD_MULTIPLETAILS|FD_TOOLONGFRAGMENT) ) {
- /* this fragment 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_wtp_fragment_error;
- } else {
- hf = hf_wtp_fragment;
- }
- 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_wtp_fragment);
- if (fd->flags&FD_OVERLAP) {
- proto_tree_add_boolean(fet,
- hf_wtp_fragment_overlap, tvb, 0, 0,
- TRUE);
- }
- if (fd->flags&FD_OVERLAPCONFLICT) {
- proto_tree_add_boolean(fet,
- hf_wtp_fragment_overlap_conflict, tvb, 0, 0,
- TRUE);
- }
- if (fd->flags&FD_MULTIPLETAILS) {
- proto_tree_add_boolean(fet,
- hf_wtp_fragment_multiple_tails, tvb, 0, 0,
- TRUE);
- }
- if (fd->flags&FD_TOOLONGFRAGMENT) {
- proto_tree_add_boolean(fet,
- hf_wtp_fragment_too_long_fragment, tvb, 0, 0,
- TRUE);
- }
- } else {
- /* nothing of interest for this fragment */
- proto_tree_add_none_format(ft, hf_wtp_fragment,
- 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 fragments]");
- }
-}
-
/* Code to actually dissect the packets */
static void
dissect_wtp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
@@ -603,7 +549,8 @@ dissect_wtp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pinfo->fragmented = FALSE;
/* show all fragments */
- show_fragments(wsp_tvb, pinfo, wtp_tree, fd_head);
+ show_fragment_seq_tree(fd_head, &wtp_frag_items,
+ wtp_tree, pinfo, wsp_tvb);
call_dissector(wsp_handle, wsp_tvb, pinfo, tree);
}