⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 plugins-wimax-mac_hd_type2_decoder.c

📁 Intel的WIMAX代码,主要是mac层code
💻 C
📖 第 1 页 / 共 3 页
字号:
plugins/wimax/mac_hd_type2_decoder.c - Google Code Search这是 Google 取自 
      http://anonsvn.wireshark.org/wireshark/trunk 的 
      plugins/wimax/mac_hd_type2_decoder.c 缓存副本

      Google 和网页作者无关,不对网页的内容负责。



http://anonsvn.wireshark.org/wireshark/trunk/plugins/wimax/
          AUTHORS
COPYING
ChangeLog
Makefile.am
Makefile.common
Makefile.nmake
README.wimax
crc.c
crc.h
crc_data.c
mac_hd_generic_decoder.c
mac_hd_type1_decoder.c
mac_hd_type2_decoder.c
mac_mgmt_msg_decoder.c
moduleinfo.h
moduleinfo.nmake
msg_aas_beam.c
msg_aas_fbck.c
msg_arq.c
msg_clk_cmp.c
msg_dcd.c
msg_dlmap.c
msg_dreg.c
msg_dsa.c
msg_dsc.c
msg_dsd.c
msg_dsx_rvd.c
msg_fpc.c
msg_pkm.c
msg_pmc.c
msg_prc_lt_ctrl.c
msg_reg_req.c
msg_reg_rsp.c
msg_rep.c
msg_res_cmd.c
msg_rng_req.c
msg_rng_rsp.c
msg_sbc.c
msg_ucd.c
msg_ulmap.c
packet-wmx.c
plugin.rc.in
wimax_bits.h
wimax_cdma_code_decoder.c
wimax_compact_dlmap_ie_decoder.c
wimax_compact_ulmap_ie_decoder.c
wimax_fch_decoder.c
wimax_ffb_decoder.c
wimax_hack_decoder.c
wimax_harq_map_decoder.c
wimax_mac.h
wimax_pdu_decoder.c
wimax_phy_attributes_decoder.c
wimax_tlv.c
wimax_tlv.h
wimax_utils.c
wimax_utils.h
    /* mac_hd_type2_decoder.c
 * WiMax MAC Type II 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.
 */

/*
#define DEBUG
*/

/* Include files */

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

#include "moduleinfo.h"

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

extern gint proto_mac_header_generic_decoder;

/* forward reference */
void proto_register_mac_header_type_2(void);
void dissect_mac_header_type_2_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);

static gint proto_mac_header_type_2_decoder = -1;
static gint ett_mac_header_type_2_decoder = -1;
static gint hf_mac_header_type_2_value_bytes = -1;

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

#define WIMAX_MAC_HEADER_SIZE  6

/* WiMax MAC Header Type II Feedback Types */
enum
{
	CQI_MIMO_FB,         /* 0 */
	DL_AVG_CINR,         /* 1 */
	MIMO_COEF_FB,        /* 2 */
	PREF_DL_CHAN_DIUC_FB,/* 3 */
	UL_TX_PWR,           /* 4 */
	PHY_CHAN_FB,         /* 5 */
	AMC_BAND_BITMAP,     /* 6 */
	SHORT_PRECODE_FB,    /* 7 */
	MULTI_TYPES_FB,      /* 8 */
	LONG_PRECODE_FB,     /* 9 */
	COMB_DL_AVG_CINR,    /* 10 */
	MIMO_CHAN_FB,        /* 11 */
	CINR_FB,             /* 12 */
	CL_MIMO_FB,          /* 13 */
	TYPE_II_FB_TYPE_MAX
} TYPE_II_FB_TYPE;

static char *type2_fb_type_abbrv[TYPE_II_FB_TYPE_MAX] =
{
	"CQI and MIMO Feedback",
	"DL average CINR",
	"MIMO Coefficients Feedback",
	"Preferred DL Channel DIUC Feedback",
	"UL Transmission Power",
	"PHY Channel Feedback",
	"AMC Band Indication Bitmap",
	"Life Span of Short-term Precoding Feedback",
	"Multiple Types of Feedback",
	"Long-term Precoding Feedback",
	"Combined DL Average CINR of Active BSs",
	"MIMO Channel Feedback",
	"CINR Feedback",
	"Close-loop MIMO Feedback"
};

/* WIMAX MAC HEADER TYPE II FILEDS */
/* first byte */
#define WIMAX_MAC_HEADER_TYPE_2_HT           0x80
#define WIMAX_MAC_HEADER_TYPE_2_EC           0x40
#define WIMAX_MAC_HEADER_TYPE_2_TYPE         0x20
#define WIMAX_MAC_HEADER_TYPE_2_CII          0x10
#define WIMAX_MAC_HEADER_TYPE_2_FB_TYPE      0x0F
static int hf_mac_header_type_2_ht = -1;
static int hf_mac_header_type_2_ec = -1;
static int hf_mac_header_type_2_type = -1;
static int hf_mac_header_type_2_cii = -1;
static int hf_mac_header_type_2_fb_type = -1;

/* 2nd to 5th bytes (varies by different fb types) */
static int hf_mac_header_type_2_cid = -1;
static int hf_mac_header_type_2_no_cid = -1;
/* CQI and MIMO Feedback */
/* 2nd & 3rd bytes */
#define WIMAX_MAC_HEADER_TYPE_2_CQI_FB_TYPE  0xE000
#define WIMAX_MAC_HEADER_TYPE_2_CQI_PAYLOAD  0x1F80
#define WIMAX_MAC_HEADER_TYPE_2_CQI_RSV      0x007F
static int hf_mac_header_type_2_cqi_fb_type = -1;
static int hf_mac_header_type_2_cqi_payload = -1;
static int hf_mac_header_type_2_cqi_rsv = -1;
/* 4th & 5th without CID */
//#define WIMAX_MAC_HEADER_TYPE_2_NO_CID       0xFFFF

/* DL average CINR */
/* 2nd byte */
#define WIMAX_MAC_HEADER_TYPE_2_DL_AVE_CINR  0xF800
#define WIMAX_MAC_HEADER_TYPE_2_DL_AVE_RSV   0x07FF
static int hf_mac_header_type_2_dl_ave_cinr = -1;
static int hf_mac_header_type_2_dl_ave_rsv = -1;

/* MIMO Coefficients Feedback */
/* 2nd & 3rd bytes */
#define WIMAX_MAC_HEADER_TYPE_2_MIMO_COEF_NI   0xC000
#define WIMAX_MAC_HEADER_TYPE_2_MIMO_COEF_AI   0x3000
#define WIMAX_MAC_HEADER_TYPE_2_MIMO_COEF      0x0F80
#define WIMAX_MAC_HEADER_TYPE_2_MIMO_COEF_RSV  0x007F
static int hf_mac_header_type_2_mimo_coef_ni = -1;
static int hf_mac_header_type_2_mimo_coef_ai = -1;
static int hf_mac_header_type_2_mimo_coef = -1;
static int hf_mac_header_type_2_mimo_coef_rsv = -1;

/* Preferred DL Channel DIUC Feedback */
/* 2nd byte */
#define WIMAX_MAC_HEADER_TYPE_2_DL_CHAN_DIUC  0xF000
#define WIMAX_MAC_HEADER_TYPE_2_DL_CHAN_DCD   0x0F00
#define WIMAX_MAC_HEADER_TYPE_2_DL_CHAN_RSV   0x00FF
static int hf_mac_header_type_2_dl_chan_diuc = -1;
static int hf_mac_header_type_2_dl_chan_dcd = -1;
static int hf_mac_header_type_2_dl_chan_rsv = -1;

/* UL Transmission Power */
/* 2nd byte */
#define WIMAX_MAC_HEADER_TYPE_2_UL_TX_PWR     0xFF00
#define WIMAX_MAC_HEADER_TYPE_2_UL_TX_PWR_RSV 0x00FF
static int hf_mac_header_type_2_ul_tx_pwr = -1;
static int hf_mac_header_type_2_ul_tx_pwr_rsv = -1;

/* PHY Channel Feedback */
/* 2nd to 4th bytes */
#define WIMAX_MAC_HEADER_TYPE_2_PHY_DIUC      0xF00000
#define WIMAX_MAC_HEADER_TYPE_2_PHY_UL_TX_PWR 0x0FF000
#define WIMAX_MAC_HEADER_TYPE_2_PHY_UL_HDRM   0x000FC0
#define WIMAX_MAC_HEADER_TYPE_2_PHY_RSV       0x00003F
static int hf_mac_header_type_2_phy_diuc = -1;
static int hf_mac_header_type_2_phy_ul_tx_pwr = -1;
static int hf_mac_header_type_2_phy_ul_hdrm = -1;
static int hf_mac_header_type_2_phy_rsv = -1;

/* AMC Band Indication Bitmap */
/* 2nd to 5th bytes */
#define WIMAX_MAC_HEADER_TYPE_2_AMC_BITMAP   0xFFF00000
#define WIMAX_MAC_HEADER_TYPE_2_AMC_CQI_1    0x000F8000
#define WIMAX_MAC_HEADER_TYPE_2_AMC_CQI_2    0x00007C00
#define WIMAX_MAC_HEADER_TYPE_2_AMC_CQI_3    0x000003E0
#define WIMAX_MAC_HEADER_TYPE_2_AMC_CQI_4    0x0000001F
static int hf_mac_header_type_2_amc_bitmap = -1;
static int hf_mac_header_type_2_amc_cqi_1 = -1;
static int hf_mac_header_type_2_amc_cqi_2 = -1;
static int hf_mac_header_type_2_amc_cqi_3 = -1;
static int hf_mac_header_type_2_amc_cqi_4 = -1;

/* Life Span of Short-term Precoding Feedback */
/* 2nd byte */
#define WIMAX_MAC_HEADER_TYPE_2_LIFE_SPAN  0xF000
#define WIMAX_MAC_HEADER_TYPE_2_LIFE_SPAN_RSV 0x0FFF
static int hf_mac_header_type_2_life_span = -1;
static int hf_mac_header_type_2_life_span_rsv = -1;

/* Multiple Types of Feedback */
/* 2nd to 5th bytes ??? */
#define WIMAX_MAC_HEADER_TYPE_2_MT_NUM_FB_TYPES 0xC0000000
#define WIMAX_MAC_HEADER_TYPE_2_MT_OCCU_FB_TYPE 0x3C000000
#define WIMAX_MAC_HEADER_TYPE_2_MT_FB_CONTENTS  0x03FFFFFF
static int hf_mac_header_type_2_mt_num_fb_types = -1;
static int hf_mac_header_type_2_mt_occu_fb_type = -1;
static int hf_mac_header_type_2_mt_fb_contents = -1;

/* Long-term Precoding Feedback */
/* 2nd & 3rd bytes */
#define WIMAX_MAC_HEADER_TYPE_2_LT_ID_FB     0xFC00
#define WIMAX_MAC_HEADER_TYPE_2_LT_RANK      0x0300
#define WIMAX_MAC_HEADER_TYPE_2_LT_FEC_QAM   0x00FC
#define WIMAX_MAC_HEADER_TYPE_2_LT_RSV       0x0003
static int hf_mac_header_type_2_lt_id_fb = -1;
static int hf_mac_header_type_2_lt_rank = -1;
static int hf_mac_header_type_2_lt_fec_qam = -1;
static int hf_mac_header_type_2_lt_rsv = -1;

/* Combined DL Average CINR of Active BSs */
/* 2nd & 3rd bytes */
#define WIMAX_MAC_HEADER_TYPE_2_COMB_DL_AVE  0xF800
#define WIMAX_MAC_HEADER_TYPE_2_COMB_DL_RSV  0x0EFF
static int hf_mac_header_type_2_comb_dl_ave = -1;
static int hf_mac_header_type_2_comb_dl_rsv = -1;

/* MIMO Channel Feedback */
/* 2nd byte */
#define WIMAX_MAC_HEADER_TYPE_2_DIUC         0xF0
#define WIMAX_MAC_HEADER_TYPE_2_PBWI         0x0F
/* 3rd to 5th bytes with CID */
#define WIMAX_MAC_HEADER_TYPE_2_SLPB         0xFE0000
#define WIMAX_MAC_HEADER_TYPE_2_PBRI_CID     0x010000
#define WIMAX_MAC_HEADER_TYPE_2_CID          0x00FFFF
/* 3rd to 5th bytes without CID */
#define WIMAX_MAC_HEADER_TYPE_2_PBRI         0x018000
#define WIMAX_MAC_HEADER_TYPE_2_CTI          0x007000
#define WIMAX_MAC_HEADER_TYPE_2_AI_0         0x000800
#define WIMAX_MAC_HEADER_TYPE_2_AI_1         0x000400
#define WIMAX_MAC_HEADER_TYPE_2_AI_2         0x000200
#define WIMAX_MAC_HEADER_TYPE_2_AI_3         0x000100
#define WIMAX_MAC_HEADER_TYPE_2_MI           0x0000C0
#define WIMAX_MAC_HEADER_TYPE_2_CT           0x000020
#define WIMAX_MAC_HEADER_TYPE_2_CQI          0x00001F
static int hf_mac_header_type_2_mimo_diuc = -1;
static int hf_mac_header_type_2_mimo_pbwi = -1;
static int hf_mac_header_type_2_mimo_slpb = -1;
static int hf_mac_header_type_2_mimo_bpri = -1;
static int hf_mac_header_type_2_mimo_bpri_cid = -1;
static int hf_mac_header_type_2_mimo_cid = -1;
static int hf_mac_header_type_2_mimo_cti = -1;
static int hf_mac_header_type_2_mimo_ai_0 = -1;
static int hf_mac_header_type_2_mimo_ai_1 = -1;
static int hf_mac_header_type_2_mimo_ai_2 = -1;
static int hf_mac_header_type_2_mimo_ai_3 = -1;
static int hf_mac_header_type_2_mimo_mi = -1;
static int hf_mac_header_type_2_mimo_ct = -1;
static int hf_mac_header_type_2_mimo_cqi = -1;

/* CINR Feedback */
/* 2nd byte */
//#define WIMAX_MAC_HEADER_TYPE_2_CINR_MEAN    0xFF
/* 3rd byte */
//#define WIMAX_MAC_HEADER_TYPE_2_CINR_DEVI    0xFF
static int hf_mac_header_type_2_cinr_mean = -1;
static int hf_mac_header_type_2_cinr_devi = -1;

/* Close-loop MIMO Feedback */
/* 2nd & 3rd bytes */
#define WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_TYPE        0xC000
#define WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_ANT_ID      0x3C00
#define WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_CQI         0x03E0
#define WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_RSV         0x008F
#define WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_STREAMS     0x3000
#define WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_ANT_SEL     0x0E00
#define WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_CQI_1       0x01F0
#define WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_RSV_1       0x000F
#define WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_CODEBOOK_ID 0x3F00
#define WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_CQI_2       0x00F8
#define WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_RSV_2       0x000E
static int hf_mac_header_type_2_cl_mimo_type = -1;
static int hf_mac_header_type_2_cl_mimo_ant_id = -1;
static int hf_mac_header_type_2_cl_mimo_cqi = -1;
static int hf_mac_header_type_2_cl_mimo_cqi_1 = -1;
static int hf_mac_header_type_2_cl_mimo_cqi_2 = -1;
static int hf_mac_header_type_2_cl_mimo_rsv = -1;
static int hf_mac_header_type_2_cl_mimo_rsv_1 = -1;
static int hf_mac_header_type_2_cl_mimo_rsv_2 = -1;
static int hf_mac_header_type_2_cl_mimo_streams = -1;
static int hf_mac_header_type_2_cl_mimo_ant_sel = -1;
static int hf_mac_header_type_2_cl_mimo_codebook_id = -1;

