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

📄 plugins-wimax-mac_hd_type1_decoder.c

📁 Intel的WIMAX代码,主要是mac层code
💻 C
📖 第 1 页 / 共 2 页
字号:
plugins/wimax/mac_hd_type1_decoder.c - Google Code Search这是 Google 取自 
      http://anonsvn.wireshark.org/wireshark/trunk 的 
      plugins/wimax/mac_hd_type1_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_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 <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_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
		}

⌨️ 快捷键说明

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