aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/wimax/mac_hd_type1_decoder.c
blob: 148364c6266b6da19bcf2a0d32f5d7881484f782 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
/* mac_hd_type1_decoder.c
 * WiMax MAC Type I Signaling Header decoder
 *
 * Copyright (c) 2007 by Intel Corporation.
 *
 * Author: Lu Pan <lu.pan@intel.com>
 *
 * $Id$
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 1999 Gerald Combs
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

/* TODO:  Add FT_UINT24 and FT_INT24 cases to gtk_widget_get_toplevel()
 * to prevent having to make all the changes from BASE_DEC to BASE_HEX
 * made to this file today: 10/20/06.
 */

/* Include files */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

/*
#define DEBUG
*/

#include "moduleinfo.h"

#include <gmodule.h>
#include <epan/packet.h>
#include <epan/prefs.h>

extern gint proto_mac_header_generic_decoder;

/* forward reference */
void proto_register_mac_header_type_1(void);
void dissect_mac_header_type_1_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);

static gint proto_mac_header_type_1_decoder = -1;
static gint ett_mac_header_type_1_decoder = -1;
static gint hf_mac_header_type_1_value_bytes = -1;

#define WIMAX_MAC_HEADER_SIZE  6

/* WiMax MAC Header Type I Sub Types */
enum
{
	BR_INCREMENTAL,            /* 0 */
	BR_AGGREGATE,              /* 1 */
	PHY_CHANNEL_REPORT,        /* 2 */
	BR_WITH_UL_TX_POWER_REPORT,/* 3 */
	BR_AND_CINR_REPORT,        /* 4 */
	BR_WITH_UL_SLEEP_CONTROL,  /* 5 */
	SN_REPORT,                 /* 6 */
	CQICH_ALLOCATION_REQUEST,  /* 7 */
	TYPE_I_SUBTYPE_MAX
} TYPE_I_SUBTYPE;

static char *type1_subtype_abbrv[TYPE_I_SUBTYPE_MAX] = 
{
	"BR INCREMENTAL",            /* 0 */
	"BR AGGREGATE",              /* 1 */
	"PHY CHANNEL_REPORT",        /* 2 */
	"BR WITH UL TX POWER_REPORT",/* 3 */
	"BR AND CINR REPORT",        /* 4 */
	"BR WITH UL SLEEP CONTROL",  /* 5 */
	"SN REPORT",                 /* 6 */
	"CQICH ALLOCATION REQUEST"   /* 7 */
};

#define WIMAX_MAC_HEADER_TYPE_1_SUB_TYPE_MASK 0x38

/* WIMAX MAC HEADER TYPE I FILEDS */
/* 1st to 3rd bytes */
/* Common Fields */
#define WIMAX_MAC_HEADER_TYPE_1_HT           0x800000
#define WIMAX_MAC_HEADER_TYPE_1_EC           0x400000
#define WIMAX_MAC_HEADER_TYPE_1_TYPE         0x380000
/* Bandwidth Request Incremental Header (type 0) &
   Bandwidth Request Aggregate Header (type 1) only */
#define WIMAX_MAC_HEADER_TYPE_1_BR           0x07FFFF
/* PHY Channel Report Header (type 2) only */
#define WIMAX_MAC_HEADER_TYPE_1_DIUC         0x078000
#define WIMAX_MAC_HEADER_TYPE_1_UL_TX_PWR    0x007F80
#define WIMAX_MAC_HEADER_TYPE_1_UL_HDRM      0x00007E
#define WIMAX_MAC_HEADER_TYPE_1_RSV_2        0x000001
/* Bandwidth Request and UL TX Power Report Header (type 3),
   Bandwidth Request and CINR Report Header (type 4), &
   Bandwidth Request and Uplink Sleep Control Header (type 5) only */