/* last byte */
//#define WIMAX_MAC_HEADER_TYPE_2_HCS          0xFF
static int hf_mac_header_type_2_hcs = -1;

/* CID Inclusion Indication messages */
static const value_string cii_msgs[] =
{
	{ 0, "without CID" },
	{ 1, "with CID" },
	{ 0,  NULL}
};

/* Feedback Types */
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" },
	{ 8, "Multiple Types of Feedback" },
	{ 9, "Long-term Precoding Feedback" },
	{ 10, "Combined DL Average CINR of Active BSs" },
	{ 11, "MIMO Channel Feedback" },
	{ 12, "CINR Feedback" },
	{ 13, "Close-loop MIMO Feedback" },
	{ 14, "Reserved" },
	{ 15, "Reserved" },
	{ 0,  NULL}
};

/* Table of the Preferred Bandwidth Ratio of bandwidth over used channel bandwidth */
static const value_string pbwi_table[] =
{
	{ 0, "1" },
	{ 1, "3/4" },
	{ 2, "2/3" },
	{ 3, "1/2" },
	{ 4, "1/3" },
	{ 5, "1/4" },
	{ 6, "1/5" },
	{ 7, "1/6" },
	{ 8, "1/8" },
	{ 9, "1/10" },
	{ 10, "1/12" },
	{ 11, "1/16" },
	{ 12, "1/24" },
	{ 13, "1/32" },
	{ 14, "1/48" },
	{ 15, "1/64" },
	{ 0,  NULL}
};

/* Burst Profile Ranking Indicator table */
static const value_string bpri_table[] =
{
	{ 0, "1st preferred burst profile" },
	{ 1, "2nd preferred burst profile" },
	{ 2, "3rd preferred burst profile" },
	{ 3, "4th preferred burst profile" },
	{ 0,  NULL}
};

/* Coherent Time Index Table */
static const value_string cti_table[] =
{
	{ 0, "Infinite" },
	{ 1, "1 frame" },
	{ 2, "2 frames" },
	{ 3, "3 frames" },
	{ 4, "4 frames" },
	{ 5, "8 frames" },
	{ 6, "14 frames" },
	{ 7, "24 frames" },
	{ 0,  NULL}
};

/* The MS Matrix Index Table */
static const value_string mi_table[] =
{
	{ 0, "No STC" },
	{ 1, "Matrix A" },
	{ 2, "Matrix B" },
	{ 3, "Matrix C" },
	{ 0,  NULL}
};

/* CQI Feedback Types */
static const value_string ct_msgs[] =
{
	{ 0, "DL average feedback" },
	{ 1, "CQI feedback" },
	{ 0,  NULL}
};

/* Antenna Indication messages */
static const value_string ai_msgs[] =
{
	{ 0, "Not applicable" },
	{ 1, "Applicable" },
	{ 0,  NULL}
};

/* MAC HEADER TYPE II display */
static hf_register_info hf[] =
{
	{
		&hf_mac_header_type_2_value_bytes,
		{
			"Values", "wimax.type2ValueBytes",
			FT_BYTES, BASE_HEX, NULL, 0x0,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_2_ht,
		{
			"MAC Header Type", "wimax.type2Ht",
			FT_UINT8, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_HT,
			"", HFILL
		}
	},
	{
		&hf_mac_header_type_2_ec,
		{
			"MAC Encryption Control", "wimax.type2Ec",
			FT_UINT8, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_EC,
			"", HFILL
		}
	},

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -