Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / plugins / epan / wimax / wimax_phy_attributes_decoder.c
blob646040d38824a176bb8b9feb8e1bf055bcd22af0
1 /* wimax_phy_attributes_decoder.c
2 * WiMax PDU Burst Physical Attributes decoder
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
15 /* Include files */
17 #include "config.h"
19 #include <epan/packet.h>
20 #include "wimax-int.h"
22 extern int proto_wimax;
24 static int proto_wimax_phy_attributes_decoder;
25 static int ett_wimax_phy_attributes_decoder;
27 static const value_string vals_subchannel_types[] =
29 { 0, "DL PUSC"},
30 { 1, "DL FUSC"},
31 {16, "UL PUSC"},
32 {0, NULL}
35 static const value_string vals_modulation_rates[] =
37 {0, "BPSK R=1/2"},
38 {1, "QPSK R=1/2"},
39 {2, "QPSK R=3/4"},
40 {3, "16-QAM R=1/2"},
41 {4, "16-QAM R=3/4"},
42 {5, "64-QAM R=1/2"},
43 {6, "64-QAM R=2/3"},
44 {7, "64-QAM R=3/4"},
45 {8, "64-QAM R=5/6"},
46 {0, NULL}
49 static const value_string vals_encoding_types[] =
51 {0, "Tail biting convolutional coding (CCTB)"},
52 {1, "Convolutional turbo coding (CTC)"},
53 {0, NULL}
56 static int hf_phy_attributes_subchannelization_type;
57 static int hf_phy_attributes_permbase;
58 static int hf_phy_attributes_modulation_rate;
59 static int hf_phy_attributes_encoding_type;
60 static int hf_phy_attributes_num_repeat;
61 static int hf_phy_attributes_symbol_offset;
62 static int hf_phy_attributes_num_of_slots;
63 static int hf_phy_attributes_subchannel;
67 static int dissect_wimax_phy_attributes_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
69 unsigned offset = 0;
70 unsigned tvb_len;
71 /* unsigned num_of_slots;*/
72 proto_item *phy_item = NULL;
73 proto_tree *phy_tree = NULL;
75 /* update the info column */
76 /*col_append_str(pinfo->cinfo, COL_INFO, "PDU Burst Physical Attributes:");*/
77 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "PHY-attr");
78 if (tree)
79 { /* we are being asked for details */
80 /* get the tvb reported length */
81 tvb_len = tvb_reported_length(tvb);
82 /* display PDU Burst Physical Attributes dissector info */
83 phy_item = proto_tree_add_protocol_format(tree, proto_wimax_phy_attributes_decoder, tvb, offset, tvb_len, "PDU Burst Physical Attributes (%u bytes)", tvb_len);
84 /* add PDU Burst Physical Attributes subtree */
85 phy_tree = proto_item_add_subtree(phy_item, ett_wimax_phy_attributes_decoder);
86 /* display the subchannelization type */
87 proto_tree_add_item(phy_tree, hf_phy_attributes_subchannelization_type, tvb, offset++, 1, ENC_BIG_ENDIAN);
88 /* display the permbase */
89 proto_tree_add_item(phy_tree, hf_phy_attributes_permbase, tvb, offset++, 1, ENC_BIG_ENDIAN);
90 /* display the modulation rate */
91 proto_tree_add_item(phy_tree, hf_phy_attributes_modulation_rate, tvb, offset++, 1, ENC_BIG_ENDIAN);
92 /* display the encoding type */
93 proto_tree_add_item(phy_tree, hf_phy_attributes_encoding_type, tvb, offset++, 1, ENC_BIG_ENDIAN);
94 /* display the numRepeat */
95 proto_tree_add_item(phy_tree, hf_phy_attributes_num_repeat, tvb, offset++, 1, ENC_BIG_ENDIAN);
96 /* display the symbol offset */
97 proto_tree_add_item(phy_tree, hf_phy_attributes_symbol_offset, tvb, offset++, 1, ENC_BIG_ENDIAN);
98 /* display the number of slots */
99 proto_tree_add_item(phy_tree, hf_phy_attributes_num_of_slots, tvb, offset, 2, ENC_BIG_ENDIAN);
100 /* get the number of slots */
101 /* num_of_slots = tvb_get_uint16(tvb, offset);*/
102 /* move to next field */
103 offset += 2;
104 /* display the physical subchannel list */
105 while(offset < tvb_len)
107 proto_tree_add_item(phy_tree, hf_phy_attributes_subchannel, tvb, offset++, 1, ENC_BIG_ENDIAN);
110 return tvb_captured_length(tvb);
113 /* Register Wimax PDU Burst Physical Attributes Protocol */
114 void wimax_proto_register_wimax_phy_attributes(void)
116 /* Physical Attributes display */
117 static hf_register_info hf[] =
120 &hf_phy_attributes_subchannelization_type,
121 {"Subchannelization Type", "wmx.phy_attributes.subchannelization_type", FT_UINT8, BASE_DEC, VALS(vals_subchannel_types), 0x0, NULL, HFILL}
124 &hf_phy_attributes_permbase,
125 {"Permbase", "wmx.phy_attributes.permbase", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
128 &hf_phy_attributes_modulation_rate,
129 {"Modulation Rate", "wmx.phy_attributes.modulation_rate", FT_UINT8, BASE_DEC, VALS(vals_modulation_rates), 0x0, NULL, HFILL}
132 &hf_phy_attributes_encoding_type,
133 {"Encoding Type", "wmx.phy_attributes.encoding_type", FT_UINT8, BASE_DEC, VALS(vals_encoding_types), 0x0, NULL, HFILL}
136 &hf_phy_attributes_num_repeat,
137 {"numRepeat", "wmx.phy_attributes.num_repeat", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
140 &hf_phy_attributes_symbol_offset,
141 {"Symbol Offset", "wmx.phy_attributes.symbol_offset", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
144 &hf_phy_attributes_num_of_slots,
145 {"Number Of Slots", "wmx.phy_attributes.num_of_slots", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
148 &hf_phy_attributes_subchannel,
149 {"Subchannel", "wmx.phy_attributes.subchannel", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
153 /* Setup protocol subtree array */
154 static int *ett[] =
156 &ett_wimax_phy_attributes_decoder
159 proto_wimax_phy_attributes_decoder = proto_wimax;
161 register_dissector("wimax_phy_attributes_burst_handler", dissect_wimax_phy_attributes_decoder, proto_wimax_phy_attributes_decoder);
163 proto_register_field_array(proto_wimax_phy_attributes_decoder, hf, array_length(hf));
164 proto_register_subtree_array(ett, array_length(ett));
168 * Editor modelines - https://www.wireshark.org/tools/modelines.html
170 * Local variables:
171 * c-basic-offset: 8
172 * tab-width: 8
173 * indent-tabs-mode: t
174 * End:
176 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
177 * :indentSize=8:tabSize=8:noTabs=false: