2 * WiMax MAC Management AAS-BEAM-SELECT/REQ/RSP Messages decoders
4 * Copyright (c) 2007 by Intel Corporation.
6 * Author: Lu Pan <lu.pan@intel.com>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1999 Gerald Combs
12 * SPDX-License-Identifier: GPL-2.0-or-later
19 #include <epan/packet.h>
20 #include "wimax_mac.h"
22 #define OFDMA_AAS_FBCK_REQ_NUMBER_OF_FRAME_MASK 0xFE
23 #define OFDMA_AAS_FBCK_REQ_DATA_TYPE_MASK 0x01
24 #define OFDMA_AAS_FBCK_REQ_FB_REQ_COUNTER_MASK 0xE0
25 #define OFDMA_AAS_FBCK_REQ_FB_REQ_RESOLUTION_MASK 0x18
26 #define OFDMA_AAS_FBCK_REQ_FB_REQ_RESERVED_MASK 0x07
28 #define OFDMA_AAS_FBCK_REQ_FB_RSP_RESERVED_MASK 0xC0
29 #define OFDMA_AAS_FBCK_RSP_DATA_TYPE_MASK 0x20
30 #define OFDMA_AAS_FBCK_REQ_FB_RSP_COUNTER_MASK 0x1C
31 #define OFDMA_AAS_FBCK_REQ_FB_RSP_RESOLUTION_MASK 0x03
33 void proto_register_mac_mgmt_msg_aas_fbck(void);
34 void proto_reg_handoff_mac_mgmt_msg_aas(void);
36 static dissector_handle_t aas_req_handle
;
37 static dissector_handle_t aas_rsp_handle
;
39 static int proto_mac_mgmt_msg_aas_fbck_decoder
;
40 static int ett_mac_mgmt_msg_aas_fbck_req_decoder
;
41 static int ett_mac_mgmt_msg_aas_fbck_rsp_decoder
;
43 static const value_string vals_data_types
[] =
45 {0, "measure on downlink preamble only"},
46 {1, "measure on downlink data (for this SS) only"},
50 static const value_string vals_resolutions_0
[] =
52 {0, "32 subcarriers"},
53 {1, "64 subcarriers"},
54 {2, "128 subcarriers"},
55 {3, "256 subcarriers"},
59 static const value_string vals_resolutions_1
[] =
64 {3, "16 subcarriers"},
69 /* static int hf_aas_fbck_unknown_type; */
70 static int hf_aas_fbck_frame_number
;
71 static int hf_aas_fbck_number_of_frames
;
72 static int hf_aas_fbck_req_data_type
;
73 static int hf_aas_fbck_rsp_data_type
;
74 static int hf_aas_fbck_req_counter
;
75 static int hf_aas_fbck_rsp_counter
;
76 static int hf_aas_fbck_req_resolution_0
;
77 static int hf_aas_fbck_rsp_resolution_0
;
78 static int hf_aas_fbck_req_resolution_1
;
79 static int hf_aas_fbck_rsp_resolution_1
;
80 static int hf_aas_fbck_req_reserved
;
81 static int hf_aas_fbck_rsp_reserved
;
82 static int hf_aas_fbck_freq_value_re
;
83 static int hf_aas_fbck_freq_value_im
;
84 static int hf_aas_fbck_rssi_value
;
85 static int hf_aas_fbck_cinr_value
;
88 static int dissect_mac_mgmt_msg_aas_fbck_req_decoder(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, void* data _U_
)
92 proto_item
*aas_fbck_item
;
93 proto_tree
*aas_fbck_tree
;
95 { /* we are being asked for details */
97 /* display MAC message type */
98 aas_fbck_item
= proto_tree_add_protocol_format(tree
, proto_mac_mgmt_msg_aas_fbck_decoder
, tvb
, offset
, -1, "AAS Channel Feedback Request (AAS-FBCK-REQ)");
100 aas_fbck_tree
= proto_item_add_subtree(aas_fbck_item
, ett_mac_mgmt_msg_aas_fbck_req_decoder
);
101 /* Display the AAS-FBCK-REQ message type */
103 /* Decode and display the AAS-FBCK-REQ message body */
104 /* display the Frame Number */
105 proto_tree_add_item(aas_fbck_tree
, hf_aas_fbck_frame_number
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
106 /* move to next field */
108 /* get the data type */
109 data_type
= tvb_get_uint8(tvb
, offset
);
110 /* display the number of Frames */
111 proto_tree_add_item(aas_fbck_tree
, hf_aas_fbck_number_of_frames
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
112 /* display the Data Type */
113 proto_tree_add_item(aas_fbck_tree
, hf_aas_fbck_req_data_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
114 /* move to next field */
116 /* display the Feedback Request Counter */
117 proto_tree_add_item(aas_fbck_tree
, hf_aas_fbck_req_counter
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
118 /* display the Frequency Measurement Resolution */
119 if(data_type
& OFDMA_AAS_FBCK_REQ_DATA_TYPE_MASK
)
120 proto_tree_add_item(aas_fbck_tree
, hf_aas_fbck_req_resolution_1
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
122 proto_tree_add_item(aas_fbck_tree
, hf_aas_fbck_req_resolution_0
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
123 /* display the reserved fields */
124 proto_tree_add_item(aas_fbck_tree
, hf_aas_fbck_req_reserved
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
126 return tvb_captured_length(tvb
);
129 static int dissect_mac_mgmt_msg_aas_fbck_rsp_decoder(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, void* data _U_
)
132 unsigned tvb_len
, data_type
;
133 proto_item
*aas_fbck_item
;
134 proto_tree
*aas_fbck_tree
;
136 { /* we are being asked for details */
138 /* Get the tvb reported length */
139 tvb_len
= tvb_reported_length(tvb
);
140 /* display MAC message type */
141 aas_fbck_item
= proto_tree_add_protocol_format(tree
, proto_mac_mgmt_msg_aas_fbck_decoder
, tvb
, offset
, -1, "AAS Channel Feedback Response (AAS-FBCK-RSP)");
143 aas_fbck_tree
= proto_item_add_subtree(aas_fbck_item
, ett_mac_mgmt_msg_aas_fbck_rsp_decoder
);
144 /* Display the AAS-FBCK-RSP message type */
146 /* get the data type */
147 data_type
= tvb_get_uint8(tvb
, offset
);
148 /* Decode and display the AAS-FBCK-RSP message body */
149 /* display the reserved fields */
150 proto_tree_add_item(aas_fbck_tree
, hf_aas_fbck_rsp_reserved
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
151 /* display the Data Type */
152 proto_tree_add_item(aas_fbck_tree
, hf_aas_fbck_rsp_data_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
153 /* display the Feedback Request Counter */
154 proto_tree_add_item(aas_fbck_tree
, hf_aas_fbck_rsp_counter
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
155 /* display the Frequency Measurement Resolution */
156 if(data_type
& OFDMA_AAS_FBCK_RSP_DATA_TYPE_MASK
)
157 proto_tree_add_item(aas_fbck_tree
, hf_aas_fbck_rsp_resolution_1
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
159 proto_tree_add_item(aas_fbck_tree
, hf_aas_fbck_rsp_resolution_0
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
160 /* move to next field */
162 for(; offset
< (tvb_len
- 2); )
164 /* display the Frequency Value (real part) */
165 proto_tree_add_item(aas_fbck_tree
, hf_aas_fbck_freq_value_re
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
166 /* move to next field */
168 /* display the Frequency Value (imaginary part) */
169 proto_tree_add_item(aas_fbck_tree
, hf_aas_fbck_freq_value_im
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
170 /* move to next field */
173 /* display the RSSI Mean Value */
174 proto_tree_add_item(aas_fbck_tree
, hf_aas_fbck_rssi_value
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
175 /* move to next field */
177 /* display the CINR Mean Value */
178 proto_tree_add_item(aas_fbck_tree
, hf_aas_fbck_cinr_value
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
180 return tvb_captured_length(tvb
);
183 /* Register Wimax Mac Payload Protocol and Dissector */
184 void proto_register_mac_mgmt_msg_aas_fbck(void)
186 /* AAS-FBCK display */
187 static hf_register_info hf_aas_fbck
[] =
190 &hf_aas_fbck_cinr_value
,
192 "CINR Mean Value", "wmx.aas_fbck.cinr_mean_value",
193 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
197 &hf_aas_fbck_req_counter
,
199 "Feedback Request Counter", "wmx.aas_fbck.counter",
200 FT_UINT8
, BASE_DEC
, NULL
, OFDMA_AAS_FBCK_REQ_FB_REQ_COUNTER_MASK
, NULL
, HFILL
204 &hf_aas_fbck_frame_number
,
206 "Frame Number", "wmx.aas_fbck.frame_number",
207 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
211 &hf_aas_fbck_freq_value_re
,
213 "Frequency Value (real part)", "wmx.aas_fbck.freq_value_re",
214 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
218 &hf_aas_fbck_freq_value_im
,
220 "Frequency Value (imaginary part)", "wmx.aas_fbck.freq_value_im",
221 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
225 &hf_aas_fbck_number_of_frames
,
227 "Number Of Frames", "wmx.aas_fbck.number_of_frames",
228 FT_UINT8
, BASE_DEC
, NULL
, OFDMA_AAS_FBCK_REQ_NUMBER_OF_FRAME_MASK
, NULL
, HFILL
232 &hf_aas_fbck_req_resolution_0
,
234 "Frequency Measurement Resolution", "wmx.aas_fbck.resolution",
235 FT_UINT8
, BASE_DEC
, VALS(vals_resolutions_0
), OFDMA_AAS_FBCK_REQ_FB_REQ_RESOLUTION_MASK
, NULL
, HFILL
239 &hf_aas_fbck_req_resolution_1
,
241 "Frequency Measurement Resolution", "wmx.aas_fbck.resolution",
242 FT_UINT8
, BASE_DEC
, VALS(vals_resolutions_1
), OFDMA_AAS_FBCK_REQ_FB_REQ_RESOLUTION_MASK
, NULL
, HFILL
246 &hf_aas_fbck_rssi_value
,
248 "RSSI Mean Value", "wmx.aas_fbck.rssi_mean_value",
249 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
254 &hf_aas_fbck_unknown_type
,
256 "Unknown TLV type", "wmx.aas_fbck.unknown_type",
257 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
262 &hf_aas_fbck_req_data_type
,
264 "Measurement Data Type", "wmx.aas_fbck_req.data_type",
265 FT_UINT8
, BASE_DEC
, VALS(vals_data_types
), OFDMA_AAS_FBCK_REQ_DATA_TYPE_MASK
, NULL
, HFILL
269 &hf_aas_fbck_req_reserved
,
271 "Reserved", "wmx.aas_fbck_req.reserved",
272 FT_UINT8
, BASE_HEX
, NULL
, OFDMA_AAS_FBCK_REQ_FB_REQ_RESERVED_MASK
, NULL
, HFILL
276 &hf_aas_fbck_rsp_counter
,
278 "Feedback Request Counter", "wmx.aas_fbck_rsp.counter",
279 FT_UINT8
, BASE_DEC
, NULL
, OFDMA_AAS_FBCK_REQ_FB_RSP_COUNTER_MASK
, NULL
, HFILL
283 &hf_aas_fbck_rsp_data_type
,
285 "Measurement Data Type", "wmx.aas_fbck_rsp.data_type",
286 FT_UINT8
, BASE_DEC
, VALS(vals_data_types
), OFDMA_AAS_FBCK_RSP_DATA_TYPE_MASK
, NULL
, HFILL
290 &hf_aas_fbck_rsp_reserved
,
292 "Reserved", "wmx.aas_fbck_rsp.reserved",
293 FT_UINT8
, BASE_HEX
, NULL
, OFDMA_AAS_FBCK_REQ_FB_RSP_RESERVED_MASK
, NULL
, HFILL
297 &hf_aas_fbck_rsp_resolution_0
,
299 "Frequency Measurement Resolution", "wmx.aas_fbck_rsp.resolution",
300 FT_UINT8
, BASE_DEC
, VALS(vals_resolutions_0
), OFDMA_AAS_FBCK_REQ_FB_RSP_RESOLUTION_MASK
, NULL
, HFILL
304 &hf_aas_fbck_rsp_resolution_1
,
306 "Frequency Measurement Resolution", "wmx.aas_fbck_rsp.resolution",
307 FT_UINT8
, BASE_DEC
, VALS(vals_resolutions_1
), OFDMA_AAS_FBCK_REQ_FB_RSP_RESOLUTION_MASK
, NULL
, HFILL
312 /* Setup protocol subtree array */
315 &ett_mac_mgmt_msg_aas_fbck_req_decoder
,
316 &ett_mac_mgmt_msg_aas_fbck_rsp_decoder
,
319 proto_mac_mgmt_msg_aas_fbck_decoder
= proto_register_protocol (
320 "WiMax AAS-FEEDBACK Messages", /* name */
321 "WiMax AAS-FEEDBACK (aas)", /* short name */
322 "wmx.aas" /* abbrev */
325 proto_register_field_array(proto_mac_mgmt_msg_aas_fbck_decoder
, hf_aas_fbck
, array_length(hf_aas_fbck
));
326 proto_register_subtree_array(ett
, array_length(ett
));
327 aas_req_handle
= register_dissector("mac_mgmt_msg_aas_feedback_req_handler", dissect_mac_mgmt_msg_aas_fbck_req_decoder
, proto_mac_mgmt_msg_aas_fbck_decoder
);
328 aas_rsp_handle
= register_dissector("mac_mgmt_msg_aas_feedback_rsp_handler", dissect_mac_mgmt_msg_aas_fbck_rsp_decoder
, proto_mac_mgmt_msg_aas_fbck_decoder
);
332 proto_reg_handoff_mac_mgmt_msg_aas(void)
334 dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_AAS_FBCK_REQ
, aas_req_handle
);
335 dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_AAS_FBCK_RSP
, aas_rsp_handle
);
339 * Editor modelines - https://www.wireshark.org/tools/modelines.html
344 * indent-tabs-mode: t
347 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
348 * :indentSize=8:tabSize=8:noTabs=false: