Skip to content

Commit

Permalink
Eliminate proto_tree_add_text from WiMax plugin.
Browse files Browse the repository at this point in the history
Most of this was done with a custom perl script that picked out the field names from the XBIT macro and generated an hf_ and filter (that was humanly tweaked from there).

Change-Id: I563db9f8ea216efe37322b784ab0daf25c038d9e
Reviewed-on: https://code.wireshark.org/review/6149
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
  • Loading branch information
mmann78 authored and AndersBroman committed Jan 1, 2015
1 parent 114e773 commit 889c566
Show file tree
Hide file tree
Showing 6 changed files with 2,228 additions and 892 deletions.
17 changes: 13 additions & 4 deletions plugins/wimax/mac_hd_generic_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ static gint hf_mac_header_generic_arq_fb_ie_seq_ack_map_2 = -1;
static gint hf_mac_header_generic_arq_fb_ie_seq1_length_6 = -1;
static gint hf_mac_header_generic_arq_fb_ie_seq2_length_6 = -1;
static gint hf_mac_header_generic_arq_fb_ie_rsv = -1;
static gint hf_mac_header_payload_fragment = -1;

static expert_field ei_mac_crc_malformed = EI_INIT;
static expert_field ei_mac_crc_missing = EI_INIT;
Expand Down Expand Up @@ -1087,7 +1088,7 @@ static void dissect_mac_header_generic_decoder(tvbuff_t *tvb, packet_info *pinfo
cid_vernier[cid_index]++;
}
/* Don't show reassembled packet until last fragment. */
proto_tree_add_text(tree, tvb, offset, frag_len, "Payload Fragment (%d bytes)", frag_len);
proto_tree_add_bytes_format(tree, hf_mac_header_payload_fragment, tvb, offset, frag_len, NULL, "Payload Fragment (%d bytes)", frag_len);

if (payload_frag && frag_type == LAST_FRAG)
{ /* defragmented completely */
Expand Down Expand Up @@ -1989,7 +1990,7 @@ void proto_register_mac_header_generic(void)
&hf_mac_header_generic_grant_mgmt_ext_pbr_tree,
{
"Scheduling Service Type (Default)",
"wimax.genericGrantSubhd.Default",
"wmx.genericGrantSubhd.Default",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL
}
Expand Down Expand Up @@ -2054,7 +2055,7 @@ void proto_register_mac_header_generic(void)
&hf_mac_header_generic_grant_mgmt_ext_rtps_tree,
{
"Scheduling Service Type (Extended rtPS)",
"wimax.genericGrantSubhd.ExtendedRTPS",
"wmx.genericGrantSubhd.ExtendedRTPS",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL
}
Expand Down Expand Up @@ -2213,7 +2214,15 @@ void proto_register_mac_header_generic(void)
FT_UINT16, BASE_DEC, NULL, ARQ_FB_IE_RSV_MASK,
NULL, HFILL
}
}
},
{
&hf_mac_header_payload_fragment,
{
"Payload Fragment", "wmx.payload_fragment",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL
}
},
};

/* Setup protocol subtree array */
Expand Down
Loading

0 comments on commit 889c566

Please sign in to comment.