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
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
[] =
35 static const value_string vals_modulation_rates
[] =
49 static const value_string vals_encoding_types
[] =
51 {0, "Tail biting convolutional coding (CCTB)"},
52 {1, "Convolutional turbo coding (CTC)"},
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_
)
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");
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 */
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 */
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
173 * indent-tabs-mode: t
176 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
177 * :indentSize=8:tabSize=8:noTabs=false: