Do some more conversions of proto_tree_add_item() 'encoding' arg
[obnox/wireshark/wip.git] / plugins / wimax / wimax_compact_dlmap_ie_decoder.c
1 /* wimax_compact_dlmap_ie_decoder.c
2  * WiMax HARQ Map Message decoder
3  *
4  * Copyright (c) 2007 by Intel Corporation.
5  *
6  * Author: Lu Pan <lu.pan@intel.com>
7  *
8  * $Id$
9  *
10  * Wireshark - Network traffic analyzer
11  * By Gerald Combs <gerald@wireshark.org>
12  * Copyright 1999 Gerald Combs
13  *
14  * This program is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU General Public License
16  * as published by the Free Software Foundation; either version 2
17  * of the License, or (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, write to the Free Software
26  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
27  */
28
29 /* Include files */
30
31 #ifdef HAVE_CONFIG_H
32 #include "config.h"
33 #endif
34
35 #include <glib.h>
36 #include <epan/packet.h>
37 #include "crc.h"
38 #include "wimax_tlv.h"
39
40 extern gint proto_wimax;
41
42 /* MASKs */
43 #define MSB_NIBBLE_MASK      0xF0
44 #define LSB_NIBBLE_MASK      0x0F
45
46 #define CID_TYPE_NORMAL      0
47 #define CID_TYPE_RCID11      1
48 #define CID_TYPE_RCID7       2
49 #define CID_TYPE_RCID3       3
50
51 /* Global Variables */
52 guint cid_type = 0;
53 guint band_amc_subchannel_type = 0;
54 guint max_logical_bands = 12;
55 guint num_of_broadcast_symbols = 0;
56 guint num_of_dl_band_amc_symbols = 0;
57 guint num_of_ul_band_amc_symbols = 0;
58 /* from switch HARQ mode extension IE */
59 guint harq_mode = 0;
60
61 /* forward reference */
62 static guint wimax_compact_dlmap_format_configuration_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset);
63 static guint wimax_compact_dlmap_rcid_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset);
64 static guint wimax_compact_dlmap_harq_control_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset);
65 static guint wimax_compact_dlmap_cqich_control_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset);
66 static guint wimax_cdlmap_extension_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset);
67 guint wimax_extended_diuc_dependent_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset);
68
69 static gint proto_wimax_compact_dlmap_ie_decoder = -1;
70
71 #if 0 /* not used ?? */
72 static gint ett_wimax_compact_dlmap_ie_decoder = -1;
73 static gint ett_wimax_format_configuration_ie_decoder = -1;
74 static gint ett_wimax_rcid_ie_decoder = -1;
75 static gint ett_wimax_harq_control_ie_decoder = -1;
76 static gint ett_wimax_extended_diuc_dependent_ie_decoder = -1;
77 static gint ett_wimax_cqich_control_ie_decoder = -1;
78 static gint ett_wimax_extension_type_ie_decoder = -1;
79 #endif
80
81 /* New Format Indications */
82 static const true_false_string tfs_indication =
83 {
84     "New format",
85     "No new format"
86 };
87
88 /* Prefixes */
89 static const true_false_string tfs_prefix =
90 {
91     "Enable HARQ",
92     "Temporary Disable HARQ"
93 };
94
95 /* CQICH Indicator */
96 static const true_false_string tfs_cqich_ind =
97 {
98     "With CQICH Control IE",
99     "No CQICH Control IE"
100 };
101
102 /* CID types */
103 static const value_string vals_cid_types[] =
104 {
105     { 0, "Normal CID" },
106     { 1, "RCID11 (default)" },
107     { 2, "RCID7" },
108     { 3, "RCID3" },
109     { 0,  NULL }
110 };
111
112 /* Subchannel Types */
113 static const value_string vals_subchannel_types[] =
114 {
115     { 0, "Default Type" },
116     { 1, "1 bin x 6 symbols Type" },
117     { 2, "2 bin x 3 symbols Type" },
118     { 3, "3 bin x 2 symbols Type" },
119     { 0,  NULL }
120 };
121
122 /* Max Logical Bands */
123 static const value_string vals_max_logical_bands[] =
124 {
125     { 0, "3 Bands" },
126     { 1, "6 Bands" },
127     { 2, "12 Bands (default)" },
128     { 3, "24 Bands" },
129     { 0,  NULL }
130 };
131
132 /* Repetition Coding Indications */
133 static const value_string rep_msgs[] =
134 {
135     { 0, "No Repetition Coding" },
136     { 1, "Repetition Coding of 2 Used" },
137     { 2, "Repetition Coding of 4 Used" },
138     { 3, "Repetition Coding of 6 Used" },
139     { 0,  NULL }
140 };
141
142 /* Repetition Coding Indications */
143 static const value_string vals_allocation_modes[] =
144 {
145     { 0, "Same Number Of Subchannels For The Selected Bands" },
146     { 1, "Different Same Number Of Subchannels For The Selected Bands" },
147     { 2, "Total Number Of Subchannels For The Selected Bands Determined by Nsch Code and Nep Code" },
148     { 3, "Reserved" },
149     { 0,  NULL }
150 };
151
152 /* Masks */
153 #define DL_MAP_TYPE_MASK      0xE0
154 #define UL_MAP_APPEND_MASK    0x10
155 #define SHORTENED_DIUC_MASK   0xE0
156 #define COMPANDED_SC_MASK     0x1F
157 #define DL_MAP_TYPE_MASK_1    0x0E
158 #define UL_MAP_APPEND_MASK_1  0x01
159 #define SHORTENED_DIUC_MASK_1 0x0E00
160 #define COMPANDED_SC_MASK_1   0x01F0
161
162 /* display indexies */
163 static gint hf_cdlmap_dl_map_type = -1;
164 static gint hf_cdlmap_ul_map_append = -1;
165 static gint hf_cdlmap_reserved = -1;
166 static gint hf_cdlmap_nep_code = -1;
167 static gint hf_cdlmap_nsch_code = -1;
168 static gint hf_cdlmap_num_bands = -1;
169 static gint hf_cdlmap_band_index = -1;
170 static gint hf_cdlmap_nb_bitmap = -1;
171 static gint hf_cdlmap_dl_map_type_1 = -1;
172 static gint hf_cdlmap_ul_map_append_1 = -1;
173 static gint hf_cdlmap_reserved_1 = -1;
174 static gint hf_cdlmap_nep_code_1 = -1;
175 static gint hf_cdlmap_nsch_code_1 = -1;
176 static gint hf_cdlmap_num_bands_1 = -1;
177 /*static gint hf_cdlmap_band_index_1 = -1;*/
178 static gint hf_cdlmap_nb_bitmap_1 = -1;
179
180 static gint hf_cdlmap_shortened_diuc = -1;
181 static gint hf_cdlmap_companded_sc = -1;
182 static gint hf_cdlmap_shortened_uiuc = -1;
183 static gint hf_cdlmap_shortened_diuc_1 = -1;
184 static gint hf_cdlmap_companded_sc_1 = -1;
185 static gint hf_cdlmap_shortened_uiuc_1 = -1;
186
187 static gint hf_cdlmap_bin_offset = -1;
188 static gint hf_cdlmap_bin_offset_1 = -1;
189
190 static gint hf_cdlmap_diuc_num_of_subchannels = -1;
191 static gint hf_cdlmap_diuc_num_of_subchannels_1 = -1;
192 static gint hf_cdlmap_diuc_repetition_coding_indication = -1;
193 static gint hf_cdlmap_diuc_repetition_coding_indication_1 = -1;
194 static gint hf_cdlmap_diuc_reserved = -1;
195 static gint hf_cdlmap_diuc_reserved_1 = -1;
196
197 static gint hf_cdlmap_bit_map_length = -1;
198 static gint hf_cdlmap_bit_map_length_1 = -1;
199 static gint hf_cdlmap_bit_map = -1;
200
201 static gint hf_cdlmap_diuc = -1;
202 static gint hf_cdlmap_diuc_1 = -1;
203
204 static gint hf_cdlmap_allocation_mode = -1;
205 static gint hf_cdlmap_allocation_mode_rsvd = -1;
206 static gint hf_cdlmap_num_subchannels = -1;
207 static gint hf_cdlmap_allocation_mode_1 = -1;
208 static gint hf_cdlmap_allocation_mode_rsvd_1 = -1;
209 static gint hf_cdlmap_num_subchannels_1 = -1;
210
211 static gint hf_cdlmap_reserved_type = -1;
212 static gint hf_cdlmap_reserved_type_1 = -1;
213
214 /* display indexies */
215 static gint hf_format_config_ie_dl_map_type = -1;
216 static gint hf_format_config_ie_dl_map_type_1 = -1;
217 static gint hf_format_config_ie_dl_map_type_32 = -1;
218 static gint hf_format_config_ie_new_format_indication = -1;
219 static gint hf_format_config_ie_new_format_indication_1 = -1;
220 static gint hf_format_config_ie_new_format_indication_32 = -1;
221 static gint hf_format_config_ie_cid_type = -1;
222 static gint hf_format_config_ie_cid_type_1 = -1;
223 static gint hf_format_config_ie_safety_pattern = -1;
224 static gint hf_format_config_ie_safety_pattern_1 = -1;
225 static gint hf_format_config_ie_subchannel_type = -1;
226 static gint hf_format_config_ie_subchannel_type_1 = -1;
227 static gint hf_format_config_ie_max_logical_bands = -1;
228 static gint hf_format_config_ie_max_logical_bands_1 = -1;
229 static gint hf_format_config_ie_num_of_broadcast_symbol = -1;
230 static gint hf_format_config_ie_num_of_broadcast_symbol_1 = -1;
231 static gint hf_format_config_ie_num_of_dl_band_amc_symbol = -1;
232 static gint hf_format_config_ie_num_of_dl_band_amc_symbol_1 = -1;
233 static gint hf_format_config_ie_num_of_ul_band_amc_symbol = -1;
234 static gint hf_format_config_ie_num_of_ul_band_amc_symbol_1 = -1;
235
236 /* Format Configuration IE Masks */
237 #define FORMAT_CONFIG_IE_DL_MAP_TYPE_MASK    0xE0000000
238 #define FORMAT_CONFIG_IE_NEW_FORMAT_IND_MASK 0x10000000
239 #define CID_TYPE_MASK_1                      0x0C000000
240 #define SAFETY_PATTERN_MASK_1                0x03E00000
241 #define BAND_AMC_SUBCHANNEL_TYPE_MASK_1      0x00180000
242 #define MAX_LOGICAL_BANDS_MASK_1             0x00060000
243 #define NUM_BROADCAST_SYMBOLS_MASK_1         0x0001F000
244 #define NUM_DL_AMC_SYMBOLS_MASK_1            0x00000FC0
245 #define NUM_UL_AMC_SYMBOLS_MASK_1            0x0000003F
246 #define CID_TYPE_MASK                        0xC0000000
247 #define SAFETY_PATTERN_MASK                  0x3E000000
248 #define BAND_AMC_SUBCHANNEL_TYPE_MASK        0x01800000
249 #define MAX_LOGICAL_BANDS_MASK               0x00600000
250 #define NUM_BROADCAST_SYMBOLS_MASK           0x001F0000
251 #define NUM_DL_AMC_SYMBOLS_MASK              0x0000FC00
252 #define NUM_UL_AMC_SYMBOLS_MASK              0x000003F0
253
254 /* display indexies */
255 static gint hf_harq_rcid_ie_prefix = -1;
256 static gint hf_harq_rcid_ie_prefix_1 = -1;
257 static gint hf_harq_rcid_ie_normal_cid = -1;
258 static gint hf_harq_rcid_ie_normal_cid_1 = -1;
259 static gint hf_harq_rcid_ie_cid3 = -1;
260 static gint hf_harq_rcid_ie_cid3_1 = -1;
261 static gint hf_harq_rcid_ie_cid7 = -1;
262 static gint hf_harq_rcid_ie_cid7_1 = -1;
263 static gint hf_harq_rcid_ie_cid11 = -1;
264 static gint hf_harq_rcid_ie_cid11_1 = -1;
265 static gint hf_harq_rcid_ie_cid11_2 = -1;
266 static gint hf_harq_rcid_ie_cid11_3 = -1;
267
268 /* Masks */
269 #define WIMAX_RCID_IE_NORMAL_CID_MASK_1      0x0FFFF0
270 #define WIMAX_RCID_IE_PREFIX_MASK            0x8000
271 #define WIMAX_RCID_IE_PREFIX_MASK_1          0x0800
272 #define WIMAX_RCID_IE_CID3_MASK              0x7000
273 #define WIMAX_RCID_IE_CID3_MASK_1            0x0700
274 #define WIMAX_RCID_IE_CID7_MASK              0x7F00
275 #define WIMAX_RCID_IE_CID7_MASK_1            0x07F0
276 #define WIMAX_RCID_IE_CID11_MASK             0x7FF0
277 #define WIMAX_RCID_IE_CID11_MASK_1           0x07FF
278
279 /* HARQ MAP HARQ Control IE display indexies */
280 static gint hf_harq_control_ie_prefix = -1;
281 static gint hf_harq_control_ie_ai_sn = -1;
282 static gint hf_harq_control_ie_spid = -1;
283 static gint hf_harq_control_ie_acid = -1;
284 static gint hf_harq_control_ie_reserved = -1;
285 static gint hf_harq_control_ie_prefix_1 = -1;
286 static gint hf_harq_control_ie_ai_sn_1 = -1;
287 static gint hf_harq_control_ie_spid_1 = -1;
288 static gint hf_harq_control_ie_acid_1 = -1;
289 static gint hf_harq_control_ie_reserved_1 = -1;
290
291 /* Masks */
292 #define WIMAX_HARQ_CONTROL_IE_PREFIX_MASK      0x80
293 #define WIMAX_HARQ_CONTROL_IE_AI_SN_MASK       0x40
294 #define WIMAX_HARQ_CONTROL_IE_SPID_MASK        0x30
295 #define WIMAX_HARQ_CONTROL_IE_ACID_MASK        0x0F
296 #define WIMAX_HARQ_CONTROL_IE_RESERVED_MASK    0x70
297 #define WIMAX_HARQ_CONTROL_IE_PREFIX_MASK_1    0x0800
298 #define WIMAX_HARQ_CONTROL_IE_AI_SN_MASK_1     0x0400
299 #define WIMAX_HARQ_CONTROL_IE_SPID_MASK_1      0x0300
300 #define WIMAX_HARQ_CONTROL_IE_ACID_MASK_1      0x00F0
301 #define WIMAX_HARQ_CONTROL_IE_RESERVED_MASK_1  0x0700
302
303 /* HARQ MAP CQICH Control IE display indexies */
304 static gint hf_cqich_control_ie_indicator = -1;
305 static gint hf_cqich_control_ie_alloc_id = -1;
306 static gint hf_cqich_control_ie_period = -1;
307 static gint hf_cqich_control_ie_frame_offset = -1;
308 static gint hf_cqich_control_ie_duration = -1;
309 static gint hf_cqich_control_ie_cqi_rep_threshold = -1;
310 static gint hf_cqich_control_ie_indicator_1 = -1;
311 static gint hf_cqich_control_ie_alloc_id_1 = -1;
312 static gint hf_cqich_control_ie_period_1 = -1;
313 static gint hf_cqich_control_ie_frame_offset_1 = -1;
314 static gint hf_cqich_control_ie_duration_1 = -1;
315 static gint hf_cqich_control_ie_cqi_rep_threshold_1 = -1;
316
317 /* Masks */
318 #define WIMAX_CQICH_CONTROL_IE_INDICATOR_MASK           0x8000
319 #define WIMAX_CQICH_CONTROL_IE_ALLOCATION_INDEX_MASK    0x7E00
320 #define WIMAX_CQICH_CONTROL_IE_PERIOD_MASK              0x0180
321 #define WIMAX_CQICH_CONTROL_IE_FRAME_OFFSET_MASK        0x0070
322 #define WIMAX_CQICH_CONTROL_IE_DURATION_MASK            0x000F
323 #define WIMAX_CQICH_CONTROL_IE_CQI_REP_THRESHOLD_MASK   0x7000
324 #define WIMAX_CQICH_CONTROL_IE_INDICATOR_MASK_1         0x080000
325 #define WIMAX_CQICH_CONTROL_IE_ALLOCATION_INDEX_MASK_1  0x07E000
326 #define WIMAX_CQICH_CONTROL_IE_PERIOD_MASK_1            0x001800
327 #define WIMAX_CQICH_CONTROL_IE_FRAME_OFFSET_MASK_1      0x000700
328 #define WIMAX_CQICH_CONTROL_IE_DURATION_MASK_1          0x0000F0
329 #define WIMAX_CQICH_CONTROL_IE_CQI_REP_THRESHOLD_MASK_1 0x070000
330
331 /* Extension Type */
332 #define EXTENSION_TYPE_MASK         0xE000
333 #define EXTENSION_TYPE_MASK_1       0x0E00
334 #define EXTENSION_SUBTYPE_MASK      0x1F00
335 #define EXTENSION_SUBTYPE_MASK_1    0x01F0
336 #define EXTENSION_LENGTH_MASK       0x00F0
337 #define EXTENSION_LENGTH_MASK_1     0x000F
338
339 static gint hf_cdlmap_extension_type = -1;
340 static gint hf_cdlmap_extension_subtype = -1;
341 static gint hf_cdlmap_extension_length = -1;
342 static gint hf_cdlmap_extension_type_1 = -1;
343 static gint hf_cdlmap_extension_subtype_1 = -1;
344 static gint hf_cdlmap_extension_length_1 = -1;
345
346 static gint hf_cdlmap_extension_time_diversity_mbs = -1;
347 static gint hf_cdlmap_extension_harq_mode = -1;
348 static gint hf_cdlmap_extension_unknown_sub_type = -1;
349 static gint hf_cdlmap_extension_time_diversity_mbs_1 = -1;
350 static gint hf_cdlmap_extension_harq_mode_1 = -1;
351 static gint hf_cdlmap_extension_unknown_sub_type_1 = -1;
352
353 /* Extended DIUC dependent IE display indexies */
354 static gint hf_extended_diuc_dependent_ie_diuc = -1;
355 static gint hf_extended_diuc_dependent_ie_diuc_1 = -1;
356 static gint hf_extended_diuc_dependent_ie_length = -1;
357 static gint hf_extended_diuc_dependent_ie_length_1 = -1;
358 static gint hf_extended_diuc_dependent_ie_channel_measurement = -1;
359 static gint hf_extended_diuc_dependent_ie_stc_zone = -1;
360 static gint hf_extended_diuc_dependent_ie_aas_dl = -1;
361 static gint hf_extended_diuc_dependent_ie_data_location = -1;
362 static gint hf_extended_diuc_dependent_ie_cid_switch = -1;
363 static gint hf_extended_diuc_dependent_ie_mimo_dl_basic = -1;
364 static gint hf_extended_diuc_dependent_ie_mimo_dl_enhanced = -1;
365 static gint hf_extended_diuc_dependent_ie_harq_map_pointer = -1;
366 static gint hf_extended_diuc_dependent_ie_phymod_dl = -1;
367 static gint hf_extended_diuc_dependent_ie_dl_pusc_burst_allocation = -1;
368 static gint hf_extended_diuc_dependent_ie_ul_interference_and_noise_level = -1;
369 static gint hf_extended_diuc_dependent_ie_unknown_diuc = -1;
370
371
372 /* Compact DL-MAP IE Types (table 89) */
373 #define COMPACT_DL_MAP_TYPE_NORMAL_SUBCHANNEL   0
374 #define COMPACT_DL_MAP_TYPE_BAND_AMC            1
375 #define COMPACT_DL_MAP_TYPE_SAFETY              2
376 #define COMPACT_DL_MAP_TYPE_UIUC                3
377 #define COMPACT_DL_MAP_TYPE_FORMAT_CONF_IE      4
378 #define COMPACT_DL_MAP_TYPE_HARQ_ACK_BITMAP_IE  5
379 #define COMPACT_DL_MAP_TYPE_RESERVED            6
380 #define COMPACT_DL_MAP_TYPE_EXTENSION           7
381
382 /* Compact DL-MAP IE decoder */
383 guint wimax_compact_dlmap_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset)
384 {
385         guint diuc, byte, length = 0;
386         guint dl_map_type, ul_map_append;
387         guint dl_map_offset, nibble_length, bit_map_length;
388         guint nband, band_count, i, allocation_mode;
389
390 #ifdef DEBUG
391         /* update the info column */
392         col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Compact DL-MAP IEs");
393 #endif
394         /* set the local offset */
395         dl_map_offset = offset;
396         /* Get the first byte */
397         byte = tvb_get_guint8(tvb, dl_map_offset);
398         if(nibble_offset & 1)
399         {
400                 dl_map_type = ((byte & DL_MAP_TYPE_MASK_1) >> 1);
401                 ul_map_append = (byte & UL_MAP_APPEND_MASK_1);
402         }
403         else
404         {
405                 dl_map_type = ((byte & DL_MAP_TYPE_MASK) >> 5);
406                 ul_map_append = (byte & UL_MAP_APPEND_MASK);
407         }
408         switch (dl_map_type)
409         {
410                 case COMPACT_DL_MAP_TYPE_NORMAL_SUBCHANNEL:/* 6.3.2.3.43.6.1 */
411                         if(nibble_offset & 1)
412                         {       /* display the DL-MAP type */
413                                 proto_tree_add_item(tree, hf_cdlmap_dl_map_type_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
414                                 /* display the UL-MAP append */
415                                 proto_tree_add_item(tree, hf_cdlmap_ul_map_append_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
416                                 /* move to next byte */
417                                 dl_map_offset++;
418                                 nibble_offset = 0;
419                         }
420                         else
421                         {       /* display the DL-MAP type */
422                                 proto_tree_add_item(tree, hf_cdlmap_dl_map_type, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
423                                 /* display the UL-MAP append */
424                                 proto_tree_add_item(tree, hf_cdlmap_ul_map_append, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
425                                 nibble_offset = 1;
426                         }
427                         length = 1;
428                         /* decode RCID IE */
429                         nibble_length = wimax_compact_dlmap_rcid_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
430                         length += nibble_length;
431                         dl_map_offset += (nibble_length >> 1);
432                         nibble_offset = (nibble_length & 1);
433                         /* check harq mode */
434                         if(!harq_mode)
435                         {       /* display the Nep and Nsch Code */
436                                 if(nibble_offset & 1)
437                                 {
438                                         proto_tree_add_item(tree, hf_cdlmap_nep_code_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
439                                         /* move to next byte */
440                                         dl_map_offset++;
441                                         proto_tree_add_item(tree, hf_cdlmap_nsch_code, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
442                                 }
443                                 else
444                                 {
445                                         proto_tree_add_item(tree, hf_cdlmap_nep_code, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
446                                         proto_tree_add_item(tree, hf_cdlmap_nsch_code_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
447                                         /* move to next byte */
448                                         dl_map_offset++;
449                                 }
450                                 length += 2;
451                         }
452                         else if(harq_mode == 1)
453                         {       /* display the Shortened DIUC and Companded SC */
454                                 if(nibble_offset & 1)
455                                 {
456                                         proto_tree_add_item(tree, hf_cdlmap_shortened_diuc_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
457                                         proto_tree_add_item(tree, hf_cdlmap_companded_sc_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
458                                 }
459                                 else
460                                 {
461                                         proto_tree_add_item(tree, hf_cdlmap_shortened_diuc, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
462                                                 proto_tree_add_item(tree, hf_cdlmap_companded_sc, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
463                                 }
464                                 /* move to next byte */
465                                 dl_map_offset++;
466                                 length += 2;
467                         }
468                         /* decode HARQ Control IE */
469                         nibble_length = wimax_compact_dlmap_harq_control_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
470                         length += nibble_length;
471                         dl_map_offset += ((nibble_offset + nibble_length) >> 1);
472                         nibble_offset = ((nibble_offset + nibble_length) & 1);
473                         /* decode CQICH Control IE */
474                         nibble_length = wimax_compact_dlmap_cqich_control_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
475                         length += nibble_length;
476                         dl_map_offset += ((nibble_offset + nibble_length) >> 1);
477                         nibble_offset = ((nibble_offset + nibble_length) & 1);
478                         if(ul_map_append)
479                         {       /* check harq mode */
480                                 if(harq_mode == 1)
481                                 {       /* display the Shortened UIUC and Companded SC */
482                                         if(nibble_offset & 1)
483                                         {
484                                                 proto_tree_add_item(tree, hf_cdlmap_shortened_uiuc_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
485                                                 proto_tree_add_item(tree, hf_cdlmap_companded_sc_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
486                                         }
487                                         else
488                                         {
489                                                 proto_tree_add_item(tree, hf_cdlmap_shortened_uiuc, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
490                                                 proto_tree_add_item(tree, hf_cdlmap_companded_sc, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
491                                         }
492                                         /* move to next byte */
493                                         dl_map_offset++;
494                                         length += 2;
495                                 }
496                                 else if(!harq_mode)
497                                 {       /* display the Nep and Nsch Code */
498                                         if(nibble_offset & 1)
499                                         {
500                                                 proto_tree_add_item(tree, hf_cdlmap_nep_code_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
501                                                 /* move to next byte */
502                                                 dl_map_offset++;
503                                                 proto_tree_add_item(tree, hf_cdlmap_nsch_code, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
504                                         }
505                                         else
506                                         {
507                                                 proto_tree_add_item(tree, hf_cdlmap_nep_code, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
508                                                 proto_tree_add_item(tree, hf_cdlmap_nsch_code_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
509                                                 /* move to next byte */
510                                                 dl_map_offset++;
511                                         }
512                                         length += 2;
513                                 }
514                                 /* decode HARQ Control IE */
515                                 nibble_length = wimax_compact_dlmap_harq_control_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
516                                 length += nibble_length;
517                         }
518                 break;
519                 case COMPACT_DL_MAP_TYPE_BAND_AMC:/* 6.3.2.3.43.6.2 */
520                         if(nibble_offset & 1)
521                         {       /* display the DL-MAP type */
522                                 proto_tree_add_item(tree, hf_cdlmap_dl_map_type_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
523                                 /* display the reserved */
524                                 proto_tree_add_item(tree, hf_cdlmap_reserved_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
525                                 /* move to next byte */
526                                 dl_map_offset++;
527                                 nibble_offset = 0;
528                         }
529                         else
530                         {       /* display the DL-MAP type */
531                                 proto_tree_add_item(tree, hf_cdlmap_dl_map_type, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
532                                 /* display the reserved */
533                                 proto_tree_add_item(tree, hf_cdlmap_reserved, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
534                                 nibble_offset = 1;
535                         }
536                         length = 1;
537                         /* decode RCID IE */
538                         nibble_length = wimax_compact_dlmap_rcid_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
539                         length += nibble_length;
540                         dl_map_offset += (nibble_length >> 1);
541                         nibble_offset = (nibble_length & 1);
542                         /* check harq mode */
543                         if(!harq_mode)
544                         {       /* display the Nep and Nsch Code */
545                                 if(nibble_offset & 1)
546                                 {
547                                         proto_tree_add_item(tree, hf_cdlmap_nep_code_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
548                                         /* move to next byte */
549                                         dl_map_offset++;
550                                         proto_tree_add_item(tree, hf_cdlmap_nsch_code, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
551                                 }
552                                 else
553                                 {
554                                         proto_tree_add_item(tree, hf_cdlmap_nep_code, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
555                                         proto_tree_add_item(tree, hf_cdlmap_nsch_code_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
556                                         /* move to next byte */
557                                         dl_map_offset++;
558                                 }
559                                 length += 2;
560                         }
561                         else if(harq_mode == 1)
562                         {       /* display the Shortened DIUC and Companded SC */
563                                 if(nibble_offset & 1)
564                                 {
565                                         proto_tree_add_item(tree, hf_cdlmap_shortened_diuc_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
566                                         proto_tree_add_item(tree, hf_cdlmap_companded_sc_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
567                                 }
568                                 else
569                                 {
570                                         proto_tree_add_item(tree, hf_cdlmap_shortened_diuc, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
571                                                 proto_tree_add_item(tree, hf_cdlmap_companded_sc, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
572                                 }
573                                 /* move to next byte */
574                                 dl_map_offset++;
575                                 length += 2;
576                         }
577                         /* get the Nband */
578                         if(max_logical_bands)
579                         {       /* get and display the Nband */
580                                 nband = tvb_get_guint8(tvb, dl_map_offset);
581                                 if(nibble_offset & 1)
582                                 {
583                                         nband = (nband & LSB_NIBBLE_MASK);
584                                         /* display the Nband */
585                                         proto_tree_add_item(tree, hf_cdlmap_num_bands_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
586                                         /* move to next byte */
587                                         dl_map_offset++;
588                                         nibble_offset = 0;
589                                         if(max_logical_bands == 3)
590                                         {
591                                                 proto_tree_add_item(tree, hf_cdlmap_band_index, tvb, dl_map_offset, nband, ENC_NA);
592                                                 length += (nband * 2);
593                                                 /* update offset */
594                                                 dl_map_offset += nband;
595                                         }
596                                         else
597                                         {
598                                                 nibble_offset = (nband & 1);
599                                                 proto_tree_add_item(tree, hf_cdlmap_band_index, tvb, dl_map_offset, ((nband >> 1) + nibble_offset), ENC_NA);
600                                                 length += nband;
601                                                 /* update offset */
602                                                 dl_map_offset += (nband >> 1);
603                                         }
604                                 }
605                                 else
606                                 {
607                                         nband = ((nband & MSB_NIBBLE_MASK) >> 4);
608                                         /* display the Nband */
609                                         proto_tree_add_item(tree, hf_cdlmap_num_bands, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
610                                         nibble_offset = 1;
611                                         if(max_logical_bands == 3)
612                                         {
613                                                 proto_tree_add_item(tree, hf_cdlmap_band_index, tvb, dl_map_offset, (nband + nibble_offset), ENC_NA);
614                                                 length += (nband * 2);
615                                                 /* update offset */
616                                                 dl_map_offset += nband;
617                                         }
618                                         else
619                                         {
620                                                 proto_tree_add_item(tree, hf_cdlmap_band_index, tvb, dl_map_offset, ((nband >> 1) + nibble_offset), ENC_NA);
621                                                 length += nband;
622                                                 /* update offset */
623                                                 dl_map_offset += ((nband + nibble_offset) >> 1);
624                                                 if(nband & 1)
625                                                         nibble_offset = 0;
626                                         }
627                                 }
628                                 length++;
629                                 band_count = nband;
630                         }
631                         else
632                         {
633                                 nband = 0;
634                                 band_count = 1;
635                                 /* display the Nb-BITMAP */
636                                 if(nibble_offset & 1)
637                                 {
638                                         proto_tree_add_item(tree, hf_cdlmap_nb_bitmap_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
639                                         /* move to next byte */
640                                         dl_map_offset++;
641                                         nibble_offset = 0;
642                                 }
643                                 else
644                                 {
645                                         proto_tree_add_item(tree, hf_cdlmap_nb_bitmap, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
646                                         nibble_offset = 1;
647                                 }
648                                 length++;
649                         }
650                         /* Get the Allocation Mode */
651                         byte = tvb_get_guint8(tvb, dl_map_offset);
652                         if(nibble_offset & 1)
653                         {
654                                 allocation_mode = ((byte & 0x0C) >> 2);
655                                 proto_tree_add_item(tree, hf_cdlmap_allocation_mode_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
656                                         proto_tree_add_item(tree, hf_cdlmap_allocation_mode_rsvd_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
657                                 nibble_offset = 0;
658                                 dl_map_offset++;
659                         }
660                         else
661                         {
662                                 allocation_mode = ((byte & 0xC0) >> 6);
663                                 proto_tree_add_item(tree, hf_cdlmap_allocation_mode, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
664                                 proto_tree_add_item(tree, hf_cdlmap_allocation_mode_rsvd, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
665                                 nibble_offset = 1;
666                         }
667                         /* Decode Allocation Mode - need to be done */
668                         if(!allocation_mode)
669                         {
670                                 if(nibble_offset & 1)
671                                 {
672                                         proto_tree_add_item(tree, hf_cdlmap_num_subchannels_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
673                                 }
674                                 else
675                                 {
676                                         proto_tree_add_item(tree, hf_cdlmap_num_subchannels, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
677                                 }
678                                 dl_map_offset++;
679                         }
680                         else if(allocation_mode == 1)
681                         {
682                                 for(i=0; i<band_count; i++)
683                                 {
684                                         if(nibble_offset & 1)
685                                         {
686                                                 proto_tree_add_item(tree, hf_cdlmap_num_subchannels_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
687                                         }
688                                         else
689                                         {
690                                                 proto_tree_add_item(tree, hf_cdlmap_num_subchannels, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
691                                         }
692                                         dl_map_offset++;
693                                 }
694                         }
695                         /* decode HARQ Control IE */
696                         nibble_length = wimax_compact_dlmap_harq_control_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
697                         length += nibble_length;
698                         dl_map_offset += ((nibble_offset + nibble_length) >> 1);
699                         nibble_offset = ((nibble_offset + nibble_length) & 1);
700                         /* decode CQICH Control IE */
701                         nibble_length = wimax_compact_dlmap_cqich_control_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
702                         length += nibble_length;
703                 break;
704                 case COMPACT_DL_MAP_TYPE_SAFETY:/* 6.3.2.3.43.6.3 */
705                         if(nibble_offset & 1)
706                         {       /* display the DL-MAP type */
707                                 proto_tree_add_item(tree, hf_cdlmap_dl_map_type_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
708                                 /* display the UL-MAP append */
709                                 proto_tree_add_item(tree, hf_cdlmap_ul_map_append_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
710                                 /* move to next byte */
711                                 dl_map_offset++;
712                                 nibble_offset = 0;
713                         }
714                         else
715                         {       /* display the DL-MAP type */
716                                 proto_tree_add_item(tree, hf_cdlmap_dl_map_type, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
717                                 /* display the UL-MAP append */
718                                 proto_tree_add_item(tree, hf_cdlmap_ul_map_append, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
719                                 nibble_offset = 1;
720                         }
721                         length = 1;
722                         /* decode RCID IE */
723                         nibble_length = wimax_compact_dlmap_rcid_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
724                         length += nibble_length;
725                         dl_map_offset += (nibble_length >> 1);
726                         nibble_offset = (nibble_length & 1);
727                         /* check harq mode */
728                         if(!harq_mode)
729                         {       /* display the Nep and Nsch Code */
730                                 if(nibble_offset & 1)
731                                 {
732                                         proto_tree_add_item(tree, hf_cdlmap_nep_code_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
733                                         /* move to next byte */
734                                         dl_map_offset++;
735                                         proto_tree_add_item(tree, hf_cdlmap_nsch_code, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
736                                 }
737                                 else
738                                 {
739                                         proto_tree_add_item(tree, hf_cdlmap_nep_code, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
740                                         proto_tree_add_item(tree, hf_cdlmap_nsch_code_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
741                                         /* move to next byte */
742                                         dl_map_offset++;
743                                 }
744                                 length += 2;
745                         }
746                         else if(harq_mode == 1)
747                         {       /* display the Shortened DIUC and Companded SC */
748                                 if(nibble_offset & 1)
749                                 {
750                                         proto_tree_add_item(tree, hf_cdlmap_shortened_diuc_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
751                                         proto_tree_add_item(tree, hf_cdlmap_companded_sc_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
752                                 }
753                                 else
754                                 {
755                                         proto_tree_add_item(tree, hf_cdlmap_shortened_diuc, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
756                                                 proto_tree_add_item(tree, hf_cdlmap_companded_sc, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
757                                 }
758                                 /* move to next byte */
759                                 dl_map_offset++;
760                                 length += 2;
761                         }
762                         /* display BIN offset */
763                         if(nibble_offset & 1)
764                         {
765                                 proto_tree_add_item(tree, hf_cdlmap_bin_offset_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
766                                 /* move to next byte */
767                                 dl_map_offset++;
768                         }
769                         else
770                         {
771                                 proto_tree_add_item(tree, hf_cdlmap_bin_offset, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
772                                 /* move to next byte */
773                                 dl_map_offset++;
774                         }
775                         length += 2;
776                         /* decode HARQ Control IE */
777                         nibble_length = wimax_compact_dlmap_harq_control_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
778                         length += nibble_length;
779                         dl_map_offset += ((nibble_offset + nibble_length) >> 1);
780                         nibble_offset = ((nibble_offset + nibble_length) & 1);
781                         /* decode CQICH Control IE */
782                         nibble_length = wimax_compact_dlmap_cqich_control_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
783                         length += nibble_length;
784                         dl_map_offset += ((nibble_offset + nibble_length) >> 1);
785                         nibble_offset = ((nibble_offset + nibble_length) & 1);
786                         if(ul_map_append)
787                         {       /* check harq mode */
788                                 if(harq_mode == 1)
789                                 {       /* display the Shortened DIUC and Companded SC */
790                                         if(nibble_offset & 1)
791                                         {
792                                                 proto_tree_add_item(tree, hf_cdlmap_shortened_diuc_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
793                                                 proto_tree_add_item(tree, hf_cdlmap_companded_sc_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
794                                         }
795                                         else
796                                         {
797                                                 proto_tree_add_item(tree, hf_cdlmap_shortened_diuc, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
798                                                 proto_tree_add_item(tree, hf_cdlmap_companded_sc, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
799                                         }
800                                         /* move to next byte */
801                                         dl_map_offset++;
802                                         length += 2;
803                                 }
804                                 else if(!harq_mode)
805                                 {       /* display the Nep and Nsch Code */
806                                         if(nibble_offset & 1)
807                                         {
808                                                 proto_tree_add_item(tree, hf_cdlmap_nep_code_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
809                                                 /* move to next byte */
810                                                 dl_map_offset++;
811                                                 proto_tree_add_item(tree, hf_cdlmap_nsch_code, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
812                                         }
813                                         else
814                                         {
815                                                 proto_tree_add_item(tree, hf_cdlmap_nep_code, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
816                                                 proto_tree_add_item(tree, hf_cdlmap_nsch_code_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
817                                                 /* move to next byte */
818                                                 dl_map_offset++;
819                                         }
820                                         length += 2;
821                                 }
822                                 /* display BIN offset */
823                                 if(nibble_offset & 1)
824                                 {
825                                         proto_tree_add_item(tree, hf_cdlmap_bin_offset_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
826                                         /* move to next byte */
827                                         dl_map_offset++;
828                                 }
829                                 else
830                                 {
831                                         proto_tree_add_item(tree, hf_cdlmap_bin_offset, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
832                                         /* move to next byte */
833                                         dl_map_offset++;
834                                 }
835                                 length += 2;
836                                 /* decode HARQ Control IE */
837                                 nibble_length = wimax_compact_dlmap_harq_control_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
838                                 length += nibble_length;
839                         }
840                 break;
841                 case COMPACT_DL_MAP_TYPE_UIUC:/* 6.3.2.3.43.6.4 */
842                         if(nibble_offset & 1)
843                         {       /* display the DL-MAP type */
844                                 proto_tree_add_item(tree, hf_cdlmap_dl_map_type_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
845                                 /* display the reserved */
846                                 proto_tree_add_item(tree, hf_cdlmap_reserved_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
847                                 /* move to next byte */
848                                 dl_map_offset++;
849                                 /* get the new byte */
850                                 byte = tvb_get_guint8(tvb, dl_map_offset);
851                                 /* get the DIUC */
852                                 diuc = ((byte & MSB_NIBBLE_MASK) >> 4);
853                                 /* display the DIUC */
854                                 proto_tree_add_item(tree, hf_cdlmap_diuc, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
855                         }
856                         else
857                         {
858                                 /* display the DL-MAP type */
859                                 proto_tree_add_item(tree, hf_cdlmap_dl_map_type, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
860                                 /* display the reserved */
861                                 proto_tree_add_item(tree, hf_cdlmap_reserved, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
862                                 /* get the DIUC */
863                                 diuc = (tvb_get_guint8(tvb, dl_map_offset) & LSB_NIBBLE_MASK);
864                                 /* display the DIUC */
865                                 proto_tree_add_item(tree, hf_cdlmap_diuc_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
866                                 /* move to next byte */
867                                 dl_map_offset++;
868                         }
869                         length = 2;
870                         if(diuc == 15)
871                         {       /* Extended DIUC dependent IE */
872                                 nibble_length =  wimax_extended_diuc_dependent_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
873                                 length += nibble_length;
874                                 dl_map_offset += (nibble_length >> 1);
875                                 nibble_offset = (nibble_length & 1);
876                         }
877                         else
878                         {       /* decode RCID IE */
879                                 nibble_length = wimax_compact_dlmap_rcid_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
880                                 length += nibble_length;
881                                 dl_map_offset += (nibble_length >> 1);
882                                 nibble_offset = (nibble_length & 1);
883                                 /* display Number of subchannels */
884                                 if(nibble_offset & 1)
885                                         proto_tree_add_item(tree, hf_cdlmap_diuc_num_of_subchannels_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
886                                 else
887                                         proto_tree_add_item(tree, hf_cdlmap_diuc_num_of_subchannels, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
888                                 length += 2;
889                                 /* display the repetition coding indication and reserved bits */
890                                 if(nibble_offset & 1)
891                                 {
892                                         proto_tree_add_item(tree, hf_cdlmap_diuc_repetition_coding_indication_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
893                                         proto_tree_add_item(tree, hf_cdlmap_diuc_reserved_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
894                                 }
895                                 else
896                                 {
897                                         proto_tree_add_item(tree, hf_cdlmap_diuc_repetition_coding_indication, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
898                                         proto_tree_add_item(tree, hf_cdlmap_diuc_reserved, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
899                                 }
900                                 length += 1;
901                         }
902                         /* decode HARQ Control IE */
903                         nibble_length = wimax_compact_dlmap_harq_control_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
904                         length += nibble_length;
905                         dl_map_offset += ((nibble_offset + nibble_length) >> 1);
906                         nibble_offset = ((nibble_offset + nibble_length) & 1);
907                         /* decode CQICH Control IE */
908                         nibble_length = wimax_compact_dlmap_cqich_control_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
909                         length += nibble_length;
910                 break;
911                 case COMPACT_DL_MAP_TYPE_FORMAT_CONF_IE:/* 6.3.2.3.43.2 */
912                         /* decode the format configuration IE */
913                         nibble_length = wimax_compact_dlmap_format_configuration_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
914                         length = nibble_length;
915                 break;
916                 case COMPACT_DL_MAP_TYPE_HARQ_ACK_BITMAP_IE:/* 6.3.2.3.43.6.5 */
917                         if(nibble_offset & 1)
918                         {       /* display the DL-MAP type */
919                                 proto_tree_add_item(tree, hf_cdlmap_dl_map_type_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
920                                 /* display the reserved */
921                                 proto_tree_add_item(tree, hf_cdlmap_reserved_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
922                                 length = 1;
923                                 /* move to next byte */
924                                 dl_map_offset++;
925                                 /* get the bit map length */
926                                 byte = tvb_get_guint8(tvb, dl_map_offset);
927                                 bit_map_length = ((byte & MSB_NIBBLE_MASK) >> 4);
928                                 /* display BITMAP Length */
929                                 proto_tree_add_item(tree, hf_cdlmap_bit_map_length, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
930                                 /* display BITMAP */
931                                 proto_tree_add_item(tree, hf_cdlmap_bit_map, tvb, dl_map_offset, bit_map_length + 1, ENC_NA);
932                                 length += (1 + bit_map_length * 2);
933                         }
934                         else
935                         {
936                                 /* display the DL-MAP type */
937                                 proto_tree_add_item(tree, hf_cdlmap_dl_map_type, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
938                                 /* display the reserved */
939                                 proto_tree_add_item(tree, hf_cdlmap_reserved, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
940                                 /* display BITMAP Length */
941                                 proto_tree_add_item(tree, hf_cdlmap_bit_map_length_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
942                                 length = 2;
943                                 /* get the bit map length */
944                                 bit_map_length =  (byte & LSB_NIBBLE_MASK);
945                                 /* move to next byte */
946                                 dl_map_offset++;
947                                 /* display BITMAP */
948                                 proto_tree_add_item(tree, hf_cdlmap_bit_map, tvb, dl_map_offset, bit_map_length, ENC_NA);
949                                 length += (bit_map_length * 2);
950                         }
951                 break;
952                 case COMPACT_DL_MAP_TYPE_EXTENSION:/* 6.3.2.3.43.6.6 */
953                         /* decode the Compact DL-MAP externsion IE */
954                         nibble_length = wimax_cdlmap_extension_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);/*, cqich_indicator);*/
955                         length = nibble_length;
956                 break;
957                 default:/* Reserved Type */
958                         /* display the reserved type */
959                         proto_tree_add_item(tree, hf_cdlmap_reserved_type_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
960                         length = 1;
961                 break;
962         }
963         /* Update the nibble_offset and length */
964         return length;
965 }
966
967 /* Format Configuration IE shifts */
968 #define CID_TYPE_SHIFT                      30
969 #define SAFETY_PATTERN_SHIFT                25
970 #define BAND_AMC_SUBCHANNEL_TYPE_SHIFT      23
971 #define MAX_LOGICAL_BANDS_SHIFT             21
972 #define NUM_BROADCAST_SYMBOLS_SHIFT         16
973 #define NUM_DL_AMC_SYMBOLS_SHIFT            10
974 #define NUM_UL_AMC_SYMBOLS_SHIFT            4
975 #define CID_TYPE_SHIFT_1              (CID_TYPE_SHIFT-NUM_UL_AMC_SYMBOLS_SHIFT)
976 #define SAFETY_PATTERN_SHIFT_1        (SAFETY_PATTERN_SHIFT-NUM_UL_AMC_SYMBOLS_SHIFT)
977 #define BAND_AMC_SUBCHANNEL_TYPE_SHIFT_1 (BAND_AMC_SUBCHANNEL_TYPE_SHIFT-NUM_UL_AMC_SYMBOLS_SHIFT)
978 #define MAX_LOGICAL_BANDS_SHIFT_1     (MAX_LOGICAL_BANDS_SHIFT-NUM_UL_AMC_SYMBOLS_SHIFT)
979 #define NUM_BROADCAST_SYMBOLS_SHIFT_1 (NUM_BROADCAST_SYMBOLS_SHIFT-NUM_UL_AMC_SYMBOLS_SHIFT)
980 #define NUM_DL_AMC_SYMBOLS_SHIFT_1    (NUM_DL_AMC_SYMBOLS_SHIFT-NUM_UL_AMC_SYMBOLS_SHIFT)
981 /*#define NUM_UL_AMC_SYMBOLS_SHIFT_1    0*/
982
983 /* Compact DL-MAP Format Configuration IE (6.3.2.3.43.2) decoder */
984 static guint wimax_compact_dlmap_format_configuration_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset)
985 {
986         guint length = 0;
987         guint dl_map_type, new_format_ind;
988         guint dl_map_offset;
989         guint32 tvb_value;
990
991 #ifdef DEBUG
992         /* update the info column */
993         col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Format Configuration IE");
994 #endif
995         /* set the local offset */
996         dl_map_offset = offset;
997         /* Get the first byte */
998         tvb_value = tvb_get_guint8(tvb, dl_map_offset);
999         if(nibble_offset & 1)
1000         {       /* get the DL-MAP type */
1001                 dl_map_type = ((tvb_value & DL_MAP_TYPE_MASK_1) >> 1);
1002                 /* ensure the dl-map type is Format Configuration IE */
1003                 if(dl_map_type != COMPACT_DL_MAP_TYPE_FORMAT_CONF_IE)
1004                         return 0;
1005                 new_format_ind = (tvb_value & 0x01);
1006                 /* display the DL-MAP type */
1007                 proto_tree_add_item(tree, hf_format_config_ie_dl_map_type_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
1008                 /* display the New format Indication */
1009                 proto_tree_add_item(tree, hf_format_config_ie_new_format_indication_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
1010                 /* update the length in nibble */
1011                 length = 1;
1012                 /* move to next byte */
1013                 dl_map_offset++;
1014                 if(new_format_ind)
1015                 {       /* display the CID Type */
1016                         proto_tree_add_item(tree, hf_format_config_ie_cid_type, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
1017                         /* display the Safety Pattern */
1018                         proto_tree_add_item(tree, hf_format_config_ie_safety_pattern, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
1019                         /* display the Subchannel pattern */
1020                         proto_tree_add_item(tree, hf_format_config_ie_subchannel_type, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
1021                         /* display the max logical bands */
1022                         proto_tree_add_item(tree, hf_format_config_ie_max_logical_bands, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
1023                         /* display the number of broadcast symbols */
1024                         proto_tree_add_item(tree, hf_format_config_ie_num_of_broadcast_symbol, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
1025                         /* display the number of dl band AMC symbols */
1026                         proto_tree_add_item(tree, hf_format_config_ie_num_of_dl_band_amc_symbol, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
1027                         /* display the number of ul band AMC symbols */
1028                         proto_tree_add_item(tree, hf_format_config_ie_num_of_ul_band_amc_symbol, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
1029                         /* update the length in nibble */
1030                         length += 7;
1031                         /* Get the next 32-bit word */
1032                         tvb_value = tvb_get_ntohl(tvb, dl_map_offset);
1033                         /* get the CID type */
1034                         cid_type = ((tvb_value & CID_TYPE_MASK) >> CID_TYPE_SHIFT);
1035                         /* get the subchannel type for band AMC */
1036                         band_amc_subchannel_type = ((tvb_value & BAND_AMC_SUBCHANNEL_TYPE_MASK) >> BAND_AMC_SUBCHANNEL_TYPE_SHIFT);
1037                         /* get the max logical bands */
1038                         max_logical_bands = ((tvb_value & MAX_LOGICAL_BANDS_MASK) >> MAX_LOGICAL_BANDS_SHIFT);
1039                         /* get the number of symbols for broadcast */
1040                         num_of_broadcast_symbols = ((tvb_value & NUM_BROADCAST_SYMBOLS_MASK) >> NUM_BROADCAST_SYMBOLS_SHIFT);
1041                         /* get the number of symbols for DL band AMC */
1042                         num_of_dl_band_amc_symbols = ((tvb_value & NUM_DL_AMC_SYMBOLS_MASK) >> NUM_DL_AMC_SYMBOLS_SHIFT);
1043                         /* get the number of symbols for UL band AMC */
1044                         num_of_ul_band_amc_symbols = ((tvb_value & NUM_UL_AMC_SYMBOLS_MASK) >> NUM_UL_AMC_SYMBOLS_SHIFT);
1045                 }
1046         }
1047         else
1048         {
1049                 dl_map_type = ((tvb_value & DL_MAP_TYPE_MASK) >> 5);
1050                 /* ensure the dl-map type is Format Configuration IE */
1051                 if(dl_map_type != COMPACT_DL_MAP_TYPE_FORMAT_CONF_IE)
1052                         return 0;
1053                 new_format_ind = (tvb_value & 0x10);
1054                 if(new_format_ind)
1055                 {       /* display the DL-MAP type */
1056                         proto_tree_add_item(tree, hf_format_config_ie_dl_map_type_32, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
1057                         /* display the New format Indication */
1058                         proto_tree_add_item(tree, hf_format_config_ie_new_format_indication_32, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
1059                         /* display the CID Type */
1060                         proto_tree_add_item(tree, hf_format_config_ie_cid_type_1, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
1061                         /* display the Safety Pattern */
1062                         proto_tree_add_item(tree, hf_format_config_ie_safety_pattern_1, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
1063                         /* display the Subchannel pattern */
1064                         proto_tree_add_item(tree, hf_format_config_ie_subchannel_type_1, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
1065                         /* display the max logical bands */
1066                         proto_tree_add_item(tree, hf_format_config_ie_max_logical_bands_1, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
1067                         /* display the number of broadcast symbols */
1068                         proto_tree_add_item(tree, hf_format_config_ie_num_of_broadcast_symbol_1, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
1069                         /* display the number of dl band AMC symbols */
1070                         proto_tree_add_item(tree, hf_format_config_ie_num_of_dl_band_amc_symbol_1, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
1071                         /* display the number of ul band AMC symbols */
1072                         proto_tree_add_item(tree, hf_format_config_ie_num_of_ul_band_amc_symbol_1, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
1073                         /* update the length in nibble */
1074                         length = 8;
1075                         /* Get the next 32-bit word */
1076                         tvb_value = tvb_get_ntohl(tvb, dl_map_offset);
1077                         /* get the CID type */
1078                         cid_type = ((tvb_value & CID_TYPE_MASK_1) >> CID_TYPE_SHIFT_1);
1079                         /* get the subchannel type for band AMC */
1080                         band_amc_subchannel_type = ((tvb_value & BAND_AMC_SUBCHANNEL_TYPE_MASK_1) >> BAND_AMC_SUBCHANNEL_TYPE_SHIFT_1);
1081                         /* get the max logical bands */
1082                         max_logical_bands = ((tvb_value & MAX_LOGICAL_BANDS_MASK_1) >> MAX_LOGICAL_BANDS_SHIFT_1);
1083                         /* get the number of symbols for broadcast */
1084                         num_of_broadcast_symbols = ((tvb_value & NUM_BROADCAST_SYMBOLS_MASK_1) >> NUM_BROADCAST_SYMBOLS_SHIFT_1);
1085                         /* get the number of symbols for DL band AMC */
1086                         num_of_dl_band_amc_symbols = ((tvb_value & NUM_DL_AMC_SYMBOLS_MASK_1) >> NUM_DL_AMC_SYMBOLS_SHIFT_1);
1087                         /* get the number of symbols for UL band AMC */
1088                         num_of_ul_band_amc_symbols = (tvb_value & NUM_UL_AMC_SYMBOLS_MASK_1);
1089                 }
1090                 else
1091                 {       /* display the DL-MAP type */
1092                         proto_tree_add_item(tree, hf_format_config_ie_dl_map_type, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
1093                         /* display the New format Indication */
1094                         proto_tree_add_item(tree, hf_format_config_ie_new_format_indication, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
1095                         /* update the length in nibble */
1096                         length = 1;
1097                 }
1098         }
1099         /* return the IE length in nibbles */
1100         return length;
1101 }
1102
1103 /* Compact DL-MAP Reduced CID IE (6.3.2.3.43.3) decoder */
1104 static guint wimax_compact_dlmap_rcid_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset)
1105 {
1106         guint length = 0;
1107         guint prefix;
1108
1109 #ifdef DEBUG
1110         /* update the info column */
1111         col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "RCID IE");
1112 #endif
1113         if(nibble_offset & 1)
1114         {
1115                 if(cid_type == CID_TYPE_NORMAL)
1116                 {       /* display the normal CID */
1117                         proto_tree_add_item(tree, hf_harq_rcid_ie_normal_cid_1, tvb, offset, 3, ENC_BIG_ENDIAN);
1118                         length = 4;
1119                 }
1120                 else
1121                 {       /* Get the prefix bit */
1122                         prefix = (tvb_get_guint8(tvb, offset) & 0x08);
1123                         /* display the prefix */
1124                         proto_tree_add_item(tree, hf_harq_rcid_ie_prefix_1, tvb, offset, 2, ENC_BIG_ENDIAN);
1125                         if(prefix)
1126                         {       /* display the CID11 */
1127                                 proto_tree_add_item(tree, hf_harq_rcid_ie_cid11_3, tvb, offset, 2, ENC_BIG_ENDIAN);
1128                                 length = 3;
1129                         }
1130                         else
1131                         {
1132                                  if(cid_type == CID_TYPE_RCID11)
1133                                 {       /* display the CID11 */
1134                                         proto_tree_add_item(tree, hf_harq_rcid_ie_cid11_1, tvb, offset, 2, ENC_BIG_ENDIAN);
1135                                         length = 3;
1136                                 }
1137                                 else if(cid_type == CID_TYPE_RCID7)
1138                                 {       /* display the normal CID7 */
1139                                         proto_tree_add_item(tree, hf_harq_rcid_ie_cid7_1, tvb, offset, 2, ENC_BIG_ENDIAN);
1140                                         length = 2;
1141                                 }
1142                                 else if(cid_type == CID_TYPE_RCID3)
1143                                 {       /* display the CID3 */
1144                                         proto_tree_add_item(tree, hf_harq_rcid_ie_cid3_1, tvb, offset, 2, ENC_BIG_ENDIAN);
1145                                         length = 1;
1146                                 }
1147                         }
1148                 }
1149         }
1150         else
1151         {
1152                 if(cid_type == CID_TYPE_NORMAL)
1153                 {       /* display the normal CID */
1154                         proto_tree_add_item(tree, hf_harq_rcid_ie_normal_cid, tvb, offset, 2, ENC_BIG_ENDIAN);
1155                         length = 4;
1156                 }
1157                 else
1158                 {       /* Get the prefix bit */
1159                         prefix = (tvb_get_guint8(tvb, offset) & 0x08);
1160                         /* display the prefix */
1161                         proto_tree_add_item(tree, hf_harq_rcid_ie_prefix, tvb, offset, 2, ENC_BIG_ENDIAN);
1162                         if(prefix || (cid_type == CID_TYPE_RCID11))
1163                         {       /* display the CID11 */
1164                                 proto_tree_add_item(tree, hf_harq_rcid_ie_cid11_2, tvb, offset, 2, ENC_BIG_ENDIAN);
1165                                 length = 3;
1166                         }
1167                         else
1168                         {
1169                                 if(cid_type == CID_TYPE_RCID11)
1170                                 {       /* display the CID11 */
1171                                         proto_tree_add_item(tree, hf_harq_rcid_ie_cid11, tvb, offset, 2, ENC_BIG_ENDIAN);
1172                                         length = 3;
1173                                 }
1174                                 else if(cid_type == CID_TYPE_RCID7)
1175                                 {       /* display the CID7 */
1176                                         proto_tree_add_item(tree, hf_harq_rcid_ie_cid7, tvb, offset, 2, ENC_BIG_ENDIAN);
1177                                         length = 2;
1178                                 }
1179                                 else if(cid_type == CID_TYPE_RCID3)
1180                                 {       /* display the CID3 */
1181                                         proto_tree_add_item(tree, hf_harq_rcid_ie_cid3, tvb, offset, 2, ENC_BIG_ENDIAN);
1182                                         length = 1;
1183                                 }
1184                         }
1185                 }
1186         }
1187         /* return the IE length in nibbles */
1188         return length;
1189 }
1190
1191 /* Compact DL-MAP HARQ Control IE (6.3.2.3.43.4) decoder */
1192 static guint wimax_compact_dlmap_harq_control_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset)
1193 {
1194         guint byte, prefix, length = 0;
1195
1196 #ifdef DEBUG
1197         /* update the info column */
1198         col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "HARQ Control IE");
1199 #endif
1200         /* Get the first byte */
1201         byte = tvb_get_guint8(tvb, offset);
1202         if(nibble_offset & 1)
1203         {       /* Get the prefix bit */
1204                 prefix = (byte & 0x08);
1205                 /* display the prefix */
1206                 proto_tree_add_item(tree, hf_harq_control_ie_prefix_1, tvb, offset, 2, ENC_BIG_ENDIAN);
1207                 if(prefix)
1208                 {       /* display the ai_sn */
1209                         proto_tree_add_item(tree, hf_harq_control_ie_ai_sn_1, tvb, offset, 2, ENC_BIG_ENDIAN);
1210                         /* display the spid */
1211                         proto_tree_add_item(tree, hf_harq_control_ie_spid_1, tvb, offset, 2, ENC_BIG_ENDIAN);
1212                         /* display the acid */
1213                         proto_tree_add_item(tree, hf_harq_control_ie_acid_1, tvb, offset, 2, ENC_BIG_ENDIAN);
1214                         length = 2;
1215                 }
1216                 else
1217                 {       /* display the reserved bits */
1218                         proto_tree_add_item(tree, hf_harq_control_ie_reserved_1, tvb, offset, 2, ENC_BIG_ENDIAN);
1219                         length = 1;
1220                 }
1221         }
1222         else
1223         {       /* Get the prefix bit */
1224                 prefix = (byte & 0x80);
1225                 /* display the prefix */
1226                 proto_tree_add_item(tree, hf_harq_control_ie_prefix, tvb, offset, 1, ENC_BIG_ENDIAN);
1227                 if(prefix)
1228                 {       /* display the ai_sn */
1229                         proto_tree_add_item(tree, hf_harq_control_ie_ai_sn, tvb, offset, 1, ENC_BIG_ENDIAN);
1230                         /* display the spid */
1231                         proto_tree_add_item(tree, hf_harq_control_ie_spid, tvb, offset, 1, ENC_BIG_ENDIAN);
1232                         /* display the acid */
1233                         proto_tree_add_item(tree, hf_harq_control_ie_acid, tvb, offset, 1, ENC_BIG_ENDIAN);
1234                         length = 2;
1235                 }
1236                 else
1237                 {       /* display the reserved bits */
1238                         proto_tree_add_item(tree, hf_harq_control_ie_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
1239                         length = 1;
1240                 }
1241         }
1242         /* return the IE length in nibbles */
1243         return length;
1244 }
1245
1246 /* Compact DL-MAP CQICH Control IE (6.3.2.3.43.5) decoder */
1247 static guint wimax_compact_dlmap_cqich_control_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset)
1248 {
1249         guint byte, cqich_indicator, length = 0;
1250
1251 #ifdef DEBUG
1252         /* update the info column */
1253         col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "CQICH Control IE");
1254 #endif
1255         /* Get the first byte */
1256         byte = tvb_get_guint8(tvb, offset);
1257         if(nibble_offset & 1)
1258         {       /* Get the CQICH indicator */
1259                 cqich_indicator = (byte & 0x08);
1260                 if(cqich_indicator)
1261                 {       /* display the CQICH indicator */
1262                         proto_tree_add_item(tree, hf_cqich_control_ie_indicator_1, tvb, offset, 3, ENC_BIG_ENDIAN);
1263                         /* display the allocation index */
1264                         proto_tree_add_item(tree, hf_cqich_control_ie_alloc_id_1, tvb, offset, 3, ENC_BIG_ENDIAN);
1265                         /* display the period */
1266                         proto_tree_add_item(tree, hf_cqich_control_ie_period_1, tvb, offset, 3, ENC_BIG_ENDIAN);
1267                         /* display the frame offset */
1268                         proto_tree_add_item(tree, hf_cqich_control_ie_frame_offset_1, tvb, offset, 3, ENC_BIG_ENDIAN);
1269                         /* display the duration */
1270                         proto_tree_add_item(tree, hf_cqich_control_ie_duration_1, tvb, offset, 3, ENC_BIG_ENDIAN);
1271                         length = 4;
1272                 }
1273                 else
1274                 {       /* display the CQICH indicator */
1275                         proto_tree_add_item(tree, hf_cqich_control_ie_indicator_1, tvb, offset, 1, ENC_BIG_ENDIAN);
1276                         /* display the CQI reporting threshold */
1277                         proto_tree_add_item(tree, hf_cqich_control_ie_cqi_rep_threshold_1, tvb, offset, 1, ENC_BIG_ENDIAN);
1278                         length = 1;
1279                 }
1280         }
1281         else
1282         {       /* Get the CQICH indicator */
1283                 cqich_indicator = (byte & 0x80);
1284                 if(cqich_indicator)
1285                 {       /* display the CQICH indicator */
1286                         proto_tree_add_item(tree, hf_cqich_control_ie_indicator, tvb, offset, 2, ENC_BIG_ENDIAN);
1287                         /* display the allocation index */
1288                         proto_tree_add_item(tree, hf_cqich_control_ie_alloc_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1289                         /* display the period */
1290                         proto_tree_add_item(tree, hf_cqich_control_ie_period, tvb, offset, 2, ENC_BIG_ENDIAN);
1291                         /* display the frame offset */
1292                         proto_tree_add_item(tree, hf_cqich_control_ie_frame_offset, tvb, offset, 2, ENC_BIG_ENDIAN);
1293                         /* display the duration */
1294                         proto_tree_add_item(tree, hf_cqich_control_ie_duration, tvb, offset, 2, ENC_BIG_ENDIAN);
1295                         length = 4;
1296                 }
1297                 else
1298                 {       /* display the CQICH indicator */
1299                         proto_tree_add_item(tree, hf_cqich_control_ie_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
1300                         /* display the CQI reporting threshold */
1301                         proto_tree_add_item(tree, hf_cqich_control_ie_cqi_rep_threshold, tvb, offset, 1, ENC_BIG_ENDIAN);
1302                         length = 1;
1303                 }
1304         }
1305         /* return the IE length in nibbles */
1306         return length;
1307 }
1308
1309 /* DL-MAP Extension IE sub-types */
1310 #define TIME_DIVERSITY_MBS  0
1311 #define HARQ_MODE_SWITCH    1
1312
1313 /* Compact DL-MAP Extension IE (6.3.2.3.43.6.6) decoder */
1314 static guint wimax_cdlmap_extension_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset)
1315 {
1316         guint tvb_value, dl_map_type, sub_type, length;
1317
1318 #ifdef DEBUG
1319         /* update the info column */
1320         col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "DL-MAP Extension IE");
1321 #endif
1322         /* Get the first 16-bit word */
1323         tvb_value = tvb_get_ntohs(tvb, offset);
1324         if(nibble_offset & 1)
1325         {       /* Get the dl-map type */
1326                 dl_map_type = ((tvb_value & 0x0E00) >> 9);
1327                 if(dl_map_type != COMPACT_DL_MAP_TYPE_EXTENSION)
1328                         return 0;
1329                 /* Get the sub-type */
1330                 sub_type = ((tvb_value & 0x01F0) >> 4);
1331                 /* Get the IE length */
1332                 length = (tvb_value & 0x000F);
1333                 /* display the DL-MAP type */
1334                 proto_tree_add_item(tree, hf_cdlmap_extension_type_1, tvb, offset, 2, ENC_BIG_ENDIAN);
1335                 /* display the DL-MAP extension subtype */
1336                 proto_tree_add_item(tree, hf_cdlmap_extension_subtype_1, tvb, offset, 2, ENC_BIG_ENDIAN);
1337                 /* display the IE length */
1338                 proto_tree_add_item(tree, hf_cdlmap_extension_length_1, tvb, offset, 2, ENC_BIG_ENDIAN);
1339                 offset += 2;
1340                 switch (sub_type)
1341                 {
1342                         case TIME_DIVERSITY_MBS:
1343                         /* display the time-diversity MBS in HEX */
1344                         proto_tree_add_item(tree, hf_cdlmap_extension_time_diversity_mbs_1, tvb, offset, (length - 2), ENC_NA);
1345                         break;
1346                         case HARQ_MODE_SWITCH:
1347                         /* display the HARQ mode */
1348                         proto_tree_add_item(tree, hf_cdlmap_extension_harq_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
1349                         /* Get the next byte */
1350                         tvb_value = tvb_get_guint8(tvb, offset);
1351                         /* get the HARQ mode */
1352                         harq_mode = ((tvb_value & MSB_NIBBLE_MASK) >> 4);
1353                         break;
1354                         default:
1355                         /* display the unknown sub-type in HEX */
1356                         proto_tree_add_item(tree, hf_cdlmap_extension_unknown_sub_type_1, tvb, offset, (length - 2), ENC_NA);
1357                         break;
1358                 }
1359         }
1360         else
1361         {       /* Get the dl-map type */
1362                 dl_map_type = ((tvb_value & 0xE000) >> 13);
1363                 if(dl_map_type != COMPACT_DL_MAP_TYPE_EXTENSION)
1364                         return 0;
1365                 /* Get the sub-type */
1366                 sub_type = ((tvb_value & 0x1F00) >> 8);
1367                 /* Get the IE length */
1368                 length = ((tvb_value & 0x00F0) >> 4);
1369                 /* display the DL-MAP type */
1370                 proto_tree_add_item(tree, hf_cdlmap_extension_type, tvb, offset, 2, ENC_BIG_ENDIAN);
1371                 /* display the DL-MAP extension subtype */
1372                 proto_tree_add_item(tree, hf_cdlmap_extension_subtype, tvb, offset, 2, ENC_BIG_ENDIAN);
1373                 /* display the IE length */
1374                 proto_tree_add_item(tree, hf_cdlmap_extension_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1375                 switch (sub_type)
1376                 {
1377                         case TIME_DIVERSITY_MBS:
1378                         /* display the time-diversity MBS in HEX */
1379                         proto_tree_add_item(tree, hf_cdlmap_extension_time_diversity_mbs, tvb, (offset + 1), (length - 1), ENC_NA);
1380                         break;
1381                         case HARQ_MODE_SWITCH:
1382                         /* display the HARQ mode */
1383                         proto_tree_add_item(tree, hf_cdlmap_extension_harq_mode_1, tvb, offset, 2, ENC_BIG_ENDIAN);
1384                         /* get the HARQ mode */
1385                         harq_mode = (tvb_value & 0x000F);
1386                         break;
1387                         default:
1388                         /* display the unknown sub-type in HEX */
1389                         proto_tree_add_item(tree, hf_cdlmap_extension_unknown_sub_type, tvb, (offset + 1), (length - 1), ENC_NA);
1390                         break;
1391                 }
1392         }
1393         /* return the IE length in nibbles */
1394         return (length * 2);
1395 }
1396
1397 /* Extended DIUCs (table 277a) */
1398 #define CHANNEL_MEASUREMENT_IE             0
1399 #define STC_ZONE_IE                        1
1400 #define AAS_DL_IE                          2
1401 #define DATA_LOCATION_IN_ANOTHER_BS_IE     3
1402 #define CID_SWITCH_IE                      4
1403 #define MIMO_DL_BASIC_IE                   5
1404 #define MIMO_DL_ENHANCED_IE                6
1405 #define HARQ_MAP_POINTER_IE                7
1406 #define PHYMOD_DL_IE                       8
1407 #define DL_PUSC_BURST_ALLOCATION_IN_OTHER_SEGMENT_IE 11
1408 #define UL_INTERFERENCE_AND_NOISE_LEVEL_IE 15
1409
1410 /* Extended DIUC IE (8.4.5.3.2) */
1411 guint wimax_extended_diuc_dependent_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset)
1412 {
1413         guint ext_diuc, length;
1414         guint8 byte;
1415
1416         /* get the first byte */
1417         byte =  tvb_get_guint8(tvb, offset);
1418         if(nibble_offset & 1)
1419         {       /* get the extended DIUC */
1420                 ext_diuc = (byte & LSB_NIBBLE_MASK);
1421                 /* display extended DIUC */
1422                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_diuc_1, tvb, offset, 1, ENC_BIG_ENDIAN);
1423                 /* move to next byte */
1424                 offset++;
1425                 /* get the 2nd byte */
1426                 byte =  tvb_get_guint8(tvb, offset);
1427                 /* get the length */
1428                 length = ((byte & MSB_NIBBLE_MASK) >> 4);
1429                 /* display extended DIUC length */
1430                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1431                 /* 8.4.5.3.2.1 (table 277a) */
1432                 switch (ext_diuc)
1433                 {
1434                         case CHANNEL_MEASUREMENT_IE:
1435                                 /* 8.4.5.3.? Channel_Measurement_IE */
1436                                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_channel_measurement, tvb, offset, (length + 1), ENC_NA);
1437                         break;
1438                         case STC_ZONE_IE:
1439                                 /* 8.4.5.3.4 STC_Zone_IE */
1440                                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_stc_zone, tvb, offset, (length + 1), ENC_NA);
1441                         break;
1442                         case AAS_DL_IE:
1443                                 /* 8.4.5.3.3 AAS_DL_IE */
1444                                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_aas_dl, tvb, offset, (length + 1), ENC_NA);
1445                         break;
1446                         case DATA_LOCATION_IN_ANOTHER_BS_IE:
1447                                 /* 8.4.5.3.6 Data_location_in_another_BS_IE */
1448                                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_data_location, tvb, offset, (length + 1), ENC_NA);
1449                         break;
1450                         case CID_SWITCH_IE:
1451                                 /* 8.4.5.3.7 CID_Switch_IE */
1452                                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_cid_switch, tvb, offset, (length + 1), ENC_NA);
1453                         break;
1454                         case MIMO_DL_BASIC_IE:
1455                                 /* 8.4.5.3.8 MIMO_DL_Basic_IE */
1456                                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_mimo_dl_basic, tvb, offset, (length + 1), ENC_NA);
1457                         break;
1458                         case MIMO_DL_ENHANCED_IE:
1459                                 /* 8.4.5.3.9 MIMO_DL_Enhanced_IE */
1460                                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_mimo_dl_enhanced, tvb, offset, (length + 1), ENC_NA);
1461                         break;
1462                         case HARQ_MAP_POINTER_IE:
1463                                 /* 8.4.5.3.10 HARQ_Map_Pointer_IE */
1464                                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_harq_map_pointer, tvb, offset, (length + 1), ENC_NA);
1465                         break;
1466                         case PHYMOD_DL_IE:
1467                                 /* 8.4.5.3.11 PHYMOD_DL_IE */
1468                                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_phymod_dl, tvb, offset, (length + 1), ENC_NA);
1469                         break;
1470                         case DL_PUSC_BURST_ALLOCATION_IN_OTHER_SEGMENT_IE:
1471                                 /* 8.4.5.3.13 DL PUSC Burst Allocation in Other Segment IE */
1472                                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_dl_pusc_burst_allocation, tvb, offset, (length + 1), ENC_NA);
1473                         break;
1474                         case UL_INTERFERENCE_AND_NOISE_LEVEL_IE:
1475                                 /* 8.4.5.3.19 UL_interference_and_noise_level_IE */
1476                                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_ul_interference_and_noise_level, tvb, offset, (length + 1), ENC_NA);
1477                         break;
1478                         default:
1479                                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_unknown_diuc, tvb, offset, (length + 1), ENC_NA);
1480                         break;
1481                 }
1482         }
1483         else
1484         {       /* get the extended DIUC */
1485                 ext_diuc = ((byte & MSB_NIBBLE_MASK) >> 4);
1486                 /* get the length */
1487                 length = (byte & LSB_NIBBLE_MASK);
1488                 /* display extended DIUC */
1489                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_diuc, tvb, offset, 1, ENC_BIG_ENDIAN);
1490                 /* display extended DIUC length */
1491                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_length_1, tvb, offset, 1, ENC_BIG_ENDIAN);
1492                 /* move to next byte */
1493                 offset++;
1494                 /* 8.4.5.3.2.1 (table 277a) */
1495                 switch (ext_diuc)
1496                 {
1497                         case CHANNEL_MEASUREMENT_IE:
1498                                 /* 8.4.5.3.? Channel_Measurement_IE */
1499                                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_channel_measurement, tvb, offset, length, ENC_NA);
1500                         break;
1501                         case STC_ZONE_IE:
1502                                 /* 8.4.5.3.4 STC_Zone_IE */
1503                                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_stc_zone, tvb, offset, length, ENC_NA);
1504                         break;
1505                         case AAS_DL_IE:
1506                                 /* 8.4.5.3.3 AAS_DL_IE */
1507                                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_aas_dl, tvb, offset, length, ENC_NA);
1508                         break;
1509                         case DATA_LOCATION_IN_ANOTHER_BS_IE:
1510                                 /* 8.4.5.3.6 Data_location_in_another_BS_IE */
1511                                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_data_location, tvb, offset, length, ENC_NA);
1512                         break;
1513                         case CID_SWITCH_IE:
1514                                 /* 8.4.5.3.7 CID_Switch_IE */
1515                                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_cid_switch, tvb, offset, length, ENC_NA);
1516                         break;
1517                         case MIMO_DL_BASIC_IE:
1518                                 /* 8.4.5.3.8 MIMO_DL_Basic_IE */
1519                                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_mimo_dl_basic, tvb, offset, length, ENC_NA);
1520                         break;
1521                         case MIMO_DL_ENHANCED_IE:
1522                                 /* 8.4.5.3.9 MIMO_DL_Enhanced_IE */
1523                                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_mimo_dl_enhanced, tvb, offset, length, ENC_NA);
1524                         break;
1525                         case HARQ_MAP_POINTER_IE:
1526                                 /* 8.4.5.3.10 HARQ_Map_Pointer_IE */
1527                                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_harq_map_pointer, tvb, offset, length, ENC_NA);
1528                         break;
1529                         case PHYMOD_DL_IE:
1530                                 /* 8.4.5.3.11 PHYMOD_DL_IE */
1531                                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_phymod_dl, tvb, offset, length, ENC_NA);
1532                         break;
1533                         case DL_PUSC_BURST_ALLOCATION_IN_OTHER_SEGMENT_IE:
1534                                 /* 8.4.5.3.13 DL PUSC Burst Allocation in Other Segment IE */
1535                                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_dl_pusc_burst_allocation, tvb, offset, length, ENC_NA);
1536                         break;
1537                         case UL_INTERFERENCE_AND_NOISE_LEVEL_IE:
1538                                 /* 8.4.5.3.19 UL_interference_and_noise_level_IE */
1539                                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_ul_interference_and_noise_level, tvb, offset, length, ENC_NA);
1540                         break;
1541                         default:
1542                                 proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_unknown_diuc, tvb, offset, length, ENC_NA);
1543                         break;
1544                 }
1545         }
1546         return ((length + 1) * 2 ); /* length in nibbles */
1547
1548 }
1549
1550 /* Register Wimax Compact DL-MAP IE Protocol */
1551 void proto_register_wimax_compact_dlmap_ie(void)
1552 {
1553         /* Compact DL-MAP IE display */
1554         static hf_register_info hf_compact_dlmap[] =
1555         {
1556                 {
1557                         &hf_cdlmap_dl_map_type,
1558                         {"DL-MAP Type", "wmx.compact_dlmap.dl_map_type", FT_UINT8, BASE_DEC, NULL, DL_MAP_TYPE_MASK, NULL, HFILL}
1559                 },
1560                 {
1561                         &hf_cdlmap_dl_map_type_1,
1562                         {"DL-MAP Type", "wmx.compact_dlmap.dl_map_type", FT_UINT8, BASE_DEC, NULL, DL_MAP_TYPE_MASK_1, NULL, HFILL}
1563                 },
1564                 {
1565                         &hf_cdlmap_ul_map_append,
1566                         {"UL-MAP Append", "wmx.compact_dlmap.ul_map_append", FT_UINT8, BASE_HEX, NULL, UL_MAP_APPEND_MASK, NULL, HFILL}
1567                 },
1568                 {
1569                         &hf_cdlmap_ul_map_append_1,
1570                         {"UL-MAP Append", "wmx.compact_dlmap.ul_map_append", FT_UINT8, BASE_HEX, NULL, UL_MAP_APPEND_MASK_1, NULL, HFILL}
1571                 },
1572                 {
1573                         &hf_cdlmap_reserved,
1574                         {"Reserved", "wmx.compact_dlmap.reserved", FT_UINT8, BASE_HEX, NULL, UL_MAP_APPEND_MASK, NULL, HFILL}
1575                 },
1576                 {
1577                         &hf_cdlmap_reserved_1,
1578                         {"Reserved", "wmx.compact_dlmap.reserved", FT_UINT8, BASE_HEX, NULL, UL_MAP_APPEND_MASK_1, NULL, HFILL}
1579                 },
1580                 {
1581                         &hf_cdlmap_nep_code,
1582                         {"Nep Code", "wmx.compact_dlmap.nep_code", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL}
1583                 },
1584                 {
1585                         &hf_cdlmap_nep_code_1,
1586                         {"Nep Code", "wmx.compact_dlmap.nep_code", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL}
1587                 },
1588                 {
1589                         &hf_cdlmap_nsch_code,
1590                         {"Nsch Code", "wmx.compact_dlmap.nsch_code", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL}
1591                 },
1592                 {
1593                         &hf_cdlmap_nsch_code_1,
1594                         {"Nsch Code", "wmx.compact_dlmap.nsch_code", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL}
1595                 },
1596                 {
1597                         &hf_cdlmap_num_bands,
1598                         {"Number Of Bands", "wmx.compact_dlmap.num_bands", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL}
1599                 },
1600                 {
1601                         &hf_cdlmap_num_bands_1,
1602                         {"Number Of Bands", "wmx.compact_dlmap.num_bands", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL}
1603                 },
1604                 {
1605                         &hf_cdlmap_band_index,
1606                         {"Band Index", "wmx.compact_dlmap.band_index", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1607                 },
1608 #if 0
1609                 {
1610                         &hf_cdlmap_band_index_1,
1611                         {"Band Index", "wmx.compact_dlmap.band_index", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1612                 },
1613 #endif
1614                 {
1615                         &hf_cdlmap_nb_bitmap,
1616                         {"Number Of Bits For Band BITMAP", "wmx.compact_dlmap.nb_bitmap", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL}
1617                 },
1618                 {
1619                         &hf_cdlmap_nb_bitmap_1,
1620                         {"Number Of Bits For Band BITMAP", "wmx.compact_dlmap.nb_bitmap", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL}
1621                 },
1622                 {
1623                         &hf_cdlmap_shortened_uiuc,
1624                         {"Shortened UIUC", "wmx.compact_dlmap.shortened_uiuc", FT_UINT8, BASE_HEX, NULL, SHORTENED_DIUC_MASK, NULL, HFILL}
1625                 },
1626                 {
1627                         &hf_cdlmap_shortened_uiuc_1,
1628                         {"Shortened UIUC", "wmx.compact_dlmap.shortened_uiuc", FT_UINT16, BASE_HEX, NULL, SHORTENED_DIUC_MASK_1, NULL, HFILL}
1629                 },
1630                 {
1631                         &hf_cdlmap_shortened_diuc,
1632                         {"Shortened DIUC", "wmx.compact_dlmap.shortened_diuc", FT_UINT8, BASE_HEX, NULL, SHORTENED_DIUC_MASK, NULL, HFILL}
1633                 },
1634                 {
1635                         &hf_cdlmap_shortened_diuc_1,
1636                         {"Shortened DIUC", "wmx.compact_dlmap.shortened_diuc", FT_UINT16, BASE_HEX, NULL, SHORTENED_DIUC_MASK_1, NULL, HFILL}
1637                 },
1638                 {
1639                         &hf_cdlmap_companded_sc,
1640                         {"Companded SC", "wmx.compact_dlmap.companded_sc", FT_UINT8, BASE_HEX, NULL, COMPANDED_SC_MASK, NULL, HFILL}
1641                 },
1642                 {
1643                         &hf_cdlmap_companded_sc_1,
1644                         {"Companded SC", "wmx.compact_dlmap.companded_sc", FT_UINT16, BASE_HEX, NULL, COMPANDED_SC_MASK_1, NULL, HFILL}
1645                 },
1646                 {
1647                         &hf_cdlmap_bin_offset,
1648                         {"BIN Offset", "wmx.compact_dlmap.bin_offset", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
1649                 },
1650                 {
1651                         &hf_cdlmap_bin_offset_1,
1652                         {"BIN Offset", "wmx.compact_dlmap.bin_offset", FT_UINT16, BASE_HEX, NULL, 0x0FF0, NULL, HFILL}
1653                 },
1654                 {
1655                         &hf_cdlmap_diuc_num_of_subchannels,
1656                         {"Number Of Subchannels", "wmx.compact_dlmap.diuc_num_of_subchannels", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
1657                 },
1658                 {
1659                         &hf_cdlmap_diuc_num_of_subchannels_1,
1660                         {"Number Of Subchannels", "wmx.compact_dlmap.diuc_num_of_subchannels", FT_UINT16, BASE_DEC, NULL, 0x0FF0, NULL, HFILL}
1661                 },
1662                 {
1663                         &hf_cdlmap_diuc_repetition_coding_indication,
1664                         {"Repetition Coding Indication", "wmx.compact_dlmap.diuc_repetition_coding_indication", FT_UINT8, BASE_DEC, VALS(rep_msgs), 0xC0, NULL, HFILL}
1665                 },
1666                 {
1667                         &hf_cdlmap_diuc_repetition_coding_indication_1,
1668                         {"Repetition Coding Indication", "wmx.compact_dlmap.diuc_repetition_coding_indication", FT_UINT8, BASE_DEC, VALS(rep_msgs), 0x0C, NULL, HFILL}
1669                 },
1670                 {
1671                         &hf_cdlmap_diuc_reserved,
1672                         {"Reserved", "wmx.compact_dlmap.diuc_reserved", FT_UINT8, BASE_HEX, NULL, 0x30, NULL, HFILL}
1673                 },
1674                 {
1675                         &hf_cdlmap_diuc_reserved_1,
1676                         {"Reserved", "wmx.compact_dlmap.diuc_reserved", FT_UINT8, BASE_HEX, NULL, 0x03, NULL, HFILL}
1677                 },
1678                 {
1679                         &hf_cdlmap_bit_map_length,
1680                         {"BIT MAP Length", "wmx.compact_dlmap.bit_map_length", FT_UINT8, BASE_DEC, NULL, MSB_NIBBLE_MASK, NULL, HFILL}
1681                 },
1682                 {
1683                         &hf_cdlmap_bit_map_length_1,
1684                         {"BIT MAP Length", "wmx.compact_dlmap.bit_map_length", FT_UINT8, BASE_DEC, NULL, LSB_NIBBLE_MASK, NULL, HFILL}
1685                 },
1686                 {
1687                         &hf_cdlmap_bit_map,
1688                         {"BIT MAP", "wmx.compact_dlmap.bit_map", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1689                 },
1690                 {
1691                         &hf_cdlmap_diuc,
1692                         {"DIUC", "wmx.compact_dlmap.diuc", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL}
1693                 },
1694                 {
1695                         &hf_cdlmap_diuc_1,
1696                         {"DIUC", "wmx.compact_dlmap.diuc", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL}
1697                 },
1698                 {
1699                         &hf_cdlmap_allocation_mode,
1700                         {"Allocation Mode", "wmx.compact_dlmap.allocation_mode", FT_UINT8, BASE_DEC, VALS(vals_allocation_modes), 0xC0, NULL, HFILL}
1701                 },
1702                 {
1703                         &hf_cdlmap_allocation_mode_1,
1704                         {"Allocation Mode", "wmx.compact_dlmap.allocation_mode", FT_UINT8, BASE_DEC, VALS(vals_allocation_modes), 0x0C, NULL, HFILL}
1705                 },
1706                 {
1707                         &hf_cdlmap_allocation_mode_rsvd,
1708                         {"Reserved", "wmx.compact_dlmap.allocation_mode_rsvd", FT_UINT8, BASE_DEC, NULL, 0x30, NULL, HFILL}
1709                 },
1710                 {
1711                         &hf_cdlmap_allocation_mode_rsvd_1,
1712                         {"Reserved", "wmx.compact_dlmap.allocation_mode_rsvd", FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL}
1713                 },
1714                 {
1715                         &hf_cdlmap_num_subchannels,
1716                         {"Number Of Subchannels", "wmx.compact_dlmap.num_subchannels", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
1717                 },
1718                 {
1719                         &hf_cdlmap_num_subchannels_1,
1720                         {"Number Of Subchannels", "wmx.compact_dlmap.num_subchannels", FT_UINT16, BASE_DEC, NULL, 0x0FF0, NULL, HFILL}
1721                 },
1722                 {
1723                         &hf_cdlmap_reserved_type,
1724                         {"DL-MAP Reserved Type", "wmx.compact_dlmap.reserved_type", FT_UINT8, BASE_DEC, NULL, DL_MAP_TYPE_MASK, NULL, HFILL}
1725                 },
1726                 {
1727                         &hf_cdlmap_reserved_type_1,
1728                         {"DL-MAP Reserved Type", "wmx.compact_dlmap.reserved_type", FT_UINT8, BASE_DEC, NULL, DL_MAP_TYPE_MASK_1, NULL, HFILL}
1729                 }
1730         };
1731
1732         /* HARQ MAP Format Configuration IE display */
1733         static hf_register_info hf_format_config[] =
1734         {
1735                 {
1736                         &hf_format_config_ie_dl_map_type,
1737                         {"DL-MAP Type", "wmx.format_config_ie.dl_map_type", FT_UINT8, BASE_DEC, NULL, DL_MAP_TYPE_MASK, NULL, HFILL}
1738                 },
1739                 {
1740                         &hf_format_config_ie_dl_map_type_1,
1741                         {"DL-MAP Type", "wmx.format_config_ie.dl_map_type", FT_UINT8, BASE_DEC, NULL, DL_MAP_TYPE_MASK_1, NULL, HFILL}
1742                 },
1743                 {
1744                         &hf_format_config_ie_dl_map_type_32,
1745                         {"DL-MAP Type", "wmx.format_config_ie.dl_map_type", FT_UINT32, BASE_DEC, NULL, FORMAT_CONFIG_IE_DL_MAP_TYPE_MASK, NULL, HFILL}
1746                 },
1747                 {
1748                         &hf_format_config_ie_new_format_indication,
1749                         {"New Format Indication", "wmx.format_config_ie.new_format_indication", FT_BOOLEAN, 8, TFS(&tfs_indication), UL_MAP_APPEND_MASK, NULL, HFILL}
1750                 },
1751                 {
1752                         &hf_format_config_ie_new_format_indication_1,
1753                         {"New Format Indication", "wmx.format_config_ie.new_format_indication", FT_BOOLEAN, 8, TFS(&tfs_indication), UL_MAP_APPEND_MASK_1, NULL, HFILL}
1754                 },
1755                 {
1756                         &hf_format_config_ie_new_format_indication_32,
1757                         {"New Format Indication", "wmx.format_config_ie.new_format_indication", FT_BOOLEAN, 32, TFS(&tfs_indication), FORMAT_CONFIG_IE_NEW_FORMAT_IND_MASK, NULL, HFILL}
1758                 },
1759                 {
1760                         &hf_format_config_ie_cid_type,
1761                         {"HARQ MAP Indicator", "wmx.harq_map.format_config_ie.indicator", FT_UINT32, BASE_HEX, VALS(vals_cid_types), CID_TYPE_MASK, NULL, HFILL}
1762                 },
1763                 {
1764                         &hf_format_config_ie_cid_type_1,
1765                         {"CID Type", "wmx.harq_map.format_config_ie.cid_type", FT_UINT32, BASE_HEX, VALS(vals_cid_types), CID_TYPE_MASK_1, NULL, HFILL}
1766                 },
1767                 {
1768                         &hf_format_config_ie_safety_pattern,
1769                         {"Safety Pattern", "wmx.harq_map.format_config_ie.safety_pattern", FT_UINT32, BASE_HEX, NULL, SAFETY_PATTERN_MASK, NULL, HFILL}
1770                 },
1771                 {
1772                         &hf_format_config_ie_safety_pattern_1,
1773                         {"Safety Pattern", "wmx.harq_map.format_config_ie.safety_pattern", FT_UINT32, BASE_HEX, NULL, SAFETY_PATTERN_MASK_1, NULL, HFILL}
1774                 },
1775                 {
1776                         &hf_format_config_ie_subchannel_type,
1777                         {"Subchannel Type For Band AMC", "wmx.harq_map.format_config_ie.subchannel_type", FT_UINT32, BASE_HEX, VALS(vals_subchannel_types), BAND_AMC_SUBCHANNEL_TYPE_MASK, NULL, HFILL}
1778                 },
1779                 {
1780                         &hf_format_config_ie_subchannel_type_1,
1781                         {"Subchannel Type For Band AMC", "wmx.harq_map.format_config_ie.subchannel_type", FT_UINT32, BASE_HEX, VALS(vals_subchannel_types), BAND_AMC_SUBCHANNEL_TYPE_MASK_1, NULL, HFILL}
1782                 },
1783                 {
1784                         &hf_format_config_ie_max_logical_bands,
1785                         {"Max Logical Bands", "wmx.harq_map.format_config_ie.max_logical_bands", FT_UINT32, BASE_HEX, VALS(vals_max_logical_bands), MAX_LOGICAL_BANDS_MASK, NULL, HFILL}
1786                 },
1787                 {
1788                         &hf_format_config_ie_max_logical_bands_1,
1789                         {"Max Logical Bands", "wmx.harq_map.format_config_ie.max_logical_bands", FT_UINT32, BASE_HEX, VALS(vals_max_logical_bands), MAX_LOGICAL_BANDS_MASK_1, NULL, HFILL}
1790                 },
1791                 {
1792                         &hf_format_config_ie_num_of_broadcast_symbol,
1793                         {"Number Of Symbols for Broadcast", "wmx.harq_map.format_config_ie.num_of_broadcast_symbol", FT_UINT32, BASE_HEX, NULL, NUM_BROADCAST_SYMBOLS_MASK_1, NULL, HFILL}
1794                 },
1795                 {
1796                         &hf_format_config_ie_num_of_broadcast_symbol_1,
1797                         {"Number Of Symbols for Broadcast", "wmx.harq_map.num_of_broadcast_symbol", FT_UINT32, BASE_HEX, NULL, NUM_BROADCAST_SYMBOLS_MASK_1, NULL, HFILL}
1798                 },
1799                 {
1800                         &hf_format_config_ie_num_of_dl_band_amc_symbol,
1801                         {"Number Of Symbols for Broadcast", "wmx.harq_map.format_config_ie.num_of_dl_band_amc_symbol", FT_UINT32, BASE_HEX, NULL, NUM_DL_AMC_SYMBOLS_MASK, NULL, HFILL}
1802                 },
1803                 {
1804                         &hf_format_config_ie_num_of_dl_band_amc_symbol_1,
1805                         {"Number Of Symbols for Broadcast", "wmx.harq_map.num_of_dl_band_amc_symbol", FT_UINT32, BASE_HEX, NULL, NUM_DL_AMC_SYMBOLS_MASK_1, NULL, HFILL}
1806                 },
1807                 {
1808                         &hf_format_config_ie_num_of_ul_band_amc_symbol,
1809                         {"Number Of Symbols for Broadcast", "wmx.harq_map.format_config_ie.num_of_ul_band_amc_symbol", FT_UINT32, BASE_HEX, NULL, NUM_UL_AMC_SYMBOLS_MASK, NULL, HFILL}
1810                 },
1811                 {
1812                         &hf_format_config_ie_num_of_ul_band_amc_symbol_1,
1813                         {"Number Of Symbols for Broadcast", "wmx.harq_map.num_of_ul_band_amc_symbol", FT_UINT32, BASE_HEX, NULL, NUM_UL_AMC_SYMBOLS_MASK_1, NULL, HFILL}
1814                 }
1815         };
1816
1817         /* HARQ MAP Reduced CID IE display */
1818         static hf_register_info hf_rcid[] =
1819         {
1820                 {
1821                         &hf_harq_rcid_ie_normal_cid,
1822                         {"Normal CID", "wmx.harq_map.rcid_ie.normal_cid", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
1823                 },
1824                 {
1825                         &hf_harq_rcid_ie_normal_cid_1,
1826                         {"Normal CID", "wmx.harq_map.rcid_ie.normal_cid", FT_UINT24, BASE_HEX, NULL, WIMAX_RCID_IE_NORMAL_CID_MASK_1, NULL, HFILL}
1827                 },
1828                 {
1829                         &hf_harq_rcid_ie_prefix,
1830                         {"Prefix", "wmx.harq_map.rcid_ie.prefix", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_PREFIX_MASK, NULL, HFILL}
1831                 },
1832                 {
1833                         &hf_harq_rcid_ie_prefix_1,
1834                         {"Prefix", "wmx.harq_map.rcid_ie.prefix", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_PREFIX_MASK_1, NULL, HFILL}
1835                 },
1836                 {
1837                         &hf_harq_rcid_ie_cid3,
1838                         {"3 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid3", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID3_MASK, NULL, HFILL}
1839                 },
1840                 {
1841                         &hf_harq_rcid_ie_cid3_1,
1842                         {"3 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid3", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID3_MASK_1, NULL, HFILL}
1843                 },
1844                 {
1845                         &hf_harq_rcid_ie_cid7,
1846                         {"7 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid7", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID7_MASK, NULL, HFILL}
1847                 },
1848                 {
1849                         &hf_harq_rcid_ie_cid7_1,
1850                         {"7 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid7", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID7_MASK_1, NULL, HFILL}
1851                 },
1852                 {
1853                         &hf_harq_rcid_ie_cid11,
1854                         {"11 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid11", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID11_MASK, NULL, HFILL}
1855                 },
1856                 {
1857                         &hf_harq_rcid_ie_cid11_1,
1858                         {"11 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid11", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID11_MASK_1, NULL, HFILL}
1859                 },
1860                 {
1861                         &hf_harq_rcid_ie_cid11_2,
1862                         {"11 LSB Of Multicast, AAS or Broadcast CID", "wmx.harq_map.rcid_ie.cid11", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID11_MASK, NULL, HFILL}
1863                 },
1864                 {
1865                         &hf_harq_rcid_ie_cid11_3,
1866                         {"11 LSB Of Multicast, AAS or Broadcast CID", "wmx.harq_map.rcid_ie.cid11", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID11_MASK_1, NULL, HFILL}
1867                 }
1868         };
1869
1870         /* HARQ MAP HARQ Control IE display */
1871         static hf_register_info hf_harq_control[] =
1872         {
1873                 {
1874                         &hf_harq_control_ie_prefix,
1875                         {"Prefix", "wmx.harq_map.harq_control_ie.prefix", FT_BOOLEAN, 8, TFS(&tfs_prefix), WIMAX_HARQ_CONTROL_IE_PREFIX_MASK, NULL, HFILL}
1876                 },
1877                 {
1878                         &hf_harq_control_ie_ai_sn,
1879                         {"HARQ ID Sequence Number(AI_SN)", "wmx.harq_map.harq_control_ie.ai_sn", FT_UINT8, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_AI_SN_MASK, NULL, HFILL}
1880                 },
1881                 {
1882                         &hf_harq_control_ie_spid,
1883                         {"Subpacket ID (SPID)", "wmx.harq_map.harq_control_ie.spid", FT_UINT8, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_SPID_MASK, NULL, HFILL}
1884                 },
1885                 {
1886                         &hf_harq_control_ie_acid,
1887                         {"HARQ CH ID (ACID)", "wmx.harq_map.harq_control_ie.acid", FT_UINT8, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_ACID_MASK, NULL, HFILL}
1888                 },
1889                 {
1890                         &hf_harq_control_ie_reserved,
1891                         {"Reserved", "wmx.harq_map.harq_control_ie.reserved", FT_UINT8, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_RESERVED_MASK, NULL, HFILL}
1892                 },
1893                 {
1894                         &hf_harq_control_ie_prefix_1,
1895                         {"Prefix", "wmx.harq_map.harq_control_ie.prefix", FT_BOOLEAN, 16, TFS(&tfs_prefix), WIMAX_HARQ_CONTROL_IE_PREFIX_MASK_1, NULL, HFILL}
1896                 },
1897                 {
1898                         &hf_harq_control_ie_ai_sn_1,
1899                         {"HARQ ID Sequence Number(AI_SN)", "wmx.harq_map.harq_control_ie.ai_sn", FT_UINT16, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_AI_SN_MASK_1, NULL, HFILL}
1900                 },
1901                 {
1902                         &hf_harq_control_ie_spid_1,
1903                         {"Subpacket ID (SPID)", "wmx.harq_map.harq_control_ie.spid", FT_UINT16, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_SPID_MASK_1, NULL, HFILL}
1904                 },
1905                 {
1906                         &hf_harq_control_ie_acid_1,
1907                         {"HARQ CH ID (ACID)", "wmx.harq_map.harq_control_ie.acid", FT_UINT16, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_ACID_MASK_1, NULL, HFILL}
1908                 },
1909                 {
1910                         &hf_harq_control_ie_reserved_1,
1911                         {"Reserved", "wmx.harq_map.harq_control_ie.reserved", FT_UINT16, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_RESERVED_MASK_1, NULL, HFILL}
1912                 }
1913         };
1914
1915         /* HARQ MAP CQICH Control IE display */
1916         static hf_register_info hf_cqich_control[] =
1917         {
1918                 {
1919                         &hf_cqich_control_ie_indicator,
1920                         {"CQICH Indicator", "wmx.harq_map.cqich_control_ie.cqich_indicator", FT_BOOLEAN, 16, TFS(&tfs_cqich_ind), WIMAX_CQICH_CONTROL_IE_INDICATOR_MASK, NULL, HFILL}
1921                 },
1922                 {
1923                         &hf_cqich_control_ie_alloc_id,
1924                         {"Allocation Index", "wmx.harq_map.cqich_control_ie.alloc_id", FT_UINT16, BASE_HEX, NULL, WIMAX_CQICH_CONTROL_IE_ALLOCATION_INDEX_MASK, NULL, HFILL}
1925                 },
1926                 {
1927                         &hf_cqich_control_ie_period,
1928                         {"PERIOD", "wmx.harq_map.cqich_control_ie.period", FT_UINT16, BASE_HEX, NULL, WIMAX_CQICH_CONTROL_IE_PERIOD_MASK, NULL, HFILL}
1929                 },
1930                 {
1931                         &hf_cqich_control_ie_frame_offset,
1932                         {"Frame Offset", "wmx.harq_map.cqich_control_ie.frame_offset", FT_UINT16, BASE_HEX, NULL, WIMAX_CQICH_CONTROL_IE_FRAME_OFFSET_MASK, NULL, HFILL}
1933                 },
1934                 {
1935                         &hf_cqich_control_ie_duration,
1936                         {"Duration", "wmx.harq_map.cqich_control_ie.duration", FT_UINT16, BASE_HEX, NULL, WIMAX_CQICH_CONTROL_IE_DURATION_MASK, NULL, HFILL}
1937                 },
1938                 {
1939                         &hf_cqich_control_ie_cqi_rep_threshold,
1940                         {"CQI Reporting Threshold", "wmx.harq_map.cqich_control_ie.cqi_rep_threshold", FT_UINT16, BASE_HEX, NULL, WIMAX_CQICH_CONTROL_IE_CQI_REP_THRESHOLD_MASK, NULL, HFILL}
1941                 },
1942                 {
1943                         &hf_cqich_control_ie_indicator_1,
1944                         {"CQICH Indicator", "wmx.harq_map.cqich_control_ie.cqich_indicator", FT_BOOLEAN, 24, TFS(&tfs_cqich_ind), WIMAX_CQICH_CONTROL_IE_INDICATOR_MASK_1, NULL, HFILL}
1945                 },
1946                 {
1947                         &hf_cqich_control_ie_alloc_id_1,
1948                         {"Allocation Index", "wmx.harq_map.cqich_control_ie.alloc_id", FT_UINT24, BASE_HEX, NULL, WIMAX_CQICH_CONTROL_IE_ALLOCATION_INDEX_MASK_1, NULL, HFILL}
1949                 },
1950                 {
1951                         &hf_cqich_control_ie_period_1,
1952                         {"PERIOD", "wmx.harq_map.cqich_control_ie.period", FT_UINT24, BASE_HEX, NULL, WIMAX_CQICH_CONTROL_IE_PERIOD_MASK_1, NULL, HFILL}
1953                 },
1954                 {
1955                         &hf_cqich_control_ie_frame_offset_1,
1956                         {"Frame Offset", "wmx.harq_map.cqich_control_ie.frame_offset", FT_UINT24, BASE_HEX, NULL, WIMAX_CQICH_CONTROL_IE_FRAME_OFFSET_MASK_1, NULL, HFILL}
1957                 },
1958                 {
1959                         &hf_cqich_control_ie_duration_1,
1960                         {"Duration", "wmx.harq_map.cqich_control_ie.duration", FT_UINT24, BASE_HEX, NULL, WIMAX_CQICH_CONTROL_IE_DURATION_MASK_1, NULL, HFILL}
1961                 },
1962                 {
1963                         &hf_cqich_control_ie_cqi_rep_threshold_1,
1964                         {"CQI Reporting Threshold", "wmx.harq_map.cqich_control_ie.cqi_rep_threshold", FT_UINT24, BASE_HEX, NULL, WIMAX_CQICH_CONTROL_IE_CQI_REP_THRESHOLD_MASK_1, NULL, HFILL}
1965                 }
1966         };
1967
1968         static hf_register_info hf_extension_type[] =
1969         {
1970                 {
1971                         &hf_cdlmap_extension_type,
1972                         {"DL-MAP Type", "wmx.extension_type.dl_map_type", FT_UINT16, BASE_DEC, NULL, EXTENSION_TYPE_MASK, NULL, HFILL}
1973                 },
1974                 {
1975                         &hf_cdlmap_extension_type_1,
1976                         {"DL-MAP Type", "wmx.extension_type.dl_map_type", FT_UINT16, BASE_DEC, NULL, EXTENSION_TYPE_MASK_1, NULL, HFILL}
1977                 },
1978                 {
1979                         &hf_cdlmap_extension_subtype,
1980                         {"Extension Subtype", "wmx.extension_type.subtype", FT_UINT16, BASE_DEC, NULL, EXTENSION_SUBTYPE_MASK, NULL, HFILL}
1981                 },
1982                 {
1983                         &hf_cdlmap_extension_subtype_1,
1984                         {"Extension Subtype", "wmx.extension_type.subtype", FT_UINT16, BASE_DEC, NULL, EXTENSION_SUBTYPE_MASK_1, NULL, HFILL}
1985                 },
1986                 {
1987                         &hf_cdlmap_extension_length,
1988                         {"Extension Length", "wmx.extension_type.length", FT_UINT16, BASE_DEC, NULL, EXTENSION_LENGTH_MASK, NULL, HFILL}
1989                 },
1990                 {
1991                         &hf_cdlmap_extension_length_1,
1992                         {"Extension Length", "wmx.extension_type.length", FT_UINT16, BASE_DEC, NULL, EXTENSION_LENGTH_MASK_1, NULL, HFILL}
1993                 },
1994                 {
1995                         &hf_cdlmap_extension_time_diversity_mbs,
1996                         {"Time Diversity MBS", "wmx.extension_type.time_diversity_mbs", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1997                 },
1998                 {
1999                         &hf_cdlmap_extension_time_diversity_mbs_1,
2000                         {"Time Diversity MBS", "wmx.extension_type.time_diversity_mbs", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
2001                 },
2002                 {
2003                         &hf_cdlmap_extension_harq_mode_1,
2004                         {"HARQ Mode Switch", "wmx.extension_type.harq_mode", FT_UINT16, BASE_HEX, NULL, 0x000F, NULL, HFILL}
2005                 },
2006                 {
2007                         &hf_cdlmap_extension_harq_mode,
2008                         {"HARQ Mode Switch", "wmx.extension_type.harq_mode", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL}
2009                 },
2010                 {
2011                         &hf_cdlmap_extension_unknown_sub_type,
2012                         {"Unknown Extension Subtype", "wmx.extension_type.unknown_sub_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
2013                 },
2014                 {
2015                         &hf_cdlmap_extension_unknown_sub_type_1,
2016                         {"Unknown Extension Subtype", "wmx.extension_type.unknown_sub_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
2017                 }
2018         };
2019
2020         /* Extended DIUC dependent IE */
2021         static hf_register_info hf_extended_diuc[] =
2022         {
2023                 {
2024                         &hf_extended_diuc_dependent_ie_diuc,
2025                         {"Extended DIUC", "wmx.extended_diuc_dependent_ie.diuc", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL }
2026                 },
2027                 {
2028                         &hf_extended_diuc_dependent_ie_diuc_1,
2029                         {"Extended DIUC", "wmx.extended_diuc_dependent_ie.diuc", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL }
2030                 },
2031                 {
2032                         &hf_extended_diuc_dependent_ie_length,
2033                         {"Length", "wmx.extended_diuc_dependent_ie.length", FT_UINT8, BASE_DEC, NULL, MSB_NIBBLE_MASK, NULL, HFILL }
2034                 },
2035                 {
2036                         &hf_extended_diuc_dependent_ie_length_1,
2037                         {"Length", "wmx.extended_diuc_dependent_ie.length", FT_UINT8, BASE_DEC, NULL, LSB_NIBBLE_MASK, NULL, HFILL }
2038                 },
2039                 {       /* 8.4.5.3.? Channel_Measurement_IE */
2040                         &hf_extended_diuc_dependent_ie_channel_measurement,
2041                         {"Channel_Measurement_IE (not implemented)", "wmx.extended_diuc_dependent_ie.channel_measurement", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }
2042                 },
2043                 {       /* 8.4.5.3.4 STC_Zone_IE */
2044                         &hf_extended_diuc_dependent_ie_stc_zone,
2045                         {"STC_Zone_IE (not implemented)", "wmx.extended_diuc_dependent_ie.stc_zone", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }
2046                 },
2047                 {       /* 8.4.5.3.3 AAS_DL_IE */
2048                         &hf_extended_diuc_dependent_ie_aas_dl,
2049                         {"AAS_DL_IE (not implemented)", "wmx.extended_diuc_dependent_ie.aas_dl", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }
2050                 },
2051                 {       /* 8.4.5.3.6 Data_location_in_another_BS_IE */
2052                         &hf_extended_diuc_dependent_ie_data_location,
2053                         {"Data_location_in_another_BS_IE (not implemented)", "wmx.extended_diuc_dependent_ie.data_location", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }
2054                 },
2055                 {       /* 8.4.5.3.7 CID_Switch_IE */
2056                         &hf_extended_diuc_dependent_ie_cid_switch,
2057                         {"CID_Switch_IE (not implemented)", "wmx.extended_diuc_dependent_ie.cid_switch", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }
2058                 },
2059
2060                 {       /* 8.4.5.3.8 MIMO_DL_Basic_IE */
2061                         &hf_extended_diuc_dependent_ie_mimo_dl_basic,
2062                         {"MIMO_DL_Basic_IE (not implemented)", "wmx.extended_diuc_dependent_ie.mimo_dl_basic", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }
2063                 },
2064                 {       /* 8.4.5.3.9 MIMO_DL_Enhanced_IE */
2065                         &hf_extended_diuc_dependent_ie_mimo_dl_enhanced,
2066                         {"MIMO_DL_Enhanced_IE (not implemented)", "wmx.extended_diuc_dependent_ie.mimo_dl_enhanced", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }
2067                 },
2068                 {       /* 8.4.5.3.10 HARQ_Map_Pointer_IE */
2069                         &hf_extended_diuc_dependent_ie_harq_map_pointer,
2070                         {"HARQ_Map_Pointer_IE (not implemented)", "wmx.extended_diuc_dependent_ie.harq_map_pointer", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }
2071                 },
2072                 {       /* 8.4.5.3.11 PHYMOD_DL_IE */
2073                         &hf_extended_diuc_dependent_ie_phymod_dl,
2074                         {"PHYMOD_DL_IE (not implemented)", "wmx.extended_diuc_dependent_ie.phymod_dl", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }
2075                 },
2076                 {       /* 8.4.5.3.13 DL PUSC Burst Allocation in Other Segment IE */
2077                         &hf_extended_diuc_dependent_ie_dl_pusc_burst_allocation,
2078                         {"DL_PUSC_Burst_Allocation_in_Other_Segment_IE (not implemented)", "wmx.extended_diuc_dependent_ie.dl_pusc_burst_allocation", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }
2079                 },
2080                 {       /* 8.4.5.3.19 UL_interference_and_noise_level_IE */
2081                         &hf_extended_diuc_dependent_ie_ul_interference_and_noise_level,
2082                         {"UL_interference_and_noise_level_IE (not implemented)", "wmx.extended_diuc_dependent_ie.ul_interference_and_noise_level", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }
2083                 },
2084                 {       /* unknown DIUC */
2085                         &hf_extended_diuc_dependent_ie_unknown_diuc,
2086                         {"Unknown Extended DIUC", "wmx.extended_diuc_dependent_ie.unknown_diuc", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }
2087                 }
2088         };
2089
2090 #if 0 /* Not used ?? */
2091         /* Setup protocol subtree array */
2092         static gint *ett[] =
2093                 {
2094                         &ett_wimax_compact_dlmap_ie_decoder,
2095                         &ett_wimax_format_configuration_ie_decoder,
2096                         &ett_wimax_rcid_ie_decoder,
2097                         &ett_wimax_harq_control_ie_decoder,
2098                         &ett_wimax_extended_diuc_dependent_ie_decoder,
2099                         &ett_wimax_cqich_control_ie_decoder,
2100                         &ett_wimax_extension_type_ie_decoder,
2101                 };
2102         proto_register_subtree_array(ett, array_length(ett));
2103 #endif
2104
2105         proto_wimax_compact_dlmap_ie_decoder = proto_wimax;
2106
2107         proto_register_field_array(proto_wimax_compact_dlmap_ie_decoder, hf_compact_dlmap, array_length(hf_compact_dlmap));
2108         proto_register_field_array(proto_wimax_compact_dlmap_ie_decoder, hf_format_config, array_length(hf_format_config));
2109         proto_register_field_array(proto_wimax_compact_dlmap_ie_decoder, hf_rcid, array_length(hf_rcid));
2110         proto_register_field_array(proto_wimax_compact_dlmap_ie_decoder, hf_harq_control, array_length(hf_harq_control));
2111         proto_register_field_array(proto_wimax_compact_dlmap_ie_decoder, hf_cqich_control, array_length(hf_cqich_control));
2112         proto_register_field_array(proto_wimax_compact_dlmap_ie_decoder, hf_extension_type, array_length(hf_extension_type));
2113         proto_register_field_array(proto_wimax_compact_dlmap_ie_decoder, hf_extended_diuc, array_length(hf_extended_diuc));
2114 }