#define WIMAX_MAC_HEADER_TYPE_1_BR_3         0x07FF00
/* Bandwidth Request and UL TX Power Report Header (type 3) only */
#define WIMAX_MAC_HEADER_TYPE_1_UL_TX_PWR_3  0x0000FF
/* Bandwidth Request and CINR Report Header (type 4) only */
#define WIMAX_MAC_HEADER_TYPE_1_CINR         0x0000FE
#define WIMAX_MAC_HEADER_TYPE_1_DCI          0x000001
/* Bandwidth Request and Uplink Sleep Control Header (type 5) only */
#define WIMAX_MAC_HEADER_TYPE_1_PSCID        0x0000FC
#define WIMAX_MAC_HEADER_TYPE_1_OP           0x000002
#define WIMAX_MAC_HEADER_TYPE_1_RSV_5        0x000001
/* SN Report Header (type 6) only */
#define WIMAX_MAC_HEADER_TYPE_1_LAST         0x040000
#define WIMAX_MAC_HEADER_TYPE_1_SDU_SN1      0x03F000
#define WIMAX_MAC_HEADER_TYPE_1_SDU_SN2      0x000FC0
#define WIMAX_MAC_HEADER_TYPE_1_SDU_SN3      0x00003F
/* CQICH Allocation Request (type 7) only */
#define WIMAX_MAC_HEADER_TYPE_1_FB_TYPE      0x070000
#define WIMAX_MAC_HEADER_TYPE_1_FBSSI        0x008000
#define WIMAX_MAC_HEADER_TYPE_1_PERIOD       0x007000
#define WIMAX_MAC_HEADER_TYPE_1_RSV_7        0x000FFF
/* 4th to 6th bytes */
//#define WIMAX_MAC_HEADER_TYPE_1_CID          0xFFFF
//#define WIMAX_MAC_HEADER_TYPE_1_HCS          0xFF
/* Common Fields */
static int hf_mac_header_type_1_ht = -1;
static int hf_mac_header_type_1_ec = -1;
static int hf_mac_header_type_1_type = -1;
/* type 0 & type 1 only */
static int hf_mac_header_type_1_br = -1;
/* type 3, type 4, & type 5 only */
static int hf_mac_header_type_1_br_3 = -1;
/* type 2 only */
static int hf_mac_header_type_1_diuc = -1;
static int hf_mac_header_type_1_ultxpwr = -1;
static int hf_mac_header_type_1_ulhdrm = -1;
static int hf_mac_header_type_1_rsv_2 = -1;
/* type 3 only */
static int hf_mac_header_type_1_ultxpwr_3 = -1;
/* type 4 only */
static int hf_mac_header_type_1_cinr = -1;
static int hf_mac_header_type_1_dci = -1;
/* type 5 only */
static int hf_mac_header_type_1_pscid = -1;
static int hf_mac_header_type_1_op = -1;
static int hf_mac_header_type_1_rsv_5 = -1;
/* type 6 only */
static int hf_mac_header_type_1_last = -1;
static int hf_mac_header_type_1_sdu_sn1 = -1;
static int hf_mac_header_type_1_sdu_sn2 = -1;
static int hf_mac_header_type_1_sdu_sn3 = -1;
/* type 7 only */
static int hf_mac_header_type_1_fb_type = -1;
static int hf_mac_header_type_1_fbssi = -1;
static int hf_mac_header_type_1_period = -1;
static int hf_mac_header_type_1_rsv_7 = -1;
/* Common Fields */
static int hf_mac_header_type_1_cid = -1;
static int hf_mac_header_type_1_hcs = -1;

/* MAC Header Type I Sub-Types */
static const value_string sub_types[] =
{
	{ BR_INCREMENTAL, "Bandwidth Request Incremental" },
	{ BR_AGGREGATE, "Bandwidth Request Aggregate" },
	{ PHY_CHANNEL_REPORT, "PHY Channel Report" },
	{ BR_WITH_UL_TX_POWER_REPORT, "Bandwidth Request with UL TX Power Report" },
	{ BR_AND_CINR_REPORT, "Bandwidth Request and CINR Report" },
	{ BR_WITH_UL_SLEEP_CONTROL, "Bandwidth Request with Sleep Control" },
	{ SN_REPORT, "SN Report" },
	{ CQICH_ALLOCATION_REQUEST, "CQICH Allocation Request" },
	{ 0,				NULL}
};

/* Feedback Types (need to be changed for type I) */
static const value_string fb_types[] =
{
	{ 0, "CQI and MIMO Feedback" },
	{ 1, "DL average CINR" },
	{ 2, "MIMO Coefficients Feedback" },
	{ 3, "Preferred DL Channel DIUC Feedback" },
	{ 4, "UL Transmission Power" },
	{ 5, "PHY Channel Feedback" },
	{ 6, "AMC Band Indication Bitmap" },
	{ 7, "Life Span of Short-term Precoding Feedback" },
	{ 0,				NULL}
};

/* DCD Change Indication messages */
static const value_string dci_msgs[] =
{
	{ 0, "Match DCD Change Count" },
	{ 1, "Mismatch DCD Change Count" },
	{ 0,				NULL}
};

/* Operation messages */
static const value_string op_msgs[] =
{
	{ 0, "Deactivate Power Saving Class" },
	{ 1, "Activate Power Saving Class" },
	{ 0,				NULL}
};

/* Last ARQ BSN or SDU SN Indication messages */
static const value_string last_msgs[] =
{
	{ 0, "First three connections" },
	{ 1, "Last three connections" },
	{ 0,				NULL}
};

/* TLV display */
static hf_register_info hf[] =
{
	{
		&hf_mac_header_type_1_value_bytes,
		{
			"Values", "wimax.type1ValueBytes",
			FT_BYTES, BASE_HEX, NULL, 0x0,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_ht,
		{
			"MAC Header Type", "wimax.type1Ht",
			FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_HT,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_ec,
		{
			"MAC Encryption Control", "wimax.type1Ec",
			FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_EC,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_type,
		{
			"MAC Sub-Type", "wimax.type1Type",
			FT_UINT24, BASE_HEX, VALS(sub_types), WIMAX_MAC_HEADER_TYPE_1_TYPE,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_br,
		{
			"Bandwidth Request", "wimax.type1Br",
			FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_BR,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_br_3,
		{
			"Bandwidth Request", "wimax.type1Br3",
			FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_BR_3,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_fb_type,
		{
			"Feedback Type", "wimax.type1FbType",
			FT_UINT24, BASE_HEX, VALS(fb_types), WIMAX_MAC_HEADER_TYPE_1_FB_TYPE,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_diuc,
		{
			"Preferred DIUC Index", "wimax.type1Diuc",
			FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_DIUC,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_ultxpwr,
		{
			"UL TX Power", "wimax.type1UlTxPwr",
			FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_UL_TX_PWR,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_ultxpwr_3,
		{
			"UL TX Power", "wimax.type1UlTxPwr3",
			FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_UL_TX_PWR_3,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_ulhdrm,
		{
			"Headroom to UL Max Power Level", "wimax.type1HdRm",
			FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_UL_HDRM,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_cinr,
		{
			"CINR Value", "wimax.type1Cinr",
			FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_CINR,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_dci,
		{
			"DCD Change Indication", "wimax.type1Dci",
			FT_UINT24, BASE_HEX, VALS(dci_msgs), WIMAX_MAC_HEADER_TYPE_1_DCI,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_pscid,
		{
			"Power Saving Class ID", "wimax.type1PsCid",
			FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_PSCID,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_op,
		{
			"Operation", "wimax.type1Op",
			FT_UINT24, BASE_HEX, VALS(op_msgs), WIMAX_MAC_HEADER_TYPE_1_OP,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_last,
		{
			"Last ARQ BSN or SDU SN", "wimax.type1Last",
			FT_UINT24, BASE_HEX, VALS(last_msgs), WIMAX_MAC_HEADER_TYPE_1_LAST,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_sdu_sn1,
		{
			"ARQ BSN or MAC SDU SN (1)", "wimax.type1SduSn1",
			FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_SDU_SN1,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_sdu_sn2,
		{
			"ARQ BSN or MAC SDU SN (2)", "wimax.type1SduSn2",
			FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_SDU_SN2,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_sdu_sn3,
		{
			"ARQ BSN or MAC SDU SN (3)", "wimax.type1SduSn3",
			FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_SDU_SN3,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_fbssi,
		{
			"FBSS Indicator", "wimax.type1Fbssi",
			FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_FBSSI,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_period,
		{
			"Preferred CQICH Allocation Period", "wimax.type1Period",
			FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_PERIOD,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_rsv_2,
		{
			"Reserved", "wimax.type1Rsv2",
			FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_RSV_2,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_rsv_5,
		{
			"Reserved", "wimax.type1Rsv5",
			FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_RSV_5,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_rsv_7,
		{
			"Reserved", "wimax.type1Rsv7",
			FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_RSV_7,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_cid,
		{
			"Connection ID", "wimax.type1Cid",
			FT_UINT16, BASE_DEC, NULL, 0x0,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_1_hcs,
		{
			"Header Check Sequence", "wimax.type1Hcs",
			FT_UINT8, BASE_HEX, NULL, 0x0,
			"", HFILL
		}
	}
};

/* Setup protocol subtree array */
static gint *ett[] =
{
	&ett_mac_header_type_1_decoder,
};

/* Register Wimax Mac Header Type II Protocol and Dissector */
void proto_register_mac_header_type_1(void)
{
	if (proto_mac_header_type_1_decoder == -1)
	{
		proto_mac_header_type_1_decoder = proto_mac_header_generic_decoder;

		proto_register_field_array(proto_mac_header_type_1_decoder, hf, array_length(hf));
		proto_register_subtree_array(ett, array_length(ett));
	}
	register_dissector("mac_header_type_1_handler", dissect_mac_header_type_1_decoder, -1);
}

void dissect_mac_header_type_1_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
	gint tvb_len, offset = 0;
	guint first_byte, sub_type;
	proto_item *parent_item = NULL;
	proto_item *ti = NULL;
	proto_tree *ti_tree = NULL;

	if (tree)
	{	/* we are being asked for details */
		/* Get the tvb length */
		tvb_len =  tvb_length(tvb);
		/* display the MAC Type I Header message */
		ti = proto_tree_add_protocol_format(tree, proto_mac_header_type_1_decoder, tvb, offset, tvb_len, "Mac Type I Header (%u bytes)", WIMAX_MAC_HEADER_SIZE);
		/* add subtree */
		ti_tree = proto_item_add_subtree(ti, ett_mac_header_type_1_decoder);
		if(tvb_len < WIMAX_MAC_HEADER_SIZE)
		{
			/* display the MAC Type I Header in Hex */
			proto_tree_add_item(ti_tree, hf_mac_header_type_1_value_bytes, tvb, offset, tvb_len, FALSE);
			return;
		}
#ifdef DEBUG
		/* update the info column */
		if (check_col(pinfo->cinfo, COL_INFO))
		{
			col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, type1_subtype_abbrv[]);
		}
#endif
		/* get the parent */
		parent_item = proto_tree_get_parent(tree);
		/* Decode and display the first 3 bytes of the header */
		proto_tree_add_item(ti_tree, hf_mac_header_type_1_ht, tvb, offset, 3, FALSE);
		proto_tree_add_item(ti_tree, hf_mac_header_type_1_ec, tvb, offset, 3, FALSE);
		proto_tree_add_item(ti_tree, hf_mac_header_type_1_type, tvb, offset, 3, FALSE);
		/* Get the first byte */
		first_byte = tvb_get_guint8(tvb, offset);
		/* get the sub Type */
		sub_type = ((first_byte & WIMAX_MAC_HEADER_TYPE_1_SUB_TYPE_MASK)>>3);
		if(sub_type < TYPE_I_SUBTYPE_MAX)
		{
			/* update the info column */
			if (check_col(pinfo->cinfo, COL_INFO))
				col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, type1_subtype_abbrv[sub_type]);
		}
		else
		{
			/* update the info column */
			if (check_col(pinfo->cinfo, COL_INFO))
				col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Unknown type 1 subtype");
			/* display MAC Header Type I Subtype */
			proto_tree_add_protocol_format(ti_tree, proto_mac_header_type_1_decoder, tvb, offset, tvb_len, "Unknown type 1 subtype: %u", sub_type);
			/* display the MAC Type I Header in Hex */
			proto_tree_add_item(ti_tree, hf_mac_header_type_1_value_bytes, tvb, offset, tvb_len, FALSE);
			return;
		}
		/* add the MAC header info */
		proto_item_append_text(parent_item, "%s", type1_subtype_abbrv[sub_type]);
		switch (sub_type)
		{
		case BR_INCREMENTAL:
		case BR_AGGREGATE:
			/* Decode and display the Bandwidth Request */
			proto_tree_add_item(ti_tree, hf_mac_header_type_1_br, tvb, offset, 3, FALSE);
		break;
		case PHY_CHANNEL_REPORT:
			/* Decode and display the Preferred-DIUC */
			proto_tree_add_item(ti_tree, hf_mac_header_type_1_diuc, tvb, offset, 3, FALSE);
			/* Decode and display the UL TX Power */
			proto_tree_add_item(ti_tree, hf_mac_header_type_1_ultxpwr, tvb, offset, 3, FALSE);
			/* Decode and display the UL Headroom */
			proto_tree_add_item(ti_tree, hf_mac_header_type_1_ulhdrm, tvb, offset, 3, FALSE);
			/* Decode and display the reserved filed */
			proto_tree_add_item(ti_tree, hf_mac_header_type_1_rsv_2, tvb, offset, 3, FALSE);
		break;
		case BR_WITH_UL_TX_POWER_REPORT:
			/* Decode and display the Bandwidth Request */
			proto_tree_add_item(ti_tree, hf_mac_header_type_1_br_3, tvb, offset, 3, FALSE);
			/* Decode and display the UL TX Power */
			proto_tree_add_item(ti_tree, hf_mac_header_type_1_ultxpwr_3, tvb, offset, 3, FALSE);
		break;
		case BR_AND_CINR_REPORT:
			/* Decode and display the Bandwidth Request */
			proto_tree_add_item(ti_tree, hf_mac_header_type_1_br_3, tvb, offset, 3, FALSE);
			/* Decode and display the CINR */
			proto_tree_add_item(ti_tree, hf_mac_header_type_1_cinr, tvb, offset, 3, FALSE);
			/* Decode and display the DCD Change Indication */
			proto_tree_add_item(ti_tree, hf_mac_header_type_1_dci, tvb, offset, 3, FALSE);
		break;
		case BR_WITH_UL_SLEEP_CONTROL:
			/* Decode and display the Bandwidth Request */
			proto_tree_add_item(ti_tree, hf_mac_header_type_1_br_3, tvb, offset, 3, FALSE);
			/* Decode and display the Power Saving Class ID */
			proto_tree_add_item(ti_tree, hf_mac_header_type_1_pscid, tvb, offset, 3, FALSE);
			/* Decode and display the Operation */
			proto_tree_add_item(ti_tree, hf_mac_header_type_1_op, tvb, offset, 3, FALSE);
			/* Decode and display the reserved filed */
			proto_tree_add_item(ti_tree, hf_mac_header_type_1_rsv_5, tvb, offset, 3, FALSE);
		break;
		case SN_REPORT:
			/* Decode and display the Last field */
			proto_tree_add_item(ti_tree, hf_mac_header_type_1_last, tvb, offset, 3, FALSE);
			/* Decode and display the SDU SN1 */
			proto_tree_add_item(ti_tree, hf_mac_header_type_1_sdu_sn1, tvb, offset, 3, FALSE);
			/* Decode and display the SDU SN2 */
			proto_tree_add_item(ti_tree, hf_mac_header_type_1_sdu_sn2, tvb, offset, 3, FALSE);
			/* Decode and display the SDU SN3 */
			proto_tree_add_item(ti_tree, hf_mac_header_type_1_sdu_sn3, tvb, offset, 3, FALSE);
		break;
		case CQICH_ALLOCATION_REQUEST:
			/* Decode and display the Feedback Type */
			proto_tree_add_item(ti_tree, hf_mac_header_type_1_fb_type, tvb, offset, 3, FALSE);
			/* Decode and display the FBSSI */
			proto_tree_add_item(ti_tree, hf_mac_header_type_1_fbssi, tvb, offset, 3, FALSE);
			/* Decode and display the Prreferred-period */
			proto_tree_add_item(ti_tree, hf_mac_header_type_1_period, tvb, offset, 3, FALSE);
			/* Decode and display the reserved filed */
			proto_tree_add_item(ti_tree, hf_mac_header_type_1_rsv_7, tvb, offset, 3, FALSE);
		break;
		}
		/* Decode and display the CID */
		proto_tree_add_item(ti_tree, hf_mac_header_type_1_cid, tvb, (offset+3), 2, FALSE);
		/* Decode and display the HCS */
		proto_tree_add_item(ti_tree, hf_mac_header_type_1_hcs, tvb, (offset+5), 1, FALSE);
	}
}