aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ieee80211.c
diff options
context:
space:
mode:
authorRichard Sharpe <realrichardsharpe@gmail.com>2022-10-18 10:48:22 -0700
committerRichard Sharpe <realrichardsharpe@gmail.com>2022-10-18 23:20:26 +0000
commit45add8812d241cd03276d448743e7448646ffa29 (patch)
tree0d78c802b7a7c06218bb7ee4205d900be25c3126 /epan/dissectors/packet-ieee80211.c
parentf90486246f78d7da9521e63836304af156afcdc0 (diff)
ieee80211: Improve the handling of Beamforming matrices.
Reduce the number of chars used so we can fit in the 240-byte limit. Fixes #18504
Diffstat (limited to 'epan/dissectors/packet-ieee80211.c')
-rw-r--r--epan/dissectors/packet-ieee80211.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c
index a43f208d98..c653f6064b 100644
--- a/epan/dissectors/packet-ieee80211.c
+++ b/epan/dissectors/packet-ieee80211.c
@@ -15167,8 +15167,10 @@ dissect_he_feedback_matrix(proto_tree *tree, tvbuff_t *tvb, int offset,
int phi_bits, int psi_bits)
{
int ri, ci;
- proto_item *pi = NULL;
int start_bit_offset = bit_offset;
+ int start_offset = offset;
+ int str_offset = 0;
+ char angles[512];
if (nc == nr) /* If they are the same, reduce Nc by one */
nc -= 1;
@@ -15185,26 +15187,30 @@ dissect_he_feedback_matrix(proto_tree *tree, tvbuff_t *tvb, int offset,
}
}
- pi = proto_tree_add_int_format(tree, hf_ieee80211_he_compressed_beamform_scidx,
- tvb, offset, ((bit_offset + 7) / 8) - offset, scidx,
- "SCIDX: %d", scidx);
-
+ str_offset = snprintf(angles, sizeof(angles), "%d", scidx);
/* Reset to the start bit offset */
bit_offset = start_bit_offset;
for (ci = 1; ci <= nc; ci++) {
for (ri = ci; ri < nr; ri++) {
int angle = he_get_bits(tvb, bit_offset, phi_bits);
- proto_item_append_text(pi, ", phi%d%d:%d", ri, ci, angle);
+ str_offset += snprintf(angles + str_offset, sizeof(angles) - str_offset,
+ ", h%d%d:%d", ri, ci, angle);
bit_offset += phi_bits;
}
for (ri = ci + 1; ri <= nr; ri++) {
int angle = he_get_bits(tvb, bit_offset, psi_bits);
- proto_item_append_text(pi, ", psi%d%d:%d", ri, ci, angle);
+ str_offset += snprintf(angles + str_offset, sizeof(angles) - str_offset,
+ ", s%d%d:%d", ri, ci, angle);
bit_offset += psi_bits;
}
}
+ /* Update this */
+ proto_tree_add_string(tree, hf_ieee80211_he_compressed_beamform_scidx,
+ tvb, offset, ((start_bit_offset + 7) / 8) - start_offset,
+ angles);
+
return bit_offset;
}
@@ -38841,7 +38847,7 @@ proto_register_ieee80211(void)
{&hf_ieee80211_he_compressed_beamform_scidx,
{"SCIDX", "wlan.he.action.he_mimo_control.scidx",
- FT_INT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+ FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
{&hf_ieee80211_beamforming_report_len,
{"Report Len", "wlan.he.action.he_mimo_control.report_len",