From 8589c2f11bb81dddd09d8bd2adcfb5e8a5b33dff Mon Sep 17 00:00:00 2001 From: Bill Meier Date: Tue, 4 Aug 2009 19:01:34 +0000 Subject: Minor changes: - Move proto_register...() to the end of the file as per convention; - Move ett[] to be local to proto_register...(); - "if (...==-1)" not req'd in proto_register...(); - #include not req'd; - Remove unneeded forward declarations. svn path=/trunk/; revision=29296 --- plugins/wimax/mac_hd_generic_decoder.c | 2651 +++++++++--------- plugins/wimax/mac_hd_type1_decoder.c | 276 +- plugins/wimax/mac_hd_type2_decoder.c | 1320 +++++---- plugins/wimax/mac_mgmt_msg_decoder.c | 164 +- plugins/wimax/msg_aas_beam.c | 253 +- plugins/wimax/msg_aas_fbck.c | 255 +- plugins/wimax/msg_clk_cmp.c | 123 +- plugins/wimax/msg_dcd.c | 1524 ++++++----- plugins/wimax/msg_dlmap.c | 849 +++--- plugins/wimax/msg_dsa.c | 149 +- plugins/wimax/msg_dsc.c | 140 +- plugins/wimax/msg_dsd.c | 148 +- plugins/wimax/msg_dsx_rvd.c | 77 +- plugins/wimax/msg_fpc.c | 139 +- plugins/wimax/msg_pkm.c | 91 +- plugins/wimax/msg_prc_lt_ctrl.c | 111 +- plugins/wimax/msg_reg_req.c | 348 ++- plugins/wimax/msg_reg_rsp.c | 189 +- plugins/wimax/msg_rep.c | 1907 +++++++------ plugins/wimax/msg_res_cmd.c | 80 +- plugins/wimax/msg_rng_req.c | 321 ++- plugins/wimax/msg_rng_rsp.c | 1019 ++++--- plugins/wimax/msg_sbc.c | 3469 ++++++++++++------------ plugins/wimax/msg_ucd.c | 1320 +++++---- plugins/wimax/msg_ulmap.c | 754 +++-- plugins/wimax/packet-wmx.c | 8 +- plugins/wimax/wimax_cdma_code_decoder.c | 82 +- plugins/wimax/wimax_compact_dlmap_ie_decoder.c | 1889 ++++++------- plugins/wimax/wimax_compact_ulmap_ie_decoder.c | 3319 ++++++++++++----------- plugins/wimax/wimax_fch_decoder.c | 98 +- plugins/wimax/wimax_ffb_decoder.c | 98 +- plugins/wimax/wimax_hack_decoder.c | 94 +- plugins/wimax/wimax_harq_map_decoder.c | 90 +- plugins/wimax/wimax_pdu_decoder.c | 72 +- plugins/wimax/wimax_phy_attributes_decoder.c | 113 +- 35 files changed, 11667 insertions(+), 11873 deletions(-) (limited to 'plugins/wimax') diff --git a/plugins/wimax/mac_hd_generic_decoder.c b/plugins/wimax/mac_hd_generic_decoder.c index d2d512d3bb..e8dfb1f142 100644 --- a/plugins/wimax/mac_hd_generic_decoder.c +++ b/plugins/wimax/mac_hd_generic_decoder.c @@ -41,8 +41,6 @@ #define DEBUG */ -#include "moduleinfo.h" - #include #include #include @@ -56,14 +54,14 @@ extern gint seen_a_service_type; extern gboolean first_gmh; /* defined in wimax_pdu_decoder.c */ guint get_service_type( void ); /* defined in wimax_utils.c */ -extern gint8 arq_enabled; /* declared in packet-wmx.c */ -extern gint scheduling_service_type; /* declared in packet-wmx.c */ -extern gint mac_sdu_length; /* declared in packet-wmx.c */ +extern gint8 arq_enabled; /* declared in packet-wmx.c */ +extern gint scheduling_service_type; /* declared in packet-wmx.c */ +extern gint mac_sdu_length; /* declared in packet-wmx.c */ extern address bs_address; /* declared in packet-wmx.c */ extern guint max_logical_bands; /* declared in wimax_compact_dlmap_ie_decoder.c */ extern gboolean is_down_link(address *src_address);/* declared in packet-wmx.c */ -extern void proto_register_mac_mgmt_msg(void); /* defined in macmgmtmsgdecoder.c */ +extern void proto_register_mac_mgmt_msg(void); /* defined in macmgmtmsgdecoder.c */ extern void init_wimax_globals(void); /* defined in msg_ulmap.c */ extern void dissect_mac_mgmt_msg_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); @@ -87,7 +85,6 @@ guint cid_broadcast = 0xFFFF; #define MAX_CID 64 /* forward reference */ -void dissect_mac_header_generic_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); static gint extended_subheader_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); static gint arq_feedback_payload_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *parent_item); @@ -96,7 +93,7 @@ static GHashTable *payload_frag_table = NULL; gint proto_mac_header_generic_decoder = -1; static gint ett_mac_header_generic_decoder = -1; -static gint ett_mac_subheader_decoder = -1; +/* static gint ett_mac_subheader_decoder = -1; */ static gint ett_mac_mesh_subheader_decoder = -1; static gint ett_mac_frag_subheader_decoder = -1; static gint ett_mac_grant_mgmt_subheader_decoder = -1; @@ -121,23 +118,6 @@ static guint8 *frag_num_array = NULL; static address save_src; static address save_dst; -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_mac_header_generic_decoder, - &ett_mac_subheader_decoder, - &ett_mac_mesh_subheader_decoder, - &ett_mac_frag_subheader_decoder, - &ett_mac_grant_mgmt_subheader_decoder, - &ett_mac_pkt_subheader_decoder, - &ett_mac_fast_fb_subheader_decoder, - &ett_mac_ext_subheader_decoder, - &ett_mac_ext_subheader_dl_decoder, - &ett_mac_ext_subheader_ul_decoder, - &ett_mac_arq_fb_payload_decoder, - &ett_mac_data_pdu_decoder, -}; - #define WIMAX_MAC_HEADER_SIZE 6 #define IP_HEADER_BYTE 0x45 @@ -721,1577 +701,1594 @@ static guint decode_packing_subheader(tvbuff_t *payload_tvb, packet_info *pinfo, return payload_offset - starting_offset; } -/* Register Wimax Generic Mac Header Protocol and Dissector */ -void proto_register_mac_header_generic(void) + +void dissect_mac_header_generic_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - /* Generic MAC header display */ - static hf_register_info hf[] = - { - { - &hf_mac_header_generic_value_bytes, - { - "Values", "wmx.genericValueBytes", - FT_BYTES, BASE_NONE, NULL, 0x0, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_ht, - { - "MAC Header Type", "wmx.genericHt", - FT_UINT24, BASE_HEX, VALS(ht_msgs), WIMAX_MAC_HEADER_GENERIC_HT, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_ec, - { - "MAC Encryption Control", "wmx.genericEc", - FT_UINT24, BASE_HEX, VALS(ec_msgs), WIMAX_MAC_HEADER_GENERIC_EC, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_type_0, - { - "MAC Sub-type Bit 0", "wmx.genericType0", - FT_UINT24, BASE_HEX, VALS(type_msg0), WIMAX_MAC_HEADER_GENERIC_TYPE_0, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_type_1, - { - "MAC Sub-type Bit 1", "wmx.genericType1", - FT_UINT24, BASE_HEX, VALS(type_msg1), WIMAX_MAC_HEADER_GENERIC_TYPE_1, - NULL, HFILL - } - }, + guint offset = 0; + guint payload_offset; + guint payload_length = 0; + + static guint8 frag_number[MAX_CID]; + static guint cid_list[MAX_CID]; + static guint cid_base; + static char *reassem_str = "Reassembled Data transport PDU (%u bytes)"; + static char *data_str = "Data transport PDU (%u bytes)"; + char *str_ptr; + gint length, i, cid_index; + guint tvb_len, ret_length, ubyte, new_tvb_len; + guint new_payload_len = 0; + guint mac_ht, mac_ec, mac_esf, mac_ci, mac_eks, mac_len, mac_cid, cid; + guint ffb_grant_mgmt_subheader, packing_subheader, fragment_subheader; + guint mesh_subheader; + guint packing_length; + guint32 mac_crc, calculated_crc; + proto_item *parent_item = NULL; + proto_item *generic_item = NULL; + proto_tree *generic_tree = NULL; + proto_item *child_item = NULL; + proto_tree *child_tree = NULL; + tvbuff_t *payload_tvb; + tvbuff_t *data_pdu_tvb; + fragment_data *payload_frag; + gboolean first_arq_fb_payload = TRUE; + + dissector_handle_t mac_payload_handle; + + proto_mac_header_generic_decoder = proto_wimax; + if (tree) + { /* we are being asked for details */ +#ifdef DEBUG + /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) { - &hf_mac_header_generic_type_2, - { - "MAC Sub-type Bit 2", "wmx.genericType2", - FT_UINT24, BASE_HEX, VALS(type_msg2), WIMAX_MAC_HEADER_GENERIC_TYPE_2, - NULL, HFILL - } - }, + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "GMH"); + } +#endif + /* Get the frame length */ + tvb_len = tvb_reported_length(tvb); + if (tvb_len < WIMAX_MAC_HEADER_SIZE) + { /* display the error message */ + generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, tvb_len, "Error: the size of Generic MAC Header tvb is too small! (%u bytes)", tvb_len); + /* add subtree */ + generic_tree = proto_item_add_subtree(generic_item, ett_mac_header_generic_decoder); + /* display the Generic MAC Header in Hex */ + proto_tree_add_item(generic_tree, hf_mac_header_generic_value_bytes, tvb, offset, tvb_len, FALSE); + return; + } + /* get the parent */ + parent_item = proto_tree_get_parent(tree); + /* add the MAC header info */ + proto_item_append_text(parent_item, " - Generic MAC Header"); + /* display MAC header message */ + generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, WIMAX_MAC_HEADER_SIZE, "Generic MAC Header (%u bytes)", WIMAX_MAC_HEADER_SIZE); + /* add MAC header subtree */ + generic_tree = proto_item_add_subtree(generic_item, ett_mac_header_generic_decoder); + /* Decode and display the MAC header */ + /* Get the first byte */ + ubyte = tvb_get_guint8(tvb, offset); + /* get the Header Type (HT) */ + mac_ht = ((ubyte & WIMAX_MAC_HEADER_GENERIC_HT_MASK)?1:0); + /* get the Encryption Control (EC) */ + mac_ec = ((ubyte & WIMAX_MAC_HEADER_GENERIC_EC_MASK)?1:0); + /* get the sub types */ + ffb_grant_mgmt_subheader = ((ubyte & GENERIC_SUB_TYPE_0)?1:0); + packing_subheader = ((ubyte & GENERIC_SUB_TYPE_1)?1:0); + fragment_subheader = ((ubyte & GENERIC_SUB_TYPE_2)?1:0); + extended_type = ((ubyte & GENERIC_SUB_TYPE_3)?1:0); + arq_fb_payload = ((ubyte & GENERIC_SUB_TYPE_4)?1:0); + mesh_subheader = ((ubyte & GENERIC_SUB_TYPE_5)?1:0); + /* Get the 2nd byte */ + ubyte = tvb_get_guint8(tvb, (offset+1)); + /* get the Extended subheader field (ESF) */ + mac_esf = ((ubyte & WIMAX_MAC_HEADER_GENERIC_ESF_MASK)?1:0); + /* get the CRC indicator (CI) */ + mac_ci = ((ubyte & WIMAX_MAC_HEADER_GENERIC_CI_MASK)?1:0); + /* get the Encryption key sequence (EKS) */ + mac_eks = ((ubyte & WIMAX_MAC_HEADER_GENERIC_EKS_MASK)>>4); + /* get the MAC length */ + mac_len = (tvb_get_ntohs(tvb, (offset+1)) & WIMAX_MAC_HEADER_GENERIC_LEN); + /* get the CID */ + mac_cid = tvb_get_ntohs(tvb, (offset+3)); + /* display the Header Type (HT) */ + proto_tree_add_item(generic_tree, hf_mac_header_generic_ht, tvb, offset, 3, FALSE); + /* display the Encryption Control (EC) */ + proto_tree_add_item(generic_tree, hf_mac_header_generic_ec, tvb, offset, 3, FALSE); + /* display the sub-types (Type) */ + proto_tree_add_item(generic_tree, hf_mac_header_generic_type_5, tvb, offset, 3, FALSE); + proto_tree_add_item(generic_tree, hf_mac_header_generic_type_4, tvb, offset, 3, FALSE); + proto_tree_add_item(generic_tree, hf_mac_header_generic_type_3, tvb, offset, 3, FALSE); + proto_tree_add_item(generic_tree, hf_mac_header_generic_type_2, tvb, offset, 3, FALSE); + proto_tree_add_item(generic_tree, hf_mac_header_generic_type_1, tvb, offset, 3, FALSE); + proto_tree_add_item(generic_tree, hf_mac_header_generic_type_0, tvb, offset, 3, FALSE); + /* display the Extended sub-header Field (ESF) */ + proto_tree_add_item(generic_tree, hf_mac_header_generic_esf, tvb, offset, 3, FALSE); + /* display the CRC Indicator (CI) */ + proto_tree_add_item(generic_tree, hf_mac_header_generic_ci, tvb, offset, 3, FALSE); + /* display the Encryption Key Sequence (EKS) */ + proto_tree_add_item(generic_tree, hf_mac_header_generic_eks, tvb, offset, 3, FALSE); + /* display the reserved field */ + proto_tree_add_item(generic_tree, hf_mac_header_generic_rsv, tvb, offset, 3, FALSE); + /* display the length */ + proto_tree_add_item(generic_tree, hf_mac_header_generic_len, tvb, offset, 3, FALSE); + /* Decode and display the CID */ + proto_tree_add_item(generic_tree, hf_mac_header_generic_cid, tvb, (offset+3), 2, FALSE); + /* Decode and display the HCS */ + proto_tree_add_item(generic_tree, hf_mac_header_generic_hcs, tvb, (offset+5), 1, FALSE); + /* get the frame length without MAC header */ + length = mac_len - WIMAX_MAC_HEADER_SIZE; +#ifdef DEBUG + proto_item_append_text(parent_item, "tvb length=%u, mac length=%u, frame length=%u,", tvb_len, mac_len, length); +#endif + /* set the offset for the frame */ + offset += WIMAX_MAC_HEADER_SIZE; + /* the processing of the subheaders is order sensitive */ + /* do not change the order */ + + if (mac_ec) { - &hf_mac_header_generic_type_3, + if (mac_ci) { - "MAC Sub-type Bit 3", "wmx.genericType3", - FT_UINT24, BASE_HEX, VALS(type_msg3), WIMAX_MAC_HEADER_GENERIC_TYPE_3, - NULL, HFILL + if (length >= (gint)sizeof(mac_crc)) + { + length -= sizeof(mac_crc); + } } - }, - { - &hf_mac_header_generic_type_4, + generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "Encrypted PDU (%u bytes)", length); + /* add payload subtree */ + generic_tree = proto_item_add_subtree(generic_item, ett_mac_data_pdu_decoder); + proto_tree_add_item(generic_tree, hf_mac_header_generic_value_bytes, tvb, offset, length, FALSE); + goto check_crc; + } + + /* if Extended subheader is present */ + if (mac_esf) + { /* add the Extended subheader info */ + proto_item_append_text(parent_item, ", Extended Subheader(s)"); + ret_length = extended_subheader_decoder(tvb_new_subset(tvb, offset, length, length), pinfo, tree); + /* update the length and offset */ + length -= ret_length; + offset += ret_length; + } + /* if Mesh subheader is present */ + if (mesh_subheader) + { /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) { - "MAC Sub-type Bit 4", "wmx.genericType4", - FT_UINT24, BASE_HEX, VALS(type_msg4), WIMAX_MAC_HEADER_GENERIC_TYPE_4, - NULL, HFILL + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Mesh subhdr"); } - }, - { - &hf_mac_header_generic_type_5, - { - "MAC Sub-type Bit 5", "wmx.genericType5", - FT_UINT24, BASE_HEX, VALS(type_msg5), WIMAX_MAC_HEADER_GENERIC_TYPE_5, - NULL, HFILL + /* add the Mesh subheader info */ + proto_item_append_text(parent_item, ", Mesh Subheader"); + /* display Mesh subheader type */ + generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "Mesh subheader (2 bytes)"); + /* add Mesh subheader subtree */ + generic_tree = proto_item_add_subtree(generic_item, ett_mac_mesh_subheader_decoder); + /* decode and display the Mesh subheader */ + proto_tree_add_item(generic_tree, hf_mac_header_generic_mesh_subheader, tvb, offset, 2, FALSE); + /* update the length and offset */ + length -= 2; + offset += 2; + } + /* if Fast-feedback allocation (DL) subheader or Grant management (UL) subheader is present */ + if (ffb_grant_mgmt_subheader) + { /* check if it is downlink packet */ + if (is_down_link(&(pinfo->src))) + { /* Fast-feedback allocation (DL) subheader is present */ + /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Fast-fb subhdr"); + } + /* add the Fast-feedback subheader info */ + proto_item_append_text(parent_item, ", Fast-feedback Subheader"); + /* display Fast-feedback allocation subheader type */ + generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "Fast-feedback allocation (DL) subheader (%u bytes)", length); + /* add Fast-feedback allocation subheader subtree */ + generic_tree = proto_item_add_subtree(generic_item, ett_mac_fast_fb_subheader_decoder); + proto_tree_add_item(generic_tree, hf_mac_header_generic_fast_fb_subhd_alloc_offset, tvb, offset, 1, FALSE); + proto_tree_add_item(generic_tree, hf_mac_header_generic_fast_fb_subhd_fb_type, tvb, offset, 1, FALSE); + /* update the length and offset */ + length -= 1; + offset += 1; } - }, - { - &hf_mac_header_generic_esf, - { - "Extended Sub-header Field", "wmx.genericEsf", - FT_UINT24, BASE_HEX, VALS(esf_msgs), WIMAX_MAC_HEADER_GENERIC_ESF, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_ci, - { - "CRC Indicator", "wmx.genericCi", - FT_UINT24, BASE_HEX, VALS(ci_msgs), WIMAX_MAC_HEADER_GENERIC_CI, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_eks, - { - "Encryption Key Sequence", "wmx.genericEks", - FT_UINT24, BASE_HEX, NULL, WIMAX_MAC_HEADER_GENERIC_EKS, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_rsv, - { - "Reserved", "wmx.genericRsv", - FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_GENERIC_RSV, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_len, - { - "Length", "wmx.genericLen", - FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_GENERIC_LEN, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_cid, - { - "Connection ID", "wmx.genericCid", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_hcs, - { - "Header Check Sequence", "wmx.genericHcs", - FT_UINT8, BASE_HEX, NULL, 0x0, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_crc, - { - "CRC", "wmx.genericCrc", - FT_UINT32, BASE_HEX, NULL, 0x0, - NULL, HFILL - } - } - }; + else /* Grant management (UL) subheader is present */ + { /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Grant mgmt subhdr"); + } + /* add the Grant management subheader info */ + proto_item_append_text(parent_item, ", Grant Management Subheader"); + /* display Grant management subheader type */ + generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, 2, "Grant management (UL) subheader (2 bytes)"); + /* add Grant management subheader subtree */ + generic_tree = proto_item_add_subtree(generic_item, ett_mac_grant_mgmt_subheader_decoder); + scheduling_service_type = get_service_type(); + switch (scheduling_service_type) + { + case SCHEDULE_SERVICE_TYPE_UGS: + proto_item_append_text(generic_item, ": It looks like UGS is the correct Scheduling Service Type"); + break; + case SCHEDULE_SERVICE_TYPE_EXT_RTPS: + proto_item_append_text(generic_item, ": It looks like Extended rtPS is the correct Scheduling Service Type"); + break; + case -1: + proto_item_append_text(generic_item, ": Cannot determine the correct Scheduling Service Type"); + break; + default: + proto_item_append_text(generic_item, ": It looks like Piggyback Request is the correct Scheduling Service Type"); + break; + } + /* Create tree for Scheduling Service Type (UGS) */ + child_item = proto_tree_add_item(generic_tree, hf_mac_header_generic_grant_mgmt_ugs_tree, tvb, offset, 2, FALSE); + child_tree = proto_item_add_subtree(child_item, ett_mac_grant_mgmt_subheader_decoder); + proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_ugs_si, tvb, offset, 2, FALSE); + proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_ugs_pm, tvb, offset, 2, FALSE); + proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_ugs_fli, tvb, offset, 2, FALSE); + proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_ugs_fl, tvb, offset, 2, FALSE); + proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_ugs_rsv, tvb, offset, 2, FALSE); - /* Extended Subheader display */ - static hf_register_info hf_ext[] = - { - { - &hf_mac_header_generic_ext_subheader_rsv, - { - "Reserved", "wmx.genericExtSubhd.Rsv", - FT_UINT8, BASE_DEC, NULL, EXTENDED_SUB_HEADER_RSV_MASK, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_ext_subheader_type_dl, - { - "DL Extended Subheader Type", "wmx.genericExtSubhd.Dl", - FT_UINT8, BASE_DEC, VALS(dl_ext_sub_header_type), EXTENDED_SUB_HEADER_TYPE_MASK, - NULL, HFILL + /* Create tree for Scheduling Service Type (Extended RTPS) */ + child_item = proto_tree_add_item(generic_tree, hf_mac_header_generic_grant_mgmt_ext_rtps_tree, tvb, offset, 2, FALSE); + child_tree = proto_item_add_subtree(child_item, ett_mac_grant_mgmt_subheader_decoder); + proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_ext_pbr, tvb, offset, 2, FALSE); + proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_ext_fli, tvb, offset, 2, FALSE); + proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_ext_fl, tvb, offset, 2, FALSE); + + /* Create tree for Scheduling Service Type (Piggyback Request) */ + child_item = proto_tree_add_item(generic_tree, hf_mac_header_generic_grant_mgmt_ext_pbr_tree, tvb, offset, 2, FALSE); + child_tree = proto_item_add_subtree(child_item, ett_mac_grant_mgmt_subheader_decoder); + proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_pbr, tvb, offset, 2, FALSE); + + /* update the length and offset */ + length -= 2; + offset += 2; } - }, - { - &hf_mac_header_generic_ext_subheader_type_ul, + } + /* if Fragmentation subheader is present */ + if (fragment_subheader) + { /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) { - "UL Extended Subheader Type", "wmx.genericExtSubhd.Ul", - FT_UINT8, BASE_DEC, VALS(ul_ext_sub_header_type), EXTENDED_SUB_HEADER_TYPE_MASK, - NULL, HFILL + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Frag subhdr"); } - }, - { - &hf_mac_header_generic_ext_subheader_sdu_sn, - { - "SDU Sequence Number", "wmx.genericExtSubhd.SduSn", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL + /* add the Fragmentation subheader info */ + proto_item_append_text(parent_item, ", Frag Subheader"); + /* display Fragmentation subheader type */ + generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, ((arq_enabled|extended_type)?2:1), "Fragmentation subheader (%u bytes)", ((arq_enabled|extended_type)?2:1)); + /* add Fragmentation subheader subtree */ + generic_tree = proto_item_add_subtree(generic_item, ett_mac_frag_subheader_decoder); + /* Get the fragment type */ + frag_type = (tvb_get_guint8(tvb, offset) & FRAGMENT_TYPE_MASK) >> 6; + if (arq_fb_payload) + { /* get the sequence number */ + seq_number = (tvb_get_ntohs(tvb, offset) & SEQ_NUMBER_MASK_11) >> 3; + /* decode and display the header */ + proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_fc_ext, tvb, offset, 2, FALSE); + proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_bsn, tvb, offset, 2, FALSE); + proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_rsv_ext, tvb, offset, 2, FALSE); + /* update the length and offset */ + length -= 2; + offset += 2; } - }, - { - &hf_mac_header_generic_ext_subheader_dl_sleep_control_pscid, + else { - "Power Saving Class ID", "wmx.genericExtSubhd.DlSleepCtrlPSCID", - FT_UINT24, BASE_DEC, NULL, DL_SLEEP_CONTROL_POWER_SAVING_CLASS_ID_MASK, - NULL, HFILL + if (extended_type) + { /* get the sequence number */ + seq_number = (tvb_get_ntohs(tvb, offset) & SEQ_NUMBER_MASK_11) >> 3; + /* decode and display the header */ + proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_fc_ext, tvb, offset, 2, FALSE); + proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_fsn_ext, tvb, offset, 2, FALSE); + proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_rsv_ext, tvb, offset, 2, FALSE); + /* update the length and offset */ + length -= 2; + offset += 2; + } + else + { /* get the sequence number */ + seq_number = (tvb_get_guint8(tvb, offset) & SEQ_NUMBER_MASK) >> 3; + /* decode and display the header */ + proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_fc, tvb, offset, 1, FALSE); + proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_fsn, tvb, offset, 1, FALSE); + proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_rsv, tvb, offset, 1, FALSE); + /* update the length and offset */ + length -= 1; + offset += 1; + } } - }, + frag_len = length; + } + else /* ??? default fragment type: no fragment */ { - &hf_mac_header_generic_ext_subheader_dl_sleep_control_op, - { - "Operation", "wmx.genericExtSubhd.DlSleepCtrlOP", - FT_UINT24, BASE_HEX, VALS(dl_sleep_control_ops), DL_SLEEP_CONTROL_OPERATION_MASK, - NULL, HFILL - } - }, + frag_type = NO_FRAG; + } + /* Decode the MAC payload if there is any */ + if (mac_ci) { - &hf_mac_header_generic_ext_subheader_dl_sleep_control_fswe, - { - "Final Sleep Window Exponent", "wmx.genericExtSubhd.DlSleepCtrlFSWE", - FT_UINT24, BASE_DEC, NULL, DL_SLEEP_CONTROL_FINAL_SLEEP_WINDOW_EXPONENT_MASK, - NULL, HFILL + if (length < (gint)sizeof(mac_crc)) + { /* display error message */ + proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "Error - the frame is too short (%u bytes)", length); + return; } - }, + length -= sizeof(mac_crc); + } + while (length > 0) { - &hf_mac_header_generic_ext_subheader_dl_sleep_control_fswb, + frag_len = length; /* Can be changed by Packing subhdr */ + if (packing_subheader) { - "Final Sleep Window Base", "wmx.genericExtSubhd.DlSleepCtrlFSWB", - FT_UINT24, BASE_DEC, NULL, DL_SLEEP_CONTROL_FINAL_SLEEP_WINDOW_BASE_MASK, - NULL, HFILL + packing_length = decode_packing_subheader(tvb, pinfo, tree, length, offset, parent_item); + length -= packing_length; + offset += packing_length; + generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, frag_len, "Data transport PDU (%u bytes)", frag_len); + /* add payload subtree */ + generic_tree = proto_item_add_subtree(generic_item, ett_mac_data_pdu_decoder); + proto_tree_add_item(generic_tree, hf_mac_header_generic_value_bytes, tvb, offset, frag_len, FALSE); } - }, - { - &hf_mac_header_generic_ext_subheader_dl_sleep_control_rsv, - { - "Reserved", "wmx.genericExtSubhd.DlSleepCtrlRsv", - FT_UINT24, BASE_DEC, NULL, DL_SLEEP_CONTROL_RESERVED_MASK, - NULL, HFILL + /* defragment first if it is fragmented */ + if (frag_type == NO_FRAG) + { /* not fragmented payload */ + payload_tvb = tvb_new_subset(tvb, offset, frag_len, frag_len); + payload_length = frag_len; + new_payload_len = frag_len; } - }, - { - &hf_mac_header_generic_ext_subheader_fb_req_uiuc, - { - "UIUC", "wmx.genericExtSubhd.FbReqUIUC", - FT_UINT24, BASE_HEX, VALS(uiuc_values), FEEDBACK_REQUEST_UIUC_MASK, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_ext_subheader_fb_req_fb_type, - { - "Feedback Type", "wmx.genericExtSubhd.FbReqFbType", - FT_UINT24, BASE_HEX, VALS(fb_types), FEEDBACK_REQUEST_FEEDBACK_TYPE_MASK, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_ext_subheader_fb_req_ofdma_symbol_offset, - { - "OFDMA Symbol Offset", "wmx.genericExtSubhd.FbReqOfdmaSymbolOffset", - FT_UINT24, BASE_HEX, NULL, FEEDBACK_REQUEST_OFDMA_SYMBOL_OFFSET_MASK, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_ext_subheader_fb_req_subchannel_offset, - { - "Subchannel Offset", "wmx.genericExtSubhd.FbReqSubchannelOffset", - FT_UINT24, BASE_HEX, NULL, FEEDBACK_REQUEST_SUBCHANNEL_OFFSET_MASK, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_ext_subheader_fb_req_slots, - { - "Number of Slots", "wmx.genericExtSubhd.FbReqSlots", - FT_UINT24, BASE_HEX, NULL, FEEDBACK_REQUEST_NUMBER_OF_SLOTS_MASK, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_ext_subheader_fb_req_frame_offset, - { - "Frame Offset", "wmx.genericExtSubhd.FbReqFrameOffset", - FT_UINT24, BASE_HEX, NULL, FEEDBACK_REQUEST_FRAME_OFFSET_MASK, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_ext_subheader_sn_req_rep_ind_1, - { - "First SN Report Indication", "wmx.genericExtSubhd.SnReqRepInd1", - FT_UINT8, BASE_DEC, VALS(sn_rep_msg), SN_REQUEST_SUBHEADER_SN_REPORT_INDICATION_1_MASK, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_ext_subheader_sn_req_rep_ind_2, - { - "Second SN Report Indication", "wmx.genericExtSubhd.SnReqRepInd2", - FT_UINT8, BASE_DEC, VALS(sn_rep_msg), SN_REQUEST_SUBHEADER_SN_REPORT_INDICATION_2_MASK, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_ext_subheader_sn_req_rsv, - { - "Reserved", "wmx.genericExtSubhd.SnReqRsv", - FT_UINT8, BASE_DEC, NULL, SN_REQUEST_SUBHEADER_RESERVED_MASK, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_ext_subheader_mimo_mode_fb_type, - { - "Feedback Type", "wmx.genericExtSubhd.MimoFbType", - FT_UINT8, BASE_DEC, VALS(mimo_fb_types), MIMO_FEEDBACK_TYPE_MASK, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_ext_subheader_mimo_fb_content, - { - "Feedback Content", "wmx.genericExtSubhd.MimoFbContent", - FT_UINT8, BASE_DEC, NULL, MIMO_FEEDBACK_CONTENT_MASK, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_ext_subheader_ul_tx_pwr_rep, - { - "UL TX Power", "wmx.genericExtSubhd.UlTxPwr", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL + else /* fragmented payload */ + { /* add the frag */ + /* Make sure cid will not match a previous packet with different data */ + for (i = 0; i < MAX_CID; i++) + { + if (cid_list[i] == mac_cid) + { + cid_base = i * (0xFFFFFFFF / MAX_CID); + break; + } + if (cid_list[i] == 0) + { + cid_list[i] = mac_cid; + cid_base = i * (0xFFFFFFFF / MAX_CID); + break; + } + } + cid_index = i; + while (pinfo->fd->num > cid_adj_array_size) + { + cid_adj_array_size += 1024; + cid_adj_array = g_realloc(cid_adj_array, sizeof(guint) * cid_adj_array_size); + frag_num_array = g_realloc(frag_num_array, sizeof(guint8) * cid_adj_array_size); + /* Clear the added memory */ + memset(&cid_adj_array[cid_adj_array_size - 1024], 0, sizeof(guint) * 1024); + } + if (first_gmh) + { + /* New cid_adjust for each packet with fragment(s) */ + cid_adjust[cid_index] += cid_vernier[cid_index]; + /* cid_vernier must always be 0 at start of packet. */ + cid_vernier[cid_index] = 0; + } + /* Create artificial sequence numbers. */ + frag_number[cid_index]++; + if (frag_type == FIRST_FRAG) + { + frag_number[cid_index] = 0; + } + if (cid_adj_array[pinfo->fd->num]) + { + /* We apparently just clicked on the packet again. */ + cid_adjust[cid_index] = cid_adj_array[pinfo->fd->num]; + /* Set the frag_number at start of packet. */ + if (first_gmh) + { + frag_number[cid_index] = frag_num_array[pinfo->fd->num]; + } + } else { + /* Save for next time we click on this packet. */ + cid_adj_array[pinfo->fd->num] = cid_adjust[cid_index]; + if (first_gmh) + { + frag_num_array[pinfo->fd->num] = frag_number[cid_index]; + } + } + /* Reset in case we stay in this while() loop to finish the packet. */ + first_gmh = FALSE; + cid = cid_base + cid_adjust[cid_index] + cid_vernier[cid_index]; + /* Save address pointers. */ + save_src = pinfo->src; + save_dst = pinfo->dst; + /* Use dl_src and dl_dst in defrag. */ + pinfo->src = pinfo->dl_src; + pinfo->dst = pinfo->dl_dst; + payload_frag = fragment_add_seq(tvb, offset, pinfo, cid, payload_frag_table, frag_number[cid_index], frag_len, ((frag_type==LAST_FRAG)?0:1)); + /* Restore address pointers. */ + pinfo->src = save_src; + pinfo->dst = save_dst; + if (frag_type == LAST_FRAG) + { + /* Make sure fragment_add_seq() sees next one as a new frame. */ + cid_vernier[cid_index]++; + } + /* Don't show reassem packet until last frag. */ + proto_tree_add_text(tree, tvb, offset, frag_len, "Payload Fragment (%d bytes)", frag_len); + + if (payload_frag && frag_type == LAST_FRAG) + { /* defragmented completely */ + payload_length = payload_frag->len; + /* create the new tvb for defragmented frame */ + payload_tvb = tvb_new_child_real_data(tvb, payload_frag->data, payload_length, payload_length); + /* add the defragmented data to the data source list */ + add_new_data_source(pinfo, payload_tvb, "Reassembled WiMax MAC payload"); + /* save the tvb langth */ + new_payload_len = payload_length; + } + else /* error or defragment is not complete */ + { + payload_tvb = NULL; +#ifdef DEBUG /* for debug only */ +/* if (frag_type == LAST_FRAG)*/ + { /* error */ + /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Dropped the incomplete frame"); + } +#endif +#if 0 + if (frag_type == FIRST_FRAG) + { /* Set up to decode the first fragment (even though next fragment not read yet) */ + payload_tvb = tvb_new_subset(tvb, offset, length, length); + payload_length = length; + frag_len = length; + } +#endif + } } - }, + /* process the defragmented payload */ + if (payload_tvb) + { /* reset the payload_offset */ + payload_offset = 0; + /* process the payload */ + if (payload_length > 0) + { + if (!new_payload_len) + continue; + /* if ARQ Feedback payload is present, it should be the first SDU */ + if (first_arq_fb_payload && arq_fb_payload) + { /* decode and display the ARQ feedback payload */ + first_arq_fb_payload = FALSE; + ret_length = arq_feedback_payload_decoder(tvb_new_subset(payload_tvb, payload_offset, new_payload_len, new_payload_len), pinfo, generic_tree, parent_item); +#ifdef DEBUG /* for debug only */ + if (ret_length != new_payload_len) + { /* error */ + /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "incorrect ARQ fb payload size"); + } +#endif + } + else /* decode SDUs */ + { /* check the payload type */ + if (mac_cid == cid_padding) + { /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Padding CID"); + } + /* get the parent */ + generic_item = proto_tree_get_parent(tree); + /* add the MAC header info */ + proto_item_append_text(generic_item, ", Padding CID"); + /* display padding CID */ + generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, payload_tvb, payload_offset, new_payload_len, "Padding CID (%u bytes)", new_payload_len); + /* add payload subtree */ + generic_tree = proto_item_add_subtree(generic_item, ett_mac_header_generic_decoder); + /* display the Padding CID payload in Hex */ + proto_tree_add_item(generic_tree, hf_mac_header_generic_value_bytes, payload_tvb, payload_offset, new_payload_len, FALSE); + } + else if ((mac_cid <= (2 * global_cid_max_basic)) || (mac_cid == cid_aas_ranging) + || (mac_cid >= cid_normal_multicast)) + { /* MAC management message */ + dissect_mac_mgmt_msg_decoder(tvb_new_subset(payload_tvb, payload_offset, new_payload_len, new_payload_len), pinfo, tree); + } + else /* data transport PDU */ + { /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Data"); + } + /* add the MAC payload info */ + proto_item_append_text(parent_item, ", Data"); + /* display payload info */ + if ((new_payload_len + payload_offset) > payload_length) + { + new_tvb_len = new_payload_len - payload_offset; + } + else + { + new_tvb_len = new_payload_len; + } + if (frag_type == LAST_FRAG || frag_type == NO_FRAG) + { + if (frag_type == NO_FRAG) + { + str_ptr = data_str; + new_payload_len = frag_len; + } + else + { + str_ptr = reassem_str; + } + { + data_pdu_tvb = tvb_new_subset(payload_tvb, payload_offset, new_tvb_len, new_tvb_len); + generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, data_pdu_tvb, payload_offset, new_payload_len, str_ptr, new_payload_len); + /* add payload subtree */ + generic_tree = proto_item_add_subtree(generic_item, ett_mac_data_pdu_decoder); + /* check the data type */ + if (tvb_get_guint8(payload_tvb, payload_offset) == IP_HEADER_BYTE) + { + mac_payload_handle = find_dissector("ip"); + if (mac_payload_handle) + call_dissector(mac_payload_handle, tvb_new_subset(payload_tvb, payload_offset, new_tvb_len, new_tvb_len), pinfo, generic_tree); + else /* display the Generic MAC Header in Hex */ + proto_tree_add_item(generic_tree, hf_mac_header_generic_value_bytes, payload_tvb, payload_offset, new_tvb_len, FALSE); + } + else /* display the Generic MAC Header in Hex */ + proto_tree_add_item(generic_tree, hf_mac_header_generic_value_bytes, payload_tvb, payload_offset, new_tvb_len, FALSE); + } + } + } + } + payload_length -= new_payload_len; + payload_offset += new_payload_len; + } /* end of while loop */ + } /* end of payload processing */ + length -= frag_len; + offset += frag_len; + } /* end of payload decoding */ +check_crc: + /* Decode and display the CRC if it is present */ + if (mac_ci) { - &hf_mac_header_generic_ext_subheader_mini_fb_type, - { - "Feedback Type", "wmx.genericExtSubhd.MiniFbType", - FT_UINT16, BASE_DEC, VALS(fb_types), MINI_FEEDBACK_TYPE_MASK, - NULL, HFILL + /* add the CRC info */ + proto_item_append_text(parent_item, ", CRC"); + /* check the length */ + if (MIN(tvb_len, tvb_reported_length(tvb)) >= mac_len) + { /* get the CRC */ + mac_crc = tvb_get_ntohl(tvb, mac_len - sizeof(mac_crc)); + /* calculate the CRC */ + calculated_crc = wimax_mac_calc_crc32((guint8 *)tvb_get_ptr(tvb, 0, mac_len - sizeof(mac_crc)), mac_len - sizeof(mac_crc)); + /* display the CRC */ + generic_item = proto_tree_add_item(tree, hf_mac_header_generic_crc, tvb, mac_len - sizeof(mac_crc), sizeof(mac_crc), FALSE); + if (mac_crc != calculated_crc) + { + proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc); + } + } + else + { /* display error message */ + proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, 0, tvb_len, "CRC missing - the frame is too short (%u bytes)", tvb_len); } - }, - { - &hf_mac_header_generic_ext_subheader_mini_fb_content, + } + else /* CRC is not included */ + { /* add the CRC info */ + proto_item_append_text(parent_item, ", No CRC"); + /* display message */ + proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, 0, tvb_len, "CRC is not included in this frame!"); + } + } +} + +static gint extended_subheader_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + gint offset = 0; + gint length, ext_length, ubyte, i; + proto_item *ti = NULL; + proto_tree *sub_tree = NULL; + proto_tree *ti_tree = NULL; + + /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Ext subhdrs"); + } + + /* Get the tvb reported length */ + length = tvb_reported_length(tvb); + if (!length) + { /* display the error message */ + proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "Error: extended subheader tvb is empty ! (%u bytes)", length); + return length; + } + + /* Get the length of the extended subheader group */ + ext_length = tvb_get_guint8(tvb, offset); + /* display subheader type */ + ti = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "Extended subheader group (%u bytes)", ext_length); + /* add extended subheader subtree */ + sub_tree = proto_item_add_subtree(ti, ett_mac_ext_subheader_decoder); + /* decode and display the extended subheaders */ + for (i=1; isrc))) /* for downlink */ + { /* decode and display the extended subheader type */ + ti = proto_tree_add_item(sub_tree, hf_mac_header_generic_ext_subheader_type_dl, tvb, (offset+i), 1, FALSE); + /* add subtree */ + ti_tree = proto_item_add_subtree(ti, ett_mac_ext_subheader_dl_decoder); + i++; + switch (ubyte) { - "Feedback Content", "wmx.genericExtSubhd.MiniFbContent", - FT_UINT16, BASE_DEC, NULL, MINI_FEEDBACK_CONTENT_MASK, - NULL, HFILL + case SDU_SN: + /* decode and display the extended sdu sn subheader */ + proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_sdu_sn, tvb, (offset+i), 1, FALSE); + i++; + break; + case DL_SLEEP_CONTROL: + /* decode and display the extended dl sleep control subheader */ + proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_dl_sleep_control_pscid, tvb, (offset+i), 3, FALSE); + proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_dl_sleep_control_op, tvb, (offset+i), 3, FALSE); + proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_dl_sleep_control_fswe, tvb, (offset+i), 3, FALSE); + proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_dl_sleep_control_fswb, tvb, (offset+i), 3, FALSE); + proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_dl_sleep_control_rsv, tvb, (offset+i), 3, FALSE); + i += 3; + break; + case FEEDBACK_REQ: + /* decode and display the extended feedback request subheader */ + proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_fb_req_uiuc, tvb, (offset+i), 3, FALSE); + proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_fb_req_fb_type, tvb, (offset+i), 3, FALSE); + proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_fb_req_ofdma_symbol_offset, tvb, (offset+i), 3, FALSE); + proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_fb_req_subchannel_offset, tvb, (offset+i), 3, FALSE); + proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_fb_req_slots, tvb, (offset+i), 3, FALSE); + proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_fb_req_frame_offset, tvb, (offset+i), 3, FALSE); + i += 3; + break; + case SN_REQ: + /* decode and display the extended SN request subheader */ + proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_sn_req_rep_ind_1, tvb, (offset+i), 1, FALSE); + proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_sn_req_rep_ind_2, tvb, (offset+i), 1, FALSE); + proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_sn_req_rsv, tvb, (offset+i), 1, FALSE); + i++; + break; + case PDU_SN_SHORT_DL: + /* decode and display the extended pdu sn (short) subheader */ + proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_pdu_sn_short, tvb, (offset+i), 1, FALSE); + i++; + break; + case PDU_SN_LONG_DL: + /* decode and display the extended pdu sn (long) subheader */ + proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_pdu_sn_long, tvb, (offset+i), 2, FALSE); + i += 2; + break; + default: /* reserved */ + break; } - }, - { - &hf_mac_header_generic_ext_subheader_pdu_sn_short, + } + else /* for uplink */ + { /* decode and display the extended subheader type */ + ti = proto_tree_add_item(sub_tree, hf_mac_header_generic_ext_subheader_type_ul, tvb, (offset+i), 1, FALSE); + /* add subtree */ + ti_tree = proto_item_add_subtree(ti, ett_mac_ext_subheader_ul_decoder); + i++; + switch (ubyte) { - "PDU Sequence Number", "wmx.genericExtSubhd.PduSnShort", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL + case MIMO_MODE_FEEDBACK: + /* decode and display the extended MIMO Mode Feedback subheader */ + proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_mimo_mode_fb_type, tvb, (offset+i), 1, FALSE); + proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_mimo_fb_content, tvb, (offset+i), 1, FALSE); + i++; + break; + case UL_TX_POWER_REPORT: + /* decode and display the extended ul tx power report subheader */ + proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_ul_tx_pwr_rep, tvb, (offset+i), 1, FALSE); + i++; + break; + case MINI_FEEDBACK: + /* decode and display the extended MINI Feedback subheader */ + proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_mini_fb_type, tvb, (offset+i), 2, FALSE); + proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_mini_fb_content, tvb, (offset+i), 2, FALSE); + i += 2; + break; + case PDU_SN_SHORT_UL: + /* decode and display the extended pdu sn (short) subheader */ + proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_pdu_sn_short, tvb, (offset+i), 1, FALSE); + i++; + break; + case PDU_SN_LONG_UL: + /* decode and display the extended pdu sn (long) subheader */ + proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_pdu_sn_long, tvb, (offset+i), 2, FALSE); + i += 2; + break; + default: /* reserved */ + break; } - }, + } + } + /* return the extended subheader length */ + return ext_length; +} + +static gint arq_feedback_payload_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *parent_item) +{ + gint length, i; + gint offset; + gint last_ie = 0; + gint ack_type, num_maps, seq_format; + gint word2, word3; + proto_item *ti = NULL; + proto_item *sub_ti = NULL; + proto_tree *sub_tree = NULL; + + /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "ARQ feedback payld"); + } + + /* add the MAC header info */ + proto_item_append_text(parent_item, ", ARQ feedback payload"); + + /* reset the offset */ + offset = 0; + + /* Get the tvb reported length */ + length = tvb_reported_length(tvb); + if (!length) + { /* display the error message */ + proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "Error: ARQ feedback payload tvb is empty ! (%u bytes)", length); + return length; + } + + /* display subheader type */ + ti = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "ARQ feedback payload "); + /* add extended subheader subtree */ + sub_tree = proto_item_add_subtree(ti, ett_mac_arq_fb_payload_decoder); + /* decode and display the ARQ Feedback IEs */ + while (!last_ie) + { /* decode and display CID */ + proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_cid, tvb, offset, 2, FALSE); + /* move to next 16-bit word */ + offset += 2; + /* Get the 2nd 16-bit */ + word2 = tvb_get_ntohs(tvb, offset); + /* get the last bit */ + last_ie = (word2 & ARQ_FB_IE_LAST_BIT_MASK); + /* get the ACK type */ + ack_type = ((word2 & ARQ_FB_IE_ACK_TYPE_MASK) >> 13); + /* get the number of ACK maps */ + num_maps = (word2 & ARQ_FB_IE_NUM_MAPS_MASK) + 1; + /* decode and display the 2nd word */ + proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_last, tvb, offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_ack_type, tvb, offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_bsn, tvb, offset, 2, FALSE); + /* decode and display the 3rd word */ + if (ack_type != 1) { - &hf_mac_header_generic_ext_subheader_pdu_sn_long, + sub_ti = proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_num_maps, tvb, offset, 2, FALSE); + /* move to next 16-bit word */ + offset += 2; + proto_item_append_text(sub_ti, " (%d map(s))", num_maps); + for (i = 0; i < num_maps; i++) { - "PDU Sequence Number", "wmx.genericExtSubhd.PduSnLong", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL + if (ack_type != 3) + { + proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_sel_ack_map, tvb, offset, 2, FALSE); + } + else + { /* Get the next 16-bit */ + word3 = tvb_get_ntohs(tvb, offset); + /* get the sequence format */ + seq_format = (word3 & ARQ_FB_IE_SEQ_FORMAT_MASK); + /* decode and display the sequence format */ + proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_seq_format, tvb, offset, 2, FALSE); + if (!seq_format) + { + proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_seq_ack_map_2, tvb, offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_seq1_length_6, tvb, offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_seq2_length_6, tvb, offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_rsv, tvb, offset, 2, FALSE); + } + else + { + proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_seq_ack_map, tvb, offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_seq1_length, tvb, offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_seq2_length, tvb, offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_seq3_length, tvb, offset, 2, FALSE); + } + } + /* move to next 16-bit word */ + offset += 2; } } - }; - - /* Mesh Subheader display */ - static hf_register_info hf_mesh[] = - { + else { - &hf_mac_header_generic_mesh_subheader, - { - "Xmt Node Id", "wmx.genericMeshSubhd", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL - } + /* Number of ACK Maps bits are reserved when ACK TYPE == 1 */ + proto_tree_add_item(sub_tree, hf_ack_type_reserved, tvb, offset, 2, FALSE); + /* move to next 16-bit word */ + offset += 2; } - }; + } + /* append text */ + proto_item_append_text(ti,"(%u bytes)", offset); + /* return the offset */ + return offset; +} - /* Fragmentation Subheader display */ - static hf_register_info hf_frag[] = +/* Register Wimax Generic Mac Header Protocol and Dissector */ +void proto_register_mac_header_generic(void) +{ + /* Generic MAC header display */ + static hf_register_info hf[] = { { - &hf_mac_header_generic_frag_subhd_fc, - { - "Fragment Type", "wmx.genericFragSubhd.Fc", - FT_UINT8, BASE_DEC, VALS(frag_types), FRAGMENTATION_SUBHEADER_FC_MASK, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_frag_subhd_fc_ext, + &hf_mac_header_generic_value_bytes, { - "Fragment Type", "wmx.genericFragSubhd.FcExt", - FT_UINT16, BASE_DEC, VALS(frag_types), FRAGMENTATION_SUBHEADER_FC_MASK, + "Values", "wmx.genericValueBytes", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { - &hf_mac_header_generic_frag_subhd_bsn, + &hf_mac_header_generic_ht, { - "Block Sequence Number (BSN)", "wmx.genericFragSubhd.Bsn", - FT_UINT16, BASE_DEC, NULL, FRAGMENTATION_SUBHEADER_BSN_MASK, + "MAC Header Type", "wmx.genericHt", + FT_UINT24, BASE_HEX, VALS(ht_msgs), WIMAX_MAC_HEADER_GENERIC_HT, NULL, HFILL } }, { - &hf_mac_header_generic_frag_subhd_fsn, + &hf_mac_header_generic_ec, { - "Fragment Sequence Number (FSN)", "wmx.genericFragSubhd.Fsn", - FT_UINT8, BASE_DEC, NULL, FRAGMENTATION_SUBHEADER_FSN_MASK, + "MAC Encryption Control", "wmx.genericEc", + FT_UINT24, BASE_HEX, VALS(ec_msgs), WIMAX_MAC_HEADER_GENERIC_EC, NULL, HFILL } }, { - &hf_mac_header_generic_frag_subhd_fsn_ext, + &hf_mac_header_generic_type_0, { - "Fragment Sequence Number (FSN)", "wmx.genericFragSubhd.FsnExt", - FT_UINT16, BASE_DEC, NULL, FRAGMENTATION_SUBHEADER_BSN_MASK, + "MAC Sub-type Bit 0", "wmx.genericType0", + FT_UINT24, BASE_HEX, VALS(type_msg0), WIMAX_MAC_HEADER_GENERIC_TYPE_0, NULL, HFILL } }, { - &hf_mac_header_generic_frag_subhd_rsv, + &hf_mac_header_generic_type_1, { - "Reserved", "wmx.genericFragSubhd.Rsv", - FT_UINT8, BASE_DEC, NULL, FRAGMENTATION_SUBHEADER_RSV_MASK, + "MAC Sub-type Bit 1", "wmx.genericType1", + FT_UINT24, BASE_HEX, VALS(type_msg1), WIMAX_MAC_HEADER_GENERIC_TYPE_1, NULL, HFILL } }, { - &hf_mac_header_generic_frag_subhd_rsv_ext, - { - "Reserved", "wmx.genericFragSubhd.RsvExt", - FT_UINT16, BASE_DEC, NULL, FRAGMENTATION_SUBHEADER_RSV_EXT_MASK, - NULL, HFILL - } - } - }; - - /* Packing Subheader display */ - static hf_register_info hf_pack[] = - { - { - &hf_mac_header_generic_packing_subhd_fc, + &hf_mac_header_generic_type_2, { - "Fragment Type", "wmx.genericPackSubhd.Fc", - FT_UINT16, BASE_DEC, VALS(frag_types), PACKING_SUBHEADER_FC_MASK, + "MAC Sub-type Bit 2", "wmx.genericType2", + FT_UINT24, BASE_HEX, VALS(type_msg2), WIMAX_MAC_HEADER_GENERIC_TYPE_2, NULL, HFILL } }, { - &hf_mac_header_generic_packing_subhd_fc_ext, + &hf_mac_header_generic_type_3, { - "Fragment Type", "wmx.genericPackSubhd.FcExt", - FT_UINT24, BASE_HEX, VALS(frag_types), PACKING_SUBHEADER_FC_MASK, + "MAC Sub-type Bit 3", "wmx.genericType3", + FT_UINT24, BASE_HEX, VALS(type_msg3), WIMAX_MAC_HEADER_GENERIC_TYPE_3, NULL, HFILL } }, { - &hf_mac_header_generic_packing_subhd_bsn, + &hf_mac_header_generic_type_4, { - "First Block Sequence Number", "wmx.genericPackSubhd.Bsn", - FT_UINT24, BASE_DEC, NULL, PACKING_SUBHEADER_BSN_MASK, + "MAC Sub-type Bit 4", "wmx.genericType4", + FT_UINT24, BASE_HEX, VALS(type_msg4), WIMAX_MAC_HEADER_GENERIC_TYPE_4, NULL, HFILL } }, { - &hf_mac_header_generic_packing_subhd_fsn, + &hf_mac_header_generic_type_5, { - "Fragment Number", "wmx.genericPackSubhd.Fsn", - FT_UINT16, BASE_DEC, NULL, PACKING_SUBHEADER_FSN_MASK, + "MAC Sub-type Bit 5", "wmx.genericType5", + FT_UINT24, BASE_HEX, VALS(type_msg5), WIMAX_MAC_HEADER_GENERIC_TYPE_5, NULL, HFILL } }, { - &hf_mac_header_generic_packing_subhd_fsn_ext, + &hf_mac_header_generic_esf, { - "Fragment Number", "wmx.genericPackSubhd.FsnExt", - FT_UINT24, BASE_DEC, NULL, PACKING_SUBHEADER_BSN_MASK, + "Extended Sub-header Field", "wmx.genericEsf", + FT_UINT24, BASE_HEX, VALS(esf_msgs), WIMAX_MAC_HEADER_GENERIC_ESF, NULL, HFILL } }, { - &hf_mac_header_generic_packing_subhd_len, + &hf_mac_header_generic_ci, { - "Length", "wmx.genericPackSubhd.Len", - FT_UINT16, BASE_DEC, NULL, PACKING_SUBHEADER_LENGTH_MASK, + "CRC Indicator", "wmx.genericCi", + FT_UINT24, BASE_HEX, VALS(ci_msgs), WIMAX_MAC_HEADER_GENERIC_CI, NULL, HFILL } }, { - &hf_mac_header_generic_packing_subhd_len_ext, - { - "Length", "wmx.genericPackSubhd.LenExt", - FT_UINT24, BASE_DEC, NULL, PACKING_SUBHEADER_LENGTH_EXT_MASK, - NULL, HFILL - } - } - }; - - /* Fast-feedback Allocation Subheader display */ - static hf_register_info hf_fast[] = - { - { - &hf_mac_header_generic_fast_fb_subhd_alloc_offset, + &hf_mac_header_generic_eks, { - "Allocation Offset", "wmx.genericFastFbSubhd.AllocOffset", - FT_UINT8, BASE_DEC, NULL, FAST_FEEDBACK_ALLOCATION_OFFSET_MASK, + "Encryption Key Sequence", "wmx.genericEks", + FT_UINT24, BASE_HEX, NULL, WIMAX_MAC_HEADER_GENERIC_EKS, NULL, HFILL } }, { - &hf_mac_header_generic_fast_fb_subhd_fb_type, - { - "Feedback Type", "wmx.genericFastFbSubhd.FbType", - FT_UINT8, BASE_DEC, VALS(fast_fb_types), FAST_FEEDBACK_FEEDBACK_TYPE_MASK, - NULL, HFILL - } - } - }; - - /* Grant Management Subheader display */ - static hf_register_info hf_grant[] = - { - { - &hf_mac_header_generic_grant_mgmt_ext_pbr_tree, + &hf_mac_header_generic_rsv, { - "Scheduling Service Type (Default)", - "wimax.genericGrantSubhd.Default", - FT_UINT16, BASE_DEC, NULL, 0x0, + "Reserved", "wmx.genericRsv", + FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_GENERIC_RSV, NULL, HFILL } }, { - &hf_mac_header_generic_grant_mgmt_subhd_pbr, + &hf_mac_header_generic_len, { - "PiggyBack Request", "wmx.genericGrantSubhd.Pbr", - FT_UINT16, BASE_DEC, NULL, 0x0, + "Length", "wmx.genericLen", + FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_GENERIC_LEN, NULL, HFILL } }, { - &hf_mac_header_generic_grant_mgmt_ugs_tree, + &hf_mac_header_generic_cid, { - "Scheduling Service Type (UGS)", "wmx.genericGrantSubhd.UGS", + "Connection ID", "wmx.genericCid", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { - &hf_mac_header_generic_grant_mgmt_subhd_ugs_si, - { - "Slip Indicator", "wmx.genericGrantSubhd.Si", - FT_UINT16, BASE_DEC, VALS(si_msgs), GRANT_MGMT_SUBHEADER_UGS_SI_MASK, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_grant_mgmt_subhd_ugs_pm, + &hf_mac_header_generic_hcs, { - "Poll-Me", "wmx.genericGrantSubhd.Pm", - FT_UINT16, BASE_DEC, VALS(pm_msgs), GRANT_MGMT_SUBHEADER_UGS_PM_MASK, + "Header Check Sequence", "wmx.genericHcs", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { - &hf_mac_header_generic_grant_mgmt_subhd_ugs_fli, + &hf_mac_header_generic_crc, { - "Frame Latency Indication", "wmx.genericGrantSubhd.Fli", - FT_UINT16, BASE_DEC, VALS(fli_msgs), GRANT_MGMT_SUBHEADER_UGS_FLI_MASK, + "CRC", "wmx.genericCrc", + FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } - }, + } + }; + + /* Extended Subheader display */ + static hf_register_info hf_ext[] = + { { - &hf_mac_header_generic_grant_mgmt_subhd_ugs_fl, + &hf_mac_header_generic_ext_subheader_rsv, { - "Frame Latency", "wmx.genericGrantSubhd.Fl", - FT_UINT16, BASE_DEC, NULL, GRANT_MGMT_SUBHEADER_UGS_FL_MASK, + "Reserved", "wmx.genericExtSubhd.Rsv", + FT_UINT8, BASE_DEC, NULL, EXTENDED_SUB_HEADER_RSV_MASK, NULL, HFILL } }, { - &hf_mac_header_generic_grant_mgmt_subhd_ugs_rsv, + &hf_mac_header_generic_ext_subheader_type_dl, { - "Reserved", "wmx.genericGrantSubhd.Rsv", - FT_UINT16, BASE_DEC, NULL, GRANT_MGMT_SUBHEADER_UGS_RSV_MASK, + "DL Extended Subheader Type", "wmx.genericExtSubhd.Dl", + FT_UINT8, BASE_DEC, VALS(dl_ext_sub_header_type), EXTENDED_SUB_HEADER_TYPE_MASK, NULL, HFILL } }, { - &hf_mac_header_generic_grant_mgmt_ext_rtps_tree, + &hf_mac_header_generic_ext_subheader_type_ul, { - "Scheduling Service Type (Extended rtPS)", - "wimax.genericGrantSubhd.ExtendedRTPS", - FT_UINT16, BASE_DEC, NULL, 0x0, + "UL Extended Subheader Type", "wmx.genericExtSubhd.Ul", + FT_UINT8, BASE_DEC, VALS(ul_ext_sub_header_type), EXTENDED_SUB_HEADER_TYPE_MASK, NULL, HFILL } }, { - &hf_mac_header_generic_grant_mgmt_subhd_ext_pbr, + &hf_mac_header_generic_ext_subheader_sdu_sn, { - "Extended PiggyBack Request", "wmx.genericGrantSubhd.ExtPbr", - FT_UINT16, BASE_DEC, NULL, GRANT_MGMT_SUBHEADER_EXT_PBR_MASK, + "SDU Sequence Number", "wmx.genericExtSubhd.SduSn", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { - &hf_mac_header_generic_grant_mgmt_subhd_ext_fli, + &hf_mac_header_generic_ext_subheader_dl_sleep_control_pscid, { - "Frame Latency Indication", "wmx.genericGrantSubhd.ExtFli", - FT_UINT16, BASE_DEC, VALS(fli_msgs), GRANT_MGMT_SUBHEADER_EXT_FLI_MASK, + "Power Saving Class ID", "wmx.genericExtSubhd.DlSleepCtrlPSCID", + FT_UINT24, BASE_DEC, NULL, DL_SLEEP_CONTROL_POWER_SAVING_CLASS_ID_MASK, NULL, HFILL } }, { - &hf_mac_header_generic_grant_mgmt_subhd_ext_fl, + &hf_mac_header_generic_ext_subheader_dl_sleep_control_op, { - "Frame Latency", "wmx.genericGrantSubhd.ExtFl", - FT_UINT16, BASE_DEC, NULL, GRANT_MGMT_SUBHEADER_EXT_FL_MASK, + "Operation", "wmx.genericExtSubhd.DlSleepCtrlOP", + FT_UINT24, BASE_HEX, VALS(dl_sleep_control_ops), DL_SLEEP_CONTROL_OPERATION_MASK, NULL, HFILL } - } - }; - - /* ARQ Feedback Payload display */ - static hf_register_info hf_arq[] = - { + }, { - &hf_mac_header_generic_arq_fb_ie_cid, + &hf_mac_header_generic_ext_subheader_dl_sleep_control_fswe, { - "CID", "wmx.genericArq.FbIeCid", - FT_UINT16, BASE_DEC, NULL, 0x0, + "Final Sleep Window Exponent", "wmx.genericExtSubhd.DlSleepCtrlFSWE", + FT_UINT24, BASE_DEC, NULL, DL_SLEEP_CONTROL_FINAL_SLEEP_WINDOW_EXPONENT_MASK, NULL, HFILL } }, { - &hf_mac_header_generic_arq_fb_ie_last, + &hf_mac_header_generic_ext_subheader_dl_sleep_control_fswb, { - "Last IE", "wmx.genericArq.FbIeLast", - FT_UINT16, BASE_DEC, VALS(last_ie_msgs), ARQ_FB_IE_LAST_BIT_MASK, + "Final Sleep Window Base", "wmx.genericExtSubhd.DlSleepCtrlFSWB", + FT_UINT24, BASE_DEC, NULL, DL_SLEEP_CONTROL_FINAL_SLEEP_WINDOW_BASE_MASK, NULL, HFILL } }, { - &hf_mac_header_generic_arq_fb_ie_ack_type, + &hf_mac_header_generic_ext_subheader_dl_sleep_control_rsv, { - "ACK Type", "wmx.genericArq.FbIeAckType", - FT_UINT16, BASE_DEC, NULL, ARQ_FB_IE_ACK_TYPE_MASK, + "Reserved", "wmx.genericExtSubhd.DlSleepCtrlRsv", + FT_UINT24, BASE_DEC, NULL, DL_SLEEP_CONTROL_RESERVED_MASK, NULL, HFILL } }, { - &hf_mac_header_generic_arq_fb_ie_bsn, + &hf_mac_header_generic_ext_subheader_fb_req_uiuc, { - "BSN", "wmx.genericArq.FbIeBsn", - FT_UINT16, BASE_DEC, NULL, ARQ_FB_IE_BSN_MASK, + "UIUC", "wmx.genericExtSubhd.FbReqUIUC", + FT_UINT24, BASE_HEX, VALS(uiuc_values), FEEDBACK_REQUEST_UIUC_MASK, NULL, HFILL } }, { - &hf_mac_header_generic_arq_fb_ie_num_maps, + &hf_mac_header_generic_ext_subheader_fb_req_fb_type, { - "Number of ACK Maps", "wmx.genericArq.FbIeMaps", - FT_UINT16, BASE_DEC, NULL, ARQ_FB_IE_NUM_MAPS_MASK, + "Feedback Type", "wmx.genericExtSubhd.FbReqFbType", + FT_UINT24, BASE_HEX, VALS(fb_types), FEEDBACK_REQUEST_FEEDBACK_TYPE_MASK, NULL, HFILL } }, { - &hf_ack_type_reserved, + &hf_mac_header_generic_ext_subheader_fb_req_ofdma_symbol_offset, { - "Reserved", "wmx.genericArq.FbIeRsvd", FT_UINT16, BASE_DEC, NULL, 0x03, NULL, HFILL + "OFDMA Symbol Offset", "wmx.genericExtSubhd.FbReqOfdmaSymbolOffset", + FT_UINT24, BASE_HEX, NULL, FEEDBACK_REQUEST_OFDMA_SYMBOL_OFFSET_MASK, + NULL, HFILL } }, { - &hf_mac_header_generic_arq_fb_ie_sel_ack_map, + &hf_mac_header_generic_ext_subheader_fb_req_subchannel_offset, { - "Selective ACK Map", "wmx.genericArq.FbIeSelAckMap", - FT_UINT16, BASE_HEX, NULL, 0x0, + "Subchannel Offset", "wmx.genericExtSubhd.FbReqSubchannelOffset", + FT_UINT24, BASE_HEX, NULL, FEEDBACK_REQUEST_SUBCHANNEL_OFFSET_MASK, NULL, HFILL } }, { - &hf_mac_header_generic_arq_fb_ie_seq_format, + &hf_mac_header_generic_ext_subheader_fb_req_slots, { - "Sequence Format", "wmx.genericArq.FbIeSeqFmt", - FT_UINT16, BASE_DEC, NULL, ARQ_FB_IE_SEQ_FORMAT_MASK, + "Number of Slots", "wmx.genericExtSubhd.FbReqSlots", + FT_UINT24, BASE_HEX, NULL, FEEDBACK_REQUEST_NUMBER_OF_SLOTS_MASK, NULL, HFILL } }, { - &hf_mac_header_generic_arq_fb_ie_seq_ack_map, + &hf_mac_header_generic_ext_subheader_fb_req_frame_offset, { - "Sequence ACK Map", "wmx.genericArq.FbIeSeqAckMap", - FT_UINT16, BASE_HEX, NULL, ARQ_FB_IE_SEQ_ACK_MAP_MASK, + "Frame Offset", "wmx.genericExtSubhd.FbReqFrameOffset", + FT_UINT24, BASE_HEX, NULL, FEEDBACK_REQUEST_FRAME_OFFSET_MASK, NULL, HFILL } }, { - &hf_mac_header_generic_arq_fb_ie_seq1_length, + &hf_mac_header_generic_ext_subheader_sn_req_rep_ind_1, { - "Sequence 1 Length", "wmx.genericArq.FbIeSeq1Len", - FT_UINT16, BASE_DEC, NULL, ARQ_FB_IE_SEQ1_LENGTH_MASK, + "First SN Report Indication", "wmx.genericExtSubhd.SnReqRepInd1", + FT_UINT8, BASE_DEC, VALS(sn_rep_msg), SN_REQUEST_SUBHEADER_SN_REPORT_INDICATION_1_MASK, NULL, HFILL } }, { - &hf_mac_header_generic_arq_fb_ie_seq2_length, + &hf_mac_header_generic_ext_subheader_sn_req_rep_ind_2, { - "Sequence 2 Length", "wmx.genericArq.FbIeSeq2Len", - FT_UINT16, BASE_DEC, NULL, ARQ_FB_IE_SEQ2_LENGTH_MASK, + "Second SN Report Indication", "wmx.genericExtSubhd.SnReqRepInd2", + FT_UINT8, BASE_DEC, VALS(sn_rep_msg), SN_REQUEST_SUBHEADER_SN_REPORT_INDICATION_2_MASK, NULL, HFILL } }, { - &hf_mac_header_generic_arq_fb_ie_seq3_length, + &hf_mac_header_generic_ext_subheader_sn_req_rsv, { - "Sequence 3 Length", "wmx.genericArq.FbIeSeq3Len", - FT_UINT16, BASE_DEC, NULL, ARQ_FB_IE_SEQ3_LENGTH_MASK, + "Reserved", "wmx.genericExtSubhd.SnReqRsv", + FT_UINT8, BASE_DEC, NULL, SN_REQUEST_SUBHEADER_RESERVED_MASK, NULL, HFILL } }, { - &hf_mac_header_generic_arq_fb_ie_seq_ack_map_2, + &hf_mac_header_generic_ext_subheader_mimo_mode_fb_type, { - "Sequence ACK Map", "wmx.genericArq.FbIeSeqAckMap2", - FT_UINT16, BASE_HEX, NULL, ARQ_FB_IE_SEQ_ACK_MAP_2_MASK, + "Feedback Type", "wmx.genericExtSubhd.MimoFbType", + FT_UINT8, BASE_DEC, VALS(mimo_fb_types), MIMO_FEEDBACK_TYPE_MASK, NULL, HFILL } }, { - &hf_mac_header_generic_arq_fb_ie_seq1_length_6, + &hf_mac_header_generic_ext_subheader_mimo_fb_content, { - "Sequence 1 Length", "wmx.genericArq.FbIeSeq1Len", - FT_UINT16, BASE_DEC, NULL, ARQ_FB_IE_SEQ1_LENGTH_6_MASK, + "Feedback Content", "wmx.genericExtSubhd.MimoFbContent", + FT_UINT8, BASE_DEC, NULL, MIMO_FEEDBACK_CONTENT_MASK, NULL, HFILL } }, { - &hf_mac_header_generic_arq_fb_ie_seq2_length_6, + &hf_mac_header_generic_ext_subheader_ul_tx_pwr_rep, { - "Sequence 2 Length", "wmx.genericArq.FbIeSeq2Len", - FT_UINT16, BASE_DEC, NULL, ARQ_FB_IE_SEQ2_LENGTH_6_MASK, + "UL TX Power", "wmx.genericExtSubhd.UlTxPwr", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { - &hf_mac_header_generic_arq_fb_ie_rsv, + &hf_mac_header_generic_ext_subheader_mini_fb_type, { - "Reserved", "wmx.genericArq.FbIeRsv", - FT_UINT16, BASE_DEC, NULL, ARQ_FB_IE_RSV_MASK, + "Feedback Type", "wmx.genericExtSubhd.MiniFbType", + FT_UINT16, BASE_DEC, VALS(fb_types), MINI_FEEDBACK_TYPE_MASK, NULL, HFILL } - } - }; - - if (proto_mac_header_generic_decoder == -1) - { - proto_mac_header_generic_decoder = proto_register_protocol ( - "WiMax Generic/Type1/Type2 MAC Header Messages", /* name */ - "WiMax Generic/Type1/Type2 MAC Header (hdr)", /* short name */ - "wmx.hdr" /* abbrev */ - ); - /* register the field display messages */ - proto_register_field_array(proto_mac_header_generic_decoder, hf, array_length(hf)); - proto_register_field_array(proto_mac_header_generic_decoder, hf_ext, array_length(hf_ext)); - proto_register_field_array(proto_mac_header_generic_decoder, hf_mesh, array_length(hf_mesh)); - proto_register_field_array(proto_mac_header_generic_decoder, hf_frag, array_length(hf_frag)); - proto_register_field_array(proto_mac_header_generic_decoder, hf_pack, array_length(hf_pack)); - proto_register_field_array(proto_mac_header_generic_decoder, hf_fast, array_length(hf_fast)); - proto_register_field_array(proto_mac_header_generic_decoder, hf_grant, array_length(hf_grant)); - proto_register_field_array(proto_mac_header_generic_decoder, hf_arq, array_length(hf_arq)); - proto_register_subtree_array(ett, array_length(ett)); - } - /* register the generic mac header dissector */ - register_dissector("mac_header_generic_handler", dissect_mac_header_generic_decoder, proto_mac_header_generic_decoder); - /* register the mac payload dissector */ - proto_register_mac_mgmt_msg(); - /* Register the payload fragment table init routine */ - register_init_routine(wimax_defragment_init); -} - -void dissect_mac_header_generic_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ - guint offset = 0; - guint payload_offset; - guint payload_length = 0; - - static guint8 frag_number[MAX_CID]; - static guint cid_list[MAX_CID]; - static guint cid_base; - static char *reassem_str = "Reassembled Data transport PDU (%u bytes)"; - static char *data_str = "Data transport PDU (%u bytes)"; - char *str_ptr; - gint length, i, cid_index; - guint tvb_len, ret_length, ubyte, new_tvb_len; - guint new_payload_len = 0; - guint mac_ht, mac_ec, mac_esf, mac_ci, mac_eks, mac_len, mac_cid, cid; - guint ffb_grant_mgmt_subheader, packing_subheader, fragment_subheader; - guint mesh_subheader; - guint packing_length; - guint32 mac_crc, calculated_crc; - proto_item *parent_item = NULL; - proto_item *generic_item = NULL; - proto_tree *generic_tree = NULL; - proto_item *child_item = NULL; - proto_tree *child_tree = NULL; - tvbuff_t *payload_tvb; - tvbuff_t *data_pdu_tvb; - fragment_data *payload_frag; - gboolean first_arq_fb_payload = TRUE; - - dissector_handle_t mac_payload_handle; - - proto_mac_header_generic_decoder = proto_wimax; - if (tree) - { /* we are being asked for details */ -#ifdef DEBUG - /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "GMH"); - } -#endif - /* Get the frame length */ - tvb_len = tvb_reported_length(tvb); - if (tvb_len < WIMAX_MAC_HEADER_SIZE) - { /* display the error message */ - generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, tvb_len, "Error: the size of Generic MAC Header tvb is too small! (%u bytes)", tvb_len); - /* add subtree */ - generic_tree = proto_item_add_subtree(generic_item, ett_mac_header_generic_decoder); - /* display the Generic MAC Header in Hex */ - proto_tree_add_item(generic_tree, hf_mac_header_generic_value_bytes, tvb, offset, tvb_len, FALSE); - return; - } - /* get the parent */ - parent_item = proto_tree_get_parent(tree); - /* add the MAC header info */ - proto_item_append_text(parent_item, " - Generic MAC Header"); - /* display MAC header message */ - generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, WIMAX_MAC_HEADER_SIZE, "Generic MAC Header (%u bytes)", WIMAX_MAC_HEADER_SIZE); - /* add MAC header subtree */ - generic_tree = proto_item_add_subtree(generic_item, ett_mac_header_generic_decoder); - /* Decode and display the MAC header */ - /* Get the first byte */ - ubyte = tvb_get_guint8(tvb, offset); - /* get the Header Type (HT) */ - mac_ht = ((ubyte & WIMAX_MAC_HEADER_GENERIC_HT_MASK)?1:0); - /* get the Encryption Control (EC) */ - mac_ec = ((ubyte & WIMAX_MAC_HEADER_GENERIC_EC_MASK)?1:0); - /* get the sub types */ - ffb_grant_mgmt_subheader = ((ubyte & GENERIC_SUB_TYPE_0)?1:0); - packing_subheader = ((ubyte & GENERIC_SUB_TYPE_1)?1:0); - fragment_subheader = ((ubyte & GENERIC_SUB_TYPE_2)?1:0); - extended_type = ((ubyte & GENERIC_SUB_TYPE_3)?1:0); - arq_fb_payload = ((ubyte & GENERIC_SUB_TYPE_4)?1:0); - mesh_subheader = ((ubyte & GENERIC_SUB_TYPE_5)?1:0); - /* Get the 2nd byte */ - ubyte = tvb_get_guint8(tvb, (offset+1)); - /* get the Extended subheader field (ESF) */ - mac_esf = ((ubyte & WIMAX_MAC_HEADER_GENERIC_ESF_MASK)?1:0); - /* get the CRC indicator (CI) */ - mac_ci = ((ubyte & WIMAX_MAC_HEADER_GENERIC_CI_MASK)?1:0); - /* get the Encryption key sequence (EKS) */ - mac_eks = ((ubyte & WIMAX_MAC_HEADER_GENERIC_EKS_MASK)>>4); - /* get the MAC length */ - mac_len = (tvb_get_ntohs(tvb, (offset+1)) & WIMAX_MAC_HEADER_GENERIC_LEN); - /* get the CID */ - mac_cid = tvb_get_ntohs(tvb, (offset+3)); - /* display the Header Type (HT) */ - proto_tree_add_item(generic_tree, hf_mac_header_generic_ht, tvb, offset, 3, FALSE); - /* display the Encryption Control (EC) */ - proto_tree_add_item(generic_tree, hf_mac_header_generic_ec, tvb, offset, 3, FALSE); - /* display the sub-types (Type) */ - proto_tree_add_item(generic_tree, hf_mac_header_generic_type_5, tvb, offset, 3, FALSE); - proto_tree_add_item(generic_tree, hf_mac_header_generic_type_4, tvb, offset, 3, FALSE); - proto_tree_add_item(generic_tree, hf_mac_header_generic_type_3, tvb, offset, 3, FALSE); - proto_tree_add_item(generic_tree, hf_mac_header_generic_type_2, tvb, offset, 3, FALSE); - proto_tree_add_item(generic_tree, hf_mac_header_generic_type_1, tvb, offset, 3, FALSE); - proto_tree_add_item(generic_tree, hf_mac_header_generic_type_0, tvb, offset, 3, FALSE); - /* display the Extended sub-header Field (ESF) */ - proto_tree_add_item(generic_tree, hf_mac_header_generic_esf, tvb, offset, 3, FALSE); - /* display the CRC Indicator (CI) */ - proto_tree_add_item(generic_tree, hf_mac_header_generic_ci, tvb, offset, 3, FALSE); - /* display the Encryption Key Sequence (EKS) */ - proto_tree_add_item(generic_tree, hf_mac_header_generic_eks, tvb, offset, 3, FALSE); - /* display the reserved field */ - proto_tree_add_item(generic_tree, hf_mac_header_generic_rsv, tvb, offset, 3, FALSE); - /* display the length */ - proto_tree_add_item(generic_tree, hf_mac_header_generic_len, tvb, offset, 3, FALSE); - /* Decode and display the CID */ - proto_tree_add_item(generic_tree, hf_mac_header_generic_cid, tvb, (offset+3), 2, FALSE); - /* Decode and display the HCS */ - proto_tree_add_item(generic_tree, hf_mac_header_generic_hcs, tvb, (offset+5), 1, FALSE); - /* get the frame length without MAC header */ - length = mac_len - WIMAX_MAC_HEADER_SIZE; -#ifdef DEBUG - proto_item_append_text(parent_item, "tvb length=%u, mac length=%u, frame length=%u,", tvb_len, mac_len, length); -#endif - /* set the offset for the frame */ - offset += WIMAX_MAC_HEADER_SIZE; - /* the processing of the subheaders is order sensitive */ - /* do not change the order */ - - if (mac_ec) + }, { - if (mac_ci) + &hf_mac_header_generic_ext_subheader_mini_fb_content, { - if (length >= (gint)sizeof(mac_crc)) - { - length -= sizeof(mac_crc); - } + "Feedback Content", "wmx.genericExtSubhd.MiniFbContent", + FT_UINT16, BASE_DEC, NULL, MINI_FEEDBACK_CONTENT_MASK, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_ext_subheader_pdu_sn_short, + { + "PDU Sequence Number", "wmx.genericExtSubhd.PduSnShort", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_ext_subheader_pdu_sn_long, + { + "PDU Sequence Number", "wmx.genericExtSubhd.PduSnLong", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } - generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "Encrypted PDU (%u bytes)", length); - /* add payload subtree */ - generic_tree = proto_item_add_subtree(generic_item, ett_mac_data_pdu_decoder); - proto_tree_add_item(generic_tree, hf_mac_header_generic_value_bytes, tvb, offset, length, FALSE); - goto check_crc; } + }; - /* if Extended subheader is present */ - if (mac_esf) - { /* add the Extended subheader info */ - proto_item_append_text(parent_item, ", Extended Subheader(s)"); - ret_length = extended_subheader_decoder(tvb_new_subset(tvb, offset, length, length), pinfo, tree); - /* update the length and offset */ - length -= ret_length; - offset += ret_length; - } - /* if Mesh subheader is present */ - if (mesh_subheader) - { /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) + /* Mesh Subheader display */ + static hf_register_info hf_mesh[] = + { + { + &hf_mac_header_generic_mesh_subheader, { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Mesh subhdr"); + "Xmt Node Id", "wmx.genericMeshSubhd", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } - /* add the Mesh subheader info */ - proto_item_append_text(parent_item, ", Mesh Subheader"); - /* display Mesh subheader type */ - generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "Mesh subheader (2 bytes)"); - /* add Mesh subheader subtree */ - generic_tree = proto_item_add_subtree(generic_item, ett_mac_mesh_subheader_decoder); - /* decode and display the Mesh subheader */ - proto_tree_add_item(generic_tree, hf_mac_header_generic_mesh_subheader, tvb, offset, 2, FALSE); - /* update the length and offset */ - length -= 2; - offset += 2; } - /* if Fast-feedback allocation (DL) subheader or Grant management (UL) subheader is present */ - if (ffb_grant_mgmt_subheader) - { /* check if it is downlink packet */ - if (is_down_link(&(pinfo->src))) - { /* Fast-feedback allocation (DL) subheader is present */ - /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Fast-fb subhdr"); - } - /* add the Fast-feedback subheader info */ - proto_item_append_text(parent_item, ", Fast-feedback Subheader"); - /* display Fast-feedback allocation subheader type */ - generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "Fast-feedback allocation (DL) subheader (%u bytes)", length); - /* add Fast-feedback allocation subheader subtree */ - generic_tree = proto_item_add_subtree(generic_item, ett_mac_fast_fb_subheader_decoder); - proto_tree_add_item(generic_tree, hf_mac_header_generic_fast_fb_subhd_alloc_offset, tvb, offset, 1, FALSE); - proto_tree_add_item(generic_tree, hf_mac_header_generic_fast_fb_subhd_fb_type, tvb, offset, 1, FALSE); - /* update the length and offset */ - length -= 1; - offset += 1; - } - else /* Grant management (UL) subheader is present */ - { /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Grant mgmt subhdr"); - } - /* add the Grant management subheader info */ - proto_item_append_text(parent_item, ", Grant Management Subheader"); - /* display Grant management subheader type */ - generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, 2, "Grant management (UL) subheader (2 bytes)"); - /* add Grant management subheader subtree */ - generic_tree = proto_item_add_subtree(generic_item, ett_mac_grant_mgmt_subheader_decoder); - scheduling_service_type = get_service_type(); - switch (scheduling_service_type) - { - case SCHEDULE_SERVICE_TYPE_UGS: - proto_item_append_text(generic_item, ": It looks like UGS is the correct Scheduling Service Type"); - break; - case SCHEDULE_SERVICE_TYPE_EXT_RTPS: - proto_item_append_text(generic_item, ": It looks like Extended rtPS is the correct Scheduling Service Type"); - break; - case -1: - proto_item_append_text(generic_item, ": Cannot determine the correct Scheduling Service Type"); - break; - default: - proto_item_append_text(generic_item, ": It looks like Piggyback Request is the correct Scheduling Service Type"); - break; - } - /* Create tree for Scheduling Service Type (UGS) */ - child_item = proto_tree_add_item(generic_tree, hf_mac_header_generic_grant_mgmt_ugs_tree, tvb, offset, 2, FALSE); - child_tree = proto_item_add_subtree(child_item, ett_mac_grant_mgmt_subheader_decoder); - proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_ugs_si, tvb, offset, 2, FALSE); - proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_ugs_pm, tvb, offset, 2, FALSE); - proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_ugs_fli, tvb, offset, 2, FALSE); - proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_ugs_fl, tvb, offset, 2, FALSE); - proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_ugs_rsv, tvb, offset, 2, FALSE); - - /* Create tree for Scheduling Service Type (Extended RTPS) */ - child_item = proto_tree_add_item(generic_tree, hf_mac_header_generic_grant_mgmt_ext_rtps_tree, tvb, offset, 2, FALSE); - child_tree = proto_item_add_subtree(child_item, ett_mac_grant_mgmt_subheader_decoder); - proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_ext_pbr, tvb, offset, 2, FALSE); - proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_ext_fli, tvb, offset, 2, FALSE); - proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_ext_fl, tvb, offset, 2, FALSE); - - /* Create tree for Scheduling Service Type (Piggyback Request) */ - child_item = proto_tree_add_item(generic_tree, hf_mac_header_generic_grant_mgmt_ext_pbr_tree, tvb, offset, 2, FALSE); - child_tree = proto_item_add_subtree(child_item, ett_mac_grant_mgmt_subheader_decoder); - proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_pbr, tvb, offset, 2, FALSE); + }; - /* update the length and offset */ - length -= 2; - offset += 2; + /* Fragmentation Subheader display */ + static hf_register_info hf_frag[] = + { + { + &hf_mac_header_generic_frag_subhd_fc, + { + "Fragment Type", "wmx.genericFragSubhd.Fc", + FT_UINT8, BASE_DEC, VALS(frag_types), FRAGMENTATION_SUBHEADER_FC_MASK, + NULL, HFILL } - } - /* if Fragmentation subheader is present */ - if (fragment_subheader) - { /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) + }, + { + &hf_mac_header_generic_frag_subhd_fc_ext, { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Frag subhdr"); + "Fragment Type", "wmx.genericFragSubhd.FcExt", + FT_UINT16, BASE_DEC, VALS(frag_types), FRAGMENTATION_SUBHEADER_FC_MASK, + NULL, HFILL } - /* add the Fragmentation subheader info */ - proto_item_append_text(parent_item, ", Frag Subheader"); - /* display Fragmentation subheader type */ - generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, ((arq_enabled|extended_type)?2:1), "Fragmentation subheader (%u bytes)", ((arq_enabled|extended_type)?2:1)); - /* add Fragmentation subheader subtree */ - generic_tree = proto_item_add_subtree(generic_item, ett_mac_frag_subheader_decoder); - /* Get the fragment type */ - frag_type = (tvb_get_guint8(tvb, offset) & FRAGMENT_TYPE_MASK) >> 6; - if (arq_fb_payload) - { /* get the sequence number */ - seq_number = (tvb_get_ntohs(tvb, offset) & SEQ_NUMBER_MASK_11) >> 3; - /* decode and display the header */ - proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_fc_ext, tvb, offset, 2, FALSE); - proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_bsn, tvb, offset, 2, FALSE); - proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_rsv_ext, tvb, offset, 2, FALSE); - /* update the length and offset */ - length -= 2; - offset += 2; + }, + { + &hf_mac_header_generic_frag_subhd_bsn, + { + "Block Sequence Number (BSN)", "wmx.genericFragSubhd.Bsn", + FT_UINT16, BASE_DEC, NULL, FRAGMENTATION_SUBHEADER_BSN_MASK, + NULL, HFILL } - else + }, + { + &hf_mac_header_generic_frag_subhd_fsn, { - if (extended_type) - { /* get the sequence number */ - seq_number = (tvb_get_ntohs(tvb, offset) & SEQ_NUMBER_MASK_11) >> 3; - /* decode and display the header */ - proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_fc_ext, tvb, offset, 2, FALSE); - proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_fsn_ext, tvb, offset, 2, FALSE); - proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_rsv_ext, tvb, offset, 2, FALSE); - /* update the length and offset */ - length -= 2; - offset += 2; - } - else - { /* get the sequence number */ - seq_number = (tvb_get_guint8(tvb, offset) & SEQ_NUMBER_MASK) >> 3; - /* decode and display the header */ - proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_fc, tvb, offset, 1, FALSE); - proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_fsn, tvb, offset, 1, FALSE); - proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_rsv, tvb, offset, 1, FALSE); - /* update the length and offset */ - length -= 1; - offset += 1; - } + "Fragment Sequence Number (FSN)", "wmx.genericFragSubhd.Fsn", + FT_UINT8, BASE_DEC, NULL, FRAGMENTATION_SUBHEADER_FSN_MASK, + NULL, HFILL } - frag_len = length; - } - else /* ??? default fragment type: no fragment */ + }, { - frag_type = NO_FRAG; + &hf_mac_header_generic_frag_subhd_fsn_ext, + { + "Fragment Sequence Number (FSN)", "wmx.genericFragSubhd.FsnExt", + FT_UINT16, BASE_DEC, NULL, FRAGMENTATION_SUBHEADER_BSN_MASK, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_frag_subhd_rsv, + { + "Reserved", "wmx.genericFragSubhd.Rsv", + FT_UINT8, BASE_DEC, NULL, FRAGMENTATION_SUBHEADER_RSV_MASK, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_frag_subhd_rsv_ext, + { + "Reserved", "wmx.genericFragSubhd.RsvExt", + FT_UINT16, BASE_DEC, NULL, FRAGMENTATION_SUBHEADER_RSV_EXT_MASK, + NULL, HFILL + } } - /* Decode the MAC payload if there is any */ - if (mac_ci) + }; + + /* Packing Subheader display */ + static hf_register_info hf_pack[] = + { { - if (length < (gint)sizeof(mac_crc)) - { /* display error message */ - proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "Error - the frame is too short (%u bytes)", length); - return; + &hf_mac_header_generic_packing_subhd_fc, + { + "Fragment Type", "wmx.genericPackSubhd.Fc", + FT_UINT16, BASE_DEC, VALS(frag_types), PACKING_SUBHEADER_FC_MASK, + NULL, HFILL } - length -= sizeof(mac_crc); - } - while (length > 0) + }, { - frag_len = length; /* Can be changed by Packing subhdr */ - if (packing_subheader) + &hf_mac_header_generic_packing_subhd_fc_ext, { - packing_length = decode_packing_subheader(tvb, pinfo, tree, length, offset, parent_item); - length -= packing_length; - offset += packing_length; - generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, frag_len, "Data transport PDU (%u bytes)", frag_len); - /* add payload subtree */ - generic_tree = proto_item_add_subtree(generic_item, ett_mac_data_pdu_decoder); - proto_tree_add_item(generic_tree, hf_mac_header_generic_value_bytes, tvb, offset, frag_len, FALSE); + "Fragment Type", "wmx.genericPackSubhd.FcExt", + FT_UINT24, BASE_HEX, VALS(frag_types), PACKING_SUBHEADER_FC_MASK, + NULL, HFILL } - /* defragment first if it is fragmented */ - if (frag_type == NO_FRAG) - { /* not fragmented payload */ - payload_tvb = tvb_new_subset(tvb, offset, frag_len, frag_len); - payload_length = frag_len; - new_payload_len = frag_len; + }, + { + &hf_mac_header_generic_packing_subhd_bsn, + { + "First Block Sequence Number", "wmx.genericPackSubhd.Bsn", + FT_UINT24, BASE_DEC, NULL, PACKING_SUBHEADER_BSN_MASK, + NULL, HFILL } - else /* fragmented payload */ - { /* add the frag */ - /* Make sure cid will not match a previous packet with different data */ - for (i = 0; i < MAX_CID; i++) - { - if (cid_list[i] == mac_cid) - { - cid_base = i * (0xFFFFFFFF / MAX_CID); - break; - } - if (cid_list[i] == 0) - { - cid_list[i] = mac_cid; - cid_base = i * (0xFFFFFFFF / MAX_CID); - break; - } - } - cid_index = i; - while (pinfo->fd->num > cid_adj_array_size) - { - cid_adj_array_size += 1024; - cid_adj_array = g_realloc(cid_adj_array, sizeof(guint) * cid_adj_array_size); - frag_num_array = g_realloc(frag_num_array, sizeof(guint8) * cid_adj_array_size); - /* Clear the added memory */ - memset(&cid_adj_array[cid_adj_array_size - 1024], 0, sizeof(guint) * 1024); - } - if (first_gmh) - { - /* New cid_adjust for each packet with fragment(s) */ - cid_adjust[cid_index] += cid_vernier[cid_index]; - /* cid_vernier must always be 0 at start of packet. */ - cid_vernier[cid_index] = 0; - } - /* Create artificial sequence numbers. */ - frag_number[cid_index]++; - if (frag_type == FIRST_FRAG) - { - frag_number[cid_index] = 0; - } - if (cid_adj_array[pinfo->fd->num]) - { - /* We apparently just clicked on the packet again. */ - cid_adjust[cid_index] = cid_adj_array[pinfo->fd->num]; - /* Set the frag_number at start of packet. */ - if (first_gmh) - { - frag_number[cid_index] = frag_num_array[pinfo->fd->num]; - } - } else { - /* Save for next time we click on this packet. */ - cid_adj_array[pinfo->fd->num] = cid_adjust[cid_index]; - if (first_gmh) - { - frag_num_array[pinfo->fd->num] = frag_number[cid_index]; - } - } - /* Reset in case we stay in this while() loop to finish the packet. */ - first_gmh = FALSE; - cid = cid_base + cid_adjust[cid_index] + cid_vernier[cid_index]; - /* Save address pointers. */ - save_src = pinfo->src; - save_dst = pinfo->dst; - /* Use dl_src and dl_dst in defrag. */ - pinfo->src = pinfo->dl_src; - pinfo->dst = pinfo->dl_dst; - payload_frag = fragment_add_seq(tvb, offset, pinfo, cid, payload_frag_table, frag_number[cid_index], frag_len, ((frag_type==LAST_FRAG)?0:1)); - /* Restore address pointers. */ - pinfo->src = save_src; - pinfo->dst = save_dst; - if (frag_type == LAST_FRAG) - { - /* Make sure fragment_add_seq() sees next one as a new frame. */ - cid_vernier[cid_index]++; - } - /* Don't show reassem packet until last frag. */ - proto_tree_add_text(tree, tvb, offset, frag_len, "Payload Fragment (%d bytes)", frag_len); - - if (payload_frag && frag_type == LAST_FRAG) - { /* defragmented completely */ - payload_length = payload_frag->len; - /* create the new tvb for defragmented frame */ - payload_tvb = tvb_new_child_real_data(tvb, payload_frag->data, payload_length, payload_length); - /* add the defragmented data to the data source list */ - add_new_data_source(pinfo, payload_tvb, "Reassembled WiMax MAC payload"); - /* save the tvb langth */ - new_payload_len = payload_length; - } - else /* error or defragment is not complete */ - { - payload_tvb = NULL; -#ifdef DEBUG /* for debug only */ -/* if (frag_type == LAST_FRAG)*/ - { /* error */ - /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Dropped the incomplete frame"); - } -#endif -#if 0 - if (frag_type == FIRST_FRAG) - { /* Set up to decode the first fragment (even though next fragment not read yet) */ - payload_tvb = tvb_new_subset(tvb, offset, length, length); - payload_length = length; - frag_len = length; - } -#endif - } + }, + { + &hf_mac_header_generic_packing_subhd_fsn, + { + "Fragment Number", "wmx.genericPackSubhd.Fsn", + FT_UINT16, BASE_DEC, NULL, PACKING_SUBHEADER_FSN_MASK, + NULL, HFILL } - /* process the defragmented payload */ - if (payload_tvb) - { /* reset the payload_offset */ - payload_offset = 0; - /* process the payload */ - if (payload_length > 0) - { - if (!new_payload_len) - continue; - /* if ARQ Feedback payload is present, it should be the first SDU */ - if (first_arq_fb_payload && arq_fb_payload) - { /* decode and display the ARQ feedback payload */ - first_arq_fb_payload = FALSE; - ret_length = arq_feedback_payload_decoder(tvb_new_subset(payload_tvb, payload_offset, new_payload_len, new_payload_len), pinfo, generic_tree, parent_item); -#ifdef DEBUG /* for debug only */ - if (ret_length != new_payload_len) - { /* error */ - /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "incorrect ARQ fb payload size"); - } -#endif - } - else /* decode SDUs */ - { /* check the payload type */ - if (mac_cid == cid_padding) - { /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Padding CID"); - } - /* get the parent */ - generic_item = proto_tree_get_parent(tree); - /* add the MAC header info */ - proto_item_append_text(generic_item, ", Padding CID"); - /* display padding CID */ - generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, payload_tvb, payload_offset, new_payload_len, "Padding CID (%u bytes)", new_payload_len); - /* add payload subtree */ - generic_tree = proto_item_add_subtree(generic_item, ett_mac_header_generic_decoder); - /* display the Padding CID payload in Hex */ - proto_tree_add_item(generic_tree, hf_mac_header_generic_value_bytes, payload_tvb, payload_offset, new_payload_len, FALSE); - } - else if ((mac_cid <= (2 * global_cid_max_basic)) || (mac_cid == cid_aas_ranging) - || (mac_cid >= cid_normal_multicast)) - { /* MAC management message */ - dissect_mac_mgmt_msg_decoder(tvb_new_subset(payload_tvb, payload_offset, new_payload_len, new_payload_len), pinfo, tree); - } - else /* data transport PDU */ - { /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Data"); - } - /* add the MAC payload info */ - proto_item_append_text(parent_item, ", Data"); - /* display payload info */ - if ((new_payload_len + payload_offset) > payload_length) - { - new_tvb_len = new_payload_len - payload_offset; - } - else - { - new_tvb_len = new_payload_len; - } - if (frag_type == LAST_FRAG || frag_type == NO_FRAG) - { - if (frag_type == NO_FRAG) - { - str_ptr = data_str; - new_payload_len = frag_len; - } - else - { - str_ptr = reassem_str; - } - { - data_pdu_tvb = tvb_new_subset(payload_tvb, payload_offset, new_tvb_len, new_tvb_len); - generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, data_pdu_tvb, payload_offset, new_payload_len, str_ptr, new_payload_len); - /* add payload subtree */ - generic_tree = proto_item_add_subtree(generic_item, ett_mac_data_pdu_decoder); - /* check the data type */ - if (tvb_get_guint8(payload_tvb, payload_offset) == IP_HEADER_BYTE) - { - mac_payload_handle = find_dissector("ip"); - if (mac_payload_handle) - call_dissector(mac_payload_handle, tvb_new_subset(payload_tvb, payload_offset, new_tvb_len, new_tvb_len), pinfo, generic_tree); - else /* display the Generic MAC Header in Hex */ - proto_tree_add_item(generic_tree, hf_mac_header_generic_value_bytes, payload_tvb, payload_offset, new_tvb_len, FALSE); - } - else /* display the Generic MAC Header in Hex */ - proto_tree_add_item(generic_tree, hf_mac_header_generic_value_bytes, payload_tvb, payload_offset, new_tvb_len, FALSE); - } - } - } - } - payload_length -= new_payload_len; - payload_offset += new_payload_len; - } /* end of while loop */ - } /* end of payload processing */ - length -= frag_len; - offset += frag_len; - } /* end of payload decoding */ -check_crc: - /* Decode and display the CRC if it is present */ - if (mac_ci) + }, + { + &hf_mac_header_generic_packing_subhd_fsn_ext, + { + "Fragment Number", "wmx.genericPackSubhd.FsnExt", + FT_UINT24, BASE_DEC, NULL, PACKING_SUBHEADER_BSN_MASK, + NULL, HFILL + } + }, { - /* add the CRC info */ - proto_item_append_text(parent_item, ", CRC"); - /* check the length */ - if (MIN(tvb_len, tvb_reported_length(tvb)) >= mac_len) - { /* get the CRC */ - mac_crc = tvb_get_ntohl(tvb, mac_len - sizeof(mac_crc)); - /* calculate the CRC */ - calculated_crc = wimax_mac_calc_crc32((guint8 *)tvb_get_ptr(tvb, 0, mac_len - sizeof(mac_crc)), mac_len - sizeof(mac_crc)); - /* display the CRC */ - generic_item = proto_tree_add_item(tree, hf_mac_header_generic_crc, tvb, mac_len - sizeof(mac_crc), sizeof(mac_crc), FALSE); - if (mac_crc != calculated_crc) - { - proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc); - } - } - else - { /* display error message */ - proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, 0, tvb_len, "CRC missing - the frame is too short (%u bytes)", tvb_len); + &hf_mac_header_generic_packing_subhd_len, + { + "Length", "wmx.genericPackSubhd.Len", + FT_UINT16, BASE_DEC, NULL, PACKING_SUBHEADER_LENGTH_MASK, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_packing_subhd_len_ext, + { + "Length", "wmx.genericPackSubhd.LenExt", + FT_UINT24, BASE_DEC, NULL, PACKING_SUBHEADER_LENGTH_EXT_MASK, + NULL, HFILL } } - else /* CRC is not included */ - { /* add the CRC info */ - proto_item_append_text(parent_item, ", No CRC"); - /* display message */ - proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, 0, tvb_len, "CRC is not included in this frame!"); - } - } -} - -static gint extended_subheader_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ - gint offset = 0; - gint length, ext_length, ubyte, i; - proto_item *ti = NULL; - proto_tree *sub_tree = NULL; - proto_tree *ti_tree = NULL; + }; - /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) + /* Fast-feedback Allocation Subheader display */ + static hf_register_info hf_fast[] = { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Ext subhdrs"); - } - - /* Get the tvb reported length */ - length = tvb_reported_length(tvb); - if (!length) - { /* display the error message */ - proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "Error: extended subheader tvb is empty ! (%u bytes)", length); - return length; - } - - /* Get the length of the extended subheader group */ - ext_length = tvb_get_guint8(tvb, offset); - /* display subheader type */ - ti = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "Extended subheader group (%u bytes)", ext_length); - /* add extended subheader subtree */ - sub_tree = proto_item_add_subtree(ti, ett_mac_ext_subheader_decoder); - /* decode and display the extended subheaders */ - for (i=1; isrc))) /* for downlink */ - { /* decode and display the extended subheader type */ - ti = proto_tree_add_item(sub_tree, hf_mac_header_generic_ext_subheader_type_dl, tvb, (offset+i), 1, FALSE); - /* add subtree */ - ti_tree = proto_item_add_subtree(ti, ett_mac_ext_subheader_dl_decoder); - i++; - switch (ubyte) + { + &hf_mac_header_generic_fast_fb_subhd_alloc_offset, { - case SDU_SN: - /* decode and display the extended sdu sn subheader */ - proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_sdu_sn, tvb, (offset+i), 1, FALSE); - i++; - break; - case DL_SLEEP_CONTROL: - /* decode and display the extended dl sleep control subheader */ - proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_dl_sleep_control_pscid, tvb, (offset+i), 3, FALSE); - proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_dl_sleep_control_op, tvb, (offset+i), 3, FALSE); - proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_dl_sleep_control_fswe, tvb, (offset+i), 3, FALSE); - proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_dl_sleep_control_fswb, tvb, (offset+i), 3, FALSE); - proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_dl_sleep_control_rsv, tvb, (offset+i), 3, FALSE); - i += 3; - break; - case FEEDBACK_REQ: - /* decode and display the extended feedback request subheader */ - proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_fb_req_uiuc, tvb, (offset+i), 3, FALSE); - proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_fb_req_fb_type, tvb, (offset+i), 3, FALSE); - proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_fb_req_ofdma_symbol_offset, tvb, (offset+i), 3, FALSE); - proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_fb_req_subchannel_offset, tvb, (offset+i), 3, FALSE); - proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_fb_req_slots, tvb, (offset+i), 3, FALSE); - proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_fb_req_frame_offset, tvb, (offset+i), 3, FALSE); - i += 3; - break; - case SN_REQ: - /* decode and display the extended SN request subheader */ - proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_sn_req_rep_ind_1, tvb, (offset+i), 1, FALSE); - proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_sn_req_rep_ind_2, tvb, (offset+i), 1, FALSE); - proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_sn_req_rsv, tvb, (offset+i), 1, FALSE); - i++; - break; - case PDU_SN_SHORT_DL: - /* decode and display the extended pdu sn (short) subheader */ - proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_pdu_sn_short, tvb, (offset+i), 1, FALSE); - i++; - break; - case PDU_SN_LONG_DL: - /* decode and display the extended pdu sn (long) subheader */ - proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_pdu_sn_long, tvb, (offset+i), 2, FALSE); - i += 2; - break; - default: /* reserved */ - break; + "Allocation Offset", "wmx.genericFastFbSubhd.AllocOffset", + FT_UINT8, BASE_DEC, NULL, FAST_FEEDBACK_ALLOCATION_OFFSET_MASK, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_fast_fb_subhd_fb_type, + { + "Feedback Type", "wmx.genericFastFbSubhd.FbType", + FT_UINT8, BASE_DEC, VALS(fast_fb_types), FAST_FEEDBACK_FEEDBACK_TYPE_MASK, + NULL, HFILL } } - else /* for uplink */ - { /* decode and display the extended subheader type */ - ti = proto_tree_add_item(sub_tree, hf_mac_header_generic_ext_subheader_type_ul, tvb, (offset+i), 1, FALSE); - /* add subtree */ - ti_tree = proto_item_add_subtree(ti, ett_mac_ext_subheader_ul_decoder); - i++; - switch (ubyte) + }; + + /* Grant Management Subheader display */ + static hf_register_info hf_grant[] = + { + { + &hf_mac_header_generic_grant_mgmt_ext_pbr_tree, { - case MIMO_MODE_FEEDBACK: - /* decode and display the extended MIMO Mode Feedback subheader */ - proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_mimo_mode_fb_type, tvb, (offset+i), 1, FALSE); - proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_mimo_fb_content, tvb, (offset+i), 1, FALSE); - i++; - break; - case UL_TX_POWER_REPORT: - /* decode and display the extended ul tx power report subheader */ - proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_ul_tx_pwr_rep, tvb, (offset+i), 1, FALSE); - i++; - break; - case MINI_FEEDBACK: - /* decode and display the extended MINI Feedback subheader */ - proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_mini_fb_type, tvb, (offset+i), 2, FALSE); - proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_mini_fb_content, tvb, (offset+i), 2, FALSE); - i += 2; - break; - case PDU_SN_SHORT_UL: - /* decode and display the extended pdu sn (short) subheader */ - proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_pdu_sn_short, tvb, (offset+i), 1, FALSE); - i++; - break; - case PDU_SN_LONG_UL: - /* decode and display the extended pdu sn (long) subheader */ - proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_pdu_sn_long, tvb, (offset+i), 2, FALSE); - i += 2; - break; - default: /* reserved */ - break; + "Scheduling Service Type (Default)", + "wimax.genericGrantSubhd.Default", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_grant_mgmt_subhd_pbr, + { + "PiggyBack Request", "wmx.genericGrantSubhd.Pbr", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_grant_mgmt_ugs_tree, + { + "Scheduling Service Type (UGS)", "wmx.genericGrantSubhd.UGS", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_grant_mgmt_subhd_ugs_si, + { + "Slip Indicator", "wmx.genericGrantSubhd.Si", + FT_UINT16, BASE_DEC, VALS(si_msgs), GRANT_MGMT_SUBHEADER_UGS_SI_MASK, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_grant_mgmt_subhd_ugs_pm, + { + "Poll-Me", "wmx.genericGrantSubhd.Pm", + FT_UINT16, BASE_DEC, VALS(pm_msgs), GRANT_MGMT_SUBHEADER_UGS_PM_MASK, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_grant_mgmt_subhd_ugs_fli, + { + "Frame Latency Indication", "wmx.genericGrantSubhd.Fli", + FT_UINT16, BASE_DEC, VALS(fli_msgs), GRANT_MGMT_SUBHEADER_UGS_FLI_MASK, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_grant_mgmt_subhd_ugs_fl, + { + "Frame Latency", "wmx.genericGrantSubhd.Fl", + FT_UINT16, BASE_DEC, NULL, GRANT_MGMT_SUBHEADER_UGS_FL_MASK, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_grant_mgmt_subhd_ugs_rsv, + { + "Reserved", "wmx.genericGrantSubhd.Rsv", + FT_UINT16, BASE_DEC, NULL, GRANT_MGMT_SUBHEADER_UGS_RSV_MASK, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_grant_mgmt_ext_rtps_tree, + { + "Scheduling Service Type (Extended rtPS)", + "wimax.genericGrantSubhd.ExtendedRTPS", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_grant_mgmt_subhd_ext_pbr, + { + "Extended PiggyBack Request", "wmx.genericGrantSubhd.ExtPbr", + FT_UINT16, BASE_DEC, NULL, GRANT_MGMT_SUBHEADER_EXT_PBR_MASK, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_grant_mgmt_subhd_ext_fli, + { + "Frame Latency Indication", "wmx.genericGrantSubhd.ExtFli", + FT_UINT16, BASE_DEC, VALS(fli_msgs), GRANT_MGMT_SUBHEADER_EXT_FLI_MASK, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_grant_mgmt_subhd_ext_fl, + { + "Frame Latency", "wmx.genericGrantSubhd.ExtFl", + FT_UINT16, BASE_DEC, NULL, GRANT_MGMT_SUBHEADER_EXT_FL_MASK, + NULL, HFILL } } - } - /* return the extended subheader length */ - return ext_length; -} - -static gint arq_feedback_payload_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *parent_item) -{ - gint length, i; - gint offset; - gint last_ie = 0; - gint ack_type, num_maps, seq_format; - gint word2, word3; - proto_item *ti = NULL; - proto_item *sub_ti = NULL; - proto_tree *sub_tree = NULL; + }; - /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) + /* ARQ Feedback Payload display */ + static hf_register_info hf_arq[] = { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "ARQ feedback payld"); - } - - /* add the MAC header info */ - proto_item_append_text(parent_item, ", ARQ feedback payload"); - - /* reset the offset */ - offset = 0; - - /* Get the tvb reported length */ - length = tvb_reported_length(tvb); - if (!length) - { /* display the error message */ - proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "Error: ARQ feedback payload tvb is empty ! (%u bytes)", length); - return length; - } - - /* display subheader type */ - ti = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "ARQ feedback payload "); - /* add extended subheader subtree */ - sub_tree = proto_item_add_subtree(ti, ett_mac_arq_fb_payload_decoder); - /* decode and display the ARQ Feedback IEs */ - while (!last_ie) - { /* decode and display CID */ - proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_cid, tvb, offset, 2, FALSE); - /* move to next 16-bit word */ - offset += 2; - /* Get the 2nd 16-bit */ - word2 = tvb_get_ntohs(tvb, offset); - /* get the last bit */ - last_ie = (word2 & ARQ_FB_IE_LAST_BIT_MASK); - /* get the ACK type */ - ack_type = ((word2 & ARQ_FB_IE_ACK_TYPE_MASK) >> 13); - /* get the number of ACK maps */ - num_maps = (word2 & ARQ_FB_IE_NUM_MAPS_MASK) + 1; - /* decode and display the 2nd word */ - proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_last, tvb, offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_ack_type, tvb, offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_bsn, tvb, offset, 2, FALSE); - /* decode and display the 3rd word */ - if (ack_type != 1) { - sub_ti = proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_num_maps, tvb, offset, 2, FALSE); - /* move to next 16-bit word */ - offset += 2; - proto_item_append_text(sub_ti, " (%d map(s))", num_maps); - for (i = 0; i < num_maps; i++) + &hf_mac_header_generic_arq_fb_ie_cid, { - if (ack_type != 3) - { - proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_sel_ack_map, tvb, offset, 2, FALSE); - } - else - { /* Get the next 16-bit */ - word3 = tvb_get_ntohs(tvb, offset); - /* get the sequence format */ - seq_format = (word3 & ARQ_FB_IE_SEQ_FORMAT_MASK); - /* decode and display the sequence format */ - proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_seq_format, tvb, offset, 2, FALSE); - if (!seq_format) - { - proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_seq_ack_map_2, tvb, offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_seq1_length_6, tvb, offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_seq2_length_6, tvb, offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_rsv, tvb, offset, 2, FALSE); - } - else - { - proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_seq_ack_map, tvb, offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_seq1_length, tvb, offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_seq2_length, tvb, offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_seq3_length, tvb, offset, 2, FALSE); - } - } - /* move to next 16-bit word */ - offset += 2; + "CID", "wmx.genericArq.FbIeCid", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } - } - else + }, { - /* Number of ACK Maps bits are reserved when ACK TYPE == 1 */ - proto_tree_add_item(sub_tree, hf_ack_type_reserved, tvb, offset, 2, FALSE); - /* move to next 16-bit word */ - offset += 2; + &hf_mac_header_generic_arq_fb_ie_last, + { + "Last IE", "wmx.genericArq.FbIeLast", + FT_UINT16, BASE_DEC, VALS(last_ie_msgs), ARQ_FB_IE_LAST_BIT_MASK, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_arq_fb_ie_ack_type, + { + "ACK Type", "wmx.genericArq.FbIeAckType", + FT_UINT16, BASE_DEC, NULL, ARQ_FB_IE_ACK_TYPE_MASK, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_arq_fb_ie_bsn, + { + "BSN", "wmx.genericArq.FbIeBsn", + FT_UINT16, BASE_DEC, NULL, ARQ_FB_IE_BSN_MASK, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_arq_fb_ie_num_maps, + { + "Number of ACK Maps", "wmx.genericArq.FbIeMaps", + FT_UINT16, BASE_DEC, NULL, ARQ_FB_IE_NUM_MAPS_MASK, + NULL, HFILL + } + }, + { + &hf_ack_type_reserved, + { + "Reserved", "wmx.genericArq.FbIeRsvd", FT_UINT16, BASE_DEC, NULL, 0x03, NULL, HFILL + } + }, + { + &hf_mac_header_generic_arq_fb_ie_sel_ack_map, + { + "Selective ACK Map", "wmx.genericArq.FbIeSelAckMap", + FT_UINT16, BASE_HEX, NULL, 0x0, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_arq_fb_ie_seq_format, + { + "Sequence Format", "wmx.genericArq.FbIeSeqFmt", + FT_UINT16, BASE_DEC, NULL, ARQ_FB_IE_SEQ_FORMAT_MASK, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_arq_fb_ie_seq_ack_map, + { + "Sequence ACK Map", "wmx.genericArq.FbIeSeqAckMap", + FT_UINT16, BASE_HEX, NULL, ARQ_FB_IE_SEQ_ACK_MAP_MASK, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_arq_fb_ie_seq1_length, + { + "Sequence 1 Length", "wmx.genericArq.FbIeSeq1Len", + FT_UINT16, BASE_DEC, NULL, ARQ_FB_IE_SEQ1_LENGTH_MASK, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_arq_fb_ie_seq2_length, + { + "Sequence 2 Length", "wmx.genericArq.FbIeSeq2Len", + FT_UINT16, BASE_DEC, NULL, ARQ_FB_IE_SEQ2_LENGTH_MASK, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_arq_fb_ie_seq3_length, + { + "Sequence 3 Length", "wmx.genericArq.FbIeSeq3Len", + FT_UINT16, BASE_DEC, NULL, ARQ_FB_IE_SEQ3_LENGTH_MASK, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_arq_fb_ie_seq_ack_map_2, + { + "Sequence ACK Map", "wmx.genericArq.FbIeSeqAckMap2", + FT_UINT16, BASE_HEX, NULL, ARQ_FB_IE_SEQ_ACK_MAP_2_MASK, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_arq_fb_ie_seq1_length_6, + { + "Sequence 1 Length", "wmx.genericArq.FbIeSeq1Len", + FT_UINT16, BASE_DEC, NULL, ARQ_FB_IE_SEQ1_LENGTH_6_MASK, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_arq_fb_ie_seq2_length_6, + { + "Sequence 2 Length", "wmx.genericArq.FbIeSeq2Len", + FT_UINT16, BASE_DEC, NULL, ARQ_FB_IE_SEQ2_LENGTH_6_MASK, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_arq_fb_ie_rsv, + { + "Reserved", "wmx.genericArq.FbIeRsv", + FT_UINT16, BASE_DEC, NULL, ARQ_FB_IE_RSV_MASK, + NULL, HFILL + } } - } - /* append text */ - proto_item_append_text(ti,"(%u bytes)", offset); - /* return the offset */ - return offset; + }; + + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_mac_header_generic_decoder, + /* &ett_mac_subheader_decoder, */ + &ett_mac_mesh_subheader_decoder, + &ett_mac_frag_subheader_decoder, + &ett_mac_grant_mgmt_subheader_decoder, + &ett_mac_pkt_subheader_decoder, + &ett_mac_fast_fb_subheader_decoder, + &ett_mac_ext_subheader_decoder, + &ett_mac_ext_subheader_dl_decoder, + &ett_mac_ext_subheader_ul_decoder, + &ett_mac_arq_fb_payload_decoder, + &ett_mac_data_pdu_decoder, + }; + + proto_mac_header_generic_decoder = proto_register_protocol ( + "WiMax Generic/Type1/Type2 MAC Header Messages", /* name */ + "WiMax Generic/Type1/Type2 MAC Header (hdr)", /* short name */ + "wmx.hdr" /* abbrev */ + ); + + /* register the field display messages */ + proto_register_field_array(proto_mac_header_generic_decoder, hf, array_length(hf)); + proto_register_field_array(proto_mac_header_generic_decoder, hf_ext, array_length(hf_ext)); + proto_register_field_array(proto_mac_header_generic_decoder, hf_mesh, array_length(hf_mesh)); + proto_register_field_array(proto_mac_header_generic_decoder, hf_frag, array_length(hf_frag)); + proto_register_field_array(proto_mac_header_generic_decoder, hf_pack, array_length(hf_pack)); + proto_register_field_array(proto_mac_header_generic_decoder, hf_fast, array_length(hf_fast)); + proto_register_field_array(proto_mac_header_generic_decoder, hf_grant, array_length(hf_grant)); + proto_register_field_array(proto_mac_header_generic_decoder, hf_arq, array_length(hf_arq)); + proto_register_subtree_array(ett, array_length(ett)); + + /* register the generic mac header dissector */ + register_dissector("mac_header_generic_handler", dissect_mac_header_generic_decoder, proto_mac_header_generic_decoder); + /* register the mac payload dissector */ + proto_register_mac_mgmt_msg(); + /* Register the payload fragment table init routine */ + register_init_routine(wimax_defragment_init); } diff --git a/plugins/wimax/mac_hd_type1_decoder.c b/plugins/wimax/mac_hd_type1_decoder.c index 1344ab018c..802dc327bc 100644 --- a/plugins/wimax/mac_hd_type1_decoder.c +++ b/plugins/wimax/mac_hd_type1_decoder.c @@ -41,17 +41,11 @@ #define DEBUG */ -#include "moduleinfo.h" - #include #include 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; @@ -215,11 +209,132 @@ static const value_string last_msgs[] = { 0, NULL} }; -/* Setup protocol subtree array */ -static gint *ett[] = +void dissect_mac_header_type_1_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - &ett_mac_header_type_1_decoder, -}; + 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 reported length */ + tvb_len = tvb_reported_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); + } +} /* Register Wimax Mac Header Type II Protocol and Dissector */ void proto_register_mac_header_type_1(void) @@ -437,139 +552,16 @@ 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; + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_mac_header_type_1_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); -} + proto_mac_header_type_1_decoder = proto_mac_header_generic_decoder; -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; + proto_register_field_array(proto_mac_header_type_1_decoder, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); - if (tree) - { /* we are being asked for details */ - /* Get the tvb reported length */ - tvb_len = tvb_reported_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); - } + register_dissector("mac_header_type_1_handler", dissect_mac_header_type_1_decoder, -1); } diff --git a/plugins/wimax/mac_hd_type2_decoder.c b/plugins/wimax/mac_hd_type2_decoder.c index 80d3e85de6..de0e015a59 100644 --- a/plugins/wimax/mac_hd_type2_decoder.c +++ b/plugins/wimax/mac_hd_type2_decoder.c @@ -41,27 +41,15 @@ #include "config.h" #endif -#include "moduleinfo.h" - #include #include 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 */ @@ -393,658 +381,81 @@ static const value_string ai_msgs[] = { 0, NULL} }; -/* Register Wimax Mac Header Type II Protocol and Dissector */ -void proto_register_mac_header_type_2(void) + +void dissect_mac_header_type_2_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - /* MAC HEADER TYPE II display */ - static hf_register_info hf[] = - { - { - &hf_mac_header_type_2_value_bytes, - { - "Values", "wmx.type2ValueBytes", - FT_BYTES, BASE_NONE, NULL, 0x0, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_ht, - { - "MAC Header Type", "wmx.type2Ht", - FT_UINT8, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_HT, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_ec, - { - "MAC Encryption Control", "wmx.type2Ec", - FT_UINT8, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_EC, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_type, - { - "MAC Sub-Type", "wmx.type2Type", - FT_UINT8, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_TYPE, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_cii, - { - "CID Inclusion Indication", "wmx.type2Cii", - FT_UINT8, BASE_DEC, VALS(cii_msgs), WIMAX_MAC_HEADER_TYPE_2_CII, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_fb_type, - { - "Feedback Type", "wmx.type2FbType", - FT_UINT8, BASE_DEC, VALS(fb_types), WIMAX_MAC_HEADER_TYPE_2_FB_TYPE, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_cqi_fb_type, - { - "Mimo Feedback Type", "wmx.type2MimoFbType", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CQI_FB_TYPE, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_cqi_payload, - { - "CQI and Mimo Feedback Payload", "wmx.type2MimoFbPayload", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CQI_PAYLOAD, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_cqi_rsv, - { - "Reserved", "wmx.type2MimoFbRsv", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CQI_RSV, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_dl_ave_cinr, - { - "DL Average CINR", "wmx.type2DlAveCinr", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_DL_AVE_CINR, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_dl_ave_rsv, - { - "Reserved", "wmx.type2DlAveRsv", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_DL_AVE_RSV, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_mimo_coef_ni, - { - "Number of Index", "wmx.type2MimoCoefNi", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_MIMO_COEF_NI, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_mimo_coef_ai, - { - "Occurrences of Antenna Index", "wmx.type2MimoCoefAi", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_MIMO_COEF_AI, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_mimo_coef, - { - "MIMO Coefficients", "wmx.type2MimoCoef", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_MIMO_COEF, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_mimo_coef_rsv, - { - "Reserved", "wmx.type2MimoCoefRsv", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_MIMO_COEF_RSV, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_dl_chan_diuc, - { - "Preferred DIUC", "wmx.type2DlChanDiuc", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_DL_CHAN_DIUC, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_dl_chan_dcd, - { - "DCD Change Count", "wmx.type2DlChanDcd", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_DL_CHAN_DCD, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_dl_chan_rsv, - { - "Reserved", "wmx.type2DlChanRsv", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_DL_CHAN_RSV, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_ul_tx_pwr, - { - "UL TX Power", "wmx.type2UlTxPwr", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_UL_TX_PWR, - NULL, HFILL - } - }, + gint tvb_len, offset = 0; + guint cii_bit, first_byte, fb_type, mimo_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 reported length */ + tvb_len = tvb_reported_length(tvb); + /* display the MAC Type II Header message */ + ti = proto_tree_add_protocol_format(tree, proto_mac_header_type_2_decoder, tvb, offset, tvb_len, "Mac Type II Header (6 bytes)"); + /* add subtree */ + ti_tree = proto_item_add_subtree(ti, ett_mac_header_type_2_decoder); + if(tvb_len < WIMAX_MAC_HEADER_SIZE) { - &hf_mac_header_type_2_ul_tx_pwr_rsv, - { - "Reserved", "wmx.type2UlTxPwrRsv", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_UL_TX_PWR_RSV, - NULL, HFILL - } - }, + /* display the error message */ + proto_tree_add_protocol_format(ti_tree, proto_mac_header_type_2_decoder, tvb, offset, tvb_len, "Error: the size of Mac Header Type II tvb is too small! (%u bytes)", tvb_len); + /* display the MAC Type II Header in Hex */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_value_bytes, tvb, offset, tvb_len, FALSE); + return; + } +#ifdef DEBUG + /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) { - &hf_mac_header_type_2_phy_diuc, - { - "Preferred DIUC Index", "wmx.type2PhyDiuc", - FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_PHY_DIUC, - NULL, HFILL - } - }, + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "MAC Signaling Header Type II"); + } +#endif + /* get the parent */ + parent_item = proto_tree_get_parent(tree); + /* Decode and display the first byte of the header */ + /* header type */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_ht, tvb, offset, 1, FALSE); + /* encryption control */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_ec, tvb, offset, 1, FALSE); + /* sub-type */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_type, tvb, offset, 1, FALSE); + /* CID inclusion indication */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cii, tvb, offset, 1, FALSE); + /* feedback type */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_fb_type, tvb, offset, 1, FALSE); + /* Get the first byte */ + first_byte = tvb_get_guint8(tvb, offset); + /* get the CII field */ + cii_bit = ((first_byte & WIMAX_MAC_HEADER_TYPE_2_CII)?1:0); + /* check the Type field */ + if(!(first_byte & WIMAX_MAC_HEADER_TYPE_2_TYPE)) { - &hf_mac_header_type_2_phy_ul_tx_pwr, + /* Get the feedback type */ + fb_type = (first_byte & WIMAX_MAC_HEADER_TYPE_2_FB_TYPE); + if(fb_type < TYPE_II_FB_TYPE_MAX) { - "UL TX Power", "wmx.type2PhyUlTxPwr", - FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_PHY_UL_TX_PWR, - NULL, HFILL + /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, type2_fb_type_abbrv[fb_type]); } - }, - { - &hf_mac_header_type_2_phy_ul_hdrm, + else { - "UL Headroom", "wmx.type2PhyHdRm", - FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_PHY_UL_HDRM, - NULL, HFILL + /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Unknown type 2 fb type"); + /* display the MAC Type I Header in Hex */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_value_bytes, tvb, offset, tvb_len, FALSE); + return; } - }, - { - &hf_mac_header_type_2_phy_rsv, - { - "Reserved", "wmx.type2PhyRsv", - FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_PHY_RSV, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_amc_bitmap, - { - "AMC Band Indication Bitmap", "wmx.type2AmcBitmap", - FT_UINT32, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_AMC_BITMAP, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_amc_cqi_1, - { - "CQI 1", "wmx.type2AmcCqi1", - FT_UINT32, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_AMC_CQI_1, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_amc_cqi_2, - { - "CQI 2", "wmx.type2AmcCqi2", - FT_UINT32, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_AMC_CQI_2, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_amc_cqi_3, - { - "CQI 3", "wmx.type2AmcCqi3", - FT_UINT32, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_AMC_CQI_3, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_amc_cqi_4, - { - "CQI 4", "wmx.type2AmcCqi4", - FT_UINT32, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_AMC_CQI_4, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_life_span, - { - "Life Span of Short-term", "wmx.type2LifeSpan", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_LIFE_SPAN, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_life_span_rsv, - { - "Reserved", "wmx.type2LifeSpanRsv", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_LIFE_SPAN_RSV, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_mt_num_fb_types, - { - "Number of Feedback Types", "wmx.type2MtNumFbTypes", - FT_UINT32, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_MT_NUM_FB_TYPES, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_mt_occu_fb_type, - { - "Occurrences of Feedback Type", "wmx.type2MtOccuFbType", - FT_UINT32, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_MT_OCCU_FB_TYPE, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_mt_fb_contents, - { - "Number of Feedback Types", "wmx.type2MtNumFbTypes", - FT_UINT32, BASE_HEX, NULL, WIMAX_MAC_HEADER_TYPE_2_MT_FB_CONTENTS, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_lt_id_fb, - { - "Long-term Feedback Index", "wmx.type2LtFbId", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_LT_ID_FB, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_lt_rank, - { - "Rank of Precoding Codebook", "wmx.type2LtRank", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_LT_RANK, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_lt_fec_qam, - { - "FEC and QAM", "wmx.type2LtFecQam", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_LT_FEC_QAM, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_lt_rsv, - { - "Reserved", "wmx.type2LtFbId", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_LT_RSV, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_comb_dl_ave, - { - "Combined DL Average CINR of Active BSs", "wmx.type2CombDlAve", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_COMB_DL_AVE, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_comb_dl_rsv, - { - "Reserved", "wmx.type2CombDlRsv", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_COMB_DL_RSV, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_mimo_diuc, - { - "Preferred DIUC Index", "wmx.type2MimoDiuc", - FT_UINT8, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_DIUC, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_mimo_pbwi, - { - "Preferred Bandwidth Index", "wmx.type2MimoPbwi", - FT_UINT8, BASE_DEC, VALS(pbwi_table), WIMAX_MAC_HEADER_TYPE_2_PBWI, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_mimo_slpb, - { - "Starting Location of Preferred Bandwidth", "wmx.type2MimoSlpb", - FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_SLPB, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_mimo_bpri_cid, - { - "Burst Profile Ranking Indicator with CID", "wmx.type2MimoBpriCid", - FT_UINT24, BASE_HEX, VALS(bpri_table), WIMAX_MAC_HEADER_TYPE_2_PBRI_CID, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_mimo_cid, - { - "Connection ID", "wmx.type2MimoCid", - FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CID, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_mimo_bpri, - { - "Burst Profile Ranking Indicator without CID", "wmx.type2MimoBpri", - FT_UINT24, BASE_HEX, VALS(bpri_table), WIMAX_MAC_HEADER_TYPE_2_PBRI, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_mimo_cti, - { - "Coherent Time Index", "wmx.type2MimoCti", - FT_UINT24, BASE_HEX, VALS(cti_table), WIMAX_MAC_HEADER_TYPE_2_CTI, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_mimo_ai_0, - { - "Antenna 0 Indication", "wmx.type2MimoAi", - FT_UINT24, BASE_HEX, VALS(ai_msgs), WIMAX_MAC_HEADER_TYPE_2_AI_0, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_mimo_ai_1, - { - "Antenna 1 Indication", "wmx.type2MimoAi", - FT_UINT24, BASE_HEX, VALS(ai_msgs), WIMAX_MAC_HEADER_TYPE_2_AI_1, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_mimo_ai_2, - { - "Antenna 2 Indication", "wmx.type2MimoAi", - FT_UINT24, BASE_HEX, VALS(ai_msgs), WIMAX_MAC_HEADER_TYPE_2_AI_2, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_mimo_ai_3, - { - "Antenna 3 Indication", "wmx.type2MimoAi", - FT_UINT24, BASE_HEX, VALS(ai_msgs), WIMAX_MAC_HEADER_TYPE_2_AI_3, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_mimo_mi, - { - "MS Matrix Indicator", "wmx.type2MimoMi", - FT_UINT24, BASE_HEX, VALS(mi_table), WIMAX_MAC_HEADER_TYPE_2_MI, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_mimo_ct, - { - "CQI Type", "wmx.type2MimoCt", - FT_UINT24, BASE_HEX, VALS(ct_msgs), WIMAX_MAC_HEADER_TYPE_2_CT, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_mimo_cqi, - { - "CQI Feedback", "wmx.type2MimoCqi", - FT_UINT24, BASE_HEX, NULL, WIMAX_MAC_HEADER_TYPE_2_CQI, - NULL, HFILL - } - }, - { &hf_mac_header_type_2_cinr_mean, - { - "CINR Mean", "wmx.type2CinrMean", - FT_UINT8, BASE_HEX, NULL, 0x0, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_cinr_devi, - { - "CINR Standard Deviation", "wmx.type2CinrDevi", - FT_UINT8, BASE_HEX, NULL, 0x0, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_cl_mimo_type, - { - "Closed-Loop MIMO Type", "wmx.type2ClMimoType", - FT_UINT16, BASE_HEX, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_TYPE, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_cl_mimo_ant_id, - { - "Antenna Grouping Index", "wmx.type2ClMimoAntId", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_ANT_ID, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_cl_mimo_cqi, - { - "Average CQI", "wmx.type2ClMimoCqi", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_CQI, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_cl_mimo_cqi_1, - { - "Average CQI", "wmx.type2ClMimoCqi", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_CQI_1, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_cl_mimo_cqi_2, - { - "Average CQI", "wmx.type2ClMimoCqi", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_CQI_2, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_cl_mimo_rsv, - { - "Reserved", "wmx.type2ClMimoRsv", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_RSV, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_cl_mimo_rsv_1, - { - "Reserved", "wmx.type2ClMimoRsv", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_RSV_1, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_cl_mimo_rsv_2, - { - "Reserved", "wmx.type2ClMimoRsv", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_RSV_2, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_cl_mimo_streams, - { - "Number of Streams", "wmx.type2ClMimoStreams", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_STREAMS, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_cl_mimo_ant_sel, - { - "Antenna Selection Option Index", "wmx.type2ClMimoAntSel", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_ANT_SEL, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_cl_mimo_codebook_id, - { - "Codebook Index", "wmx.type2ClMimoCodeBkId", - FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_CODEBOOK_ID, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_cid, - { - "Connection ID", "wmx.type2Cid", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_no_cid, - { - "Reserved", "wmx.type2NoCid", - FT_UINT16, BASE_HEX, NULL, 0x0, - NULL, HFILL - } - }, - { - &hf_mac_header_type_2_hcs, - { - "Header Check Sequence", "wmx.type2Hcs", - FT_UINT8, BASE_HEX, NULL, 0x0, - NULL, HFILL - } - } - }; - - if (proto_mac_header_type_2_decoder == -1) - { - proto_mac_header_type_2_decoder = proto_mac_header_generic_decoder; - - proto_register_field_array(proto_mac_header_type_2_decoder, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - } - register_dissector("mac_header_type_2_handler", dissect_mac_header_type_2_decoder, -1); -} - - -void dissect_mac_header_type_2_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ - gint tvb_len, offset = 0; - guint cii_bit, first_byte, fb_type, mimo_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 reported length */ - tvb_len = tvb_reported_length(tvb); - /* display the MAC Type II Header message */ - ti = proto_tree_add_protocol_format(tree, proto_mac_header_type_2_decoder, tvb, offset, tvb_len, "Mac Type II Header (6 bytes)"); - /* add subtree */ - ti_tree = proto_item_add_subtree(ti, ett_mac_header_type_2_decoder); - if(tvb_len < WIMAX_MAC_HEADER_SIZE) - { - /* display the error message */ - proto_tree_add_protocol_format(ti_tree, proto_mac_header_type_2_decoder, tvb, offset, tvb_len, "Error: the size of Mac Header Type II tvb is too small! (%u bytes)", tvb_len); - /* display the MAC Type II Header in Hex */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_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, "MAC Signaling Header Type II"); - } -#endif - /* get the parent */ - parent_item = proto_tree_get_parent(tree); - /* Decode and display the first byte of the header */ - /* header type */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_ht, tvb, offset, 1, FALSE); - /* encryption control */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_ec, tvb, offset, 1, FALSE); - /* sub-type */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_type, tvb, offset, 1, FALSE); - /* CID inclusion indication */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cii, tvb, offset, 1, FALSE); - /* feedback type */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_fb_type, tvb, offset, 1, FALSE); - /* Get the first byte */ - first_byte = tvb_get_guint8(tvb, offset); - /* get the CII field */ - cii_bit = ((first_byte & WIMAX_MAC_HEADER_TYPE_2_CII)?1:0); - /* check the Type field */ - if(!(first_byte & WIMAX_MAC_HEADER_TYPE_2_TYPE)) - { - /* Get the feedback type */ - fb_type = (first_byte & WIMAX_MAC_HEADER_TYPE_2_FB_TYPE); - if(fb_type < TYPE_II_FB_TYPE_MAX) - { - /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, type2_fb_type_abbrv[fb_type]); - } - else - { - /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Unknown type 2 fb type"); - /* display the MAC Type I Header in Hex */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_value_bytes, tvb, offset, tvb_len, FALSE); - return; - } - /* move to the second byte */ - offset++; - /* add the MAC header info */ - proto_item_append_text(parent_item, "%s", type2_fb_type_abbrv[fb_type]); - /* process the feedback header based on the fb type */ - switch (fb_type) + /* move to the second byte */ + offset++; + /* add the MAC header info */ + proto_item_append_text(parent_item, "%s", type2_fb_type_abbrv[fb_type]); + /* process the feedback header based on the fb type */ + switch (fb_type) { case CQI_MIMO_FB: /* Decode and display the CQI and MIMO feedback */ @@ -1374,16 +785,597 @@ void dissect_mac_header_type_2_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_ default: break; } - /* Decode and display the HCS */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_hcs, tvb, (offset+4), 1, FALSE); - } - else + /* Decode and display the HCS */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_hcs, tvb, (offset+4), 1, FALSE); + } + else + { + /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Error - Undefined Type"); + } + } + } +} + +/* Register Wimax Mac Header Type II Protocol and Dissector */ +void proto_register_mac_header_type_2(void) +{ + /* MAC HEADER TYPE II display */ + static hf_register_info hf[] = + { + { + &hf_mac_header_type_2_value_bytes, + { + "Values", "wmx.type2ValueBytes", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_ht, + { + "MAC Header Type", "wmx.type2Ht", + FT_UINT8, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_HT, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_ec, + { + "MAC Encryption Control", "wmx.type2Ec", + FT_UINT8, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_EC, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_type, + { + "MAC Sub-Type", "wmx.type2Type", + FT_UINT8, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_TYPE, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_cii, + { + "CID Inclusion Indication", "wmx.type2Cii", + FT_UINT8, BASE_DEC, VALS(cii_msgs), WIMAX_MAC_HEADER_TYPE_2_CII, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_fb_type, + { + "Feedback Type", "wmx.type2FbType", + FT_UINT8, BASE_DEC, VALS(fb_types), WIMAX_MAC_HEADER_TYPE_2_FB_TYPE, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_cqi_fb_type, + { + "Mimo Feedback Type", "wmx.type2MimoFbType", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CQI_FB_TYPE, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_cqi_payload, + { + "CQI and Mimo Feedback Payload", "wmx.type2MimoFbPayload", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CQI_PAYLOAD, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_cqi_rsv, + { + "Reserved", "wmx.type2MimoFbRsv", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CQI_RSV, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_dl_ave_cinr, + { + "DL Average CINR", "wmx.type2DlAveCinr", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_DL_AVE_CINR, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_dl_ave_rsv, + { + "Reserved", "wmx.type2DlAveRsv", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_DL_AVE_RSV, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_mimo_coef_ni, + { + "Number of Index", "wmx.type2MimoCoefNi", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_MIMO_COEF_NI, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_mimo_coef_ai, + { + "Occurrences of Antenna Index", "wmx.type2MimoCoefAi", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_MIMO_COEF_AI, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_mimo_coef, + { + "MIMO Coefficients", "wmx.type2MimoCoef", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_MIMO_COEF, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_mimo_coef_rsv, + { + "Reserved", "wmx.type2MimoCoefRsv", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_MIMO_COEF_RSV, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_dl_chan_diuc, + { + "Preferred DIUC", "wmx.type2DlChanDiuc", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_DL_CHAN_DIUC, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_dl_chan_dcd, + { + "DCD Change Count", "wmx.type2DlChanDcd", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_DL_CHAN_DCD, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_dl_chan_rsv, + { + "Reserved", "wmx.type2DlChanRsv", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_DL_CHAN_RSV, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_ul_tx_pwr, + { + "UL TX Power", "wmx.type2UlTxPwr", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_UL_TX_PWR, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_ul_tx_pwr_rsv, + { + "Reserved", "wmx.type2UlTxPwrRsv", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_UL_TX_PWR_RSV, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_phy_diuc, + { + "Preferred DIUC Index", "wmx.type2PhyDiuc", + FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_PHY_DIUC, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_phy_ul_tx_pwr, + { + "UL TX Power", "wmx.type2PhyUlTxPwr", + FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_PHY_UL_TX_PWR, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_phy_ul_hdrm, + { + "UL Headroom", "wmx.type2PhyHdRm", + FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_PHY_UL_HDRM, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_phy_rsv, + { + "Reserved", "wmx.type2PhyRsv", + FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_PHY_RSV, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_amc_bitmap, + { + "AMC Band Indication Bitmap", "wmx.type2AmcBitmap", + FT_UINT32, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_AMC_BITMAP, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_amc_cqi_1, + { + "CQI 1", "wmx.type2AmcCqi1", + FT_UINT32, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_AMC_CQI_1, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_amc_cqi_2, + { + "CQI 2", "wmx.type2AmcCqi2", + FT_UINT32, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_AMC_CQI_2, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_amc_cqi_3, + { + "CQI 3", "wmx.type2AmcCqi3", + FT_UINT32, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_AMC_CQI_3, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_amc_cqi_4, + { + "CQI 4", "wmx.type2AmcCqi4", + FT_UINT32, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_AMC_CQI_4, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_life_span, + { + "Life Span of Short-term", "wmx.type2LifeSpan", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_LIFE_SPAN, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_life_span_rsv, + { + "Reserved", "wmx.type2LifeSpanRsv", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_LIFE_SPAN_RSV, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_mt_num_fb_types, + { + "Number of Feedback Types", "wmx.type2MtNumFbTypes", + FT_UINT32, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_MT_NUM_FB_TYPES, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_mt_occu_fb_type, + { + "Occurrences of Feedback Type", "wmx.type2MtOccuFbType", + FT_UINT32, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_MT_OCCU_FB_TYPE, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_mt_fb_contents, + { + "Number of Feedback Types", "wmx.type2MtNumFbTypes", + FT_UINT32, BASE_HEX, NULL, WIMAX_MAC_HEADER_TYPE_2_MT_FB_CONTENTS, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_lt_id_fb, + { + "Long-term Feedback Index", "wmx.type2LtFbId", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_LT_ID_FB, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_lt_rank, + { + "Rank of Precoding Codebook", "wmx.type2LtRank", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_LT_RANK, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_lt_fec_qam, + { + "FEC and QAM", "wmx.type2LtFecQam", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_LT_FEC_QAM, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_lt_rsv, + { + "Reserved", "wmx.type2LtFbId", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_LT_RSV, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_comb_dl_ave, + { + "Combined DL Average CINR of Active BSs", "wmx.type2CombDlAve", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_COMB_DL_AVE, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_comb_dl_rsv, + { + "Reserved", "wmx.type2CombDlRsv", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_COMB_DL_RSV, + NULL, HFILL + } + }, { - /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) + &hf_mac_header_type_2_mimo_diuc, { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Error - Undefined Type"); + "Preferred DIUC Index", "wmx.type2MimoDiuc", + FT_UINT8, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_DIUC, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_mimo_pbwi, + { + "Preferred Bandwidth Index", "wmx.type2MimoPbwi", + FT_UINT8, BASE_DEC, VALS(pbwi_table), WIMAX_MAC_HEADER_TYPE_2_PBWI, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_mimo_slpb, + { + "Starting Location of Preferred Bandwidth", "wmx.type2MimoSlpb", + FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_SLPB, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_mimo_bpri_cid, + { + "Burst Profile Ranking Indicator with CID", "wmx.type2MimoBpriCid", + FT_UINT24, BASE_HEX, VALS(bpri_table), WIMAX_MAC_HEADER_TYPE_2_PBRI_CID, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_mimo_cid, + { + "Connection ID", "wmx.type2MimoCid", + FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CID, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_mimo_bpri, + { + "Burst Profile Ranking Indicator without CID", "wmx.type2MimoBpri", + FT_UINT24, BASE_HEX, VALS(bpri_table), WIMAX_MAC_HEADER_TYPE_2_PBRI, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_mimo_cti, + { + "Coherent Time Index", "wmx.type2MimoCti", + FT_UINT24, BASE_HEX, VALS(cti_table), WIMAX_MAC_HEADER_TYPE_2_CTI, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_mimo_ai_0, + { + "Antenna 0 Indication", "wmx.type2MimoAi", + FT_UINT24, BASE_HEX, VALS(ai_msgs), WIMAX_MAC_HEADER_TYPE_2_AI_0, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_mimo_ai_1, + { + "Antenna 1 Indication", "wmx.type2MimoAi", + FT_UINT24, BASE_HEX, VALS(ai_msgs), WIMAX_MAC_HEADER_TYPE_2_AI_1, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_mimo_ai_2, + { + "Antenna 2 Indication", "wmx.type2MimoAi", + FT_UINT24, BASE_HEX, VALS(ai_msgs), WIMAX_MAC_HEADER_TYPE_2_AI_2, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_mimo_ai_3, + { + "Antenna 3 Indication", "wmx.type2MimoAi", + FT_UINT24, BASE_HEX, VALS(ai_msgs), WIMAX_MAC_HEADER_TYPE_2_AI_3, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_mimo_mi, + { + "MS Matrix Indicator", "wmx.type2MimoMi", + FT_UINT24, BASE_HEX, VALS(mi_table), WIMAX_MAC_HEADER_TYPE_2_MI, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_mimo_ct, + { + "CQI Type", "wmx.type2MimoCt", + FT_UINT24, BASE_HEX, VALS(ct_msgs), WIMAX_MAC_HEADER_TYPE_2_CT, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_mimo_cqi, + { + "CQI Feedback", "wmx.type2MimoCqi", + FT_UINT24, BASE_HEX, NULL, WIMAX_MAC_HEADER_TYPE_2_CQI, + NULL, HFILL + } + }, + { &hf_mac_header_type_2_cinr_mean, + { + "CINR Mean", "wmx.type2CinrMean", + FT_UINT8, BASE_HEX, NULL, 0x0, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_cinr_devi, + { + "CINR Standard Deviation", "wmx.type2CinrDevi", + FT_UINT8, BASE_HEX, NULL, 0x0, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_cl_mimo_type, + { + "Closed-Loop MIMO Type", "wmx.type2ClMimoType", + FT_UINT16, BASE_HEX, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_TYPE, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_cl_mimo_ant_id, + { + "Antenna Grouping Index", "wmx.type2ClMimoAntId", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_ANT_ID, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_cl_mimo_cqi, + { + "Average CQI", "wmx.type2ClMimoCqi", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_CQI, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_cl_mimo_cqi_1, + { + "Average CQI", "wmx.type2ClMimoCqi", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_CQI_1, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_cl_mimo_cqi_2, + { + "Average CQI", "wmx.type2ClMimoCqi", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_CQI_2, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_cl_mimo_rsv, + { + "Reserved", "wmx.type2ClMimoRsv", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_RSV, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_cl_mimo_rsv_1, + { + "Reserved", "wmx.type2ClMimoRsv", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_RSV_1, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_cl_mimo_rsv_2, + { + "Reserved", "wmx.type2ClMimoRsv", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_RSV_2, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_cl_mimo_streams, + { + "Number of Streams", "wmx.type2ClMimoStreams", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_STREAMS, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_cl_mimo_ant_sel, + { + "Antenna Selection Option Index", "wmx.type2ClMimoAntSel", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_ANT_SEL, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_cl_mimo_codebook_id, + { + "Codebook Index", "wmx.type2ClMimoCodeBkId", + FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_CODEBOOK_ID, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_cid, + { + "Connection ID", "wmx.type2Cid", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_no_cid, + { + "Reserved", "wmx.type2NoCid", + FT_UINT16, BASE_HEX, NULL, 0x0, + NULL, HFILL + } + }, + { + &hf_mac_header_type_2_hcs, + { + "Header Check Sequence", "wmx.type2Hcs", + FT_UINT8, BASE_HEX, NULL, 0x0, + NULL, HFILL } } - } + }; + + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_mac_header_type_2_decoder, + }; + + proto_mac_header_type_2_decoder = proto_mac_header_generic_decoder; + + proto_register_field_array(proto_mac_header_type_2_decoder, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + + register_dissector("mac_header_type_2_handler", dissect_mac_header_type_2_decoder, -1); } diff --git a/plugins/wimax/mac_mgmt_msg_decoder.c b/plugins/wimax/mac_mgmt_msg_decoder.c index 30c15dec19..1f8c137ef5 100644 --- a/plugins/wimax/mac_mgmt_msg_decoder.c +++ b/plugins/wimax/mac_mgmt_msg_decoder.c @@ -32,8 +32,6 @@ #include "config.h" #endif -#include "moduleinfo.h" - #include #include #include "wimax_mac.h" @@ -109,10 +107,6 @@ extern void dissect_mac_mgmt_msg_rep_rsp_decoder(tvbuff_t *tvb, packet_info *pin extern void dissect_mac_mgmt_msg_clk_cmp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); extern void dissect_mac_mgmt_msg_dsx_rvd_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); -/* forward reference */ -void proto_register_mac_mgmt_msg(void); -void dissect_mac_mgmt_msg_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - static gint proto_mac_mgmt_msg_decoder = -1; static gint ett_mac_mgmt_msg_decoder = -1; @@ -188,89 +182,9 @@ char *mgt_msg_abbrv[MAC_MGMT_MSG_TYPE_MAX] = "MOB-ASC-REP" }; -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_mac_mgmt_msg_decoder, -}; - static gint hf_mac_mgmt_msg_values = -1; static gint hf_mac_mgmt_msg_unknown_type = -1; -/* Register Wimax Mac Payload Protocol and Dissector */ -void proto_register_mac_mgmt_msg(void) -{ - /* Payload display */ - static hf_register_info hf[] = - { - { - &hf_mac_mgmt_msg_values, - { - "Values", "wmx.values", - FT_BYTES, BASE_NONE, NULL, 0x0, - NULL, HFILL - } - }, - { - &hf_mac_mgmt_msg_unknown_type, - { - "Unknown MAC Message Type", "wmx.unknown_type", - FT_BYTES, BASE_NONE, NULL, 0x0, - NULL, HFILL - } - } - }; - - if (proto_mac_mgmt_msg_decoder == -1) - { - proto_mac_mgmt_msg_decoder = proto_wimax; -#if 0 - proto_mac_mgmt_msg_decoder = proto_register_protocol ( - "WiMax MAC Management Message", /* name */ - "MGMT MSG", /* short name */ - "wmx.mgmtmsg" /* abbrev */ - ); -#endif - - proto_register_field_array(proto_mac_mgmt_msg_decoder, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - } - - /* Register dissector by name */ - register_dissector("wmx_mac_mgmt_msg_decoder", dissect_mac_mgmt_msg_decoder, - proto_mac_mgmt_msg_decoder); - - proto_register_mac_mgmt_msg_dcd(); - proto_register_mac_mgmt_msg_ucd(); - proto_register_mac_mgmt_msg_dlmap(); - proto_register_mac_mgmt_msg_ulmap(); - proto_register_mac_mgmt_msg_rng_req(); - proto_register_mac_mgmt_msg_rng_rsp(); - proto_register_mac_mgmt_msg_reg_req(); - proto_register_mac_mgmt_msg_reg_rsp(); - proto_register_mac_mgmt_msg_dsa(); - proto_register_mac_mgmt_msg_dsc(); - proto_register_mac_mgmt_msg_dsd(); - proto_register_mac_mgmt_msg_arq_feedback(); - proto_register_mac_mgmt_msg_arq_discard(); - proto_register_mac_mgmt_msg_arq_reset(); - proto_register_mac_mgmt_msg_dreg_req(); - proto_register_mac_mgmt_msg_dreg_cmd(); - proto_register_mac_mgmt_msg_fpc(); - proto_register_mac_mgmt_msg_sbc(); - proto_register_mac_mgmt_msg_pkm(); - proto_register_mac_mgmt_msg_pmc_req(); - proto_register_mac_mgmt_msg_pmc_rsp(); - proto_register_mac_mgmt_msg_prc_lt_ctrl(); - proto_register_mac_mgmt_msg_aas_fbck(); - proto_register_mac_mgmt_msg_aas_beam(); - proto_register_mac_mgmt_msg_res_cmd(); - proto_register_mac_mgmt_msg_rep(); - proto_register_mac_mgmt_msg_clk_cmp(); - proto_register_mac_mgmt_msg_dsx_rvd(); - - proto_register_wimax_utility_decoders(); -} void dissect_mac_mgmt_msg_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { @@ -879,3 +793,81 @@ void dissect_mac_mgmt_msg_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree } } } + +/* Register Wimax Mac Payload Protocol and Dissector */ +void proto_register_mac_mgmt_msg(void) +{ + /* Payload display */ + static hf_register_info hf[] = + { + { + &hf_mac_mgmt_msg_values, + { + "Values", "wmx.values", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL + } + }, + { + &hf_mac_mgmt_msg_unknown_type, + { + "Unknown MAC Message Type", "wmx.unknown_type", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL + } + } + }; + + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_mac_mgmt_msg_decoder, + }; + + proto_mac_mgmt_msg_decoder = proto_wimax; +#if 0 + proto_mac_mgmt_msg_decoder = proto_register_protocol ( + "WiMax MAC Management Message", /* name */ + "MGMT MSG", /* short name */ + "wmx.mgmtmsg" /* abbrev */ + ); +#endif + + proto_register_field_array(proto_mac_mgmt_msg_decoder, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + + /* Register dissector by name */ + register_dissector("wmx_mac_mgmt_msg_decoder", dissect_mac_mgmt_msg_decoder, + proto_mac_mgmt_msg_decoder); + + proto_register_mac_mgmt_msg_dcd(); + proto_register_mac_mgmt_msg_ucd(); + proto_register_mac_mgmt_msg_dlmap(); + proto_register_mac_mgmt_msg_ulmap(); + proto_register_mac_mgmt_msg_rng_req(); + proto_register_mac_mgmt_msg_rng_rsp(); + proto_register_mac_mgmt_msg_reg_req(); + proto_register_mac_mgmt_msg_reg_rsp(); + proto_register_mac_mgmt_msg_dsa(); + proto_register_mac_mgmt_msg_dsc(); + proto_register_mac_mgmt_msg_dsd(); + proto_register_mac_mgmt_msg_arq_feedback(); + proto_register_mac_mgmt_msg_arq_discard(); + proto_register_mac_mgmt_msg_arq_reset(); + proto_register_mac_mgmt_msg_dreg_req(); + proto_register_mac_mgmt_msg_dreg_cmd(); + proto_register_mac_mgmt_msg_fpc(); + proto_register_mac_mgmt_msg_sbc(); + proto_register_mac_mgmt_msg_pkm(); + proto_register_mac_mgmt_msg_pmc_req(); + proto_register_mac_mgmt_msg_pmc_rsp(); + proto_register_mac_mgmt_msg_prc_lt_ctrl(); + proto_register_mac_mgmt_msg_aas_fbck(); + proto_register_mac_mgmt_msg_aas_beam(); + proto_register_mac_mgmt_msg_res_cmd(); + proto_register_mac_mgmt_msg_rep(); + proto_register_mac_mgmt_msg_clk_cmp(); + proto_register_mac_mgmt_msg_dsx_rvd(); + + proto_register_wimax_utility_decoders(); +} diff --git a/plugins/wimax/msg_aas_beam.c b/plugins/wimax/msg_aas_beam.c index 634aa25e56..41d60a016c 100644 --- a/plugins/wimax/msg_aas_beam.c +++ b/plugins/wimax/msg_aas_beam.c @@ -49,26 +49,10 @@ extern gint proto_mac_mgmt_msg_aas_fbck_decoder; #define AAS_BEAM_BEAM_BIT_MASK_MASK 0xF0 #define AAS_BEAM_RESERVED_MASK 0x0F -/* forward reference */ -void proto_register_mac_mgmt_msg_aas_beam(void); -void dissect_mac_mgmt_msg_aas_beam_select_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); -#ifdef OFDM -static void dissect_mac_mgmt_msg_aas_beam_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); -static void dissect_mac_mgmt_msg_aas_beam_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); -#endif - static gint proto_mac_mgmt_msg_aas_beam_decoder = -1; static gint ett_mac_mgmt_msg_aas_beam_select_decoder = -1; static gint ett_mac_mgmt_msg_aas_beam_req_decoder = -1; -static gint ett_mac_mgmt_msg_aas_beam_rsp_decoder = -1; - -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_mac_mgmt_msg_aas_beam_select_decoder, - &ett_mac_mgmt_msg_aas_beam_req_decoder, - &ett_mac_mgmt_msg_aas_beam_rsp_decoder, -}; +/* static gint ett_mac_mgmt_msg_aas_beam_rsp_decoder = -1; */ #ifdef OFDM static const value_string vals_report_types[] = @@ -105,120 +89,6 @@ static int hf_aas_beam_rssi_value = -1; static int hf_aas_beam_cinr_value = -1; #endif -/* Register Wimax Mac Payload Protocol and Dissector */ -void proto_register_mac_mgmt_msg_aas_beam(void) -{ - /* AAS-BEAM display */ - static hf_register_info hf_aas_beam[] = - { - { - &hf_aas_beam_message_type, - { - "MAC Management Message Type", "wmx.macmgtmsgtype.aas_beam", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_aas_beam_select_index, - { - "AAS Beam Index", "wmx.aas_beam.aas_beam_index", - FT_UINT8, BASE_DEC, NULL, AAS_BEAM_SELECT_AAS_BEAM_INDEX_MASK, NULL, HFILL - } - }, - { - &hf_aas_beam_beam_bit_mask, - { - "Beam Bit Mask", "wmx.aas_beam.beam_bit_mask", - FT_UINT8, BASE_HEX, NULL, AAS_BEAM_BEAM_BIT_MASK_MASK, NULL, HFILL - } - }, -#ifdef OFDM - { - &hf_aas_beam_cinr_value, - { - "CINR Mean Value", "wmx.aas_beam.cinr_mean_value", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_aas_beam_feedback_request_number, - { - "Feedback Request Number", "wmx.aas_beam.feedback_request_number", - FT_UINT8, BASE_DEC, NULL, AAS_BEAM_FEEDBACK_REQUEST_NUMBER_MASK, NULL, HFILL - } - }, - { - &hf_aas_beam_frame_number, - { - "Frame Number", "wmx.aas_beam.frame_number", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_aas_beam_freq_value_im, - { - "Frequency Value (imaginary part)", "wmx.aas_beam.freq_value_im", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_aas_beam_freq_value_re, - { - "Frequency Value (real part)", "wmx.aas_beam.freq_value_re", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_aas_beam_measurement_report_type, - { - "Measurement Report Type", "wmx.aas_beam.measurement_report_type", - FT_UINT8, BASE_DEC, VALS(vals_report_types), AAS_BEAM_MEASUREMENT_REPORT_TYPE_MASK, NULL, HFILL - } - }, - { - &hf_aas_beam_select_reserved, - { - "Reserved", "wmx.aas_beam.reserved", - FT_UINT8, BASE_HEX, NULL, AAS_BEAM_SELECT_RESERVED_MASK, NULL, HFILL - } - }, - { - &hf_aas_beam_resolution_parameter, - { - "Resolution Parameter", "wmx.aas_beam.resolution_parameter", - FT_UINT8, BASE_DEC, VALS(vals_resolution_parameter), AAS_BEAM_RESOLUTION_PARAMETER_MASK, NULL, HFILL - } - }, - { - &hf_aas_beam_rssi_value, - { - "RSSI Mean Value", "wmx.aas_beam.rssi_mean_value", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, -#endif - { - &hf_aas_beam_unknown_type, - { - "Unknown TLV type", "wmx.aas_beam.unknown_type", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - } - }; - - if (proto_mac_mgmt_msg_aas_beam_decoder == -1) - { - proto_mac_mgmt_msg_aas_beam_decoder = proto_mac_mgmt_msg_aas_fbck_decoder; - - proto_register_field_array(proto_mac_mgmt_msg_aas_beam_decoder, hf_aas_beam, array_length(hf_aas_beam)); - proto_register_subtree_array(ett, array_length(ett)); - } - register_dissector("mac_mgmt_msg_aas_beam_select_handler", dissect_mac_mgmt_msg_aas_beam_select_decoder, -1); -#ifdef OFDM - register_dissector("mac_mgmt_msg_aas_beam_req_handler", dissect_mac_mgmt_msg_aas_beam_req_decoder, -1); - register_dissector("mac_mgmt_msg_aas_beam_rsp_handler", dissect_mac_mgmt_msg_aas_beam_rsp_decoder, -1); -#endif -} void dissect_mac_mgmt_msg_aas_beam_select_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { @@ -369,3 +239,124 @@ static void dissect_mac_mgmt_msg_aas_beam_rsp_decoder(tvbuff_t *tvb, packet_info } } #endif + +/* Register Wimax Mac Payload Protocol and Dissector */ +void proto_register_mac_mgmt_msg_aas_beam(void) +{ + /* AAS-BEAM display */ + static hf_register_info hf_aas_beam[] = + { + { + &hf_aas_beam_message_type, + { + "MAC Management Message Type", "wmx.macmgtmsgtype.aas_beam", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_aas_beam_select_index, + { + "AAS Beam Index", "wmx.aas_beam.aas_beam_index", + FT_UINT8, BASE_DEC, NULL, AAS_BEAM_SELECT_AAS_BEAM_INDEX_MASK, NULL, HFILL + } + }, + { + &hf_aas_beam_beam_bit_mask, + { + "Beam Bit Mask", "wmx.aas_beam.beam_bit_mask", + FT_UINT8, BASE_HEX, NULL, AAS_BEAM_BEAM_BIT_MASK_MASK, NULL, HFILL + } + }, +#ifdef OFDM + { + &hf_aas_beam_cinr_value, + { + "CINR Mean Value", "wmx.aas_beam.cinr_mean_value", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_aas_beam_feedback_request_number, + { + "Feedback Request Number", "wmx.aas_beam.feedback_request_number", + FT_UINT8, BASE_DEC, NULL, AAS_BEAM_FEEDBACK_REQUEST_NUMBER_MASK, NULL, HFILL + } + }, + { + &hf_aas_beam_frame_number, + { + "Frame Number", "wmx.aas_beam.frame_number", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_aas_beam_freq_value_im, + { + "Frequency Value (imaginary part)", "wmx.aas_beam.freq_value_im", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_aas_beam_freq_value_re, + { + "Frequency Value (real part)", "wmx.aas_beam.freq_value_re", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_aas_beam_measurement_report_type, + { + "Measurement Report Type", "wmx.aas_beam.measurement_report_type", + FT_UINT8, BASE_DEC, VALS(vals_report_types), AAS_BEAM_MEASUREMENT_REPORT_TYPE_MASK, NULL, HFILL + } + }, + { + &hf_aas_beam_select_reserved, + { + "Reserved", "wmx.aas_beam.reserved", + FT_UINT8, BASE_HEX, NULL, AAS_BEAM_SELECT_RESERVED_MASK, NULL, HFILL + } + }, + { + &hf_aas_beam_resolution_parameter, + { + "Resolution Parameter", "wmx.aas_beam.resolution_parameter", + FT_UINT8, BASE_DEC, VALS(vals_resolution_parameter), AAS_BEAM_RESOLUTION_PARAMETER_MASK, NULL, HFILL + } + }, + { + &hf_aas_beam_rssi_value, + { + "RSSI Mean Value", "wmx.aas_beam.rssi_mean_value", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, +#endif + { + &hf_aas_beam_unknown_type, + { + "Unknown TLV type", "wmx.aas_beam.unknown_type", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + } + }; + + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_mac_mgmt_msg_aas_beam_select_decoder, + &ett_mac_mgmt_msg_aas_beam_req_decoder, + /* &ett_mac_mgmt_msg_aas_beam_rsp_decoder, */ + }; + + proto_mac_mgmt_msg_aas_beam_decoder = proto_mac_mgmt_msg_aas_fbck_decoder; + + proto_register_field_array(proto_mac_mgmt_msg_aas_beam_decoder, hf_aas_beam, array_length(hf_aas_beam)); + proto_register_subtree_array(ett, array_length(ett)); + + register_dissector("mac_mgmt_msg_aas_beam_select_handler", dissect_mac_mgmt_msg_aas_beam_select_decoder, -1); +#ifdef OFDM + register_dissector("mac_mgmt_msg_aas_beam_req_handler", dissect_mac_mgmt_msg_aas_beam_req_decoder, -1); + register_dissector("mac_mgmt_msg_aas_beam_rsp_handler", dissect_mac_mgmt_msg_aas_beam_rsp_decoder, -1); +#endif +} diff --git a/plugins/wimax/msg_aas_fbck.c b/plugins/wimax/msg_aas_fbck.c index 24bc919771..f38e16546f 100644 --- a/plugins/wimax/msg_aas_fbck.c +++ b/plugins/wimax/msg_aas_fbck.c @@ -47,21 +47,9 @@ #define OFDMA_AAS_FBCK_REQ_FB_RSP_COUNTER_MASK 0x1C #define OFDMA_AAS_FBCK_REQ_FB_RSP_RESOLUTION_MASK 0x03 -/* forward reference */ -void proto_register_mac_mgmt_msg_aas_fbck(void); -void dissect_mac_mgmt_msg_aas_fbck_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); -void dissect_mac_mgmt_msg_aas_fbck_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - gint proto_mac_mgmt_msg_aas_fbck_decoder = -1; static gint ett_mac_mgmt_msg_aas_fbck_req_decoder = -1; -static gint ett_mac_mgmt_msg_aas_fbck_rsp_decoder = -1; - -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_mac_mgmt_msg_aas_fbck_req_decoder, - &ett_mac_mgmt_msg_aas_fbck_rsp_decoder, -}; +/* static gint ett_mac_mgmt_msg_aas_fbck_rsp_decoder = -1; */ static const value_string vals_data_types[] = { @@ -108,6 +96,116 @@ static int hf_aas_fbck_freq_value_im = -1; static int hf_aas_fbck_rssi_value = -1; static int hf_aas_fbck_cinr_value = -1; + +void dissect_mac_mgmt_msg_aas_fbck_req_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +{ + guint offset = 0; + guint tvb_len, payload_type, data_type; + proto_item *aas_fbck_item = NULL; + proto_tree *aas_fbck_tree = NULL; + + if(tree) + { /* we are being asked for details */ + /* get the message type */ + payload_type = tvb_get_guint8(tvb, offset); + /* ensure the message type is AAS-FBCK-REQ */ + if(payload_type != MAC_MGMT_MSG_AAS_FBCK_REQ) + return; + /* Get the tvb reported length */ + tvb_len = tvb_reported_length(tvb); + /* display MAC message type */ + aas_fbck_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_aas_fbck_decoder, tvb, offset, tvb_len, "AAS Channel Feedback Request (AAS-FBCK-REQ) (%u bytes)", tvb_len); + /* add subtree */ + aas_fbck_tree = proto_item_add_subtree(aas_fbck_item, ett_mac_mgmt_msg_aas_fbck_req_decoder); + /* Display the AAS-FBCK-REQ message type */ + proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_message_type, tvb, offset, 1, FALSE); + /* move to next field */ + offset++; + /* Decode and display the AAS-FBCK-REQ message body */ + /* display the Frame Number */ + proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_frame_number, tvb, offset, 1, FALSE); + /* move to next field */ + offset++; + /* get the data type */ + data_type = tvb_get_guint8(tvb, offset); + /* display the number of Frames */ + proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_number_of_frames, tvb, offset, 1, FALSE); + /* display the Data Type */ + proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_req_data_type, tvb, offset, 1, FALSE); + /* move to next field */ + offset++; + /* display the Feedback Request Counter */ + proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_req_counter, tvb, offset, 1, FALSE); + /* display the Frequency Measurement Resolution */ + if(data_type & OFDMA_AAS_FBCK_REQ_DATA_TYPE_MASK) + proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_req_resolution_1, tvb, offset, 1, FALSE); + else + proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_req_resolution_0, tvb, offset, 1, FALSE); + /* display the reserved fields */ + proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_req_reserved, tvb, offset, 1, FALSE); + } +} + +void dissect_mac_mgmt_msg_aas_fbck_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +{ + guint offset = 0; + guint tvb_len, payload_type, data_type; + proto_item *aas_fbck_item = NULL; + proto_tree *aas_fbck_tree = NULL; + + if(tree) + { /* we are being asked for details */ + /* get the message type */ + payload_type = tvb_get_guint8(tvb, offset); + /* ensure the message type is AAS-FBCK-RSP */ + if(payload_type != MAC_MGMT_MSG_AAS_FBCK_RSP) + return; + /* Get the tvb reported length */ + tvb_len = tvb_reported_length(tvb); + /* display MAC message type */ + aas_fbck_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_aas_fbck_decoder, tvb, offset, tvb_len, "AAS Channel Feedback Response (AAS-FBCK-RSP) (%u bytes)", tvb_len); + /* add subtree */ + aas_fbck_tree = proto_item_add_subtree(aas_fbck_item, ett_mac_mgmt_msg_aas_fbck_req_decoder); + /* Display the AAS-FBCK-RSP message type */ + proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_message_type, tvb, offset, 1, FALSE); + /* move to next field */ + offset++; + /* get the data type */ + data_type = tvb_get_guint8(tvb, offset); + /* Decode and display the AAS-FBCK-RSP message body */ + /* display the reserved fields */ + proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_rsp_reserved, tvb, offset, 1, FALSE); + /* display the Data Type */ + proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_rsp_data_type, tvb, offset, 1, FALSE); + /* display the Feedback Request Counter */ + proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_rsp_counter, tvb, offset, 1, FALSE); + /* display the Frequency Measurement Resolution */ + if(data_type & OFDMA_AAS_FBCK_RSP_DATA_TYPE_MASK) + proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_rsp_resolution_1, tvb, offset, 1, FALSE); + else + proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_rsp_resolution_0, tvb, offset, 1, FALSE); + /* move to next field */ + offset++; + for(; offset < (tvb_len - 2); ) + { + /* display the Frequency Value (real part) */ + proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_freq_value_re, tvb, offset, 1, FALSE); + /* move to next field */ + offset++; + /* display the Frequency Value (imaginary part) */ + proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_freq_value_im, tvb, offset, 1, FALSE); + /* move to next field */ + offset++; + } + /* display the RSSI Mean Value */ + proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_rssi_value, tvb, offset, 1, FALSE); + /* move to next field */ + offset++; + /* display the CINR Mean Value */ + proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_cinr_value, tvb, offset, 1, FALSE); + } +} + /* Register Wimax Mac Payload Protocol and Dissector */ void proto_register_mac_mgmt_msg_aas_fbck(void) { @@ -242,124 +340,19 @@ void proto_register_mac_mgmt_msg_aas_fbck(void) } }; - if (proto_mac_mgmt_msg_aas_fbck_decoder == -1) - { - proto_mac_mgmt_msg_aas_fbck_decoder = proto_register_protocol ( - "WiMax AAS-FEEDBACK/BEAM Messages", /* name */ - "WiMax AAS-FEEDBACK/BEAM (aas)", /* short name */ - "wmx.aas" /* abbrev */ - ); - - proto_register_field_array(proto_mac_mgmt_msg_aas_fbck_decoder, hf_aas_fbck, array_length(hf_aas_fbck)); - proto_register_subtree_array(ett, array_length(ett)); - } -} - -void dissect_mac_mgmt_msg_aas_fbck_req_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) -{ - guint offset = 0; - guint tvb_len, payload_type, data_type; - proto_item *aas_fbck_item = NULL; - proto_tree *aas_fbck_tree = NULL; - - if(tree) - { /* we are being asked for details */ - /* get the message type */ - payload_type = tvb_get_guint8(tvb, offset); - /* ensure the message type is AAS-FBCK-REQ */ - if(payload_type != MAC_MGMT_MSG_AAS_FBCK_REQ) - return; - /* Get the tvb reported length */ - tvb_len = tvb_reported_length(tvb); - /* display MAC message type */ - aas_fbck_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_aas_fbck_decoder, tvb, offset, tvb_len, "AAS Channel Feedback Request (AAS-FBCK-REQ) (%u bytes)", tvb_len); - /* add subtree */ - aas_fbck_tree = proto_item_add_subtree(aas_fbck_item, ett_mac_mgmt_msg_aas_fbck_req_decoder); - /* Display the AAS-FBCK-REQ message type */ - proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_message_type, tvb, offset, 1, FALSE); - /* move to next field */ - offset++; - /* Decode and display the AAS-FBCK-REQ message body */ - /* display the Frame Number */ - proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_frame_number, tvb, offset, 1, FALSE); - /* move to next field */ - offset++; - /* get the data type */ - data_type = tvb_get_guint8(tvb, offset); - /* display the number of Frames */ - proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_number_of_frames, tvb, offset, 1, FALSE); - /* display the Data Type */ - proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_req_data_type, tvb, offset, 1, FALSE); - /* move to next field */ - offset++; - /* display the Feedback Request Counter */ - proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_req_counter, tvb, offset, 1, FALSE); - /* display the Frequency Measurement Resolution */ - if(data_type & OFDMA_AAS_FBCK_REQ_DATA_TYPE_MASK) - proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_req_resolution_1, tvb, offset, 1, FALSE); - else - proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_req_resolution_0, tvb, offset, 1, FALSE); - /* display the reserved fields */ - proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_req_reserved, tvb, offset, 1, FALSE); - } -} + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_mac_mgmt_msg_aas_fbck_req_decoder, + /* &ett_mac_mgmt_msg_aas_fbck_rsp_decoder, */ + }; -void dissect_mac_mgmt_msg_aas_fbck_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) -{ - guint offset = 0; - guint tvb_len, payload_type, data_type; - proto_item *aas_fbck_item = NULL; - proto_tree *aas_fbck_tree = NULL; + proto_mac_mgmt_msg_aas_fbck_decoder = proto_register_protocol ( + "WiMax AAS-FEEDBACK/BEAM Messages", /* name */ + "WiMax AAS-FEEDBACK/BEAM (aas)", /* short name */ + "wmx.aas" /* abbrev */ + ); - if(tree) - { /* we are being asked for details */ - /* get the message type */ - payload_type = tvb_get_guint8(tvb, offset); - /* ensure the message type is AAS-FBCK-RSP */ - if(payload_type != MAC_MGMT_MSG_AAS_FBCK_RSP) - return; - /* Get the tvb reported length */ - tvb_len = tvb_reported_length(tvb); - /* display MAC message type */ - aas_fbck_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_aas_fbck_decoder, tvb, offset, tvb_len, "AAS Channel Feedback Response (AAS-FBCK-RSP) (%u bytes)", tvb_len); - /* add subtree */ - aas_fbck_tree = proto_item_add_subtree(aas_fbck_item, ett_mac_mgmt_msg_aas_fbck_req_decoder); - /* Display the AAS-FBCK-RSP message type */ - proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_message_type, tvb, offset, 1, FALSE); - /* move to next field */ - offset++; - /* get the data type */ - data_type = tvb_get_guint8(tvb, offset); - /* Decode and display the AAS-FBCK-RSP message body */ - /* display the reserved fields */ - proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_rsp_reserved, tvb, offset, 1, FALSE); - /* display the Data Type */ - proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_rsp_data_type, tvb, offset, 1, FALSE); - /* display the Feedback Request Counter */ - proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_rsp_counter, tvb, offset, 1, FALSE); - /* display the Frequency Measurement Resolution */ - if(data_type & OFDMA_AAS_FBCK_RSP_DATA_TYPE_MASK) - proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_rsp_resolution_1, tvb, offset, 1, FALSE); - else - proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_rsp_resolution_0, tvb, offset, 1, FALSE); - /* move to next field */ - offset++; - for(; offset < (tvb_len - 2); ) - { - /* display the Frequency Value (real part) */ - proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_freq_value_re, tvb, offset, 1, FALSE); - /* move to next field */ - offset++; - /* display the Frequency Value (imaginary part) */ - proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_freq_value_im, tvb, offset, 1, FALSE); - /* move to next field */ - offset++; - } - /* display the RSSI Mean Value */ - proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_rssi_value, tvb, offset, 1, FALSE); - /* move to next field */ - offset++; - /* display the CINR Mean Value */ - proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_cinr_value, tvb, offset, 1, FALSE); - } + proto_register_field_array(proto_mac_mgmt_msg_aas_fbck_decoder, hf_aas_fbck, array_length(hf_aas_fbck)); + proto_register_subtree_array(ett, array_length(ett)); } diff --git a/plugins/wimax/msg_clk_cmp.c b/plugins/wimax/msg_clk_cmp.c index 6f56e5d744..a25d1b6c4a 100644 --- a/plugins/wimax/msg_clk_cmp.c +++ b/plugins/wimax/msg_clk_cmp.c @@ -36,19 +36,10 @@ #include #include "wimax_mac.h" -/* Forward reference */ -void dissect_mac_mgmt_msg_clk_cmp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - static gint proto_mac_mgmt_msg_clk_cmp_decoder = -1; static gint ett_mac_mgmt_msg_clk_cmp_decoder = -1; -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_mac_mgmt_msg_clk_cmp_decoder, -}; - /* CLK_CMP fields */ static gint hf_clk_cmp_message_type = -1; static gint hf_clk_cmp_clock_count = -1; @@ -57,6 +48,53 @@ static gint hf_clk_cmp_seq_number = -1; static gint hf_clk_cmp_comparison_value = -1; static gint hf_clk_cmp_invalid_tlv = -1; + +/* Decode CLK_CMP messages. */ +void dissect_mac_mgmt_msg_clk_cmp_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +{ + guint offset = 0; + guint i; + guint clock_count; + guint tvb_len, payload_type; + proto_item *clk_cmp_item = NULL; + proto_tree *clk_cmp_tree = NULL; + + /* Ensure the right payload type */ + payload_type = tvb_get_guint8(tvb, 0); + if(payload_type != MAC_MGMT_MSG_CLK_CMP) + { + return; + } + + if (tree) + { /* we are being asked for details */ + /* Get the tvb reported length */ + tvb_len = tvb_reported_length(tvb); + /* display MAC payload type CLK_CMP */ + clk_cmp_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_clk_cmp_decoder, tvb, offset, tvb_len, "Clock Comparison (CLK-CMP) (%u bytes)", tvb_len); + /* add MAC CLK_CMP subtree */ + clk_cmp_tree = proto_item_add_subtree(clk_cmp_item, ett_mac_mgmt_msg_clk_cmp_decoder); + /* display the Message Type */ + proto_tree_add_item(clk_cmp_tree, hf_clk_cmp_message_type, tvb, offset, 1, FALSE); + /* set the offset for clock count */ + offset ++; + /* get the clock count */ + clock_count = tvb_get_guint8(tvb, offset); + /* display the clock count */ + proto_tree_add_item(clk_cmp_tree, hf_clk_cmp_clock_count, tvb, offset, 1, FALSE); + /* set the offset for clock comparison */ + offset++; + for (i = 0; i < clock_count; i++ ) + { /* display the Clock ID */ + proto_tree_add_item(clk_cmp_tree, hf_clk_cmp_clock_id, tvb, offset++, 1, FALSE); + /* display the sequence number */ + proto_tree_add_item(clk_cmp_tree, hf_clk_cmp_seq_number, tvb, offset++, 1, FALSE); + /* display the comparison value */ + proto_tree_add_item(clk_cmp_tree, hf_clk_cmp_comparison_value, tvb, offset++, 1, FALSE); + } + } +} + /* Register Wimax Mac Payload Protocol and Dissector */ void proto_register_mac_mgmt_msg_clk_cmp(void) { @@ -107,61 +145,18 @@ void proto_register_mac_mgmt_msg_clk_cmp(void) } }; - if (proto_mac_mgmt_msg_clk_cmp_decoder == -1) { - proto_mac_mgmt_msg_clk_cmp_decoder = proto_register_protocol ( - "WiMax CLK-CMP Message", /* name */ - "WiMax CLK-CMP (clk)", /* short name */ - "wmx.clk" /* abbrev */ - ); - - proto_register_field_array(proto_mac_mgmt_msg_clk_cmp_decoder, hf_clk_cmp, array_length(hf_clk_cmp)); - proto_register_subtree_array(ett, array_length(ett)); - } -} - -/* Decode CLK_CMP messages. */ -void dissect_mac_mgmt_msg_clk_cmp_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) -{ - guint offset = 0; - guint i; - guint clock_count; - guint tvb_len, payload_type; - proto_item *clk_cmp_item = NULL; - proto_tree *clk_cmp_tree = NULL; + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_mac_mgmt_msg_clk_cmp_decoder, + }; - /* Ensure the right payload type */ - payload_type = tvb_get_guint8(tvb, 0); - if(payload_type != MAC_MGMT_MSG_CLK_CMP) - { - return; - } + proto_mac_mgmt_msg_clk_cmp_decoder = proto_register_protocol ( + "WiMax CLK-CMP Message", /* name */ + "WiMax CLK-CMP (clk)", /* short name */ + "wmx.clk" /* abbrev */ + ); - if (tree) - { /* we are being asked for details */ - /* Get the tvb reported length */ - tvb_len = tvb_reported_length(tvb); - /* display MAC payload type CLK_CMP */ - clk_cmp_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_clk_cmp_decoder, tvb, offset, tvb_len, "Clock Comparison (CLK-CMP) (%u bytes)", tvb_len); - /* add MAC CLK_CMP subtree */ - clk_cmp_tree = proto_item_add_subtree(clk_cmp_item, ett_mac_mgmt_msg_clk_cmp_decoder); - /* display the Message Type */ - proto_tree_add_item(clk_cmp_tree, hf_clk_cmp_message_type, tvb, offset, 1, FALSE); - /* set the offset for clock count */ - offset ++; - /* get the clock count */ - clock_count = tvb_get_guint8(tvb, offset); - /* display the clock count */ - proto_tree_add_item(clk_cmp_tree, hf_clk_cmp_clock_count, tvb, offset, 1, FALSE); - /* set the offset for clock comparison */ - offset++; - for (i = 0; i < clock_count; i++ ) - { /* display the Clock ID */ - proto_tree_add_item(clk_cmp_tree, hf_clk_cmp_clock_id, tvb, offset++, 1, FALSE); - /* display the sequence number */ - proto_tree_add_item(clk_cmp_tree, hf_clk_cmp_seq_number, tvb, offset++, 1, FALSE); - /* display the comparison value */ - proto_tree_add_item(clk_cmp_tree, hf_clk_cmp_comparison_value, tvb, offset++, 1, FALSE); - } - } + proto_register_field_array(proto_mac_mgmt_msg_clk_cmp_decoder, hf_clk_cmp, array_length(hf_clk_cmp)); + proto_register_subtree_array(ett, array_length(ett)); } - diff --git a/plugins/wimax/msg_dcd.c b/plugins/wimax/msg_dcd.c index 856bc569fa..0f4afedc95 100644 --- a/plugins/wimax/msg_dcd.c +++ b/plugins/wimax/msg_dcd.c @@ -36,8 +36,6 @@ #define DEBUG */ -#include "moduleinfo.h" - #include #include #include "wimax_tlv.h" @@ -48,19 +46,9 @@ extern gint proto_wimax; /* Delete the following variable as soon as possible */ extern gboolean include_cor2_changes; -/* forward reference */ -void proto_register_mac_mgmt_msg_dcd(void); -void dissect_mac_mgmt_msg_dcd_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - gint proto_mac_mgmt_msg_dcd_decoder = -1; static gint ett_mac_mgmt_msg_dcd_decoder = -1; -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_mac_mgmt_msg_dcd_decoder, -}; - /* fix fields */ static gint hf_dcd_message_type = -1; static gint hf_dcd_downlink_channel_id = -1; @@ -341,769 +329,250 @@ static const value_string tfs_support[] = {0, NULL} }; -/* Register Wimax Mac Payload Protocol and Dissector */ -void proto_register_mac_mgmt_msg_dcd(void) + +/* WiMax MAC Management DCD message (table 15) dissector */ +void dissect_mac_mgmt_msg_dcd_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - /* DCD display */ - static hf_register_info hf[] = + guint offset = 0; + guint tvb_len, payload_type, length; + guint configChangeCount; + gint tlv_type, tlv_len, tlv_offset, tlv_value_offset; + guint dl_burst_diuc, dl_num_regions; + proto_item *dcd_item = NULL; + proto_tree *dcd_tree = NULL; + proto_item *tlv_item = NULL; + proto_tree *tlv_tree = NULL; + proto_tree *sub_tree = NULL; + tlv_info_t tlv_info; + + /* Ensure the right payload type */ + payload_type = tvb_get_guint8(tvb, offset); + if(payload_type != MAC_MGMT_MSG_DCD) { + return; + } + + if(tree) + { /* we are being asked for details */ + /* Get the tvb reported length */ + tvb_len = tvb_reported_length(tvb); + /* display MAC payload type DCD */ + dcd_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dcd_decoder, tvb, offset, tvb_len, "Downlink Channel Descriptor (DCD) (%u bytes)", tvb_len); + /* add MAC DCD subtree */ + dcd_tree = proto_item_add_subtree(dcd_item, ett_mac_mgmt_msg_dcd_decoder); + /* Decode and display the Downlink Channel Descriptor (DCD) */ + /* display the Message Type */ + proto_tree_add_item(dcd_tree, hf_dcd_message_type, tvb, offset, 1, FALSE); + /* set the offset for the Downlink Channel ID */ + offset++; + /* display the Downlink Channel ID */ + proto_tree_add_item(dcd_tree, hf_dcd_downlink_channel_id, tvb, offset, 1, FALSE); + /* set the offset for the Configuration Change Count */ + offset++; + /* get the Configuration Change Count */ + configChangeCount = tvb_get_guint8(tvb, offset); + /* display the Configuration Change Count */ + proto_tree_add_item(dcd_tree, hf_dcd_config_change_count, tvb, offset, 1, FALSE); + /* set the offset for the TLV Encoded info */ + offset++; + /* process the DCD TLV Encoded information (table 358) */ + while(offset < tvb_len) { - &hf_dcd_message_type, - { - "MAC Management Message Type", "wmx.macmgtmsgtype.dcd", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_33_asr, - { - "ASR (Anchor Switch Report) Slot Length (M) and Switching Period (L)", "wmx.dcd.asr", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_33_asr_l, - { - "ASR Switching Period (L)", "wmx.dcd.asr.l", - FT_UINT8, BASE_DEC, NULL, 0x0f, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_33_asr_m, - { - "ASR Slot Length (M)", "wmx.dcd.asr.m", - FT_UINT8, BASE_DEC, NULL, 0xf0, NULL, HFILL - } - }, - { - &hf_dcd_bs_eirp, - { - "BS EIRP", "wmx.dcd.bs_eirp", - FT_INT16, BASE_DEC, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_dcd_bs_id, - { - "Base Station ID", "wmx.dcd.bs_id", - FT_ETHER, BASE_NONE, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_dcd_restart_count, - { - "BS Restart Count", "wmx.dcd.bs_restart_count", - FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_dl_burst_diuc, - { - "DIUC", "wmx.dcd.burst.diuc", - FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL - } - }, - { - &hf_dcd_burst_diuc_entry_threshold, - { - "DIUC Minimum Entry Threshold (in 0.25 dB units)", "wmx.dcd.burst.diuc_entry_threshold", - FT_FLOAT, BASE_NONE, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_dcd_burst_diuc_exit_threshold, - { - "DIUC Mandatory Exit Threshold (in 0.25 dB units)", "wmx.dcd.burst.diuc_exit_threshold", - FT_FLOAT, BASE_NONE, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_dcd_burst_fec, - { - "FEC Code Type", "wmx.dcd.burst.fec", - FT_UINT8, BASE_DEC, VALS(vals_dcd_burst_fec_ofdma), 0x00, NULL, HFILL - } - }, - { - &hf_dcd_burst_freq, - { - "Frequency", "wmx.dcd.burst.freq", - FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_dl_burst_reserved, - { - "Reserved", "wmx.dcd.burst.reserved", - FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL - } - }, - { - &hf_dcd_burst_tcs, - { - "TCS", "wmx.dcd.burst.tcs", - FT_UINT8, BASE_DEC, VALS(vals_dcd_burst_tcs), 0x00, NULL, HFILL - } - }, - { - &hf_dcd_channel_nr, - { - "Channel Nr", "wmx.dcd.channel_nr", - FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_dcd_config_change_count, - { - "Configuration Change Count", "wmx.dcd.config_change_count", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter_physical_cinr_measurements, - { - "Default Averaging Parameter for Physical CINR Measurements (in multiples of 1/16)", "wmx.dcd.default_physical_cinr_meas_averaging_parameter", - FT_UINT8, BASE_HEX, NULL, 0xf0, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter, - { - "Default RSSI and CINR Averaging Parameter", "wmx.dcd.default_rssi_and_cinr_averaging_parameter", - FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter_rssi_measurements, - { - "Default Averaging Parameter for RSSI Measurements (in multiples of 1/16)", "wmx.dcd.default_rssi_meas_averaging_parameter", - FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_22_dl_amc_allocated_physical_bands_bitmap, - { - "DL AMC Allocated Physical Bands Bitmap", "wmx.dcd.dl_amc_allocated_phy_bands_bitmap", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dcd_dl_burst_profile_diuc, - { - "DIUC", "wmx.dcd.dl_burst_profile_diuc", - FT_UINT8, BASE_DEC, VALS(diuc_msgs), 0x0F, NULL, HFILL - } - }, - { - &hf_dcd_dl_burst_profile_rsv, - { - "Reserved", "wmx.dcd.dl_burst_profile_rsv", - FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL - } - }, - { - &hf_dcd_downlink_channel_id, - { - "Reserved", "wmx.dcd.dl_channel_id", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_153_downlink_burst_profile_for_mutiple_fec_types, - { - "Downlink Burst Profile for Multiple FEC Types","wimax.dcd.dl_burst_profile_multiple_fec_types", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_34_dl_region_definition, - { - "DL Region Definition", "wmx.dcd.dl_region_definition", - FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL + /* get the TLV information */ + init_tlv_info(&tlv_info, tvb, offset); + /* get the TLV type */ + tlv_type = get_tlv_type(&tlv_info); + /* get the TLV length */ + tlv_len = get_tlv_length(&tlv_info); + if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1) + { /* invalid tlv info */ + if(check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "DCD TLV error"); + } + proto_tree_add_item(dcd_tree, hf_dcd_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE); + break; } - }, - { - &hf_dcd_tlv_t_34_dl_region_definition_num_region, + /* get the TLV value offset */ + tlv_value_offset = get_tlv_value_offset(&tlv_info); +#ifdef DEBUG /* for debug only */ + tlv_item = proto_tree_add_protocol_format(dcd_tree, proto_mac_mgmt_msg_dcd_decoder, tvb, offset, (tlv_len + tlv_value_offset), "DCD Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, tlv_len, offset, tvb_len); +#endif + /* update the offset */ + offset += tlv_value_offset; + /* process DCD TLVs */ + switch (tlv_type) { - "Number of Regions", "wmx.dcd.dl_region_definition.num_region", - FT_UINT8, BASE_DEC, NULL, 0xFC, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_34_dl_region_definition_num_subchannels, - { - "Number of Subchannels", "wmx.dcd.dl_region_definition.num_subchannels", - FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_34_dl_region_definition_num_symbols, - { - "Number of OFDMA Symbols", "wmx.dcd.dl_region_definition.num_symbols", - FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_34_dl_region_definition_reserved, - { - "Reserved", "wmx.dcd.dl_region_definition.reserved", - FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_34_dl_region_definition_subchannel_offset, - { - "Subchannel Offset", "wmx.dcd.dl_region_definition.subchannel_offset", - FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_34_dl_region_definition_symbol_offset, - { - "OFDMA Symbol Offset", "wmx.dcd.dl_region_definition.symbol_offset", - FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL - } - }, -#ifndef WIMAX_16D_2004 - { - &hf_dcd_eirxp, - { - "EIRXP (IR, max)", "wmx.dcd.eirxp", - FT_INT16, BASE_DEC, NULL, 0x00, NULL, HFILL - } - }, -#endif - { - &hf_dcd_frame_duration, - { - "Frame Duration", "wmx.dcd.frame_duration", - FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_dcd_frame_duration_code, - { - "Frame Duration Code", "wmx.dcd.frame_duration_code", - FT_UINT8, BASE_HEX, VALS(vals_dcd_frame_duration), 0x00, NULL, HFILL - } - }, - { - &hf_dcd_frame_nr, - { - "Frame Number", "wmx.dcd.frame_nr", - FT_UINT24, BASE_DEC, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_dcd_frequency, - { - "Downlink Center Frequency", "wmx.dcd.frequency", - FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_31_h_add_threshold, - { - "H_add Threshold", "wmx.dcd.h_add_threshold", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, + case DCD_DOWNLINK_BURST_PROFILE: + { /* Downlink Burst Profile TLV (table 363)*/ + /* get the DIUC */ + dl_burst_diuc = (tvb_get_guint8(tvb, offset) & 0x0F); + /* display TLV info */ + /* add TLV subtree */ + tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, proto_mac_mgmt_msg_dcd_decoder, tvb, offset, tlv_len, "Downlink_Burst_Profile (DIUC=%u) (%u bytes)", (dl_burst_diuc+1), tlv_len); + /* detail display */ + proto_tree_add_item(tlv_tree, hf_dcd_dl_burst_profile_rsv, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_dl_burst_profile_diuc, tvb, offset, 1, FALSE); + /* process subTLVs */ + for (tlv_offset = 1; tlv_offset < tlv_len; ) + { /* get the TLV information */ + init_tlv_info(&tlv_info, tvb, (offset+tlv_offset)); + /* get the TLV type */ + tlv_type = get_tlv_type(&tlv_info); + /* get the TLV length */ + length = get_tlv_length(&tlv_info); + if(tlv_type == -1 || length > MAX_TLV_LEN || length < 1) + { /* invalid tlv info */ + if(check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "DL Burst Profile TLV error"); + } + proto_tree_add_item(tlv_tree, hf_dcd_invalid_tlv, tvb, offset, (tlv_len - offset - tlv_offset), FALSE); + break; + } + /* update the offset */ + tlv_offset += get_tlv_value_offset(&tlv_info); + switch (tlv_type) + { + case DCD_BURST_FREQUENCY: + { + sub_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, tlv_tree, hf_dcd_burst_freq, tvb, (offset+tlv_offset), 1, FALSE); + tlv_item = proto_tree_add_item(sub_tree, hf_dcd_burst_freq, tvb, (offset+tlv_offset), 1, FALSE); + proto_item_append_text(tlv_item, " kHz"); + break; + } + case DCD_BURST_FEC_CODE_TYPE: + { + sub_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, tlv_tree, hf_dcd_burst_fec, tvb, (offset+tlv_offset), 1, FALSE); + proto_tree_add_item(sub_tree, hf_dcd_burst_fec, tvb, (offset+tlv_offset), 1, FALSE); + break; + } + case DCD_BURST_DIUC_EXIT_THRESHOLD: + { + sub_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, tlv_tree, hf_dcd_burst_diuc_exit_threshold, tvb, (offset+tlv_offset), length, FALSE); + tlv_item = proto_tree_add_item(sub_tree, hf_dcd_burst_diuc_exit_threshold, tvb, (offset+tlv_offset), length, FALSE); + break; + } + case DCD_BURST_DIUC_ENTRY_THRESHOLD: + { + sub_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, tlv_tree, hf_dcd_burst_diuc_entry_threshold, tvb, (offset+tlv_offset), length, FALSE); + tlv_item = proto_tree_add_item(sub_tree, hf_dcd_burst_diuc_entry_threshold, tvb, (offset+tlv_offset), length, FALSE); + break; + } + case DCD_BURST_TCS_ENABLE: + { + sub_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, tlv_tree, hf_dcd_burst_tcs, tvb, (offset+tlv_offset), length, FALSE); + proto_tree_add_item(sub_tree, hf_dcd_burst_tcs, tvb, (offset+tlv_offset), 1, FALSE); + break; + } + default: + /* ??? */ + break; + } + tlv_offset += length; + } + break; + } + case DCD_BS_EIRP: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_bs_eirp, tvb, offset, tlv_len, FALSE); + tlv_item = proto_tree_add_item(tlv_tree, hf_dcd_bs_eirp, tvb, offset, tlv_len, FALSE); + proto_item_append_text(tlv_item, " dBm"); + break; + } + case DCD_FRAME_DURATION: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_frame_duration, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_frame_duration, tvb, offset, tlv_len, FALSE); + break; + } + case DCD_PHY_TYPE: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_phy_type, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_phy_type, tvb, offset, tlv_len, FALSE); + break; + } + case DCD_POWER_ADJUSTMENT: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_power_adjustment, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_power_adjustment, tvb, offset, 1, FALSE); + break; + } + case DCD_CHANNEL_NR: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_channel_nr, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_channel_nr, tvb, offset, tlv_len, FALSE); + break; + } + case DCD_TTG: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_ttg, tvb, offset, tlv_len, FALSE); + tlv_item = proto_tree_add_item(tlv_tree, hf_dcd_ttg, tvb, offset, tlv_len, FALSE); + proto_item_append_text(tlv_item, " PS"); + break; + } + case DCD_RTG: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_rtg, tvb, offset, tlv_len, FALSE); + tlv_item = proto_tree_add_item(tlv_tree, hf_dcd_rtg, tvb, offset, tlv_len, FALSE); + proto_item_append_text(tlv_item, " PS"); + break; + } #ifdef WIMAX_16D_2004 - { - &hf_dcd_h_arq_ack_delay, - { - "H-ARQ ACK Delay for DL Burst", "wmx.dcd.h_arq_ack_delay_dl_burst", - FT_UINT8, BASE_DEC, NULL, 0x00, "", HFILL - } - }, + case DCD_RSS: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_rss, tvb, offset, tlv_len, FALSE); + tlv_item = proto_tree_add_item(tlv_tree, hf_dcd_rss, tvb, offset, tlv_len, FALSE); + proto_item_append_text(tlv_item, " dBm"); + break; + } #else - { - &hf_dcd_h_arq_ack_delay, - { - "H-ARQ ACK Delay for UL Burst", "wmx.dcd.h_arq_ack_delay_ul_burst", - FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL - } - }, + case DCD_EIRXP: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_eirxp, tvb, offset, tlv_len, FALSE); + tlv_item = proto_tree_add_item(tlv_tree, hf_dcd_eirxp, tvb, offset, tlv_len, FALSE); + proto_item_append_text(tlv_item, " dBm"); + break; + } #endif - { - &hf_dcd_tlv_t_32_h_delete_threshold, - { - "H_delete Threshold", "wmx.dcd.h_delete_threshold", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_50_ho_type_support, - { - "HO Type Support", "wmx.dcd.ho_type_support", - FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_50_ho_type_support_fbss_ho, - { - "FBSS HO", "wmx.dcd.ho_type_support.fbss_ho", - FT_UINT8, BASE_HEX, VALS(tfs_support), 0x20, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_50_ho_type_support_ho, - { - "HO", "wmx.dcd.ho_type_support.ho", - FT_UINT8, BASE_HEX, VALS(tfs_support), 0x80, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_50_ho_type_support_mdho, - { - "MDHO", "wmx.dcd.ho_type_support.mdho", - FT_UINT8, BASE_HEX, VALS(tfs_support), 0x40, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_50_ho_type_support_reserved, - { - "Reserved", "wmx.dcd.ho_type_support.reserved", - FT_UINT8, BASE_HEX, NULL, 0x1f, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_51_hysteresis_margin, - { - "Hysteresis Margin", "wmx.dcd.hysteresis_margin", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dcd_invalid_tlv, - { - "Invalid TLV", "wmx.dcd.invalid_tlv", - FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL - } - }, - { - &hf_dcd_mac_version, - { - "MAC Version", "wmx.dcd.mac_version", - FT_UINT8, BASE_DEC, VALS(vals_dcd_mac_version), 0x00, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_20_maximum_retransmission, - { - "Maximum Retransmission", "wmx.dcd.maximum_retransmission", - FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_60_noise_interference, - { - "Noise and Interference", "wmx.dcd.noise_interference", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_35_paging_group_id, - { - "Paging Group ID", "wmx.dcd.paging_group_id", - FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_36_tusc1_permutation_active_subchannels_bitmap, - { - "TUSC1 permutation active subchannels bitmap", "wmx.dcd.tusc1", - FT_UINT16, BASE_HEX, NULL, 0xFF80, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_37_tusc2_permutation_active_subchannels_bitmap, - { - "TUSC2 permutation active subchannels bitmap", "wmx.dcd.tusc2", - FT_UINT16, BASE_HEX, NULL, 0xFFF8, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_45_paging_interval_length, - { - "Paging Interval Length", "wmx.dcd.paging_interval_length", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_19_permutation_type_for_broadcast_regions_in_harq_zone, - { - "Permutation Type for Broadcast Region in HARQ Zone", "wmx.dcd.permutation_type_broadcast_region_in_harq_zone", - FT_UINT8, BASE_DEC, VALS(vals_dcd_permutation_type), 0x00, NULL, HFILL - } - }, - { - &hf_dcd_phy_type, - { - "PHY Type", "wmx.dcd.phy_type", - FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_dcd_power_adjustment, - { - "Power Adjustment Rule", "wmx.dcd.power_adjustment", - FT_UINT8, BASE_HEX, VALS(vals_dcd_power_adjustmnt), 0x00, NULL, HFILL - } - }, -#ifdef WIMAX_16D_2004 - { - &hf_dcd_rss, - { - "RSS (IR, max)", "wmx.dcd.rss", - FT_INT16, BASE_DEC, NULL, 0x00, "", HFILL - } - }, -#endif - { - &hf_dcd_rtg, - { - "RTG", "wmx.dcd.rtg", - FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL - } - }, + case DCD_CHANNEL_SWITCH_FRAME_NR: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_channel_switch_frame_nr, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_channel_switch_frame_nr, tvb, offset, tlv_len, FALSE); + break; + } + case DCD_FREQUENCY: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_frequency, tvb, offset, tlv_len, FALSE); + tlv_item = proto_tree_add_item(tlv_tree, hf_dcd_frequency, tvb, offset, tlv_len, FALSE); + proto_item_append_text(tlv_item, " kHz"); + break; + } + case DCD_BS_ID: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_bs_id, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_bs_id, tvb, offset, tlv_len, FALSE); + break; + } + case DCD_FRAME_DURATION_CODE: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_frame_duration_code, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_frame_duration_code, tvb, offset, tlv_len, FALSE); + break; + } + case DCD_FRAME_NR: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_frame_nr, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_frame_nr, tvb, offset, tlv_len, FALSE); + break; + } #ifdef WIMAX_16D_2004 - { - &hf_dcd_size_cqich_id, - { - "Size of CQICH-ID Field", "wmx.dcd.size_cqich_id", - FT_UINT8, BASE_DEC, VALS(vals_dcd_size_of_cqich_id), 0x00, "", HFILL - } - }, -#endif - { - &hf_dcd_channel_switch_frame_nr, - { - "Channel Switch Frame Number", "wmx.dcd.switch_frame", - FT_UINT24, BASE_DEC, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_52_time_to_trigger_duration, - { - "Time to Trigger Duration", "wmx.dcd.time_trigger_duration", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_543_trigger_averaging_duration, - { - "Trigger Averaging Duration", "wmx.dcd.trigger_averaging_duration", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_542_trigger_value, - { - "Trigger Value", "wmx.dcd.trigger_value", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dcd_ttg, - { - "TTG", "wmx.dcd.ttg", - FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_541_type_function_action, - { - "Type/Function/Action", "wmx.dcd.type_function_action", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_541_action, - { - "Action", "wmx.dcd.type_function_action.action", - FT_UINT8, BASE_HEX, VALS(vals_dcd_action), 0x7, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_541_function, - { - "Function", "wmx.dcd.type_function_action.function", - FT_UINT8, BASE_HEX, VALS(vals_dcd_function), 0x38, NULL, HFILL - } - }, - { - &hf_dcd_tlv_t_541_type, - { - "Type", "wmx.dcd.type_function_action.type", - FT_UINT8, BASE_HEX, VALS(vals_dcd_type), 0xC0, NULL, HFILL - } - }, - { - &hf_dcd_unknown_type, - { - "Unknown DCD Type", "wmx.dcd.unknown_tlv_value", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - } - }; - - if (proto_mac_mgmt_msg_dcd_decoder == -1) - { - proto_mac_mgmt_msg_dcd_decoder = proto_register_protocol ( - "WiMax DCD/UCD Messages", /* name */ - "WiMax DCD/UCD (cd)", /* short name */ - "wmx.cd" /* abbrev */ - ); - - proto_register_field_array(proto_mac_mgmt_msg_dcd_decoder, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - } -} - -/* WiMax MAC Management DCD message (table 15) dissector */ -void dissect_mac_mgmt_msg_dcd_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ - guint offset = 0; - guint tvb_len, payload_type, length; - guint configChangeCount; - gint tlv_type, tlv_len, tlv_offset, tlv_value_offset; - guint dl_burst_diuc, dl_num_regions; - proto_item *dcd_item = NULL; - proto_tree *dcd_tree = NULL; - proto_item *tlv_item = NULL; - proto_tree *tlv_tree = NULL; - proto_tree *sub_tree = NULL; - tlv_info_t tlv_info; - - /* Ensure the right payload type */ - payload_type = tvb_get_guint8(tvb, offset); - if(payload_type != MAC_MGMT_MSG_DCD) - { - return; - } - - if(tree) - { /* we are being asked for details */ - /* Get the tvb reported length */ - tvb_len = tvb_reported_length(tvb); - /* display MAC payload type DCD */ - dcd_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dcd_decoder, tvb, offset, tvb_len, "Downlink Channel Descriptor (DCD) (%u bytes)", tvb_len); - /* add MAC DCD subtree */ - dcd_tree = proto_item_add_subtree(dcd_item, ett_mac_mgmt_msg_dcd_decoder); - /* Decode and display the Downlink Channel Descriptor (DCD) */ - /* display the Message Type */ - proto_tree_add_item(dcd_tree, hf_dcd_message_type, tvb, offset, 1, FALSE); - /* set the offset for the Downlink Channel ID */ - offset++; - /* display the Downlink Channel ID */ - proto_tree_add_item(dcd_tree, hf_dcd_downlink_channel_id, tvb, offset, 1, FALSE); - /* set the offset for the Configuration Change Count */ - offset++; - /* get the Configuration Change Count */ - configChangeCount = tvb_get_guint8(tvb, offset); - /* display the Configuration Change Count */ - proto_tree_add_item(dcd_tree, hf_dcd_config_change_count, tvb, offset, 1, FALSE); - /* set the offset for the TLV Encoded info */ - offset++; - /* process the DCD TLV Encoded information (table 358) */ - while(offset < tvb_len) - { - /* get the TLV information */ - init_tlv_info(&tlv_info, tvb, offset); - /* get the TLV type */ - tlv_type = get_tlv_type(&tlv_info); - /* get the TLV length */ - tlv_len = get_tlv_length(&tlv_info); - if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1) - { /* invalid tlv info */ - if(check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "DCD TLV error"); - } - proto_tree_add_item(dcd_tree, hf_dcd_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE); - break; - } - /* get the TLV value offset */ - tlv_value_offset = get_tlv_value_offset(&tlv_info); -#ifdef DEBUG /* for debug only */ - tlv_item = proto_tree_add_protocol_format(dcd_tree, proto_mac_mgmt_msg_dcd_decoder, tvb, offset, (tlv_len + tlv_value_offset), "DCD Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, tlv_len, offset, tvb_len); -#endif - /* update the offset */ - offset += tlv_value_offset; - /* process DCD TLVs */ - switch (tlv_type) - { - case DCD_DOWNLINK_BURST_PROFILE: - { /* Downlink Burst Profile TLV (table 363)*/ - /* get the DIUC */ - dl_burst_diuc = (tvb_get_guint8(tvb, offset) & 0x0F); - /* display TLV info */ - /* add TLV subtree */ - tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, proto_mac_mgmt_msg_dcd_decoder, tvb, offset, tlv_len, "Downlink_Burst_Profile (DIUC=%u) (%u bytes)", (dl_burst_diuc+1), tlv_len); - /* detail display */ - proto_tree_add_item(tlv_tree, hf_dcd_dl_burst_profile_rsv, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_dl_burst_profile_diuc, tvb, offset, 1, FALSE); - /* process subTLVs */ - for (tlv_offset = 1; tlv_offset < tlv_len; ) - { /* get the TLV information */ - init_tlv_info(&tlv_info, tvb, (offset+tlv_offset)); - /* get the TLV type */ - tlv_type = get_tlv_type(&tlv_info); - /* get the TLV length */ - length = get_tlv_length(&tlv_info); - if(tlv_type == -1 || length > MAX_TLV_LEN || length < 1) - { /* invalid tlv info */ - if(check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "DL Burst Profile TLV error"); - } - proto_tree_add_item(tlv_tree, hf_dcd_invalid_tlv, tvb, offset, (tlv_len - offset - tlv_offset), FALSE); - break; - } - /* update the offset */ - tlv_offset += get_tlv_value_offset(&tlv_info); - switch (tlv_type) - { - case DCD_BURST_FREQUENCY: - { - sub_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, tlv_tree, hf_dcd_burst_freq, tvb, (offset+tlv_offset), 1, FALSE); - tlv_item = proto_tree_add_item(sub_tree, hf_dcd_burst_freq, tvb, (offset+tlv_offset), 1, FALSE); - proto_item_append_text(tlv_item, " kHz"); - break; - } - case DCD_BURST_FEC_CODE_TYPE: - { - sub_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, tlv_tree, hf_dcd_burst_fec, tvb, (offset+tlv_offset), 1, FALSE); - proto_tree_add_item(sub_tree, hf_dcd_burst_fec, tvb, (offset+tlv_offset), 1, FALSE); - break; - } - case DCD_BURST_DIUC_EXIT_THRESHOLD: - { - sub_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, tlv_tree, hf_dcd_burst_diuc_exit_threshold, tvb, (offset+tlv_offset), length, FALSE); - tlv_item = proto_tree_add_item(sub_tree, hf_dcd_burst_diuc_exit_threshold, tvb, (offset+tlv_offset), length, FALSE); - break; - } - case DCD_BURST_DIUC_ENTRY_THRESHOLD: - { - sub_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, tlv_tree, hf_dcd_burst_diuc_entry_threshold, tvb, (offset+tlv_offset), length, FALSE); - tlv_item = proto_tree_add_item(sub_tree, hf_dcd_burst_diuc_entry_threshold, tvb, (offset+tlv_offset), length, FALSE); - break; - } - case DCD_BURST_TCS_ENABLE: - { - sub_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, tlv_tree, hf_dcd_burst_tcs, tvb, (offset+tlv_offset), length, FALSE); - proto_tree_add_item(sub_tree, hf_dcd_burst_tcs, tvb, (offset+tlv_offset), 1, FALSE); - break; - } - default: - /* ??? */ - break; - } - tlv_offset += length; - } - break; - } - case DCD_BS_EIRP: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_bs_eirp, tvb, offset, tlv_len, FALSE); - tlv_item = proto_tree_add_item(tlv_tree, hf_dcd_bs_eirp, tvb, offset, tlv_len, FALSE); - proto_item_append_text(tlv_item, " dBm"); - break; - } - case DCD_FRAME_DURATION: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_frame_duration, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_frame_duration, tvb, offset, tlv_len, FALSE); - break; - } - case DCD_PHY_TYPE: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_phy_type, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_phy_type, tvb, offset, tlv_len, FALSE); - break; - } - case DCD_POWER_ADJUSTMENT: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_power_adjustment, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_power_adjustment, tvb, offset, 1, FALSE); - break; - } - case DCD_CHANNEL_NR: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_channel_nr, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_channel_nr, tvb, offset, tlv_len, FALSE); - break; - } - case DCD_TTG: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_ttg, tvb, offset, tlv_len, FALSE); - tlv_item = proto_tree_add_item(tlv_tree, hf_dcd_ttg, tvb, offset, tlv_len, FALSE); - proto_item_append_text(tlv_item, " PS"); - break; - } - case DCD_RTG: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_rtg, tvb, offset, tlv_len, FALSE); - tlv_item = proto_tree_add_item(tlv_tree, hf_dcd_rtg, tvb, offset, tlv_len, FALSE); - proto_item_append_text(tlv_item, " PS"); - break; - } -#ifdef WIMAX_16D_2004 - case DCD_RSS: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_rss, tvb, offset, tlv_len, FALSE); - tlv_item = proto_tree_add_item(tlv_tree, hf_dcd_rss, tvb, offset, tlv_len, FALSE); - proto_item_append_text(tlv_item, " dBm"); - break; - } -#else - case DCD_EIRXP: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_eirxp, tvb, offset, tlv_len, FALSE); - tlv_item = proto_tree_add_item(tlv_tree, hf_dcd_eirxp, tvb, offset, tlv_len, FALSE); - proto_item_append_text(tlv_item, " dBm"); - break; - } -#endif - case DCD_CHANNEL_SWITCH_FRAME_NR: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_channel_switch_frame_nr, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_channel_switch_frame_nr, tvb, offset, tlv_len, FALSE); - break; - } - case DCD_FREQUENCY: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_frequency, tvb, offset, tlv_len, FALSE); - tlv_item = proto_tree_add_item(tlv_tree, hf_dcd_frequency, tvb, offset, tlv_len, FALSE); - proto_item_append_text(tlv_item, " kHz"); - break; - } - case DCD_BS_ID: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_bs_id, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_bs_id, tvb, offset, tlv_len, FALSE); - break; - } - case DCD_FRAME_DURATION_CODE: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_frame_duration_code, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_frame_duration_code, tvb, offset, tlv_len, FALSE); - break; - } - case DCD_FRAME_NR: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_frame_nr, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_frame_nr, tvb, offset, tlv_len, FALSE); - break; - } -#ifdef WIMAX_16D_2004 - case DCD_SIZE_CQICH_ID: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_size_cqich_id, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_size_cqich_id, tvb, offset, tlv_len, FALSE); - break; - } + case DCD_SIZE_CQICH_ID: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_size_cqich_id, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_size_cqich_id, tvb, offset, tlv_len, FALSE); + break; + } #endif case DCD_H_ARQ_ACK_DELAY: { @@ -1315,3 +784,526 @@ void dissect_mac_mgmt_msg_dcd_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_t } /* end of TLV process while loop */ } } + +/* Register Wimax Mac Payload Protocol and Dissector */ +void proto_register_mac_mgmt_msg_dcd(void) +{ + /* DCD display */ + static hf_register_info hf[] = + { + { + &hf_dcd_message_type, + { + "MAC Management Message Type", "wmx.macmgtmsgtype.dcd", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_33_asr, + { + "ASR (Anchor Switch Report) Slot Length (M) and Switching Period (L)", "wmx.dcd.asr", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_33_asr_l, + { + "ASR Switching Period (L)", "wmx.dcd.asr.l", + FT_UINT8, BASE_DEC, NULL, 0x0f, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_33_asr_m, + { + "ASR Slot Length (M)", "wmx.dcd.asr.m", + FT_UINT8, BASE_DEC, NULL, 0xf0, NULL, HFILL + } + }, + { + &hf_dcd_bs_eirp, + { + "BS EIRP", "wmx.dcd.bs_eirp", + FT_INT16, BASE_DEC, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_dcd_bs_id, + { + "Base Station ID", "wmx.dcd.bs_id", + FT_ETHER, BASE_NONE, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_dcd_restart_count, + { + "BS Restart Count", "wmx.dcd.bs_restart_count", + FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_dl_burst_diuc, + { + "DIUC", "wmx.dcd.burst.diuc", + FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL + } + }, + { + &hf_dcd_burst_diuc_entry_threshold, + { + "DIUC Minimum Entry Threshold (in 0.25 dB units)", "wmx.dcd.burst.diuc_entry_threshold", + FT_FLOAT, BASE_NONE, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_dcd_burst_diuc_exit_threshold, + { + "DIUC Mandatory Exit Threshold (in 0.25 dB units)", "wmx.dcd.burst.diuc_exit_threshold", + FT_FLOAT, BASE_NONE, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_dcd_burst_fec, + { + "FEC Code Type", "wmx.dcd.burst.fec", + FT_UINT8, BASE_DEC, VALS(vals_dcd_burst_fec_ofdma), 0x00, NULL, HFILL + } + }, + { + &hf_dcd_burst_freq, + { + "Frequency", "wmx.dcd.burst.freq", + FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_dl_burst_reserved, + { + "Reserved", "wmx.dcd.burst.reserved", + FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL + } + }, + { + &hf_dcd_burst_tcs, + { + "TCS", "wmx.dcd.burst.tcs", + FT_UINT8, BASE_DEC, VALS(vals_dcd_burst_tcs), 0x00, NULL, HFILL + } + }, + { + &hf_dcd_channel_nr, + { + "Channel Nr", "wmx.dcd.channel_nr", + FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_dcd_config_change_count, + { + "Configuration Change Count", "wmx.dcd.config_change_count", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter_physical_cinr_measurements, + { + "Default Averaging Parameter for Physical CINR Measurements (in multiples of 1/16)", "wmx.dcd.default_physical_cinr_meas_averaging_parameter", + FT_UINT8, BASE_HEX, NULL, 0xf0, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter, + { + "Default RSSI and CINR Averaging Parameter", "wmx.dcd.default_rssi_and_cinr_averaging_parameter", + FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter_rssi_measurements, + { + "Default Averaging Parameter for RSSI Measurements (in multiples of 1/16)", "wmx.dcd.default_rssi_meas_averaging_parameter", + FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_22_dl_amc_allocated_physical_bands_bitmap, + { + "DL AMC Allocated Physical Bands Bitmap", "wmx.dcd.dl_amc_allocated_phy_bands_bitmap", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dcd_dl_burst_profile_diuc, + { + "DIUC", "wmx.dcd.dl_burst_profile_diuc", + FT_UINT8, BASE_DEC, VALS(diuc_msgs), 0x0F, NULL, HFILL + } + }, + { + &hf_dcd_dl_burst_profile_rsv, + { + "Reserved", "wmx.dcd.dl_burst_profile_rsv", + FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL + } + }, + { + &hf_dcd_downlink_channel_id, + { + "Reserved", "wmx.dcd.dl_channel_id", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_153_downlink_burst_profile_for_mutiple_fec_types, + { + "Downlink Burst Profile for Multiple FEC Types","wimax.dcd.dl_burst_profile_multiple_fec_types", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_34_dl_region_definition, + { + "DL Region Definition", "wmx.dcd.dl_region_definition", + FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_34_dl_region_definition_num_region, + { + "Number of Regions", "wmx.dcd.dl_region_definition.num_region", + FT_UINT8, BASE_DEC, NULL, 0xFC, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_34_dl_region_definition_num_subchannels, + { + "Number of Subchannels", "wmx.dcd.dl_region_definition.num_subchannels", + FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_34_dl_region_definition_num_symbols, + { + "Number of OFDMA Symbols", "wmx.dcd.dl_region_definition.num_symbols", + FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_34_dl_region_definition_reserved, + { + "Reserved", "wmx.dcd.dl_region_definition.reserved", + FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_34_dl_region_definition_subchannel_offset, + { + "Subchannel Offset", "wmx.dcd.dl_region_definition.subchannel_offset", + FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_34_dl_region_definition_symbol_offset, + { + "OFDMA Symbol Offset", "wmx.dcd.dl_region_definition.symbol_offset", + FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL + } + }, +#ifndef WIMAX_16D_2004 + { + &hf_dcd_eirxp, + { + "EIRXP (IR, max)", "wmx.dcd.eirxp", + FT_INT16, BASE_DEC, NULL, 0x00, NULL, HFILL + } + }, +#endif + { + &hf_dcd_frame_duration, + { + "Frame Duration", "wmx.dcd.frame_duration", + FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_dcd_frame_duration_code, + { + "Frame Duration Code", "wmx.dcd.frame_duration_code", + FT_UINT8, BASE_HEX, VALS(vals_dcd_frame_duration), 0x00, NULL, HFILL + } + }, + { + &hf_dcd_frame_nr, + { + "Frame Number", "wmx.dcd.frame_nr", + FT_UINT24, BASE_DEC, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_dcd_frequency, + { + "Downlink Center Frequency", "wmx.dcd.frequency", + FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_31_h_add_threshold, + { + "H_add Threshold", "wmx.dcd.h_add_threshold", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, +#ifdef WIMAX_16D_2004 + { + &hf_dcd_h_arq_ack_delay, + { + "H-ARQ ACK Delay for DL Burst", "wmx.dcd.h_arq_ack_delay_dl_burst", + FT_UINT8, BASE_DEC, NULL, 0x00, "", HFILL + } + }, +#else + { + &hf_dcd_h_arq_ack_delay, + { + "H-ARQ ACK Delay for UL Burst", "wmx.dcd.h_arq_ack_delay_ul_burst", + FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL + } + }, +#endif + { + &hf_dcd_tlv_t_32_h_delete_threshold, + { + "H_delete Threshold", "wmx.dcd.h_delete_threshold", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_50_ho_type_support, + { + "HO Type Support", "wmx.dcd.ho_type_support", + FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_50_ho_type_support_fbss_ho, + { + "FBSS HO", "wmx.dcd.ho_type_support.fbss_ho", + FT_UINT8, BASE_HEX, VALS(tfs_support), 0x20, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_50_ho_type_support_ho, + { + "HO", "wmx.dcd.ho_type_support.ho", + FT_UINT8, BASE_HEX, VALS(tfs_support), 0x80, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_50_ho_type_support_mdho, + { + "MDHO", "wmx.dcd.ho_type_support.mdho", + FT_UINT8, BASE_HEX, VALS(tfs_support), 0x40, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_50_ho_type_support_reserved, + { + "Reserved", "wmx.dcd.ho_type_support.reserved", + FT_UINT8, BASE_HEX, NULL, 0x1f, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_51_hysteresis_margin, + { + "Hysteresis Margin", "wmx.dcd.hysteresis_margin", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dcd_invalid_tlv, + { + "Invalid TLV", "wmx.dcd.invalid_tlv", + FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL + } + }, + { + &hf_dcd_mac_version, + { + "MAC Version", "wmx.dcd.mac_version", + FT_UINT8, BASE_DEC, VALS(vals_dcd_mac_version), 0x00, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_20_maximum_retransmission, + { + "Maximum Retransmission", "wmx.dcd.maximum_retransmission", + FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_60_noise_interference, + { + "Noise and Interference", "wmx.dcd.noise_interference", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_35_paging_group_id, + { + "Paging Group ID", "wmx.dcd.paging_group_id", + FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_36_tusc1_permutation_active_subchannels_bitmap, + { + "TUSC1 permutation active subchannels bitmap", "wmx.dcd.tusc1", + FT_UINT16, BASE_HEX, NULL, 0xFF80, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_37_tusc2_permutation_active_subchannels_bitmap, + { + "TUSC2 permutation active subchannels bitmap", "wmx.dcd.tusc2", + FT_UINT16, BASE_HEX, NULL, 0xFFF8, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_45_paging_interval_length, + { + "Paging Interval Length", "wmx.dcd.paging_interval_length", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_19_permutation_type_for_broadcast_regions_in_harq_zone, + { + "Permutation Type for Broadcast Region in HARQ Zone", "wmx.dcd.permutation_type_broadcast_region_in_harq_zone", + FT_UINT8, BASE_DEC, VALS(vals_dcd_permutation_type), 0x00, NULL, HFILL + } + }, + { + &hf_dcd_phy_type, + { + "PHY Type", "wmx.dcd.phy_type", + FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_dcd_power_adjustment, + { + "Power Adjustment Rule", "wmx.dcd.power_adjustment", + FT_UINT8, BASE_HEX, VALS(vals_dcd_power_adjustmnt), 0x00, NULL, HFILL + } + }, +#ifdef WIMAX_16D_2004 + { + &hf_dcd_rss, + { + "RSS (IR, max)", "wmx.dcd.rss", + FT_INT16, BASE_DEC, NULL, 0x00, "", HFILL + } + }, +#endif + { + &hf_dcd_rtg, + { + "RTG", "wmx.dcd.rtg", + FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL + } + }, +#ifdef WIMAX_16D_2004 + { + &hf_dcd_size_cqich_id, + { + "Size of CQICH-ID Field", "wmx.dcd.size_cqich_id", + FT_UINT8, BASE_DEC, VALS(vals_dcd_size_of_cqich_id), 0x00, "", HFILL + } + }, +#endif + { + &hf_dcd_channel_switch_frame_nr, + { + "Channel Switch Frame Number", "wmx.dcd.switch_frame", + FT_UINT24, BASE_DEC, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_52_time_to_trigger_duration, + { + "Time to Trigger Duration", "wmx.dcd.time_trigger_duration", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_543_trigger_averaging_duration, + { + "Trigger Averaging Duration", "wmx.dcd.trigger_averaging_duration", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_542_trigger_value, + { + "Trigger Value", "wmx.dcd.trigger_value", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dcd_ttg, + { + "TTG", "wmx.dcd.ttg", + FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_541_type_function_action, + { + "Type/Function/Action", "wmx.dcd.type_function_action", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_541_action, + { + "Action", "wmx.dcd.type_function_action.action", + FT_UINT8, BASE_HEX, VALS(vals_dcd_action), 0x7, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_541_function, + { + "Function", "wmx.dcd.type_function_action.function", + FT_UINT8, BASE_HEX, VALS(vals_dcd_function), 0x38, NULL, HFILL + } + }, + { + &hf_dcd_tlv_t_541_type, + { + "Type", "wmx.dcd.type_function_action.type", + FT_UINT8, BASE_HEX, VALS(vals_dcd_type), 0xC0, NULL, HFILL + } + }, + { + &hf_dcd_unknown_type, + { + "Unknown DCD Type", "wmx.dcd.unknown_tlv_value", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + } + }; + + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_mac_mgmt_msg_dcd_decoder, + }; + + proto_mac_mgmt_msg_dcd_decoder = proto_register_protocol ( + "WiMax DCD/UCD Messages", /* name */ + "WiMax DCD/UCD (cd)", /* short name */ + "wmx.cd" /* abbrev */ + ); + + proto_register_field_array(proto_mac_mgmt_msg_dcd_decoder, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); +} diff --git a/plugins/wimax/msg_dlmap.c b/plugins/wimax/msg_dlmap.c index 79830323f6..584b53b493 100644 --- a/plugins/wimax/msg_dlmap.c +++ b/plugins/wimax/msg_dlmap.c @@ -32,8 +32,6 @@ #include "config.h" #endif -#include "moduleinfo.h" - #include #include #include "crc.h" @@ -79,14 +77,11 @@ gint sub_dl_ul_map = 0; extern gint man_ofdma; -/* forward reference */ -void dissect_mac_mgmt_msg_dlmap_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - gint proto_mac_mgmt_msg_dlmap_decoder = -1; static gint ett_dlmap = -1; static gint ett_dlmap_ie = -1; -static gint ett_dlmap_c_ie = -1; +/* static gint ett_dlmap_c_ie = -1; */ static gint ett_109x = -1; /* SUB-DL-UL-MAP */ static gint ett_109x_dl = -1; static gint ett_109x_ul = -1; @@ -130,62 +125,9 @@ static gint ett_286x = -1; static gint ett_286y = -1; static gint ett_286z = -1; static gint ett_305 = -1; -static gint ett_305_dl = -1; +/* static gint ett_305_dl = -1; */ static gint ett_308a = -1; -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_dlmap, - &ett_dlmap_ie, - &ett_dlmap_c_ie, - &ett_109x, - &ett_109x_dl, - &ett_109x_ul, - &ett_275_phy, - &ett_275_1, - &ett_277, - &ett_277b, - &ett_278, - &ett_279, - &ett_280, - &ett_281, - &ett_282, - &ett_283, - &ett_284, - &ett_285, - &ett_286, - &ett_286a, - &ett_286b, - &ett_286c, - &ett_286d, - &ett_286e, - &ett_286f, - &ett_286g, - &ett_286h, - &ett_286i, - &ett_286j, - &ett_286k, - &ett_286l, - &ett_286m, - &ett_286n, - &ett_286o, - &ett_286p, - &ett_286q, - &ett_286r, - &ett_286s, - &ett_286t, - &ett_286u, - &ett_286v, - &ett_286w, - &ett_286x, - &ett_286y, - &ett_286z, - &ett_305, - &ett_305_dl, - &ett_308a, -}; - #define DCD_DOWNLINK_BURST_PROFILE 1 #define DCD_BS_EIRP 2 #define DCD_FRAME_DURATION 3 @@ -1846,374 +1788,8 @@ gint UL_interference_and_noise_level_IE(proto_tree *diuc_tree, const guint8 *buf extern gint wimax_decode_ulmapc(proto_tree *base_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb); -/* Register Wimax Mac Payload Protocol and Dissector */ -void proto_register_mac_mgmt_msg_dlmap(void) -{ - /* DL-MAP fields display */ - static hf_register_info hf[] = - { - { - &hf_dlmap_message_type, - { - "MAC Management Message Type", "wmx.macmgtmsgtype.dlmap", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dlmap_bsid, - { - "Base Station ID", "wmx.dlmap.bsid", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dlmap_dcd, - { - "DCD Count", "wmx.dlmap.dcd", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dlmap_fch_expected, - { - "FCH Expected", "wmx.dlmap.fch_expected", - FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dlmap_ie, - { - "DL-MAP IE", "wmx.dlmap.ie", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dlmap_ie_boosting, - { - "Boosting", "wmx.dlmap.ie.boosting", - FT_UINT32, BASE_DEC, VALS(boost_msgs), 0x00038000, NULL, HFILL - } - }, - { - &hf_dlmap_ie_boosting2, - { - "Boosting", "wmx.dlmap.ie.boosting", - FT_UINT32, BASE_DEC, VALS(boost_msgs), 0x0000E000, NULL, HFILL - } - }, - { - &hf_dlmap_ie_cid, - { - "CID", "wmx.dlmap.ie.cid", - FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dlmap_ie_diuc, - { - "DIUC", "wmx.dlmap.ie.diuc", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dlmap_ie_ncid, - { - "N_CID", "wmx.dlmap.ie.ncid", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dlmap_ie_numsub, - { - "Number of Subchannels", "wmx.dlmap.ie.numsub", - FT_UINT32, BASE_DEC, NULL, 0x000000FC, NULL, HFILL - } - }, - { - &hf_dlmap_ie_numsym, - { - "Number of OFDMA Symbols", "wmx.dlmap.ie.numsym", - FT_UINT32, BASE_DEC, NULL, 0x00007F00, NULL, HFILL - } - }, - { - &hf_dlmap_ie_numsub2, - { - "Number of Subchannels", "wmx.dlmap.ie.numsub", - FT_UINT32, BASE_DEC, NULL, 0x000000FC, NULL, HFILL - } - }, - { - &hf_dlmap_ie_numsym2, - { - "Number of OFDMA Symbols", "wmx.dlmap.ie.numsym", - FT_UINT32, BASE_DEC, NULL, 0x00001F00, NULL, HFILL - } - }, - { - &hf_dlmap_ie_offsub, - { - "Subchannel Offset", "wmx.dlmap.ie.offsub", - FT_UINT32, BASE_DEC, NULL, 0x00FC0000, NULL, HFILL - } - }, - { - &hf_dlmap_ie_offsym, - { - "OFDMA Symbol Offset", "wmx.dlmap.ie.offsym", - FT_UINT32, BASE_DEC, NULL, 0xFF000000, NULL, HFILL - } - }, - /* alt ie format */ - { - &hf_dlmap_ie_offsub2, - { - "Subchannel Offset", "wmx.dlmap.ie.offsub", - FT_UINT32, BASE_DEC, NULL, 0x00FF0000, NULL, HFILL - } - }, - { - &hf_dlmap_ie_offsym2, - { - "OFDMA Symbol Offset", "wmx.dlmap.ie.offsym", - FT_UINT32, BASE_DEC, NULL, 0xFF000000, NULL, HFILL - } - }, - { - &hf_dlmap_ie_rep, - { - "Repetition Coding Indication", "wmx.dlmap.ie.rep", - FT_UINT32, BASE_DEC, VALS(rep_msgs), 0x00000003, NULL, HFILL - } - }, - { - &hf_dlmap_ie_rep2, - { - "Repetition Coding Indication", "wmx.dlmap.ie.rep", - FT_UINT32, BASE_DEC, VALS(rep_msgs), 0x00000003, NULL, HFILL - } - }, - { - &hf_dlmap_ofdma_sym, - { - "Num OFDMA Symbols", "wmx.dlmap.ofdma_sym", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dlmap_phy_fdur, - { - "Frame Duration Code", "wmx.dlmap.phy_fdur", - FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_dlmap_phy_fnum, - { - "Frame Number", "wmx.dlmap.phy_fnum", - FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dlmapc_compr, - { - "Compressed map indicator", "wmx.dlmapc.compr", - FT_UINT16, BASE_DEC, NULL, 0xe000, NULL, HFILL - } - }, - { - &hf_dlmapc_count, - { - "DL IE Count", "wmx.dlmapc.count", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dlmapc_len, - { - "Map message length", "wmx.dlmapc.len", - FT_UINT16, BASE_DEC, NULL, 0x07FF, NULL, HFILL - } - }, - { - &hf_dlmapc_opid, - { - "Operator ID", "wmx.dlmapc.opid", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dlmapc_rsv, - { - "Reserved", "wmx.dlmapc.rsv", - FT_UINT16, BASE_DEC, NULL, 0x0800, NULL, HFILL - } - }, - { - &hf_dlmapc_secid, - { - "Sector ID", "wmx.dlmapc.secid", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dlmapc_sync, - { - "PHY Synchronization Field", "wmx.dlmapc.sync", - FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dlmapc_ulmap, - { - "UL-MAP appended", "wmx.dlmapc.ulmap", - FT_UINT16, BASE_DEC, NULL, 0x1000, NULL, HFILL - } - }, - { - &hf_dlmap_xie_diuc, - { - "Extended DIUC", "wmx.dlmapc.xie_diuc", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dlmap_xie_len, - { - "Length", "wmx.dlmapc.xie_len", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_109x_cmi, - { - "SUB-DL-UL-MAP map indicator", "wmx.dlul.cmi", - FT_UINT16, BASE_DEC, NULL, 0xE000, NULL, HFILL - } - }, - { - &hf_109x_dl, - { - "DL HARQ ACK offset", "wmx.dlul.dl", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_109x_dlie, - { - "DL IE Count", "wmx.dlul.dlie", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_109x_haoi, - { - "HARQ ACK offset indicator", "wmx.dlul.haoi", - FT_UINT16, BASE_DEC, NULL, 0x0001, NULL, HFILL - } - }, - { - &hf_109x_len, - { - "Map message length - The length is limited to 735 bytes at most", "wmx.dlul.len", - FT_UINT16, BASE_DEC, NULL, 0x1FF8, NULL, HFILL - } - }, - { - &hf_109x_rcid, - { - "RCID_Type", "wmx.dlul.rcid", - FT_UINT16, BASE_DEC, NULL, 0x0006, NULL, HFILL - } - }, - { - &hf_109x_subofs, - { - "Subchannel offset", "wmx.dlul.subofs", - FT_UINT8, BASE_DEC, NULL, 0xFE, NULL, HFILL - } - }, - { - &hf_109x_symofs, - { - "OFDMA Symbol offset of subsequent sub-bursts " - "in this Sub-DL-UL-MAP message with reference to " - "the start of UL sub-frame.", "wmx.dlul.symofs", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_109x_rsv, - { - "Reserved", "wmx.dlul.rsv", - FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL - } - }, - { - &hf_109x_ul, - { - "UL HARQ ACK offset", "wmx.dlul.ul", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_308a_cmi, - { - "Compressed map indicator", "wmx.dlmap.reduced_aas_private.cmi", - FT_UINT8, BASE_DEC, NULL, 0xe0, NULL, HFILL - } - }, - { - &hf_308a_mult, - { - "Multiple IE", "wmx.dlmap.reduced_aas_private.mult", - FT_UINT8, BASE_DEC, NULL, 0x02, NULL, HFILL - } - }, - { - &hf_308a_rsv, - { - "Reserved", "wmx.dlmap.reduced_aas_private.rsv", - FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL - } - }, - { - &hf_308a_type, - { - "Compressed Map Type", "wmx.dlmap.reduced_aas_private.type", - FT_UINT8, BASE_DEC, NULL, 0x0d, NULL, HFILL - } - }, - { - &hf_308a_ulmap, - { - "UL-MAP appended", "wmx.dlmap.reduced_aas_private.ulmap", - FT_UINT8, BASE_DEC, NULL, 0x10, NULL, HFILL - } - }, - { - &hf_mac_header_compress_dlmap_crc, - { - "CRC", "wmx.compress_dlmap_crc", - FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL - } - } - }; - - if (proto_mac_mgmt_msg_dlmap_decoder == -1) - { - proto_mac_mgmt_msg_dlmap_decoder = proto_register_protocol ( - "WiMax DLMAP/ULMAP Messages", /* name */ - "WiMax DLMAP/ULMAP (map)", /* short name */ - "wmx.map" /* abbrev */ - ); - - proto_register_field_array(proto_mac_mgmt_msg_dlmap_decoder, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - } -} - -gint dissect_dlmap_ie(proto_tree *ie_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) + +gint dissect_dlmap_ie(proto_tree *ie_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) { /* decode a single DL-MAP IE and return the * length of the IE in nibbles @@ -2830,3 +2406,420 @@ gint wimax_decode_dlmap_reduced_aas(tvbuff_t *tvb, packet_info *pinfo, proto_tre return BIT_TO_BYTE(bit) - offset; } + +/* Register Wimax Mac Payload Protocol and Dissector */ +void proto_register_mac_mgmt_msg_dlmap(void) +{ + /* DL-MAP fields display */ + static hf_register_info hf[] = + { + { + &hf_dlmap_message_type, + { + "MAC Management Message Type", "wmx.macmgtmsgtype.dlmap", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmap_bsid, + { + "Base Station ID", "wmx.dlmap.bsid", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmap_dcd, + { + "DCD Count", "wmx.dlmap.dcd", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmap_fch_expected, + { + "FCH Expected", "wmx.dlmap.fch_expected", + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmap_ie, + { + "DL-MAP IE", "wmx.dlmap.ie", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmap_ie_boosting, + { + "Boosting", "wmx.dlmap.ie.boosting", + FT_UINT32, BASE_DEC, VALS(boost_msgs), 0x00038000, NULL, HFILL + } + }, + { + &hf_dlmap_ie_boosting2, + { + "Boosting", "wmx.dlmap.ie.boosting", + FT_UINT32, BASE_DEC, VALS(boost_msgs), 0x0000E000, NULL, HFILL + } + }, + { + &hf_dlmap_ie_cid, + { + "CID", "wmx.dlmap.ie.cid", + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmap_ie_diuc, + { + "DIUC", "wmx.dlmap.ie.diuc", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmap_ie_ncid, + { + "N_CID", "wmx.dlmap.ie.ncid", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmap_ie_numsub, + { + "Number of Subchannels", "wmx.dlmap.ie.numsub", + FT_UINT32, BASE_DEC, NULL, 0x000000FC, NULL, HFILL + } + }, + { + &hf_dlmap_ie_numsym, + { + "Number of OFDMA Symbols", "wmx.dlmap.ie.numsym", + FT_UINT32, BASE_DEC, NULL, 0x00007F00, NULL, HFILL + } + }, + { + &hf_dlmap_ie_numsub2, + { + "Number of Subchannels", "wmx.dlmap.ie.numsub", + FT_UINT32, BASE_DEC, NULL, 0x000000FC, NULL, HFILL + } + }, + { + &hf_dlmap_ie_numsym2, + { + "Number of OFDMA Symbols", "wmx.dlmap.ie.numsym", + FT_UINT32, BASE_DEC, NULL, 0x00001F00, NULL, HFILL + } + }, + { + &hf_dlmap_ie_offsub, + { + "Subchannel Offset", "wmx.dlmap.ie.offsub", + FT_UINT32, BASE_DEC, NULL, 0x00FC0000, NULL, HFILL + } + }, + { + &hf_dlmap_ie_offsym, + { + "OFDMA Symbol Offset", "wmx.dlmap.ie.offsym", + FT_UINT32, BASE_DEC, NULL, 0xFF000000, NULL, HFILL + } + }, + /* alt ie format */ + { + &hf_dlmap_ie_offsub2, + { + "Subchannel Offset", "wmx.dlmap.ie.offsub", + FT_UINT32, BASE_DEC, NULL, 0x00FF0000, NULL, HFILL + } + }, + { + &hf_dlmap_ie_offsym2, + { + "OFDMA Symbol Offset", "wmx.dlmap.ie.offsym", + FT_UINT32, BASE_DEC, NULL, 0xFF000000, NULL, HFILL + } + }, + { + &hf_dlmap_ie_rep, + { + "Repetition Coding Indication", "wmx.dlmap.ie.rep", + FT_UINT32, BASE_DEC, VALS(rep_msgs), 0x00000003, NULL, HFILL + } + }, + { + &hf_dlmap_ie_rep2, + { + "Repetition Coding Indication", "wmx.dlmap.ie.rep", + FT_UINT32, BASE_DEC, VALS(rep_msgs), 0x00000003, NULL, HFILL + } + }, + { + &hf_dlmap_ofdma_sym, + { + "Num OFDMA Symbols", "wmx.dlmap.ofdma_sym", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmap_phy_fdur, + { + "Frame Duration Code", "wmx.dlmap.phy_fdur", + FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_dlmap_phy_fnum, + { + "Frame Number", "wmx.dlmap.phy_fnum", + FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmapc_compr, + { + "Compressed map indicator", "wmx.dlmapc.compr", + FT_UINT16, BASE_DEC, NULL, 0xe000, NULL, HFILL + } + }, + { + &hf_dlmapc_count, + { + "DL IE Count", "wmx.dlmapc.count", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmapc_len, + { + "Map message length", "wmx.dlmapc.len", + FT_UINT16, BASE_DEC, NULL, 0x07FF, NULL, HFILL + } + }, + { + &hf_dlmapc_opid, + { + "Operator ID", "wmx.dlmapc.opid", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmapc_rsv, + { + "Reserved", "wmx.dlmapc.rsv", + FT_UINT16, BASE_DEC, NULL, 0x0800, NULL, HFILL + } + }, + { + &hf_dlmapc_secid, + { + "Sector ID", "wmx.dlmapc.secid", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmapc_sync, + { + "PHY Synchronization Field", "wmx.dlmapc.sync", + FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmapc_ulmap, + { + "UL-MAP appended", "wmx.dlmapc.ulmap", + FT_UINT16, BASE_DEC, NULL, 0x1000, NULL, HFILL + } + }, + { + &hf_dlmap_xie_diuc, + { + "Extended DIUC", "wmx.dlmapc.xie_diuc", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmap_xie_len, + { + "Length", "wmx.dlmapc.xie_len", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_109x_cmi, + { + "SUB-DL-UL-MAP map indicator", "wmx.dlul.cmi", + FT_UINT16, BASE_DEC, NULL, 0xE000, NULL, HFILL + } + }, + { + &hf_109x_dl, + { + "DL HARQ ACK offset", "wmx.dlul.dl", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_109x_dlie, + { + "DL IE Count", "wmx.dlul.dlie", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_109x_haoi, + { + "HARQ ACK offset indicator", "wmx.dlul.haoi", + FT_UINT16, BASE_DEC, NULL, 0x0001, NULL, HFILL + } + }, + { + &hf_109x_len, + { + "Map message length - The length is limited to 735 bytes at most", "wmx.dlul.len", + FT_UINT16, BASE_DEC, NULL, 0x1FF8, NULL, HFILL + } + }, + { + &hf_109x_rcid, + { + "RCID_Type", "wmx.dlul.rcid", + FT_UINT16, BASE_DEC, NULL, 0x0006, NULL, HFILL + } + }, + { + &hf_109x_subofs, + { + "Subchannel offset", "wmx.dlul.subofs", + FT_UINT8, BASE_DEC, NULL, 0xFE, NULL, HFILL + } + }, + { + &hf_109x_symofs, + { + "OFDMA Symbol offset of subsequent sub-bursts " + "in this Sub-DL-UL-MAP message with reference to " + "the start of UL sub-frame.", "wmx.dlul.symofs", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_109x_rsv, + { + "Reserved", "wmx.dlul.rsv", + FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL + } + }, + { + &hf_109x_ul, + { + "UL HARQ ACK offset", "wmx.dlul.ul", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_308a_cmi, + { + "Compressed map indicator", "wmx.dlmap.reduced_aas_private.cmi", + FT_UINT8, BASE_DEC, NULL, 0xe0, NULL, HFILL + } + }, + { + &hf_308a_mult, + { + "Multiple IE", "wmx.dlmap.reduced_aas_private.mult", + FT_UINT8, BASE_DEC, NULL, 0x02, NULL, HFILL + } + }, + { + &hf_308a_rsv, + { + "Reserved", "wmx.dlmap.reduced_aas_private.rsv", + FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL + } + }, + { + &hf_308a_type, + { + "Compressed Map Type", "wmx.dlmap.reduced_aas_private.type", + FT_UINT8, BASE_DEC, NULL, 0x0d, NULL, HFILL + } + }, + { + &hf_308a_ulmap, + { + "UL-MAP appended", "wmx.dlmap.reduced_aas_private.ulmap", + FT_UINT8, BASE_DEC, NULL, 0x10, NULL, HFILL + } + }, + { + &hf_mac_header_compress_dlmap_crc, + { + "CRC", "wmx.compress_dlmap_crc", + FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL + } + } + }; + + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_dlmap, + &ett_dlmap_ie, + /* &ett_dlmap_c_ie, */ + &ett_109x, + &ett_109x_dl, + &ett_109x_ul, + &ett_275_phy, + &ett_275_1, + &ett_277, + &ett_277b, + &ett_278, + &ett_279, + &ett_280, + &ett_281, + &ett_282, + &ett_283, + &ett_284, + &ett_285, + &ett_286, + &ett_286a, + &ett_286b, + &ett_286c, + &ett_286d, + &ett_286e, + &ett_286f, + &ett_286g, + &ett_286h, + &ett_286i, + &ett_286j, + &ett_286k, + &ett_286l, + &ett_286m, + &ett_286n, + &ett_286o, + &ett_286p, + &ett_286q, + &ett_286r, + &ett_286s, + &ett_286t, + &ett_286u, + &ett_286v, + &ett_286w, + &ett_286x, + &ett_286y, + &ett_286z, + &ett_305, + /* &ett_305_dl, */ + &ett_308a, + }; + + proto_mac_mgmt_msg_dlmap_decoder = proto_register_protocol ( + "WiMax DLMAP/ULMAP Messages", /* name */ + "WiMax DLMAP/ULMAP (map)", /* short name */ + "wmx.map" /* abbrev */ + ); + + proto_register_field_array(proto_mac_mgmt_msg_dlmap_decoder, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); +} diff --git a/plugins/wimax/msg_dsa.c b/plugins/wimax/msg_dsa.c index 4bd75d7479..9f3f1cfd7a 100644 --- a/plugins/wimax/msg_dsa.c +++ b/plugins/wimax/msg_dsa.c @@ -44,30 +44,16 @@ extern gint proto_wimax; -/* forward reference */ -void proto_register_mac_mgmt_msg_dsa(void); -void dissect_mac_mgmt_msg_dsa_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); -void dissect_mac_mgmt_msg_dsa_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); -void dissect_mac_mgmt_msg_dsa_ack_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - gint proto_mac_mgmt_msg_dsa_decoder = -1; static gint ett_mac_mgmt_msg_dsa_req_decoder = -1; static gint ett_mac_mgmt_msg_dsa_rsp_decoder = -1; static gint ett_mac_mgmt_msg_dsa_ack_decoder = -1; -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_mac_mgmt_msg_dsa_req_decoder, - &ett_mac_mgmt_msg_dsa_rsp_decoder, - &ett_mac_mgmt_msg_dsa_ack_decoder, -}; - -static gchar *dsa_msgs[] = -{ - "Dynamic Service Addition Request (DSA-REQ)", - "Dynamic Service Addition Response (DSA-RSP)", - "Dynamic Service Addition Acknowledge (DSA-ACK)" +static const value_string vals_dsa_msgs[] = { + MAC_MGMT_MSG_DSA_REQ, "Dynamic Service Addition Request (DSA-REQ)", + MAC_MGMT_MSG_DSA_RSP, "Dynamic Service Addition Response (DSA-RSP)", + MAC_MGMT_MSG_DSA_ACK, "Dynamic Service Addition Acknowledge (DSA-ACK)", + 0, NULL }; /* fix fields */ @@ -77,62 +63,6 @@ static gint hf_dsa_rsp_message_type = -1; static gint hf_dsa_confirmation_code = -1; static gint hf_dsa_ack_message_type = -1; -/* Register Wimax Mac Payload Protocol and Dissector */ -void proto_register_mac_mgmt_msg_dsa(void) -{ - /* DSx display */ - static hf_register_info hf[] = - { - { - &hf_dsa_ack_message_type, - { - "MAC Management Message Type", "wmx.macmgtmsgtype.dsa_ack", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dsa_req_message_type, - { - "MAC Management Message Type", "wmx.macmgtmsgtype.dsa_req", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dsa_rsp_message_type, - { - "MAC Management Message Type", "wmx.macmgtmsgtype.dsa_rsp", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dsa_confirmation_code, - { - "Confirmation code", "wmx.dsa.confirmation_code", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dsa_transaction_id, - { - "Transaction ID", "wmx.dsa.transaction_id", - FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL - } - } - }; - - - if (proto_mac_mgmt_msg_dsa_decoder == -1) - { - proto_mac_mgmt_msg_dsa_decoder = proto_register_protocol ( - "WiMax DSA/C/D Messages", /* name */ - "WiMax DSA/C/D (ds)", /* short name */ - "wmx.ds" /* abbrev */ - ); - - proto_register_field_array(proto_mac_mgmt_msg_dsa_decoder, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - } -} void dissect_mac_mgmt_msg_dsa_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { @@ -151,7 +81,8 @@ void dissect_mac_mgmt_msg_dsa_req_decoder(tvbuff_t *tvb, packet_info *pinfo, pro /* Get the tvb reported length */ tvb_len = tvb_reported_length(tvb); /* display MAC message type */ - dsa_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dsa_decoder, tvb, offset, tvb_len, "%s (%u bytes)", dsa_msgs[payload_type - MAC_MGMT_MSG_DSA_REQ], tvb_len); + dsa_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dsa_decoder, tvb, offset, tvb_len, + "%s (%u bytes)", val_to_str(payload_type, vals_dsa_msgs, "Unknown"), tvb_len); /* add MAC DSx subtree */ dsa_tree = proto_item_add_subtree(dsa_item, ett_mac_mgmt_msg_dsa_req_decoder); /* Decode and display the Uplink Channel Descriptor (UCD) */ @@ -185,7 +116,8 @@ void dissect_mac_mgmt_msg_dsa_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, pro /* Get the tvb reported length */ tvb_len = tvb_reported_length(tvb); /* display MAC message type */ - dsa_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dsa_decoder, tvb, offset, tvb_len, "%s (%u bytes)", dsa_msgs[payload_type - MAC_MGMT_MSG_DSA_REQ], tvb_len); + dsa_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dsa_decoder, tvb, offset, tvb_len, + "%s (%u bytes)", val_to_str(payload_type, vals_dsa_msgs, "Unknown"), tvb_len); /* add MAC DSx subtree */ dsa_tree = proto_item_add_subtree(dsa_item, ett_mac_mgmt_msg_dsa_rsp_decoder); /* Decode and display the Uplink Channel Descriptor (UCD) */ @@ -223,7 +155,8 @@ void dissect_mac_mgmt_msg_dsa_ack_decoder(tvbuff_t *tvb, packet_info *pinfo, pro /* Get the tvb reported length */ tvb_len = tvb_reported_length(tvb); /* display MAC message type */ - dsa_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dsa_decoder, tvb, offset, tvb_len, "%s (%u bytes)", dsa_msgs[payload_type - MAC_MGMT_MSG_DSA_REQ], tvb_len); + dsa_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dsa_decoder, tvb, offset, tvb_len, + "%s (%u bytes)", val_to_str(payload_type, vals_dsa_msgs, "Unknown"), tvb_len); /* add MAC DSx subtree */ dsa_tree = proto_item_add_subtree(dsa_item, ett_mac_mgmt_msg_dsa_ack_decoder); /* Decode and display the Uplink Channel Descriptor (UCD) */ @@ -244,3 +177,63 @@ void dissect_mac_mgmt_msg_dsa_ack_decoder(tvbuff_t *tvb, packet_info *pinfo, pro } } +/* Register Wimax Mac Payload Protocol and Dissector */ +void proto_register_mac_mgmt_msg_dsa(void) +{ + /* DSx display */ + static hf_register_info hf[] = + { + { + &hf_dsa_ack_message_type, + { + "MAC Management Message Type", "wmx.macmgtmsgtype.dsa_ack", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dsa_req_message_type, + { + "MAC Management Message Type", "wmx.macmgtmsgtype.dsa_req", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dsa_rsp_message_type, + { + "MAC Management Message Type", "wmx.macmgtmsgtype.dsa_rsp", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dsa_confirmation_code, + { + "Confirmation code", "wmx.dsa.confirmation_code", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dsa_transaction_id, + { + "Transaction ID", "wmx.dsa.transaction_id", + FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL + } + } + }; + + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_mac_mgmt_msg_dsa_req_decoder, + &ett_mac_mgmt_msg_dsa_rsp_decoder, + &ett_mac_mgmt_msg_dsa_ack_decoder, + }; + + proto_mac_mgmt_msg_dsa_decoder = proto_register_protocol ( + "WiMax DSA/C/D Messages", /* name */ + "WiMax DSA/C/D (ds)", /* short name */ + "wmx.ds" /* abbrev */ + ); + + proto_register_field_array(proto_mac_mgmt_msg_dsa_decoder, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); +} diff --git a/plugins/wimax/msg_dsc.c b/plugins/wimax/msg_dsc.c index 287e19aeab..049b33789f 100644 --- a/plugins/wimax/msg_dsc.c +++ b/plugins/wimax/msg_dsc.c @@ -44,30 +44,16 @@ extern gint proto_mac_mgmt_msg_dsa_decoder; -/* forward reference */ -void proto_register_mac_mgmt_msg_dsc(void); -void dissect_mac_mgmt_msg_dsc_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); -void dissect_mac_mgmt_msg_dsc_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); -void dissect_mac_mgmt_msg_dsc_ack_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - static gint proto_mac_mgmt_msg_dsc_decoder = -1; static gint ett_mac_mgmt_msg_dsc_req_decoder = -1; static gint ett_mac_mgmt_msg_dsc_rsp_decoder = -1; static gint ett_mac_mgmt_msg_dsc_ack_decoder = -1; -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_mac_mgmt_msg_dsc_req_decoder, - &ett_mac_mgmt_msg_dsc_rsp_decoder, - &ett_mac_mgmt_msg_dsc_ack_decoder -}; - -static gchar *dsc_msgs[] = -{ - "Dynamic Service Change Request (DSC-REQ)", - "Dynamic Service Change Response (DSC-RSP)", - "Dynamic Service Change Acknowledge (DSC-ACK)" +static const value_string vals_dsc_msgs[] = { + MAC_MGMT_MSG_DSC_REQ, "Dynamic Service Change Request (DSC-REQ)", + MAC_MGMT_MSG_DSC_RSP, "Dynamic Service Change Response (DSC-RSP)", + MAC_MGMT_MSG_DSC_ACK, "Dynamic Service Change Acknowledge (DSC-ACK)", + 0, NULL }; /* fix fields */ @@ -77,57 +63,6 @@ static gint hf_dsc_rsp_message_type = -1; static gint hf_dsc_confirmation_code = -1; static gint hf_dsc_ack_message_type = -1; -/* Register Wimax Mac Payload Protocol and Dissector */ -void proto_register_mac_mgmt_msg_dsc(void) -{ - /* DSx display */ - static hf_register_info hf[] = - { - { - &hf_dsc_ack_message_type, - { - "MAC Management Message Type", "wmx.macmgtmsgtype.dsc_ack", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dsc_req_message_type, - { - "MAC Management Message Type", "wmx.macmgtmsgtype.dsc_req", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dsc_rsp_message_type, - { - "MAC Management Message Type", "wmx.macmgtmsgtype.dsc_rsp", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dsc_confirmation_code, - { - "Confirmation code", "wmx.dsc.confirmation_code", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dsc_transaction_id, - { - "Transaction ID", "wmx.dsc.transaction_id", - FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL - } - } - }; - - if (proto_mac_mgmt_msg_dsc_decoder == -1) - { - proto_mac_mgmt_msg_dsc_decoder = proto_mac_mgmt_msg_dsa_decoder; - - proto_register_field_array(proto_mac_mgmt_msg_dsc_decoder, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - } -} void dissect_mac_mgmt_msg_dsc_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { @@ -147,7 +82,8 @@ void dissect_mac_mgmt_msg_dsc_req_decoder(tvbuff_t *tvb, packet_info *pinfo, pro /* Get the tvb reported length */ tvb_len = tvb_reported_length(tvb); /* display MAC message type */ - dsc_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dsc_decoder, tvb, offset, tvb_len, "%s (%u bytes)", dsc_msgs[payload_type - MAC_MGMT_MSG_DSC_REQ], tvb_len); + dsc_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dsc_decoder, tvb, offset, tvb_len, + "%s (%u bytes)", val_to_str(payload_type, vals_dsc_msgs, "Unknown"), tvb_len); /* add MAC DSx subtree */ dsc_tree = proto_item_add_subtree(dsc_item, ett_mac_mgmt_msg_dsc_req_decoder); /* Decode and display the Uplink Channel Descriptor (UCD) */ @@ -184,7 +120,8 @@ void dissect_mac_mgmt_msg_dsc_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, pro /* Get the tvb reported length */ tvb_len = tvb_reported_length(tvb); /* display MAC message type */ - dsc_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dsc_decoder, tvb, offset, tvb_len, "%s (%u bytes)", dsc_msgs[payload_type - MAC_MGMT_MSG_DSC_REQ], tvb_len); + dsc_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dsc_decoder, tvb, offset, tvb_len, + "%s (%u bytes)", val_to_str(payload_type, vals_dsc_msgs, "Unknown"), tvb_len); /* add MAC DSx subtree */ dsc_tree = proto_item_add_subtree(dsc_item, ett_mac_mgmt_msg_dsc_rsp_decoder); /* Decode and display the Uplink Channel Descriptor (UCD) */ @@ -225,7 +162,8 @@ void dissect_mac_mgmt_msg_dsc_ack_decoder(tvbuff_t *tvb, packet_info *pinfo, pro /* Get the tvb reported length */ tvb_len = tvb_reported_length(tvb); /* display MAC message type */ - dsc_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dsc_decoder, tvb, offset, tvb_len, "%s (%u bytes)", dsc_msgs[payload_type - MAC_MGMT_MSG_DSC_REQ], tvb_len); + dsc_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dsc_decoder, tvb, offset, tvb_len, + "%s (%u bytes)", val_to_str(payload_type, vals_dsc_msgs, "Unknown"), tvb_len); /* add MAC DSx subtree */ dsc_tree = proto_item_add_subtree(dsc_item, ett_mac_mgmt_msg_dsc_ack_decoder); /* Decode and display the Uplink Channel Descriptor (UCD) */ @@ -248,3 +186,59 @@ void dissect_mac_mgmt_msg_dsc_ack_decoder(tvbuff_t *tvb, packet_info *pinfo, pro } } +/* Register Wimax Mac Payload Protocol and Dissector */ +void proto_register_mac_mgmt_msg_dsc(void) +{ + /* DSx display */ + static hf_register_info hf[] = + { + { + &hf_dsc_ack_message_type, + { + "MAC Management Message Type", "wmx.macmgtmsgtype.dsc_ack", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dsc_req_message_type, + { + "MAC Management Message Type", "wmx.macmgtmsgtype.dsc_req", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dsc_rsp_message_type, + { + "MAC Management Message Type", "wmx.macmgtmsgtype.dsc_rsp", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dsc_confirmation_code, + { + "Confirmation code", "wmx.dsc.confirmation_code", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dsc_transaction_id, + { + "Transaction ID", "wmx.dsc.transaction_id", + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL + } + } + }; + + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_mac_mgmt_msg_dsc_req_decoder, + &ett_mac_mgmt_msg_dsc_rsp_decoder, + &ett_mac_mgmt_msg_dsc_ack_decoder + }; + + proto_mac_mgmt_msg_dsc_decoder = proto_mac_mgmt_msg_dsa_decoder; + + proto_register_field_array(proto_mac_mgmt_msg_dsc_decoder, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); +} diff --git a/plugins/wimax/msg_dsd.c b/plugins/wimax/msg_dsd.c index 13e557ddbc..599a40465b 100644 --- a/plugins/wimax/msg_dsd.c +++ b/plugins/wimax/msg_dsd.c @@ -44,34 +44,19 @@ extern gint proto_mac_mgmt_msg_dsa_decoder; -/* forward reference */ -void proto_register_mac_mgmt_msg_dsd(void); -void dissect_mac_mgmt_msg_dsd_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); -void dissect_mac_mgmt_msg_dsd_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - gint proto_mac_mgmt_msg_dsd_decoder = -1; static gint ett_mac_mgmt_msg_dsd_req_decoder = -1; static gint ett_mac_mgmt_msg_dsd_rsp_decoder = -1; -static gint ett_dsd_ul_sfe_decoder = -1; -static gint ett_dsd_dl_sfe_decoder = -1; -static gint ett_dsd_hmac_tuple = -1; -static gint ett_dsd_cmac_tuple = -1; - -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_mac_mgmt_msg_dsd_req_decoder, - &ett_mac_mgmt_msg_dsd_rsp_decoder, - &ett_dsd_ul_sfe_decoder, - &ett_dsd_dl_sfe_decoder, - &ett_dsd_hmac_tuple, - &ett_dsd_cmac_tuple, -}; +/* static gint ett_dsd_ul_sfe_decoder = -1; */ +/* static gint ett_dsd_dl_sfe_decoder = -1; */ +/* static gint ett_dsd_hmac_tuple = -1; */ +/* static gint ett_dsd_cmac_tuple = -1; */ -static gchar *dsd_msgs[] = +static const value_string vals_dsd_msgs[] = { - "Dynamic Service Deletion Request (DSD-REQ)", - "Dynamic Service Deletion Response (DSD-RSP)" + MAC_MGMT_MSG_DSD_REQ, "Dynamic Service Deletion Request (DSD-REQ)", + MAC_MGMT_MSG_DSD_RSP, "Dynamic Service Deletion Response (DSD-RSP)", + 0, NULL }; /* fix fields */ @@ -83,57 +68,6 @@ static gint hf_dsd_confirmation_code = -1; static gint hf_dsd_invalid_tlv = -1; static gint hf_dsd_unknown_type = -1; -/* Register Wimax Mac Payload Protocol and Dissector */ -void proto_register_mac_mgmt_msg_dsd(void) -{ - /* DSx display */ - static hf_register_info hf[] = - { - { - &hf_dsd_req_message_type, - { - "MAC Management Message Type", "wmx.macmgtmsgtype.dsd_req", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dsd_rsp_message_type, - { - "MAC Management Message Type", "wmx.macmgtmsgtype.dsd_rsp", - FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL - } - }, - { - &hf_dsd_confirmation_code, - { - "Confirmation code", "wmx.dsd.confirmation_code", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dsd_service_flow_id, - { - "Service Flow ID", "wmx.dsd.service_flow_id", - FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_dsd_transaction_id, - { - "Transaction ID", "wmx.dsd.transaction_id", - FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL - } - } - }; - - if (proto_mac_mgmt_msg_dsd_decoder == -1) - { - proto_mac_mgmt_msg_dsd_decoder = proto_mac_mgmt_msg_dsa_decoder; - - proto_register_field_array(proto_mac_mgmt_msg_dsd_decoder, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - } -} void dissect_mac_mgmt_msg_dsd_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { @@ -155,7 +89,8 @@ void dissect_mac_mgmt_msg_dsd_req_decoder(tvbuff_t *tvb, packet_info *pinfo, pro /* Get the tvb reported length */ tvb_len = tvb_reported_length(tvb); /* display MAC message type */ - dsd_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dsd_decoder, tvb, offset, tvb_len, "%s (%u bytes)", dsd_msgs[payload_type - MAC_MGMT_MSG_DSD_REQ], tvb_len); + dsd_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dsd_decoder, tvb, offset, tvb_len, + "%s (%u bytes)", val_to_str(payload_type, vals_dsd_msgs, "Unknown"), tvb_len); /* add MAC DSx subtree */ dsd_tree = proto_item_add_subtree(dsd_item, ett_mac_mgmt_msg_dsd_req_decoder); /* Decode and display the DSD message */ @@ -239,7 +174,8 @@ void dissect_mac_mgmt_msg_dsd_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, pro /* Get the tvb reported length */ tvb_len = tvb_reported_length(tvb); /* display MAC message type */ - dsd_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dsd_decoder, tvb, offset, tvb_len, "%s (%u bytes)", dsd_msgs[payload_type - MAC_MGMT_MSG_DSD_REQ], tvb_len); + dsd_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dsd_decoder, tvb, offset, tvb_len, + "%s (%u bytes)", val_to_str(payload_type, vals_dsd_msgs, "Unknown"), tvb_len); /* add MAC DSx subtree */ dsd_tree = proto_item_add_subtree(dsd_item, ett_mac_mgmt_msg_dsd_rsp_decoder); /* Decode and display the DSD message */ @@ -306,3 +242,63 @@ void dissect_mac_mgmt_msg_dsd_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, pro } /* end of while loop */ } } + +/* Register Wimax Mac Payload Protocol and Dissector */ +void proto_register_mac_mgmt_msg_dsd(void) +{ + /* DSx display */ + static hf_register_info hf[] = + { + { + &hf_dsd_req_message_type, + { + "MAC Management Message Type", "wmx.macmgtmsgtype.dsd_req", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dsd_rsp_message_type, + { + "MAC Management Message Type", "wmx.macmgtmsgtype.dsd_rsp", + FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL + } + }, + { + &hf_dsd_confirmation_code, + { + "Confirmation code", "wmx.dsd.confirmation_code", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dsd_service_flow_id, + { + "Service Flow ID", "wmx.dsd.service_flow_id", + FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dsd_transaction_id, + { + "Transaction ID", "wmx.dsd.transaction_id", + FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL + } + } + }; + + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_mac_mgmt_msg_dsd_req_decoder, + &ett_mac_mgmt_msg_dsd_rsp_decoder, + /* &ett_dsd_ul_sfe_decoder, */ + /* &ett_dsd_dl_sfe_decoder, */ + /* &ett_dsd_hmac_tuple, */ + /* &ett_dsd_cmac_tuple, */ + }; + + proto_mac_mgmt_msg_dsd_decoder = proto_mac_mgmt_msg_dsa_decoder; + + proto_register_field_array(proto_mac_mgmt_msg_dsd_decoder, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); +} diff --git a/plugins/wimax/msg_dsx_rvd.c b/plugins/wimax/msg_dsx_rvd.c index 63a1bb208c..ee9fb03f93 100644 --- a/plugins/wimax/msg_dsx_rvd.c +++ b/plugins/wimax/msg_dsx_rvd.c @@ -36,55 +36,14 @@ #include #include "wimax_mac.h" -/* forward reference */ -void dissect_mac_mgmt_msg_dsx_rvd_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - static gint proto_mac_mgmt_msg_dsx_rvd_decoder = -1; static gint ett_mac_mgmt_msg_dsx_rvd_decoder = -1; -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_mac_mgmt_msg_dsx_rvd_decoder, -}; - /* fix fields */ static gint hf_dsx_rvd_message_type = -1; static gint hf_dsx_rvd_transaction_id = -1; static gint hf_dsx_rvd_confirmation_code = -1; -/* Register Wimax Mac Payload Protocol and Dissector */ -void proto_register_mac_mgmt_msg_dsx_rvd(void) -{ - /* DSX_RVD display */ - static hf_register_info hf_dsx_rvd[] = - { - { - &hf_dsx_rvd_message_type, - {"MAC Management Message Type", "wmx.macmgtmsgtype.dsx_rvd", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} - }, - { - &hf_dsx_rvd_confirmation_code, - { "Confirmation code", "wmx.dsx_rvd.confirmation_code", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} - }, - { - &hf_dsx_rvd_transaction_id, - { "Transaction ID", "wmx.dsx_rvd.transaction_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL} - } - }; - - if (proto_mac_mgmt_msg_dsx_rvd_decoder == -1) - { - proto_mac_mgmt_msg_dsx_rvd_decoder = proto_register_protocol ( - "WiMax DSX-RVD Message", /* name */ - "WiMax DSX-RVD (dsx)", /* short name */ - "wmx.dsx" /* abbrev */ - ); - - proto_register_field_array(proto_mac_mgmt_msg_dsx_rvd_decoder, hf_dsx_rvd, array_length(hf_dsx_rvd)); - proto_register_subtree_array(ett, array_length(ett)); - } -} /* Decode DSX-RVD messages. */ void dissect_mac_mgmt_msg_dsx_rvd_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) @@ -119,3 +78,39 @@ void dissect_mac_mgmt_msg_dsx_rvd_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree_add_item(dsx_rvd_tree, hf_dsx_rvd_confirmation_code, tvb, offset, 1, FALSE); } } + +/* Register Wimax Mac Payload Protocol and Dissector */ +void proto_register_mac_mgmt_msg_dsx_rvd(void) +{ + /* DSX_RVD display */ + static hf_register_info hf_dsx_rvd[] = + { + { + &hf_dsx_rvd_message_type, + {"MAC Management Message Type", "wmx.macmgtmsgtype.dsx_rvd", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} + }, + { + &hf_dsx_rvd_confirmation_code, + { "Confirmation code", "wmx.dsx_rvd.confirmation_code", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} + }, + { + &hf_dsx_rvd_transaction_id, + { "Transaction ID", "wmx.dsx_rvd.transaction_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL} + } + }; + + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_mac_mgmt_msg_dsx_rvd_decoder, + }; + + proto_mac_mgmt_msg_dsx_rvd_decoder = proto_register_protocol ( + "WiMax DSX-RVD Message", /* name */ + "WiMax DSX-RVD (dsx)", /* short name */ + "wmx.dsx" /* abbrev */ + ); + + proto_register_field_array(proto_mac_mgmt_msg_dsx_rvd_decoder, hf_dsx_rvd, array_length(hf_dsx_rvd)); + proto_register_subtree_array(ett, array_length(ett)); +} diff --git a/plugins/wimax/msg_fpc.c b/plugins/wimax/msg_fpc.c index 4a91046b4e..e0748309f4 100644 --- a/plugins/wimax/msg_fpc.c +++ b/plugins/wimax/msg_fpc.c @@ -32,8 +32,6 @@ #include "config.h" #endif -#include "moduleinfo.h" - #include #include #include "crc.h" @@ -42,19 +40,10 @@ extern gint man_ofdma; -/* Forward reference */ -void dissect_mac_mgmt_msg_fpc_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - static gint proto_mac_mgmt_msg_fpc_decoder = -1; static gint ett_mac_mgmt_msg_fpc_decoder = -1; -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_mac_mgmt_msg_fpc_decoder, -}; - /* FPC fields */ static gint hf_fpc_message_type = -1; static gint hf_fpc_number_of_stations = -1; @@ -63,68 +52,6 @@ static gint hf_fpc_power_adjust = -1; static gint hf_fpc_power_measurement_frame = -1; static gint hf_fpc_invalid_tlv = -1; -/* Register Wimax Mac Payload Protocol and Dissector */ -void proto_register_mac_mgmt_msg_fpc(void) -{ - /* FPC fields display */ - static hf_register_info hf[] = - { - { - &hf_fpc_message_type, - { - "MAC Management Message Type", "wmx.macmgtmsgtype.fpc", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL - } - }, - { - &hf_fpc_basic_cid, - { - "Basic CID", "wmx.fpc.basic_cid", - FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_fpc_invalid_tlv, - { - "Invalid TLV", "wmx.fpc.invalid_tlv", - FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL - } - }, - { - &hf_fpc_number_of_stations, - { - "Number of stations", "wmx.fpc.number_stations", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_fpc_power_adjust, - { - "Power Adjust. Signed change in power level (incr of 0.25dB) that the SS shall apply to its current power setting", "wmx.fpc.power_adjust", - FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_fpc_power_measurement_frame, - { - "Power measurement frame. The 8 LSB of the frame number in which the BS measured the power corrections referred to in the message", "wmx.fpc.power_measurement_frame", - FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - } - }; - - if (proto_mac_mgmt_msg_fpc_decoder == -1) { - proto_mac_mgmt_msg_fpc_decoder = proto_register_protocol ( - "WiMax FPC Message", /* name */ - "WiMax FPC (fpc)", /* short name */ - "wmx.fpc" /* abbrev */ - ); - - proto_register_field_array(proto_mac_mgmt_msg_fpc_decoder, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - } -} /* Decode FPC messages. */ void dissect_mac_mgmt_msg_fpc_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) @@ -186,3 +113,69 @@ void dissect_mac_mgmt_msg_fpc_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, pro } } +/* Register Wimax Mac Payload Protocol and Dissector */ +void proto_register_mac_mgmt_msg_fpc(void) +{ + /* FPC fields display */ + static hf_register_info hf[] = + { + { + &hf_fpc_message_type, + { + "MAC Management Message Type", "wmx.macmgtmsgtype.fpc", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL + } + }, + { + &hf_fpc_basic_cid, + { + "Basic CID", "wmx.fpc.basic_cid", + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_fpc_invalid_tlv, + { + "Invalid TLV", "wmx.fpc.invalid_tlv", + FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL + } + }, + { + &hf_fpc_number_of_stations, + { + "Number of stations", "wmx.fpc.number_stations", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_fpc_power_adjust, + { + "Power Adjust. Signed change in power level (incr of 0.25dB) that the SS shall apply to its current power setting", "wmx.fpc.power_adjust", + FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_fpc_power_measurement_frame, + { + "Power measurement frame. The 8 LSB of the frame number in which the BS measured the power corrections referred to in the message", "wmx.fpc.power_measurement_frame", + FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + } + }; + + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_mac_mgmt_msg_fpc_decoder, + }; + + proto_mac_mgmt_msg_fpc_decoder = proto_register_protocol ( + "WiMax FPC Message", /* name */ + "WiMax FPC (fpc)", /* short name */ + "wmx.fpc" /* abbrev */ + ); + + proto_register_field_array(proto_mac_mgmt_msg_fpc_decoder, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); +} diff --git a/plugins/wimax/msg_pkm.c b/plugins/wimax/msg_pkm.c index 7b8c283dc6..3eda0d46e3 100644 --- a/plugins/wimax/msg_pkm.c +++ b/plugins/wimax/msg_pkm.c @@ -36,30 +36,16 @@ #include "config.h" #endif -#include "moduleinfo.h" - #include #include #include "wimax_tlv.h" #include "wimax_mac.h" #include "wimax_utils.h" -/* forward reference */ -void proto_register_mac_mgmt_msg_pkm(void); -void dissect_mac_mgmt_msg_pkm_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); -void dissect_mac_mgmt_msg_pkm_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - static gint proto_mac_mgmt_msg_pkm_decoder = -1; static gint ett_mac_mgmt_msg_pkm_req_decoder = -1; static gint ett_mac_mgmt_msg_pkm_rsp_decoder = -1; -/* Setup protocol subtree array */ -static gint *ett_pkm[] = -{ - &ett_mac_mgmt_msg_pkm_req_decoder, - &ett_mac_mgmt_msg_pkm_rsp_decoder, -}; - static const value_string vals_pkm_msg_code[] = { {3, "SA ADD"}, @@ -99,42 +85,6 @@ static gint hf_pkm_rsp_message_type = -1; static gint hf_pkm_msg_code = -1; static gint hf_pkm_msg_pkm_id = -1; -/* Register Wimax Mac PKM-REQ/RSP Messages Dissectors */ -void proto_register_mac_mgmt_msg_pkm(void) -{ - /* PKM display */ - static hf_register_info hf_pkm[] = - { - { - &hf_pkm_msg_code, - {"Code", "wmx.pkm.msg_code",FT_UINT8, BASE_DEC, VALS(vals_pkm_msg_code),0x0, NULL, HFILL} - }, - { - &hf_pkm_msg_pkm_id, - {"PKM Identifier", "wmx.pkm.msg_pkm_identifier",FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} - }, - { - &hf_pkm_req_message_type, - {"MAC Management Message Type", "wmx.macmgtmsgtype.pkm_req", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} - }, - { - &hf_pkm_rsp_message_type, - {"MAC Management Message Type", "wmx.macmgtmsgtype.pkm_rsp", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} - } - }; - - if (proto_mac_mgmt_msg_pkm_decoder == -1) - { - proto_mac_mgmt_msg_pkm_decoder = proto_register_protocol ( - "WiMax PKM-REQ/RSP Messages", /* name */ - "WiMax PKM-REQ/RSP (pkm)", /* short name */ - "wmx.pkm" /* abbrev */ - ); - - proto_register_field_array(proto_mac_mgmt_msg_pkm_decoder, hf_pkm, array_length(hf_pkm)); - proto_register_subtree_array(ett_pkm, array_length(ett_pkm)); - } -} /* Wimax Mac PKM-REQ Message Dissector */ void dissect_mac_mgmt_msg_pkm_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) @@ -219,3 +169,44 @@ void dissect_mac_mgmt_msg_pkm_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, pro wimax_pkm_tlv_encoded_attributes_decoder(tvb_new_subset(tvb, offset, length, length), pinfo, pkm_tree); } } + +/* Register Wimax Mac PKM-REQ/RSP Messages Dissectors */ +void proto_register_mac_mgmt_msg_pkm(void) +{ + /* PKM display */ + static hf_register_info hf_pkm[] = + { + { + &hf_pkm_msg_code, + {"Code", "wmx.pkm.msg_code",FT_UINT8, BASE_DEC, VALS(vals_pkm_msg_code),0x0, NULL, HFILL} + }, + { + &hf_pkm_msg_pkm_id, + {"PKM Identifier", "wmx.pkm.msg_pkm_identifier",FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} + }, + { + &hf_pkm_req_message_type, + {"MAC Management Message Type", "wmx.macmgtmsgtype.pkm_req", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} + }, + { + &hf_pkm_rsp_message_type, + {"MAC Management Message Type", "wmx.macmgtmsgtype.pkm_rsp", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} + } + }; + + /* Setup protocol subtree array */ + static gint *ett_pkm[] = + { + &ett_mac_mgmt_msg_pkm_req_decoder, + &ett_mac_mgmt_msg_pkm_rsp_decoder, + }; + + proto_mac_mgmt_msg_pkm_decoder = proto_register_protocol ( + "WiMax PKM-REQ/RSP Messages", /* name */ + "WiMax PKM-REQ/RSP (pkm)", /* short name */ + "wmx.pkm" /* abbrev */ + ); + + proto_register_field_array(proto_mac_mgmt_msg_pkm_decoder, hf_pkm, array_length(hf_pkm)); + proto_register_subtree_array(ett_pkm, array_length(ett_pkm)); +} diff --git a/plugins/wimax/msg_prc_lt_ctrl.c b/plugins/wimax/msg_prc_lt_ctrl.c index 562de1292f..59437b40f2 100644 --- a/plugins/wimax/msg_prc_lt_ctrl.c +++ b/plugins/wimax/msg_prc_lt_ctrl.c @@ -32,8 +32,6 @@ #include "config.h" #endif -#include "moduleinfo.h" - #include #include #include "crc.h" @@ -42,19 +40,10 @@ extern gint man_ofdma; -/* Forward reference */ -void dissect_mac_mgmt_msg_prc_lt_ctrl_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - static gint proto_mac_mgmt_msg_prc_lt_ctrl_decoder = -1; static gint ett_mac_mgmt_msg_prc_lt_ctrl_decoder = -1; -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_mac_mgmt_msg_prc_lt_ctrl_decoder, -}; - /* PRC-LT-CTRL fields */ static gint hf_prc_lt_ctrl_message_type = -1; static gint hf_prc_lt_ctrl_precoding = -1; @@ -67,6 +56,46 @@ static const value_string vals_turn_on[] = { {0, NULL} }; + +/* Decode PRC-LT-CTRL messages. */ +void dissect_mac_mgmt_msg_prc_lt_ctrl_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +{ + guint offset = 0; + guint tvb_len, payload_type; + proto_item *prc_lt_ctrl_item = NULL; + proto_tree *prc_lt_ctrl_tree = NULL; + + /* Ensure the right payload type */ + payload_type = tvb_get_guint8(tvb, 0); + if(payload_type != MAC_MGMT_MSG_PRC_LT_CTRL) + { + return; + } + + if (tree) + { /* we are being asked for details */ + + /* Get the tvb reported length */ + tvb_len = tvb_reported_length(tvb); + /* display MAC payload type PRC-LT-CTRL */ + prc_lt_ctrl_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_prc_lt_ctrl_decoder, tvb, 0, tvb_len, "MAC Management Message, PRC-LT-CTRL (65)"); + + /* add MAC PRC-LT-CTRL subtree */ + prc_lt_ctrl_tree = proto_item_add_subtree(prc_lt_ctrl_item, ett_mac_mgmt_msg_prc_lt_ctrl_decoder); + + /* display the Message Type */ + proto_tree_add_item(prc_lt_ctrl_tree, hf_prc_lt_ctrl_message_type, tvb, offset, 1, FALSE); + offset ++; + + /* display whether to Setup or Tear-down the + * long-term MIMO precoding delay */ + proto_tree_add_item(prc_lt_ctrl_tree, hf_prc_lt_ctrl_precoding, tvb, offset, 1, FALSE); + + /* display the Precoding Delay */ + proto_tree_add_item(prc_lt_ctrl_tree, hf_prc_lt_ctrl_precoding_delay, tvb, offset, 1, FALSE); + } +} + /* Register Wimax Mac Payload Protocol and Dissector */ void proto_register_mac_mgmt_msg_prc_lt_ctrl(void) { @@ -105,54 +134,18 @@ void proto_register_mac_mgmt_msg_prc_lt_ctrl(void) } }; - if (proto_mac_mgmt_msg_prc_lt_ctrl_decoder == -1) { - proto_mac_mgmt_msg_prc_lt_ctrl_decoder = proto_register_protocol ( - "WiMax PRC-LT-CTRL Message", /* name */ - "WiMax PRC-LT-CTRL (prc)", /* short name */ - "wmx.prc" /* abbrev */ - ); - - proto_register_field_array(proto_mac_mgmt_msg_prc_lt_ctrl_decoder, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - } -} - -/* Decode PRC-LT-CTRL messages. */ -void dissect_mac_mgmt_msg_prc_lt_ctrl_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) -{ - guint offset = 0; - guint tvb_len, payload_type; - proto_item *prc_lt_ctrl_item = NULL; - proto_tree *prc_lt_ctrl_tree = NULL; - - /* Ensure the right payload type */ - payload_type = tvb_get_guint8(tvb, 0); - if(payload_type != MAC_MGMT_MSG_PRC_LT_CTRL) - { - return; - } - - if (tree) - { /* we are being asked for details */ - - /* Get the tvb reported length */ - tvb_len = tvb_reported_length(tvb); - /* display MAC payload type PRC-LT-CTRL */ - prc_lt_ctrl_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_prc_lt_ctrl_decoder, tvb, 0, tvb_len, "MAC Management Message, PRC-LT-CTRL (65)"); - - /* add MAC PRC-LT-CTRL subtree */ - prc_lt_ctrl_tree = proto_item_add_subtree(prc_lt_ctrl_item, ett_mac_mgmt_msg_prc_lt_ctrl_decoder); - - /* display the Message Type */ - proto_tree_add_item(prc_lt_ctrl_tree, hf_prc_lt_ctrl_message_type, tvb, offset, 1, FALSE); - offset ++; + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_mac_mgmt_msg_prc_lt_ctrl_decoder, + }; - /* display whether to Setup or Tear-down the - * long-term MIMO precoding delay */ - proto_tree_add_item(prc_lt_ctrl_tree, hf_prc_lt_ctrl_precoding, tvb, offset, 1, FALSE); + proto_mac_mgmt_msg_prc_lt_ctrl_decoder = proto_register_protocol ( + "WiMax PRC-LT-CTRL Message", /* name */ + "WiMax PRC-LT-CTRL (prc)", /* short name */ + "wmx.prc" /* abbrev */ + ); - /* display the Precoding Delay */ - proto_tree_add_item(prc_lt_ctrl_tree, hf_prc_lt_ctrl_precoding_delay, tvb, offset, 1, FALSE); - } + proto_register_field_array(proto_mac_mgmt_msg_prc_lt_ctrl_decoder, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); } - diff --git a/plugins/wimax/msg_reg_req.c b/plugins/wimax/msg_reg_req.c index c5425dd03e..caadf2f258 100644 --- a/plugins/wimax/msg_reg_req.c +++ b/plugins/wimax/msg_reg_req.c @@ -34,8 +34,6 @@ #define WIMAX_16E_2005 -#include "moduleinfo.h" - #include #include #include "crc.h" @@ -46,19 +44,9 @@ extern gint proto_wimax; extern gboolean include_cor2_changes; -/* Forward reference */ -void dissect_mac_mgmt_msg_reg_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - - gint proto_mac_mgmt_msg_reg_req_decoder = -1; static gint ett_mac_mgmt_msg_reg_req_decoder = -1; -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_mac_mgmt_msg_reg_req_decoder -}; - /* REG-REQ fields */ static gint hf_reg_ss_mgmt_support = -1; static gint hf_reg_ip_mgmt_mode = -1; @@ -524,6 +512,164 @@ void dissect_extended_tlv(proto_tree *reg_req_tree, gint tlv_type, tvbuff_t *tvb #endif } + +/* Decode REG-REQ messages. */ +void dissect_mac_mgmt_msg_reg_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + guint offset = 0; + guint tlv_offset; + guint tvb_len, payload_type; + proto_item *reg_req_item = NULL; + proto_tree *reg_req_tree = NULL; + proto_tree *tlv_tree = NULL; + gboolean hmac_found = FALSE; + tlv_info_t tlv_info; + gint tlv_type; + gint tlv_len; + + /* Ensure the right payload type */ + payload_type = tvb_get_guint8(tvb, offset); + if (payload_type != MAC_MGMT_MSG_REG_REQ) + { + return; + } + + if (tree) + { /* we are being asked for details */ + + /* Get the tvb reported length */ + tvb_len = tvb_reported_length(tvb); + /* display MAC payload type REG-REQ */ + reg_req_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_reg_req_decoder, tvb, offset, tvb_len, "MAC Management Message, REG-REQ (6)"); + /* add MAC REG-REQ subtree */ + reg_req_tree = proto_item_add_subtree(reg_req_item, ett_mac_mgmt_msg_reg_req_decoder); + /* display the Message Type */ + proto_tree_add_item(reg_req_tree, hf_reg_req_message_type, tvb, offset, 1, FALSE); + offset += 1; + + while(offset < tvb_len) + { + /* Get the TLV data. */ + init_tlv_info(&tlv_info, tvb, offset); + /* get the TLV type */ + tlv_type = get_tlv_type(&tlv_info); + /* get the TLV length */ + tlv_len = get_tlv_length(&tlv_info); + if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1) + { /* invalid tlv info */ + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "REG-REQ TLV error"); + } + proto_tree_add_item(reg_req_tree, hf_reg_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE); + break; + } + /* get the offset to the TLV data */ + tlv_offset = offset + get_tlv_value_offset(&tlv_info); + + switch (tlv_type) { + case REG_ARQ_PARAMETERS: + case REG_SS_MGMT_SUPPORT: + case REG_IP_MGMT_MODE: + case REG_IP_VERSION: + case REG_UL_TRANSPORT_CIDS_SUPPORTED: + case REG_IP_PHS_SDU_ENCAP: + case REG_MAX_CLASSIFIERS_SUPPORTED: + case REG_PHS_SUPPORT: + case REG_ARQ_SUPPORT: + case REG_DSX_FLOW_CONTROL: + case REG_MAC_CRC_SUPPORT: + case REG_MCA_FLOW_CONTROL: + case REG_MCAST_POLLING_CIDS: + case REG_NUM_DL_TRANS_CID: + case REG_MAC_ADDRESS: +#ifdef WIMAX_16E_2005 + case REG_TLV_T_20_MAX_MAC_DATA_PER_FRAME_SUPPORT: + case REG_TLV_T_21_PACKING_SUPPORT: + case REG_TLV_T_22_MAC_EXTENDED_RTPS_SUPPORT: + case REG_TLV_T_23_MAX_NUM_BURSTS_TRANSMITTED_CONCURRENTLY_TO_THE_MS: + case REG_TLV_T_26_METHOD_FOR_ALLOCATING_IP_ADDR_SECONDARY_MGMNT_CONNECTION: + case REG_TLV_T_27_HANDOVER_SUPPORTED: + case REG_TLV_T_29_HO_PROCESS_OPTIMIZATION_MS_TIMER: + case REG_TLV_T_31_MOBILITY_FEATURES_SUPPORTED: + case REG_TLV_T_40_ARQ_ACK_TYPE: + case REG_TLV_T_41_MS_HO_CONNECTIONS_PARAM_PROCESSING_TIME: + case REG_TLV_T_42_MS_HO_TEK_PROCESSING_TIME: + case REG_TLV_T_43_MAC_HEADER_AND_EXTENDED_SUBHEADER_SUPPORT: + case REG_REQ_BS_SWITCHING_TIMER: + case REG_POWER_SAVING_CLASS_CAPABILITY: +#endif + /* Decode REG-REQ sub-TLV's. */ + dissect_extended_tlv(reg_req_tree, tlv_type, tvb, tlv_offset, tlv_len, pinfo, offset, proto_mac_mgmt_msg_reg_req_decoder); + break; + case REG_REQ_SECONDARY_MGMT_CID: + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, hf_reg_req_secondary_mgmt_cid, tvb, tlv_offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_reg_req_secondary_mgmt_cid, tvb, tlv_offset, 2, FALSE); + break; + case REG_REQ_TLV_T_32_SLEEP_MODE_RECOVERY_TIME: + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, hf_reg_req_tlv_t_32_sleep_mode_recovery_time, tvb, tlv_offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_reg_req_tlv_t_32_sleep_mode_recovery_time, tvb, tlv_offset, 1, FALSE); + break; + case REG_REQ_TLV_T_33_MS_PREV_IP_ADDR: + if ( tlv_len == 4 ) { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, hf_ms_previous_ip_address_v4, tvb, tlv_offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_ms_previous_ip_address_v4, tvb, tlv_offset, tlv_len, FALSE); + } else if ( tlv_len == 16 ) { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, hf_ms_previous_ip_address_v6, tvb, tlv_offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_ms_previous_ip_address_v6, tvb, tlv_offset, tlv_len, FALSE); + } + break; + case REG_TLV_T_37_IDLE_MODE_TIMEOUT: + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, hf_idle_mode_timeout, tvb, tlv_offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_idle_mode_timeout, tvb, tlv_offset, tlv_len, FALSE); + break; + case REG_REQ_TLV_T_45_MS_PERIODIC_RANGING_TIMER_INFO: + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, hf_reg_req_tlv_t_45_ms_periodic_ranging_timer, tvb, tlv_offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_reg_req_tlv_t_45_ms_periodic_ranging_timer, tvb, tlv_offset, tlv_len, FALSE); + break; + case REG_HANDOVER_INDICATION_READINESS_TIMER: + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, hf_reg_tlv_t_46_handover_indication_readiness_timer, tvb, tlv_offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_reg_tlv_t_46_handover_indication_readiness_timer, tvb, tlv_offset, tlv_len, FALSE); + break; + + case DSx_UPLINK_FLOW: + /* display Uplink Service Flow Encodings info */ + /* add subtree */ + tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, proto_mac_mgmt_msg_reg_req_decoder, tvb, tlv_offset, tlv_len, "Uplink Service Flow Encodings (%u byte(s))", tlv_len); + /* decode and display the DL Service Flow Encodings */ + wimax_service_flow_encodings_decoder(tvb_new_subset(tvb, tlv_offset, tlv_len, tlv_len), pinfo, tlv_tree); + break; + case DSx_DOWNLINK_FLOW: + /* display Downlink Service Flow Encodings info */ + /* add subtree */ + tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, proto_mac_mgmt_msg_reg_req_decoder, tvb, tlv_offset, tlv_len, "Downlink Service Flow Encodings (%u byte(s))", tlv_len); + /* decode and display the DL Service Flow Encodings */ + wimax_service_flow_encodings_decoder(tvb_new_subset(tvb, tlv_offset, tlv_len, tlv_len), pinfo, tlv_tree); + break; + case HMAC_TUPLE: /* Table 348d */ + /* decode and display the HMAC Tuple */ + tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, proto_mac_mgmt_msg_reg_req_decoder, tvb, tlv_offset, tlv_len, "HMAC Tuple (%u byte(s))", tlv_len); + wimax_hmac_tuple_decoder(tlv_tree, tvb, tlv_offset, tlv_len); + hmac_found = TRUE; + break; + case CMAC_TUPLE: /* Table 348b */ + /* decode and display the CMAC Tuple */ + tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, proto_mac_mgmt_msg_reg_req_decoder, tvb, tlv_offset, tlv_len, "CMAC Tuple (%u byte(s))", tlv_len); + wimax_cmac_tuple_decoder(tlv_tree, tvb, tlv_offset, tlv_len); + break; + default: + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, hf_tlv_type, tvb, tlv_offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_tlv_type, tvb, tlv_offset, tlv_len, FALSE); + break; + } + /* update the offset */ + offset = tlv_len + tlv_offset; + } /* End while() looping through the tvb. */ + if (!hmac_found) + proto_item_append_text(reg_req_tree, " (HMAC Tuple is missing !)"); + } +} + /* Register Wimax Mac Payload Protocol and Dissector */ void proto_register_mac_mgmt_msg_reg_req(void) { @@ -1263,173 +1409,19 @@ void proto_register_mac_mgmt_msg_reg_req(void) } }; - - if (proto_mac_mgmt_msg_reg_req_decoder == -1) - { - proto_mac_mgmt_msg_reg_req_decoder = proto_register_protocol ( - "WiMax REG-REQ/RSP Messages", /* name */ - "WiMax REG-REQ/RSP (reg)", /* short name */ - "wmx.reg" /* abbrev */ - ); - - proto_register_field_array(proto_mac_mgmt_msg_reg_req_decoder, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - } -} - -/* Decode REG-REQ messages. */ -void dissect_mac_mgmt_msg_reg_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ - guint offset = 0; - guint tlv_offset; - guint tvb_len, payload_type; - proto_item *reg_req_item = NULL; - proto_tree *reg_req_tree = NULL; - proto_tree *tlv_tree = NULL; - gboolean hmac_found = FALSE; - tlv_info_t tlv_info; - gint tlv_type; - gint tlv_len; - - /* Ensure the right payload type */ - payload_type = tvb_get_guint8(tvb, offset); - if (payload_type != MAC_MGMT_MSG_REG_REQ) - { - return; - } - - if (tree) - { /* we are being asked for details */ - - /* Get the tvb reported length */ - tvb_len = tvb_reported_length(tvb); - /* display MAC payload type REG-REQ */ - reg_req_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_reg_req_decoder, tvb, offset, tvb_len, "MAC Management Message, REG-REQ (6)"); - /* add MAC REG-REQ subtree */ - reg_req_tree = proto_item_add_subtree(reg_req_item, ett_mac_mgmt_msg_reg_req_decoder); - /* display the Message Type */ - proto_tree_add_item(reg_req_tree, hf_reg_req_message_type, tvb, offset, 1, FALSE); - offset += 1; - - while(offset < tvb_len) + /* Setup protocol subtree array */ + static gint *ett[] = { - /* Get the TLV data. */ - init_tlv_info(&tlv_info, tvb, offset); - /* get the TLV type */ - tlv_type = get_tlv_type(&tlv_info); - /* get the TLV length */ - tlv_len = get_tlv_length(&tlv_info); - if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1) - { /* invalid tlv info */ - if (check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "REG-REQ TLV error"); - } - proto_tree_add_item(reg_req_tree, hf_reg_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE); - break; - } - /* get the offset to the TLV data */ - tlv_offset = offset + get_tlv_value_offset(&tlv_info); + &ett_mac_mgmt_msg_reg_req_decoder + }; - switch (tlv_type) { - case REG_ARQ_PARAMETERS: - case REG_SS_MGMT_SUPPORT: - case REG_IP_MGMT_MODE: - case REG_IP_VERSION: - case REG_UL_TRANSPORT_CIDS_SUPPORTED: - case REG_IP_PHS_SDU_ENCAP: - case REG_MAX_CLASSIFIERS_SUPPORTED: - case REG_PHS_SUPPORT: - case REG_ARQ_SUPPORT: - case REG_DSX_FLOW_CONTROL: - case REG_MAC_CRC_SUPPORT: - case REG_MCA_FLOW_CONTROL: - case REG_MCAST_POLLING_CIDS: - case REG_NUM_DL_TRANS_CID: - case REG_MAC_ADDRESS: -#ifdef WIMAX_16E_2005 - case REG_TLV_T_20_MAX_MAC_DATA_PER_FRAME_SUPPORT: - case REG_TLV_T_21_PACKING_SUPPORT: - case REG_TLV_T_22_MAC_EXTENDED_RTPS_SUPPORT: - case REG_TLV_T_23_MAX_NUM_BURSTS_TRANSMITTED_CONCURRENTLY_TO_THE_MS: - case REG_TLV_T_26_METHOD_FOR_ALLOCATING_IP_ADDR_SECONDARY_MGMNT_CONNECTION: - case REG_TLV_T_27_HANDOVER_SUPPORTED: - case REG_TLV_T_29_HO_PROCESS_OPTIMIZATION_MS_TIMER: - case REG_TLV_T_31_MOBILITY_FEATURES_SUPPORTED: - case REG_TLV_T_40_ARQ_ACK_TYPE: - case REG_TLV_T_41_MS_HO_CONNECTIONS_PARAM_PROCESSING_TIME: - case REG_TLV_T_42_MS_HO_TEK_PROCESSING_TIME: - case REG_TLV_T_43_MAC_HEADER_AND_EXTENDED_SUBHEADER_SUPPORT: - case REG_REQ_BS_SWITCHING_TIMER: - case REG_POWER_SAVING_CLASS_CAPABILITY: -#endif - /* Decode REG-REQ sub-TLV's. */ - dissect_extended_tlv(reg_req_tree, tlv_type, tvb, tlv_offset, tlv_len, pinfo, offset, proto_mac_mgmt_msg_reg_req_decoder); - break; - case REG_REQ_SECONDARY_MGMT_CID: - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, hf_reg_req_secondary_mgmt_cid, tvb, tlv_offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_reg_req_secondary_mgmt_cid, tvb, tlv_offset, 2, FALSE); - break; - case REG_REQ_TLV_T_32_SLEEP_MODE_RECOVERY_TIME: - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, hf_reg_req_tlv_t_32_sleep_mode_recovery_time, tvb, tlv_offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_reg_req_tlv_t_32_sleep_mode_recovery_time, tvb, tlv_offset, 1, FALSE); - break; - case REG_REQ_TLV_T_33_MS_PREV_IP_ADDR: - if ( tlv_len == 4 ) { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, hf_ms_previous_ip_address_v4, tvb, tlv_offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_ms_previous_ip_address_v4, tvb, tlv_offset, tlv_len, FALSE); - } else if ( tlv_len == 16 ) { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, hf_ms_previous_ip_address_v6, tvb, tlv_offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_ms_previous_ip_address_v6, tvb, tlv_offset, tlv_len, FALSE); - } - break; - case REG_TLV_T_37_IDLE_MODE_TIMEOUT: - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, hf_idle_mode_timeout, tvb, tlv_offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_idle_mode_timeout, tvb, tlv_offset, tlv_len, FALSE); - break; - case REG_REQ_TLV_T_45_MS_PERIODIC_RANGING_TIMER_INFO: - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, hf_reg_req_tlv_t_45_ms_periodic_ranging_timer, tvb, tlv_offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_reg_req_tlv_t_45_ms_periodic_ranging_timer, tvb, tlv_offset, tlv_len, FALSE); - break; - case REG_HANDOVER_INDICATION_READINESS_TIMER: - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, hf_reg_tlv_t_46_handover_indication_readiness_timer, tvb, tlv_offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_reg_tlv_t_46_handover_indication_readiness_timer, tvb, tlv_offset, tlv_len, FALSE); - break; - case DSx_UPLINK_FLOW: - /* display Uplink Service Flow Encodings info */ - /* add subtree */ - tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, proto_mac_mgmt_msg_reg_req_decoder, tvb, tlv_offset, tlv_len, "Uplink Service Flow Encodings (%u byte(s))", tlv_len); - /* decode and display the DL Service Flow Encodings */ - wimax_service_flow_encodings_decoder(tvb_new_subset(tvb, tlv_offset, tlv_len, tlv_len), pinfo, tlv_tree); - break; - case DSx_DOWNLINK_FLOW: - /* display Downlink Service Flow Encodings info */ - /* add subtree */ - tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, proto_mac_mgmt_msg_reg_req_decoder, tvb, tlv_offset, tlv_len, "Downlink Service Flow Encodings (%u byte(s))", tlv_len); - /* decode and display the DL Service Flow Encodings */ - wimax_service_flow_encodings_decoder(tvb_new_subset(tvb, tlv_offset, tlv_len, tlv_len), pinfo, tlv_tree); - break; - case HMAC_TUPLE: /* Table 348d */ - /* decode and display the HMAC Tuple */ - tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, proto_mac_mgmt_msg_reg_req_decoder, tvb, tlv_offset, tlv_len, "HMAC Tuple (%u byte(s))", tlv_len); - wimax_hmac_tuple_decoder(tlv_tree, tvb, tlv_offset, tlv_len); - hmac_found = TRUE; - break; - case CMAC_TUPLE: /* Table 348b */ - /* decode and display the CMAC Tuple */ - tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, proto_mac_mgmt_msg_reg_req_decoder, tvb, tlv_offset, tlv_len, "CMAC Tuple (%u byte(s))", tlv_len); - wimax_cmac_tuple_decoder(tlv_tree, tvb, tlv_offset, tlv_len); - break; - default: - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, hf_tlv_type, tvb, tlv_offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_tlv_type, tvb, tlv_offset, tlv_len, FALSE); - break; - } - /* update the offset */ - offset = tlv_len + tlv_offset; - } /* End while() looping through the tvb. */ - if (!hmac_found) - proto_item_append_text(reg_req_tree, " (HMAC Tuple is missing !)"); - } + proto_mac_mgmt_msg_reg_req_decoder = proto_register_protocol ( + "WiMax REG-REQ/RSP Messages", /* name */ + "WiMax REG-REQ/RSP (reg)", /* short name */ + "wmx.reg" /* abbrev */ + ); + + proto_register_field_array(proto_mac_mgmt_msg_reg_req_decoder, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); } diff --git a/plugins/wimax/msg_reg_rsp.c b/plugins/wimax/msg_reg_rsp.c index cf9b0148f1..6c285c8b81 100644 --- a/plugins/wimax/msg_reg_rsp.c +++ b/plugins/wimax/msg_reg_rsp.c @@ -36,8 +36,6 @@ #define FRAG_LAST 0x1 -#include "moduleinfo.h" - #include #include #include "wimax_tlv.h" @@ -52,21 +50,10 @@ extern gint man_ofdma; extern void dissect_extended_tlv(proto_tree *reg_req_tree, gint tlv_type, tvbuff_t *tvb, guint tlv_offset, guint tlv_len, packet_info *pinfo, guint offset, gint proto_registry); extern void dissect_mac_mgmt_msg_dsc_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); -/* forward reference */ -void dissect_mac_mgmt_msg_reg_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - - static gint proto_mac_mgmt_msg_reg_rsp_decoder = -1; static gint ett_mac_mgmt_msg_reg_rsp_decoder = -1; static gint ett_reg_rsp_message_tree = -1; -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_mac_mgmt_msg_reg_rsp_decoder, - &ett_reg_rsp_message_tree -}; - /* NCT messages */ /* REG-RSP fields */ @@ -90,92 +77,6 @@ static const value_string vals_reg_rsp_status [] = { }; -/* Register Wimax Mac Payload Protocol and Dissector */ -void proto_register_mac_mgmt_msg_reg_rsp(void) -{ - /* REG-RSP fields display */ - static hf_register_info hf[] = - { - { - &hf_reg_rsp_message_type, - { - "MAC Management Message Type", "wmx.macmgtmsgtype.reg_rsp", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_reg_invalid_tlv, - { - "Invalid TLV", "wmx.reg_rsp.invalid_tlv", - FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL - } - }, - { - &hf_reg_rsp_new_cid_after_ho, - { - "New CID after handover to new BS", "wmx.reg_rsp.new_cid_after_ho", - FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_reg_rsp_status, - { - "Response", "wmx.reg_rsp.response", - FT_UINT8, BASE_HEX, VALS(vals_reg_rsp_status), 0x0, NULL, HFILL - } - }, - { - &hf_reg_rsp_secondary_mgmt_cid, - { - "Secondary Management CID", "wmx.reg_rsp.secondary_mgmt_cid", - FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_reg_total_provisioned_sf, - { - "Total Number of Provisional Service Flow", "wmx.reg_rsp.total_provisional_sf", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_reg_rsp_service_flow_id, - { - "Service flow ID", "wmx.reg_rsp.service_flow_id", - FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_reg_rsp_system_resource_retain_time, - { - "System Resource Retain Time", "wmx.reg_rsp.system_resource_retain_time", - FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_tlv_type, - { - "Unknown TLV Type", "wmx.reg_rsp.unknown_tlv_type", - FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_tlv_value, - { - "Value", "wmx.reg_rsp.tlv_value", - FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL - } - } - }; - - if (proto_mac_mgmt_msg_reg_rsp_decoder == -1) - { - proto_mac_mgmt_msg_reg_rsp_decoder = proto_mac_mgmt_msg_reg_req_decoder; - - proto_register_field_array(proto_mac_mgmt_msg_reg_rsp_decoder, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - } -} /* Decode REG-RSP messages. */ void dissect_mac_mgmt_msg_reg_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) @@ -392,3 +293,93 @@ void dissect_mac_mgmt_msg_reg_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, pro } } +/* Register Wimax Mac Payload Protocol and Dissector */ +void proto_register_mac_mgmt_msg_reg_rsp(void) +{ + /* REG-RSP fields display */ + static hf_register_info hf[] = + { + { + &hf_reg_rsp_message_type, + { + "MAC Management Message Type", "wmx.macmgtmsgtype.reg_rsp", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_reg_invalid_tlv, + { + "Invalid TLV", "wmx.reg_rsp.invalid_tlv", + FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL + } + }, + { + &hf_reg_rsp_new_cid_after_ho, + { + "New CID after handover to new BS", "wmx.reg_rsp.new_cid_after_ho", + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_reg_rsp_status, + { + "Response", "wmx.reg_rsp.response", + FT_UINT8, BASE_HEX, VALS(vals_reg_rsp_status), 0x0, NULL, HFILL + } + }, + { + &hf_reg_rsp_secondary_mgmt_cid, + { + "Secondary Management CID", "wmx.reg_rsp.secondary_mgmt_cid", + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_reg_total_provisioned_sf, + { + "Total Number of Provisional Service Flow", "wmx.reg_rsp.total_provisional_sf", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_reg_rsp_service_flow_id, + { + "Service flow ID", "wmx.reg_rsp.service_flow_id", + FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_reg_rsp_system_resource_retain_time, + { + "System Resource Retain Time", "wmx.reg_rsp.system_resource_retain_time", + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_tlv_type, + { + "Unknown TLV Type", "wmx.reg_rsp.unknown_tlv_type", + FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_tlv_value, + { + "Value", "wmx.reg_rsp.tlv_value", + FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL + } + } + }; + + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_mac_mgmt_msg_reg_rsp_decoder, + &ett_reg_rsp_message_tree + }; + + proto_mac_mgmt_msg_reg_rsp_decoder = proto_mac_mgmt_msg_reg_req_decoder; + + proto_register_field_array(proto_mac_mgmt_msg_reg_rsp_decoder, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); +} diff --git a/plugins/wimax/msg_rep.c b/plugins/wimax/msg_rep.c index 4d63b97c81..df636b9214 100644 --- a/plugins/wimax/msg_rep.c +++ b/plugins/wimax/msg_rep.c @@ -35,30 +35,16 @@ #include "config.h" #endif -#include "moduleinfo.h" - #include #include #include "wimax_tlv.h" #include "wimax_mac.h" #include "wimax_utils.h" -/* forward reference */ -void proto_register_mac_mgmt_msg_rep(void); -void dissect_mac_mgmt_msg_rep_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); -void dissect_mac_mgmt_msg_rep_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - static gint proto_mac_mgmt_msg_rep_decoder = -1; static gint ett_mac_mgmt_msg_rep_req_decoder = -1; static gint ett_mac_mgmt_msg_rep_rsp_decoder = -1; -/* Setup protocol subtree array */ -static gint *ett_rep[] = -{ - &ett_mac_mgmt_msg_rep_req_decoder, - &ett_mac_mgmt_msg_rep_rsp_decoder, -}; - static const value_string vals_channel_types[] = { { 0, "Normal Subchannel"}, @@ -269,953 +255,239 @@ static gint hf_rep_rsp_channel_selectivity_rep_frequency_c = -1; #define REP_RSP_ZONE_SPEC_EFFECTIVE_CINR_CQICH_ID_MASK 0xE0 #define REP_RSP_ZONE_SPEC_EFFECTIVE_CINR_CQICH_ID_4_MASK 0xF0 -/* Register Wimax Mac REP-REQ Messages Dissectors */ -void proto_register_mac_mgmt_msg_rep(void) + +/* Wimax Mac REP-REQ Message Dissector */ +void dissect_mac_mgmt_msg_rep_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - /* report display */ - static hf_register_info hf_rep[] = + guint offset = 0; + guint tvb_len, payload_type; + gint tlv_type, tlv_len, tlv_value_offset, length, tlv_offset; + proto_item *rep_item = NULL; + proto_tree *rep_tree = NULL; + proto_tree *tlv_tree = NULL; + proto_tree *ti_tree = NULL; + tlv_info_t tlv_info; + + /* Ensure the right payload type */ + payload_type = tvb_get_guint8(tvb, offset); + if(payload_type != MAC_MGMT_MSG_REP_REQ) { - { - &hf_rep_invalid_tlv, - { - "Invalid TLV", "wmx.rep.invalid_tlv", - FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL + return; + } + + if(tree) + { /* we are being asked for details */ + /* Get the tvb reported length */ + tvb_len = tvb_reported_length(tvb); + /* display MAC payload type REP-REQ */ + rep_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_rep_decoder, tvb, offset, tvb_len, "Report Request (REP-REQ) (%u bytes)", tvb_len); + /* add MAC REP-REQ subtree */ + rep_tree = proto_item_add_subtree(rep_item, ett_mac_mgmt_msg_rep_req_decoder); + /* Decode and display the Report Request message (REP-REQ) */ + /* display the Message Type */ + proto_tree_add_item(rep_tree, hf_rep_req_message_type, tvb, offset, 1, FALSE); + /* set the offset for the TLV Encoded info */ + offset++; + /* process the REP-REQ TLVs */ + while(offset < tvb_len) + { /* get the TLV information */ + init_tlv_info(&tlv_info, tvb, offset); + /* get the TLV type */ + tlv_type = get_tlv_type(&tlv_info); + /* get the TLV length */ + tlv_len = get_tlv_length(&tlv_info); + if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1) + { /* invalid tlv info */ + if(check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "REP-REQ TLV error"); + } + proto_tree_add_item(rep_tree, hf_rep_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE); + break; } - }, - { - &hf_rep_req_message_type, + /* get the TLV value offset */ + tlv_value_offset = get_tlv_value_offset(&tlv_info); +#ifdef DEBUG /* for debug only */ + proto_tree_add_protocol_format(rep_tree, proto_mac_mgmt_msg_rep_decoder, tvb, offset, (tlv_len + tlv_value_offset), "REP-REQ Type: %u (%u bytes, offset=%u, length=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tlv_len, tvb_len); +#endif + /* update the offset for the TLV value */ + offset += tlv_value_offset; + /* process REP-REQ TLV Encoded information (11.11) */ + switch (tlv_type) { - "MAC Management Message Type", "wmx.macmgtmsgtype.rep_req", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + case REP_REQ_REPORT_REQUEST: + /* process the REP-REQ report request TLVs */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_req_decoder, rep_tree, hf_rep_req_report_request, tvb, offset, tlv_len, FALSE); + for( tlv_offset = 0; tlv_offset < tlv_len; ) + { /* get the TLV information */ + init_tlv_info(&tlv_info, tvb, (offset + tlv_offset)); + /* get the TLV type */ + tlv_type = get_tlv_type(&tlv_info); + /* get the TLV length */ + length = get_tlv_length(&tlv_info); + if(tlv_type == -1 || length > MAX_TLV_LEN || length < 1) + { /* invalid tlv info */ + if(check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "REP-REQ Report Request TLV error"); + } + proto_tree_add_item(tlv_tree, hf_rep_invalid_tlv, tvb, (offset + tlv_offset), (tlv_len - offset - tlv_offset), FALSE); + break; + } +#ifdef DEBUG /* for debug only */ + proto_tree_add_protocol_format(rep_tree, proto_mac_mgmt_msg_rep_decoder, tvb, offset, (length + tlv_value_offset), "REP-REQ Report Request Type: %u (%u bytes, offset=%u, length=%u, tvb_len=%u)", tlv_type, (length + tlv_value_offset), offset, length, tvb_len); +#endif + /* update the offset */ + tlv_offset += get_tlv_value_offset(&tlv_info); + switch (tlv_type) + { + case REP_REQ_REPORT_TYPE: + /* decode and display the Report type */ + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_req_decoder, tlv_tree, hf_rep_req_report_type, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_rep_type_bit0, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_rep_type_bit1, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_rep_type_bit2, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_rep_type_bit3_6, tvb, (offset + tlv_offset), length, FALSE); +/* proto_item_append_text(ti, " dB");*/ + proto_tree_add_item(ti_tree, hf_rep_req_rep_type_bit7, tvb, (offset + tlv_offset), length, FALSE); + break; + case REP_REQ_CHANNEL_NUMBER: + /* decode and display the Channel Number */ + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_req_decoder, tlv_tree, hf_rep_req_channel_number, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_channel_number, tvb, (offset + tlv_offset), length, FALSE); + break; + case REP_REQ_CHANNEL_TYPE: + /* decode and display the Channel Type */ + ti_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_rep_req_decoder, tlv_tree, proto_mac_mgmt_msg_rep_decoder, tvb, (offset + tlv_offset), length, "Channel Type (%u byte(s))", length); + proto_tree_add_item(ti_tree, hf_rep_req_channel_type_request, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_channel_type_reserved, tvb, (offset + tlv_offset), length, FALSE); + break; + case REP_REQ_ZONE_SPEC_PHY_CINR_REQ: + /* decode and display the zone specific physical cinr request */ + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_req_decoder, tlv_tree, hf_rep_req_zone_spec_phy_cinr_request, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit0_2, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit3, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit4, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit5_6, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit7, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit8_13, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit14_17, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit18, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit19_23, tvb, (offset + tlv_offset), length, FALSE); + break; + case REP_REQ_PREAMBLE_PHY_CINR_REQ: + /* decode and display the preamble phy cinr request */ + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_req_decoder, tlv_tree, hf_rep_req_preamble_phy_cinr_request, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_preamble_phy_cinr_req_bit0_1, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_preamble_phy_cinr_req_bit2_5, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_preamble_phy_cinr_req_bit6, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_preamble_phy_cinr_req_bit7, tvb, (offset + tlv_offset), length, FALSE); + break; + case REP_REQ_ZONE_SPEC_EFF_CINR_REQ: + /* decode and display the zone specific effective cinr request */ + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_req_decoder, tlv_tree, hf_rep_req_zone_spec_effective_cinr_request, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_effective_cinr_req_bit0_2, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_effective_cinr_req_bit3, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_effective_cinr_req_bit4, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_effective_cinr_req_bit5_6, tvb, (offset + tlv_offset), length, FALSE); + /* proto_item_append_text(ti, " dB");*/ + proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_effective_cinr_req_bit7, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_effective_cinr_req_bit8_13, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_effective_cinr_req_bit14_15, tvb, (offset + tlv_offset), length, FALSE); + break; + case REP_REQ_PREAMBLE_EFF_CINR_REQ: + /* decode and display the preamble effective cinr request */ + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_req_decoder, tlv_tree, hf_rep_req_preamble_effective_cinr_request, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_preamble_effective_cinr_req_bit0_1, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_preamble_effective_cinr_req_bit2_7, tvb, (offset + tlv_offset), length, FALSE); + break; + case REP_REQ_CHANNEL_SELECTIVITY_REPORT: + /* decode and display the channel selectivity report */ + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_req_decoder, tlv_tree, hf_rep_req_channel_selectivity_report, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_channel_selectivity_rep_bit0, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_req_channel_selectivity_rep_bit1_7, tvb, (offset + tlv_offset), length, FALSE); + break; + default: + /* display the unknown tlv in hex */ + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_req_decoder, tlv_tree, hf_rep_unknown_type, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_unknown_type, tvb, (offset + tlv_offset), length, FALSE); + break; + } + tlv_offset += length; + } /* end of TLV process for loop */ + break; + default: + /* display the unknown tlv in hex */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_req_decoder, rep_tree, hf_rep_unknown_type, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_rep_unknown_type, tvb, offset, tlv_len, FALSE); + break; } - }, - { /* type 1.2 */ - &hf_rep_req_channel_number, - { - "Channel Number", "wmx.rep_req.channel_number", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + offset += tlv_len; + } /* end of TLV process while loop */ + } +} + +/* Wimax Mac REP-RSP Message Dissector */ +void dissect_mac_mgmt_msg_rep_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + guint offset = 0; + guint tvb_len, payload_type, length, value; + gint tlv_type, tlv_len, tlv_value_offset, tlv_offset; + gint db_val; + proto_item *rep_item = NULL; + proto_tree *rep_tree = NULL; + proto_tree *tlv_tree = NULL; + proto_item *ti = NULL; + proto_tree *ti_tree = NULL; + tlv_info_t tlv_info; + gfloat current_power; + + /* Ensure the right payload type */ + payload_type = tvb_get_guint8(tvb, offset); + if(payload_type != MAC_MGMT_MSG_REP_RSP) + { + return; + } + + if(tree) + { /* we are being asked for details */ + /* Get the tvb reported length */ + tvb_len = tvb_reported_length(tvb); + /* display MAC payload type REP-RSP */ + rep_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_rep_decoder, tvb, offset, tvb_len, "Report Response (REP-RSP) (%u bytes)", tvb_len); + /* add MAC REP-RSP subtree */ + rep_tree = proto_item_add_subtree(rep_item, ett_mac_mgmt_msg_rep_rsp_decoder); + /* Decode and display the Report Response message (REP-RSP) */ + /* display the Message Type */ + proto_tree_add_item(rep_tree, hf_rep_rsp_message_type, tvb, offset, 1, FALSE); + /* set the offset for the TLV Encoded info */ + offset++; + /* process the REP-RSP TLVs */ + while(offset < tvb_len) + { /* get the TLV information */ + init_tlv_info(&tlv_info, tvb, offset); + /* get the TLV type */ + tlv_type = get_tlv_type(&tlv_info); + /* get the TLV length */ + tlv_len = get_tlv_length(&tlv_info); + if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1) + { /* invalid tlv info */ + if(check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "REP-RSP TLV error"); + } + proto_tree_add_item(rep_tree, hf_rep_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE); + break; } - }, - { /* type 1.8 */ - &hf_rep_req_channel_selectivity_report, - { - "Channel Selectivity Report", "wmx.rep_req.channel_selectivity_report", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_req_channel_selectivity_rep_bit0, - { - "Include Frequency Selectivity Report", "wmx.rep_req.channel_selectivity_report.bit0", - FT_BOOLEAN, 8, NULL, REP_REQ_CHANNEL_SELECTIVITY_REPORT_BIT0, NULL, HFILL - } - }, - { - &hf_rep_req_channel_selectivity_rep_bit1_7, - { - "Reserved", "wmx.rep_req.channel_selectivity_report.bit1_7", - FT_UINT8, BASE_HEX, NULL, REP_REQ_CHANNEL_SELECTIVITY_REPORT_BIT1_7, NULL, HFILL - } - }, - { /* type 1.3 */ - &hf_rep_req_channel_type_request, - { - "Channel Type Request", "wmx.rep_req.channel_type.request", - FT_UINT8, BASE_DEC, VALS(vals_channel_types), 0x03, NULL, HFILL - } - }, - { - &hf_rep_req_channel_type_reserved, - { - "Reserved", "wmx.rep_req.channel_type.reserved", - FT_UINT8, BASE_HEX, NULL, 0xFC, NULL, HFILL - } - }, - { /* type 1.7 */ - &hf_rep_req_preamble_effective_cinr_request, - { - "Preamble Effective CINR Request", "wmx.rep_req.preamble_effective_cinr_request", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_req_preamble_effective_cinr_req_bit0_1, - { - "Type Of Preamble Physical CINR Measurement", "wmx.rep_req.preamble_effective_cinr_request.bit0_1", - FT_UINT8, BASE_DEC, VALS(vals_type_of_measurements), REP_REQ_PREAMBLE_EFFECTIVE_CINR_REQUEST_BIT0_1, NULL, HFILL - } - }, - { - &hf_rep_req_preamble_effective_cinr_req_bit2_7, - { - "Reserved", "wmx.rep_req.preamble_effective_cinr_request.bit2_7", - FT_UINT8, BASE_HEX, NULL, REP_REQ_PREAMBLE_EFFECTIVE_CINR_REQUEST_BIT2_7, NULL, HFILL - } - }, - { /* type 1.5 */ - &hf_rep_req_preamble_phy_cinr_request, - { - "Preamble Physical CINR Request", "wmx.rep_req.preamble_phy_cinr_request", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_req_preamble_phy_cinr_req_bit0_1, - { - "Type Of Preamble Physical CINR Measurement", "wmx.rep_req.preamble_phy_cinr_request.bit0_1", - FT_UINT8, BASE_DEC, VALS(vals_type_of_measurements), REP_REQ_PREAMBLE_PHY_CINR_REQUEST_BIT0_1, NULL, HFILL - } - }, - { - &hf_rep_req_preamble_phy_cinr_req_bit2_5, - { - "Alpha (ave) in multiples of 1/16", "wmx.rep_req.preamble_phy_cinr_request.bit2_5", - FT_UINT8, BASE_DEC, NULL, REP_REQ_PREAMBLE_PHY_CINR_REQUEST_BIT2_5, NULL, HFILL - } - }, - { - &hf_rep_req_preamble_phy_cinr_req_bit6, - { - "CINR Report Type", "wmx.rep_req.preamble_phy_cinr_request.bit6", - FT_UINT8, BASE_DEC, VALS(vals_cinr_report_types), REP_REQ_PREAMBLE_PHY_CINR_REQUEST_BIT6, NULL, HFILL - } - }, - { - &hf_rep_req_preamble_phy_cinr_req_bit7, - { - "Reserved", "wmx.rep_req.preamble_phy_cinr_request.bit7", - FT_UINT8, BASE_HEX, NULL, REP_REQ_PREAMBLE_PHY_CINR_REQUEST_BIT7, NULL, HFILL - } - }, - { /* report request */ - &hf_rep_req_report_request, - { - "Report Request", "wmx.rep_req.report_request", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { /* type 1.1 */ - &hf_rep_req_report_type, - { - "Report Type", "wmx.rep_req.report_type", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_req_rep_type_bit0, - { - "Include DFS Basic Report", "wmx.rep_req.report_type.bit0", - FT_BOOLEAN, 8, NULL, REP_REQ_REPORT_TYPE_BIT0, NULL, HFILL - } - }, - { - &hf_rep_req_rep_type_bit1, - { - "Include CINR Report", "wmx.rep_req.report_type.bit1", - FT_BOOLEAN, 8, NULL, REP_REQ_REPORT_TYPE_BIT1, NULL, HFILL - } - }, - { - &hf_rep_req_rep_type_bit2, - { - "Include RSSI Report", "wmx.rep_req.report_type.bit2", - FT_BOOLEAN, 8, NULL, REP_REQ_REPORT_TYPE_BIT2, NULL, HFILL - } - }, - { - &hf_rep_req_rep_type_bit3_6, - { - "Alpha (ave) in multiples of 1/32", "wmx.rep_req.report_type.bit3_6", - FT_UINT8, BASE_DEC, NULL, REP_REQ_REPORT_TYPE_BIT3_6, NULL, HFILL - } - }, - { - &hf_rep_req_rep_type_bit7, - { - "Include Current Transmit Power Report", "wmx.rep_req.report_type.bit7", - FT_BOOLEAN, 8, NULL, REP_REQ_REPORT_TYPE_BIT7, NULL, HFILL - } - }, - { - &hf_rep_rsp_preamble_effective_cinr_rep_cqich_id, - { - "The 4 least significant bits of CQICH_ID", "wmx.rep_req.zone_spec_effective_cinr_report.cqich_id_4", - FT_UINT8, BASE_HEX, NULL, REP_RSP_ZONE_SPEC_EFFECTIVE_CINR_CQICH_ID_4_MASK, NULL, HFILL - } - }, - { - &hf_rep_rsp_zone_spec_effective_cinr_rep_cqich_id, - { - "The 3 least significant bits of CQICH_ID", "wmx.rep_req.zone_spec_effective_cinr_report.cqich_id", - FT_UINT8, BASE_HEX, NULL, REP_RSP_ZONE_SPEC_EFFECTIVE_CINR_CQICH_ID_MASK, NULL, HFILL - } - }, - { - &hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr, - { - "Effective CINR", "wmx.rep_req.zone_spec_effective_cinr_report.effective_cinr", - FT_UINT8, BASE_DEC, NULL, REP_RSP_ZONE_SPEC_EFFECTIVE_CINR_EFFECTIVE_CINR_MASK, NULL, HFILL - } - }, - { - &hf_rep_rsp_zone_spec_effective_cinr_rep_report_type, - { - "Effective CINR Report", "wmx.rep_req.zone_spec_effective_cinr_report.report_type", - FT_UINT8, BASE_DEC, VALS(vals_data_cinr_measurements), REP_RSP_ZONE_SPEC_EFFECTIVE_CINR_REPORT_TYPE_MASK, NULL, HFILL - } - }, - { /* type 1.6 */ - &hf_rep_req_zone_spec_effective_cinr_request, - { - "Zone-specific Effective CINR Request", "wmx.rep_req.zone_spec_effective_cinr_request", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_req_zone_spec_effective_cinr_req_bit0_2, - { - "Type Of Zone On Which CINR Is To Be Reported", "wmx.rep_req.zone_spec_effective_cinr_request.bit0_2", - FT_UINT16, BASE_HEX, VALS(vals_type_of_zones), REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT0_2, NULL, HFILL - } - }, - { - &hf_rep_req_zone_spec_effective_cinr_req_bit3, - { - "STC Zone", "wmx.rep_req.zone_spec_effective_cinr_request.bit3", - FT_BOOLEAN, 16, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT3, NULL, HFILL - } - }, - { - &hf_rep_req_zone_spec_effective_cinr_req_bit4, - { - "AAS Zone", "wmx.rep_req.zone_spec_effective_cinr_request.bit4", - FT_BOOLEAN, 16, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT4, NULL, HFILL - } - }, - { - &hf_rep_req_zone_spec_effective_cinr_req_bit5_6, - { - "PRBS ID", "wmx.rep_req.zone_spec_effective_cinr_request.bit5_6", - FT_UINT16, BASE_HEX, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT5_6, NULL, HFILL - } - }, - { - &hf_rep_req_zone_spec_effective_cinr_req_bit7, - { - "CINR Measurement Report", "wmx.rep_req.zone_spec_effective_cinr_request.bit7", - FT_UINT16, BASE_HEX, VALS(vals_data_cinr_measurements), REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT7, NULL, HFILL - } - }, - { - &hf_rep_req_zone_spec_effective_cinr_req_bit8_13, - { - "PUSC Major Group Map", "wmx.rep_req.zone_spec_effective_cinr_request.bit8_13", - FT_UINT16, BASE_HEX, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT8_13, NULL, HFILL - } - }, - { - &hf_rep_req_zone_spec_effective_cinr_req_bit14_15, - { - "Reserved", "wmx.rep_req.zone_spec_effective_cinr_request.bit14_15", - FT_UINT16, BASE_HEX, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT14_15, NULL, HFILL - } - }, - { /* second byte */ - &hf_rep_rsp_zone_spec_phy_cinr_rep_deviation, - { - "Standard Deviation of CINR", "wmx.rep_req.zone_spec_phy_cinr_report.deviation", - FT_UINT8, BASE_DEC, NULL, REP_RSP_ZONE_SPEC_PHY_CINR_DEVIATION_MASK, NULL, HFILL - } - }, - { /* first byte */ - &hf_rep_rsp_zone_spec_phy_cinr_rep_mean, - { - "Mean of Physical CINR", "wmx.rep_req.zone_spec_phy_cinr_report.mean", - FT_UINT8, BASE_DEC, NULL, REP_RSP_ZONE_SPEC_PHY_CINR_MEAN_MASK, NULL, HFILL - } - }, - { - &hf_rep_rsp_zone_spec_phy_cinr_rep_report_type, - { - "CINR Report Type", "wmx.rep_req.zone_spec_phy_cinr_report.report_type", - FT_UINT8, BASE_DEC, VALS(vals_data_cinr_measurements), REP_RSP_ZONE_SPEC_PHY_CINR_REP_TYPE_MASK, NULL, HFILL - } - }, - { - &hf_rep_rsp_zone_spec_phy_cinr_rep_reserved1, - { - "Reserved", "wmx.rep_req.zone_spec_phy_cinr_report.reserved1", - FT_UINT8, BASE_HEX, NULL, REP_RSP_ZONE_SPEC_PHY_CINR_RSV1_MASK, NULL, HFILL - } - }, - { - &hf_rep_rsp_zone_spec_phy_cinr_rep_reserved2, - { - "Reserved", "wmx.rep_req.zone_spec_phy_cinr_report.reserved2", - FT_UINT8, BASE_HEX, NULL, REP_RSP_ZONE_SPEC_PHY_CINR_RSV2_MASK, NULL, HFILL - } - }, - { /* type 1.4 */ - &hf_rep_req_zone_spec_phy_cinr_request, - { - "Zone-specific Physical CINR Request", "wmx.rep_req.zone_spec_phy_cinr_request", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_req_zone_spec_phy_cinr_req_bit0_2, - { - "Type Of Zone On Which CINR Is To Be Reported", "wmx.rep_req.zone_spec_phy_cinr_request.bit0_2", - FT_UINT24, BASE_HEX, VALS(vals_type_of_zones), REP_REQ_TYPE_OF_ZONE_REQUEST_BIT0_2, NULL, HFILL - } - }, - { - &hf_rep_req_zone_spec_phy_cinr_req_bit3, - { - "STC Zone", "wmx.rep_req.zone_spec_phy_cinr_request.bit3", - FT_BOOLEAN, 24, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_BIT3, NULL, HFILL - } - }, - { - &hf_rep_req_zone_spec_phy_cinr_req_bit4, - { - "AAS Zone", "wmx.rep_req.zone_spec_phy_cinr_request.bit4", - FT_BOOLEAN, 24, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_BIT4, NULL, HFILL - } - }, - { - &hf_rep_req_zone_spec_phy_cinr_req_bit5_6, - { - "PRBS ID", "wmx.rep_req.zone_spec_phy_cinr_request.bit5_6", - FT_UINT24, BASE_HEX, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_BIT5_6, NULL, HFILL - } - }, - { - &hf_rep_req_zone_spec_phy_cinr_req_bit7, - { - "CINR Measurement Report", "wmx.rep_req.zone_spec_phy_cinr_request.bit7", - FT_UINT24, BASE_HEX, VALS(vals_data_cinr_measurements), REP_REQ_TYPE_OF_ZONE_REQUEST_BIT7, NULL, HFILL - } - }, - { - &hf_rep_req_zone_spec_phy_cinr_req_bit8_13, - { - "PUSC Major Group Map", "wmx.rep_req.zone_spec_phy_cinr_request.bit8_13", - FT_UINT24, BASE_HEX, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_BIT8_13, NULL, HFILL - } - }, - { - &hf_rep_req_zone_spec_phy_cinr_req_bit14_17, - { - "Alpha (ave) in multiples of 1/16", "wmx.rep_req.zone_spec_phy_cinr_request.bit14_17", - FT_UINT24, BASE_DEC, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_BIT14_17, NULL, HFILL - } - }, - { - &hf_rep_req_zone_spec_phy_cinr_req_bit18, - { - "CINR Report Type", "wmx.rep_req.zone_spec_phy_cinr_request.bit18", - FT_UINT24, BASE_HEX, VALS(vals_cinr_report_types), REP_REQ_TYPE_OF_ZONE_REQUEST_BIT18, NULL, HFILL - } - }, - { - &hf_rep_req_zone_spec_phy_cinr_req_bit19_23, - { - "Reserved", "wmx.rep_req.zone_spec_phy_cinr_request.bit19_23", - FT_UINT24, BASE_HEX, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_BIT19_23, NULL, HFILL - } - }, - { - &hf_rep_rsp_message_type, - { - "MAC Management Message Type", "wmx.macmgtmsgtype.rep_rsp", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { /* 6.3 */ - &hf_rep_rsp_channel_selectivity_report, - { - "Channel Selectivity Report", "wmx.rep_rsp.channel_selectivity_report", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_rsp_channel_selectivity_rep_frequency_a, - { - "Frequency Selectivity Report a", "wmx.rep_rsp.channel_selectivity_report.frequency_a", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_rsp_channel_selectivity_rep_frequency_b, - { - "Frequency Selectivity Report b", "wmx.rep_rsp.channel_selectivity_report.frequency_b", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_rsp_channel_selectivity_rep_frequency_c, - { - "Frequency Selectivity Report c", "wmx.rep_rsp.channel_selectivity_report.frequency_c", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_rsp_channel_type_report, - { - "Channel Type Report", "wmx.rep_rsp.channel_type_report", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_rsp_channel_type_band_amc, - { - "Band AMC", "wmx.rep_rsp.channel_type_report.band_amc", - FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_rsp_channel_type_enhanced_band_amc, - { - "Enhanced Band AMC", "wmx.rep_rsp.channel_type_report.enhanced_band_amc", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_rsp_channel_type_safety_channel, - { - "Safety Channel", "wmx.rep_rsp.channel_type_report.safety_channel", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_rsp_channel_type_sounding, - { - "Sounding", "wmx.rep_rsp.channel_type_report.sounding", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_rsp_channel_type_subchannel, - { - "Normal Subchannel", "wmx.rep_rsp.channel_type_report.subchannel", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_rsp_preamble_effective_cinr_report, - { - "Preamble Effective CINR Report", "wmx.rep_rsp.preamble_effective_cinr_report", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { /* 6.1 */ - &hf_rep_rsp_preamble_effective_cinr_rep_configuration_1, - { - "The Estimation Of Effective CINR Measured From Preamble For Frequency Reuse Configuration=1", "wmx.rep_rsp.preamble_effective_cinr_report.configuration_1", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { /* 6.2 */ - &hf_rep_rsp_preamble_effective_cinr_rep_configuration_3, - { - "The Estimation Of Effective CINR Measured From Preamble For Frequency Reuse Configuration=3", "wmx.rep_rsp.preamble_effective_cinr_report.configuration_3", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_rsp_preamble_phy_cinr_report, - { - "Preamble Physical CINR Report", "wmx.rep_rsp.preamble_phy_cinr_report", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { /* 4.3 */ - &hf_rep_rsp_preamble_phy_cinr_rep_band_amc_zone, - { - "The Estimation Of Physical CINR Measured From Preamble For Band AMC Zone", "wmx.rep_rsp.preamble_phy_cinr_report.band_amc_zone", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { /* 4.1 */ - &hf_rep_rsp_preamble_phy_cinr_rep_configuration_1, - { - "The Estimation Of Physical CINR Measured From Preamble For Frequency Reuse Configuration=1", "wmx.rep_rsp.preamble_phy_cinr_report.configuration_1", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { /* 4.2 */ - &hf_rep_rsp_preamble_phy_cinr_rep_configuration_3, - { - "The Estimation Of Physical CINR Measured From Preamble For Frequency Reuse Configuration=3", "wmx.rep_rsp.preamble_phy_cinr_report.configuration_3", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - /* Report Response */ - { - &hf_rep_rsp_report_type, - { - "Report Type", "wmx.rep_rsp.report_type", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_rsp_report_type_basic_report, - { - "Basic Report", "wmx.rep_rsp.report_type.basic_report", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_rsp_report_type_basic_report_bit0, - { - "Wireless HUMAN Detected", "wmx.rep_rsp.report_type.basic_report.bit0", - FT_BOOLEAN, 8, NULL, REP_RSP_REPORT_TYPE_BASIC_REPORT_BIT0, NULL, HFILL - } - }, - { - &hf_rep_rsp_report_type_basic_report_bit1, - { - "Unknown Transmission Detected", "wmx.rep_rsp.report_type.basic_report.bit1", - FT_BOOLEAN, 8, NULL, REP_RSP_REPORT_TYPE_BASIC_REPORT_BIT1, NULL, HFILL - } - }, - { - &hf_rep_rsp_report_type_basic_report_bit2, - { - "Specific Spectrum User Detected", "wmx.rep_rsp.report_type.basic_report.bit2", - FT_BOOLEAN, 8, NULL, REP_RSP_REPORT_TYPE_BASIC_REPORT_BIT2, NULL, HFILL - } - }, - { - &hf_rep_rsp_report_type_basic_report_bit3, - { - "Channel Not Measured", "wmx.rep_rsp.report_type.basic_report.bit3", - FT_BOOLEAN, 8, NULL, REP_RSP_REPORT_TYPE_BASIC_REPORT_BIT3, NULL, HFILL - } - }, - { - &hf_rep_rsp_report_type_basic_report_reserved, - { - "Reserved", "wmx.rep_rsp.report_type.basic_report.reserved", - FT_UINT8, BASE_HEX, NULL, REP_RSP_REPORT_TYPE_BASIC_REPORT_RSV, NULL, HFILL - } - }, - { - &hf_rep_rsp_report_type_channel_number, - { - "Channel Number", "wmx.rep_rsp.report_type.channel_number", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_rsp_report_type_cinr_report, - { - "CINR Report", "wmx.rep_rsp.report_type.cinr_report", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_rsp_report_type_cinr_report_deviation, - { - "CINR Standard Deviation", "wmx.rep_rsp.report_type.cinr_report_deviation", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_rsp_report_type_cinr_report_mean, - { - "CINR Mean", "wmx.rep_rsp.report_type.cinr_report_mean", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_rsp_report_type_duration, - { - "Duration", "wmx.rep_rsp.report_type.duration", - FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_rsp_report_type_frame_number, - { - "Start Frame", "wmx.rep_rsp.report_type.frame_number", - FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_rsp_report_type_rssi_report, - { - "RSSI Report", "wmx.rep_rsp.report_type.rssi_report", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_rsp_report_type_rssi_report_deviation, - { - "RSSI Standard Deviation", "wmx.rep_rsp.report_type.rssi_report_deviation", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_rsp_current_transmitted_power, - { - "Current Transmitted Power", "wmx.rep_rsp.current_transmitted_power", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_rsp_report_type_rssi_report_mean, - { - "RSSI Mean", "wmx.rep_rsp.report_type.rssi_report_mean", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_rsp_zone_spec_effective_cinr_report, - { - "Zone-specific Effective CINR Report", "wmx.rep_rsp.zone_spec_effective_cinr_report", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { /* 5.5 */ - &hf_rep_rsp_zone_spec_effective_cinr_rep_amc_aas, - { - "AMC AAS Zone", "wmx.rep_rsp.zone_spec_effective_cinr_report.amc_aas", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { /* 5.3 */ - &hf_rep_rsp_zone_spec_effective_cinr_rep_fusc, - { - "FUSC Zone", "wmx.rep_rsp.zone_spec_effective_cinr_report.fusc", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { /* 5.4 */ - &hf_rep_rsp_zone_spec_effective_cinr_rep_optional_fusc, - { - "Optional FUSC Zone", "wmx.rep_rsp.zone_spec_effective_cinr_report.optional_fusc", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { /* 5.1 */ - &hf_rep_rsp_zone_spec_effective_cinr_rep_pusc_sc0, - { - "PUSC Zone (use all SC=0)", "wmx.rep_rsp.zone_spec_effective_cinr_report.pusc_sc0", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { /* 5.2 */ - &hf_rep_rsp_zone_spec_effective_cinr_rep_pusc_sc1, - { - "PUSC Zone (use all SC=1)", "wmx.rep_rsp.zone_spec_effective_cinr_report.pusc_sc1", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_rsp_zone_spec_phy_cinr_report, - { - "Zone-specific Physical CINR Report", "wmx.rep_rsp.zone_spec_phy_cinr_report", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { /* 3.6 */ - &hf_rep_rsp_zone_spec_phy_cinr_rep_amc, - { - "AMC Zone", "wmx.rep_rsp.zone_spec_phy_cinr_report.amc", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { /* 3.3 */ - &hf_rep_rsp_zone_spec_phy_cinr_rep_fusc, - { - "FUSC Zone", "wmx.rep_rsp.zone_spec_phy_cinr_report.fusc", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { /* 3.4 */ - &hf_rep_rsp_zone_spec_phy_cinr_rep_optional_fusc, - { - "Optional FUSC Zone", "wmx.rep_rsp.zone_spec_phy_cinr_report.optional_fusc", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { /* 3.1 */ - &hf_rep_rsp_zone_spec_phy_cinr_rep_pusc_sc0, - { - "PUSC Zone (use all SC=0)", "wmx.rep_rsp.zone_spec_phy_cinr_report.pusc_sc0", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { /* 3.2 */ - &hf_rep_rsp_zone_spec_phy_cinr_rep_pusc_sc1, - { - "PUSC Zone (use all SC=1)", "wmx.rep_rsp.zone_spec_phy_cinr_report.pusc_sc1", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { /* 3.5 */ - &hf_rep_rsp_zone_spec_phy_cinr_rep_safety_channel, - { - "Safety Channel", "wmx.rep_rsp.zone_spec_phy_cinr_report.safety_channel", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rep_unknown_type, - { - "Unknown TLV type", "wmx.rep.unknown_tlv_type", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - } - }; - - if (proto_mac_mgmt_msg_rep_decoder == -1) - { - proto_mac_mgmt_msg_rep_decoder = proto_register_protocol ( - "WiMax REP-REQ/RSP Messages", /* name */ - "WiMax REP-REQ/RSP (rep)", /* short name */ - "wmx.rep" /* abbrev */ - ); - - proto_register_field_array(proto_mac_mgmt_msg_rep_decoder, hf_rep, array_length(hf_rep)); - proto_register_subtree_array(ett_rep, array_length(ett_rep)); - } -} - -/* Wimax Mac REP-REQ Message Dissector */ -void dissect_mac_mgmt_msg_rep_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ - guint offset = 0; - guint tvb_len, payload_type; - gint tlv_type, tlv_len, tlv_value_offset, length, tlv_offset; - proto_item *rep_item = NULL; - proto_tree *rep_tree = NULL; - proto_tree *tlv_tree = NULL; - proto_tree *ti_tree = NULL; - tlv_info_t tlv_info; - - /* Ensure the right payload type */ - payload_type = tvb_get_guint8(tvb, offset); - if(payload_type != MAC_MGMT_MSG_REP_REQ) - { - return; - } - - if(tree) - { /* we are being asked for details */ - /* Get the tvb reported length */ - tvb_len = tvb_reported_length(tvb); - /* display MAC payload type REP-REQ */ - rep_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_rep_decoder, tvb, offset, tvb_len, "Report Request (REP-REQ) (%u bytes)", tvb_len); - /* add MAC REP-REQ subtree */ - rep_tree = proto_item_add_subtree(rep_item, ett_mac_mgmt_msg_rep_req_decoder); - /* Decode and display the Report Request message (REP-REQ) */ - /* display the Message Type */ - proto_tree_add_item(rep_tree, hf_rep_req_message_type, tvb, offset, 1, FALSE); - /* set the offset for the TLV Encoded info */ - offset++; - /* process the REP-REQ TLVs */ - while(offset < tvb_len) - { /* get the TLV information */ - init_tlv_info(&tlv_info, tvb, offset); - /* get the TLV type */ - tlv_type = get_tlv_type(&tlv_info); - /* get the TLV length */ - tlv_len = get_tlv_length(&tlv_info); - if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1) - { /* invalid tlv info */ - if(check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "REP-REQ TLV error"); - } - proto_tree_add_item(rep_tree, hf_rep_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE); - break; - } - /* get the TLV value offset */ - tlv_value_offset = get_tlv_value_offset(&tlv_info); -#ifdef DEBUG /* for debug only */ - proto_tree_add_protocol_format(rep_tree, proto_mac_mgmt_msg_rep_decoder, tvb, offset, (tlv_len + tlv_value_offset), "REP-REQ Type: %u (%u bytes, offset=%u, length=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tlv_len, tvb_len); -#endif - /* update the offset for the TLV value */ - offset += tlv_value_offset; - /* process REP-REQ TLV Encoded information (11.11) */ - switch (tlv_type) - { - case REP_REQ_REPORT_REQUEST: - /* process the REP-REQ report request TLVs */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_req_decoder, rep_tree, hf_rep_req_report_request, tvb, offset, tlv_len, FALSE); - for( tlv_offset = 0; tlv_offset < tlv_len; ) - { /* get the TLV information */ - init_tlv_info(&tlv_info, tvb, (offset + tlv_offset)); - /* get the TLV type */ - tlv_type = get_tlv_type(&tlv_info); - /* get the TLV length */ - length = get_tlv_length(&tlv_info); - if(tlv_type == -1 || length > MAX_TLV_LEN || length < 1) - { /* invalid tlv info */ - if(check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "REP-REQ Report Request TLV error"); - } - proto_tree_add_item(tlv_tree, hf_rep_invalid_tlv, tvb, (offset + tlv_offset), (tlv_len - offset - tlv_offset), FALSE); - break; - } -#ifdef DEBUG /* for debug only */ - proto_tree_add_protocol_format(rep_tree, proto_mac_mgmt_msg_rep_decoder, tvb, offset, (length + tlv_value_offset), "REP-REQ Report Request Type: %u (%u bytes, offset=%u, length=%u, tvb_len=%u)", tlv_type, (length + tlv_value_offset), offset, length, tvb_len); -#endif - /* update the offset */ - tlv_offset += get_tlv_value_offset(&tlv_info); - switch (tlv_type) - { - case REP_REQ_REPORT_TYPE: - /* decode and display the Report type */ - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_req_decoder, tlv_tree, hf_rep_req_report_type, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_rep_type_bit0, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_rep_type_bit1, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_rep_type_bit2, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_rep_type_bit3_6, tvb, (offset + tlv_offset), length, FALSE); -/* proto_item_append_text(ti, " dB");*/ - proto_tree_add_item(ti_tree, hf_rep_req_rep_type_bit7, tvb, (offset + tlv_offset), length, FALSE); - break; - case REP_REQ_CHANNEL_NUMBER: - /* decode and display the Channel Number */ - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_req_decoder, tlv_tree, hf_rep_req_channel_number, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_channel_number, tvb, (offset + tlv_offset), length, FALSE); - break; - case REP_REQ_CHANNEL_TYPE: - /* decode and display the Channel Type */ - ti_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_rep_req_decoder, tlv_tree, proto_mac_mgmt_msg_rep_decoder, tvb, (offset + tlv_offset), length, "Channel Type (%u byte(s))", length); - proto_tree_add_item(ti_tree, hf_rep_req_channel_type_request, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_channel_type_reserved, tvb, (offset + tlv_offset), length, FALSE); - break; - case REP_REQ_ZONE_SPEC_PHY_CINR_REQ: - /* decode and display the zone specific physical cinr request */ - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_req_decoder, tlv_tree, hf_rep_req_zone_spec_phy_cinr_request, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit0_2, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit3, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit4, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit5_6, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit7, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit8_13, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit14_17, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit18, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit19_23, tvb, (offset + tlv_offset), length, FALSE); - break; - case REP_REQ_PREAMBLE_PHY_CINR_REQ: - /* decode and display the preamble phy cinr request */ - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_req_decoder, tlv_tree, hf_rep_req_preamble_phy_cinr_request, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_preamble_phy_cinr_req_bit0_1, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_preamble_phy_cinr_req_bit2_5, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_preamble_phy_cinr_req_bit6, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_preamble_phy_cinr_req_bit7, tvb, (offset + tlv_offset), length, FALSE); - break; - case REP_REQ_ZONE_SPEC_EFF_CINR_REQ: - /* decode and display the zone specific effective cinr request */ - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_req_decoder, tlv_tree, hf_rep_req_zone_spec_effective_cinr_request, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_effective_cinr_req_bit0_2, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_effective_cinr_req_bit3, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_effective_cinr_req_bit4, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_effective_cinr_req_bit5_6, tvb, (offset + tlv_offset), length, FALSE); - /* proto_item_append_text(ti, " dB");*/ - proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_effective_cinr_req_bit7, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_effective_cinr_req_bit8_13, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_effective_cinr_req_bit14_15, tvb, (offset + tlv_offset), length, FALSE); - break; - case REP_REQ_PREAMBLE_EFF_CINR_REQ: - /* decode and display the preamble effective cinr request */ - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_req_decoder, tlv_tree, hf_rep_req_preamble_effective_cinr_request, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_preamble_effective_cinr_req_bit0_1, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_preamble_effective_cinr_req_bit2_7, tvb, (offset + tlv_offset), length, FALSE); - break; - case REP_REQ_CHANNEL_SELECTIVITY_REPORT: - /* decode and display the channel selectivity report */ - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_req_decoder, tlv_tree, hf_rep_req_channel_selectivity_report, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_channel_selectivity_rep_bit0, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_req_channel_selectivity_rep_bit1_7, tvb, (offset + tlv_offset), length, FALSE); - break; - default: - /* display the unknown tlv in hex */ - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_req_decoder, tlv_tree, hf_rep_unknown_type, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_unknown_type, tvb, (offset + tlv_offset), length, FALSE); - break; - } - tlv_offset += length; - } /* end of TLV process for loop */ - break; - default: - /* display the unknown tlv in hex */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_req_decoder, rep_tree, hf_rep_unknown_type, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_rep_unknown_type, tvb, offset, tlv_len, FALSE); - break; - } - offset += tlv_len; - } /* end of TLV process while loop */ - } -} - -/* Wimax Mac REP-RSP Message Dissector */ -void dissect_mac_mgmt_msg_rep_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ - guint offset = 0; - guint tvb_len, payload_type, length, value; - gint tlv_type, tlv_len, tlv_value_offset, tlv_offset; - gint db_val; - proto_item *rep_item = NULL; - proto_tree *rep_tree = NULL; - proto_tree *tlv_tree = NULL; - proto_item *ti = NULL; - proto_tree *ti_tree = NULL; - tlv_info_t tlv_info; - gfloat current_power; - - /* Ensure the right payload type */ - payload_type = tvb_get_guint8(tvb, offset); - if(payload_type != MAC_MGMT_MSG_REP_RSP) - { - return; - } - - if(tree) - { /* we are being asked for details */ - /* Get the tvb reported length */ - tvb_len = tvb_reported_length(tvb); - /* display MAC payload type REP-RSP */ - rep_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_rep_decoder, tvb, offset, tvb_len, "Report Response (REP-RSP) (%u bytes)", tvb_len); - /* add MAC REP-RSP subtree */ - rep_tree = proto_item_add_subtree(rep_item, ett_mac_mgmt_msg_rep_rsp_decoder); - /* Decode and display the Report Response message (REP-RSP) */ - /* display the Message Type */ - proto_tree_add_item(rep_tree, hf_rep_rsp_message_type, tvb, offset, 1, FALSE); - /* set the offset for the TLV Encoded info */ - offset++; - /* process the REP-RSP TLVs */ - while(offset < tvb_len) - { /* get the TLV information */ - init_tlv_info(&tlv_info, tvb, offset); - /* get the TLV type */ - tlv_type = get_tlv_type(&tlv_info); - /* get the TLV length */ - tlv_len = get_tlv_length(&tlv_info); - if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1) - { /* invalid tlv info */ - if(check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "REP-RSP TLV error"); - } - proto_tree_add_item(rep_tree, hf_rep_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE); - break; - } - /* get the TLV value offset */ - tlv_value_offset = get_tlv_value_offset(&tlv_info); -#ifdef DEBUG /* for debug only */ - proto_tree_add_protocol_format(rep_tree, proto_mac_mgmt_msg_rep_decoder, tvb, offset, (tlv_len + tlv_value_offset), "REP-RSP Type: %u (%u bytes, offset=%u, tlv_len=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tlv_len, tvb_len); -#endif - /* update the offset for the TLV value */ - offset += tlv_value_offset; - /* process REP-RSP TLV Encoded information (11.12) */ - switch (tlv_type) + /* get the TLV value offset */ + tlv_value_offset = get_tlv_value_offset(&tlv_info); +#ifdef DEBUG /* for debug only */ + proto_tree_add_protocol_format(rep_tree, proto_mac_mgmt_msg_rep_decoder, tvb, offset, (tlv_len + tlv_value_offset), "REP-RSP Type: %u (%u bytes, offset=%u, tlv_len=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tlv_len, tvb_len); +#endif + /* update the offset for the TLV value */ + offset += tlv_value_offset; + /* process REP-RSP TLV Encoded information (11.12) */ + switch (tlv_type) { case REP_RSP_REPORT_TYPE: /* decode and display the Report type */ @@ -1610,7 +882,726 @@ void dissect_mac_mgmt_msg_rep_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, pro proto_tree_add_item(tlv_tree, hf_rep_unknown_type, tvb, offset, tlv_len, FALSE); break; } - offset += tlv_len; - } /* end of TLV process while loop */ - } + offset += tlv_len; + } /* end of TLV process while loop */ + } +} + +/* Register Wimax Mac REP-REQ Messages Dissectors */ +void proto_register_mac_mgmt_msg_rep(void) +{ + /* report display */ + static hf_register_info hf_rep[] = + { + { + &hf_rep_invalid_tlv, + { + "Invalid TLV", "wmx.rep.invalid_tlv", + FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL + } + }, + { + &hf_rep_req_message_type, + { + "MAC Management Message Type", "wmx.macmgtmsgtype.rep_req", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { /* type 1.2 */ + &hf_rep_req_channel_number, + { + "Channel Number", "wmx.rep_req.channel_number", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { /* type 1.8 */ + &hf_rep_req_channel_selectivity_report, + { + "Channel Selectivity Report", "wmx.rep_req.channel_selectivity_report", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_req_channel_selectivity_rep_bit0, + { + "Include Frequency Selectivity Report", "wmx.rep_req.channel_selectivity_report.bit0", + FT_BOOLEAN, 8, NULL, REP_REQ_CHANNEL_SELECTIVITY_REPORT_BIT0, NULL, HFILL + } + }, + { + &hf_rep_req_channel_selectivity_rep_bit1_7, + { + "Reserved", "wmx.rep_req.channel_selectivity_report.bit1_7", + FT_UINT8, BASE_HEX, NULL, REP_REQ_CHANNEL_SELECTIVITY_REPORT_BIT1_7, NULL, HFILL + } + }, + { /* type 1.3 */ + &hf_rep_req_channel_type_request, + { + "Channel Type Request", "wmx.rep_req.channel_type.request", + FT_UINT8, BASE_DEC, VALS(vals_channel_types), 0x03, NULL, HFILL + } + }, + { + &hf_rep_req_channel_type_reserved, + { + "Reserved", "wmx.rep_req.channel_type.reserved", + FT_UINT8, BASE_HEX, NULL, 0xFC, NULL, HFILL + } + }, + { /* type 1.7 */ + &hf_rep_req_preamble_effective_cinr_request, + { + "Preamble Effective CINR Request", "wmx.rep_req.preamble_effective_cinr_request", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_req_preamble_effective_cinr_req_bit0_1, + { + "Type Of Preamble Physical CINR Measurement", "wmx.rep_req.preamble_effective_cinr_request.bit0_1", + FT_UINT8, BASE_DEC, VALS(vals_type_of_measurements), REP_REQ_PREAMBLE_EFFECTIVE_CINR_REQUEST_BIT0_1, NULL, HFILL + } + }, + { + &hf_rep_req_preamble_effective_cinr_req_bit2_7, + { + "Reserved", "wmx.rep_req.preamble_effective_cinr_request.bit2_7", + FT_UINT8, BASE_HEX, NULL, REP_REQ_PREAMBLE_EFFECTIVE_CINR_REQUEST_BIT2_7, NULL, HFILL + } + }, + { /* type 1.5 */ + &hf_rep_req_preamble_phy_cinr_request, + { + "Preamble Physical CINR Request", "wmx.rep_req.preamble_phy_cinr_request", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_req_preamble_phy_cinr_req_bit0_1, + { + "Type Of Preamble Physical CINR Measurement", "wmx.rep_req.preamble_phy_cinr_request.bit0_1", + FT_UINT8, BASE_DEC, VALS(vals_type_of_measurements), REP_REQ_PREAMBLE_PHY_CINR_REQUEST_BIT0_1, NULL, HFILL + } + }, + { + &hf_rep_req_preamble_phy_cinr_req_bit2_5, + { + "Alpha (ave) in multiples of 1/16", "wmx.rep_req.preamble_phy_cinr_request.bit2_5", + FT_UINT8, BASE_DEC, NULL, REP_REQ_PREAMBLE_PHY_CINR_REQUEST_BIT2_5, NULL, HFILL + } + }, + { + &hf_rep_req_preamble_phy_cinr_req_bit6, + { + "CINR Report Type", "wmx.rep_req.preamble_phy_cinr_request.bit6", + FT_UINT8, BASE_DEC, VALS(vals_cinr_report_types), REP_REQ_PREAMBLE_PHY_CINR_REQUEST_BIT6, NULL, HFILL + } + }, + { + &hf_rep_req_preamble_phy_cinr_req_bit7, + { + "Reserved", "wmx.rep_req.preamble_phy_cinr_request.bit7", + FT_UINT8, BASE_HEX, NULL, REP_REQ_PREAMBLE_PHY_CINR_REQUEST_BIT7, NULL, HFILL + } + }, + { /* report request */ + &hf_rep_req_report_request, + { + "Report Request", "wmx.rep_req.report_request", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { /* type 1.1 */ + &hf_rep_req_report_type, + { + "Report Type", "wmx.rep_req.report_type", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_req_rep_type_bit0, + { + "Include DFS Basic Report", "wmx.rep_req.report_type.bit0", + FT_BOOLEAN, 8, NULL, REP_REQ_REPORT_TYPE_BIT0, NULL, HFILL + } + }, + { + &hf_rep_req_rep_type_bit1, + { + "Include CINR Report", "wmx.rep_req.report_type.bit1", + FT_BOOLEAN, 8, NULL, REP_REQ_REPORT_TYPE_BIT1, NULL, HFILL + } + }, + { + &hf_rep_req_rep_type_bit2, + { + "Include RSSI Report", "wmx.rep_req.report_type.bit2", + FT_BOOLEAN, 8, NULL, REP_REQ_REPORT_TYPE_BIT2, NULL, HFILL + } + }, + { + &hf_rep_req_rep_type_bit3_6, + { + "Alpha (ave) in multiples of 1/32", "wmx.rep_req.report_type.bit3_6", + FT_UINT8, BASE_DEC, NULL, REP_REQ_REPORT_TYPE_BIT3_6, NULL, HFILL + } + }, + { + &hf_rep_req_rep_type_bit7, + { + "Include Current Transmit Power Report", "wmx.rep_req.report_type.bit7", + FT_BOOLEAN, 8, NULL, REP_REQ_REPORT_TYPE_BIT7, NULL, HFILL + } + }, + { + &hf_rep_rsp_preamble_effective_cinr_rep_cqich_id, + { + "The 4 least significant bits of CQICH_ID", "wmx.rep_req.zone_spec_effective_cinr_report.cqich_id_4", + FT_UINT8, BASE_HEX, NULL, REP_RSP_ZONE_SPEC_EFFECTIVE_CINR_CQICH_ID_4_MASK, NULL, HFILL + } + }, + { + &hf_rep_rsp_zone_spec_effective_cinr_rep_cqich_id, + { + "The 3 least significant bits of CQICH_ID", "wmx.rep_req.zone_spec_effective_cinr_report.cqich_id", + FT_UINT8, BASE_HEX, NULL, REP_RSP_ZONE_SPEC_EFFECTIVE_CINR_CQICH_ID_MASK, NULL, HFILL + } + }, + { + &hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr, + { + "Effective CINR", "wmx.rep_req.zone_spec_effective_cinr_report.effective_cinr", + FT_UINT8, BASE_DEC, NULL, REP_RSP_ZONE_SPEC_EFFECTIVE_CINR_EFFECTIVE_CINR_MASK, NULL, HFILL + } + }, + { + &hf_rep_rsp_zone_spec_effective_cinr_rep_report_type, + { + "Effective CINR Report", "wmx.rep_req.zone_spec_effective_cinr_report.report_type", + FT_UINT8, BASE_DEC, VALS(vals_data_cinr_measurements), REP_RSP_ZONE_SPEC_EFFECTIVE_CINR_REPORT_TYPE_MASK, NULL, HFILL + } + }, + { /* type 1.6 */ + &hf_rep_req_zone_spec_effective_cinr_request, + { + "Zone-specific Effective CINR Request", "wmx.rep_req.zone_spec_effective_cinr_request", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_req_zone_spec_effective_cinr_req_bit0_2, + { + "Type Of Zone On Which CINR Is To Be Reported", "wmx.rep_req.zone_spec_effective_cinr_request.bit0_2", + FT_UINT16, BASE_HEX, VALS(vals_type_of_zones), REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT0_2, NULL, HFILL + } + }, + { + &hf_rep_req_zone_spec_effective_cinr_req_bit3, + { + "STC Zone", "wmx.rep_req.zone_spec_effective_cinr_request.bit3", + FT_BOOLEAN, 16, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT3, NULL, HFILL + } + }, + { + &hf_rep_req_zone_spec_effective_cinr_req_bit4, + { + "AAS Zone", "wmx.rep_req.zone_spec_effective_cinr_request.bit4", + FT_BOOLEAN, 16, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT4, NULL, HFILL + } + }, + { + &hf_rep_req_zone_spec_effective_cinr_req_bit5_6, + { + "PRBS ID", "wmx.rep_req.zone_spec_effective_cinr_request.bit5_6", + FT_UINT16, BASE_HEX, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT5_6, NULL, HFILL + } + }, + { + &hf_rep_req_zone_spec_effective_cinr_req_bit7, + { + "CINR Measurement Report", "wmx.rep_req.zone_spec_effective_cinr_request.bit7", + FT_UINT16, BASE_HEX, VALS(vals_data_cinr_measurements), REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT7, NULL, HFILL + } + }, + { + &hf_rep_req_zone_spec_effective_cinr_req_bit8_13, + { + "PUSC Major Group Map", "wmx.rep_req.zone_spec_effective_cinr_request.bit8_13", + FT_UINT16, BASE_HEX, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT8_13, NULL, HFILL + } + }, + { + &hf_rep_req_zone_spec_effective_cinr_req_bit14_15, + { + "Reserved", "wmx.rep_req.zone_spec_effective_cinr_request.bit14_15", + FT_UINT16, BASE_HEX, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT14_15, NULL, HFILL + } + }, + { /* second byte */ + &hf_rep_rsp_zone_spec_phy_cinr_rep_deviation, + { + "Standard Deviation of CINR", "wmx.rep_req.zone_spec_phy_cinr_report.deviation", + FT_UINT8, BASE_DEC, NULL, REP_RSP_ZONE_SPEC_PHY_CINR_DEVIATION_MASK, NULL, HFILL + } + }, + { /* first byte */ + &hf_rep_rsp_zone_spec_phy_cinr_rep_mean, + { + "Mean of Physical CINR", "wmx.rep_req.zone_spec_phy_cinr_report.mean", + FT_UINT8, BASE_DEC, NULL, REP_RSP_ZONE_SPEC_PHY_CINR_MEAN_MASK, NULL, HFILL + } + }, + { + &hf_rep_rsp_zone_spec_phy_cinr_rep_report_type, + { + "CINR Report Type", "wmx.rep_req.zone_spec_phy_cinr_report.report_type", + FT_UINT8, BASE_DEC, VALS(vals_data_cinr_measurements), REP_RSP_ZONE_SPEC_PHY_CINR_REP_TYPE_MASK, NULL, HFILL + } + }, + { + &hf_rep_rsp_zone_spec_phy_cinr_rep_reserved1, + { + "Reserved", "wmx.rep_req.zone_spec_phy_cinr_report.reserved1", + FT_UINT8, BASE_HEX, NULL, REP_RSP_ZONE_SPEC_PHY_CINR_RSV1_MASK, NULL, HFILL + } + }, + { + &hf_rep_rsp_zone_spec_phy_cinr_rep_reserved2, + { + "Reserved", "wmx.rep_req.zone_spec_phy_cinr_report.reserved2", + FT_UINT8, BASE_HEX, NULL, REP_RSP_ZONE_SPEC_PHY_CINR_RSV2_MASK, NULL, HFILL + } + }, + { /* type 1.4 */ + &hf_rep_req_zone_spec_phy_cinr_request, + { + "Zone-specific Physical CINR Request", "wmx.rep_req.zone_spec_phy_cinr_request", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_req_zone_spec_phy_cinr_req_bit0_2, + { + "Type Of Zone On Which CINR Is To Be Reported", "wmx.rep_req.zone_spec_phy_cinr_request.bit0_2", + FT_UINT24, BASE_HEX, VALS(vals_type_of_zones), REP_REQ_TYPE_OF_ZONE_REQUEST_BIT0_2, NULL, HFILL + } + }, + { + &hf_rep_req_zone_spec_phy_cinr_req_bit3, + { + "STC Zone", "wmx.rep_req.zone_spec_phy_cinr_request.bit3", + FT_BOOLEAN, 24, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_BIT3, NULL, HFILL + } + }, + { + &hf_rep_req_zone_spec_phy_cinr_req_bit4, + { + "AAS Zone", "wmx.rep_req.zone_spec_phy_cinr_request.bit4", + FT_BOOLEAN, 24, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_BIT4, NULL, HFILL + } + }, + { + &hf_rep_req_zone_spec_phy_cinr_req_bit5_6, + { + "PRBS ID", "wmx.rep_req.zone_spec_phy_cinr_request.bit5_6", + FT_UINT24, BASE_HEX, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_BIT5_6, NULL, HFILL + } + }, + { + &hf_rep_req_zone_spec_phy_cinr_req_bit7, + { + "CINR Measurement Report", "wmx.rep_req.zone_spec_phy_cinr_request.bit7", + FT_UINT24, BASE_HEX, VALS(vals_data_cinr_measurements), REP_REQ_TYPE_OF_ZONE_REQUEST_BIT7, NULL, HFILL + } + }, + { + &hf_rep_req_zone_spec_phy_cinr_req_bit8_13, + { + "PUSC Major Group Map", "wmx.rep_req.zone_spec_phy_cinr_request.bit8_13", + FT_UINT24, BASE_HEX, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_BIT8_13, NULL, HFILL + } + }, + { + &hf_rep_req_zone_spec_phy_cinr_req_bit14_17, + { + "Alpha (ave) in multiples of 1/16", "wmx.rep_req.zone_spec_phy_cinr_request.bit14_17", + FT_UINT24, BASE_DEC, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_BIT14_17, NULL, HFILL + } + }, + { + &hf_rep_req_zone_spec_phy_cinr_req_bit18, + { + "CINR Report Type", "wmx.rep_req.zone_spec_phy_cinr_request.bit18", + FT_UINT24, BASE_HEX, VALS(vals_cinr_report_types), REP_REQ_TYPE_OF_ZONE_REQUEST_BIT18, NULL, HFILL + } + }, + { + &hf_rep_req_zone_spec_phy_cinr_req_bit19_23, + { + "Reserved", "wmx.rep_req.zone_spec_phy_cinr_request.bit19_23", + FT_UINT24, BASE_HEX, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_BIT19_23, NULL, HFILL + } + }, + { + &hf_rep_rsp_message_type, + { + "MAC Management Message Type", "wmx.macmgtmsgtype.rep_rsp", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { /* 6.3 */ + &hf_rep_rsp_channel_selectivity_report, + { + "Channel Selectivity Report", "wmx.rep_rsp.channel_selectivity_report", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_rsp_channel_selectivity_rep_frequency_a, + { + "Frequency Selectivity Report a", "wmx.rep_rsp.channel_selectivity_report.frequency_a", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_rsp_channel_selectivity_rep_frequency_b, + { + "Frequency Selectivity Report b", "wmx.rep_rsp.channel_selectivity_report.frequency_b", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_rsp_channel_selectivity_rep_frequency_c, + { + "Frequency Selectivity Report c", "wmx.rep_rsp.channel_selectivity_report.frequency_c", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_rsp_channel_type_report, + { + "Channel Type Report", "wmx.rep_rsp.channel_type_report", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_rsp_channel_type_band_amc, + { + "Band AMC", "wmx.rep_rsp.channel_type_report.band_amc", + FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_rsp_channel_type_enhanced_band_amc, + { + "Enhanced Band AMC", "wmx.rep_rsp.channel_type_report.enhanced_band_amc", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_rsp_channel_type_safety_channel, + { + "Safety Channel", "wmx.rep_rsp.channel_type_report.safety_channel", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_rsp_channel_type_sounding, + { + "Sounding", "wmx.rep_rsp.channel_type_report.sounding", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_rsp_channel_type_subchannel, + { + "Normal Subchannel", "wmx.rep_rsp.channel_type_report.subchannel", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_rsp_preamble_effective_cinr_report, + { + "Preamble Effective CINR Report", "wmx.rep_rsp.preamble_effective_cinr_report", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { /* 6.1 */ + &hf_rep_rsp_preamble_effective_cinr_rep_configuration_1, + { + "The Estimation Of Effective CINR Measured From Preamble For Frequency Reuse Configuration=1", "wmx.rep_rsp.preamble_effective_cinr_report.configuration_1", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { /* 6.2 */ + &hf_rep_rsp_preamble_effective_cinr_rep_configuration_3, + { + "The Estimation Of Effective CINR Measured From Preamble For Frequency Reuse Configuration=3", "wmx.rep_rsp.preamble_effective_cinr_report.configuration_3", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_rsp_preamble_phy_cinr_report, + { + "Preamble Physical CINR Report", "wmx.rep_rsp.preamble_phy_cinr_report", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { /* 4.3 */ + &hf_rep_rsp_preamble_phy_cinr_rep_band_amc_zone, + { + "The Estimation Of Physical CINR Measured From Preamble For Band AMC Zone", "wmx.rep_rsp.preamble_phy_cinr_report.band_amc_zone", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { /* 4.1 */ + &hf_rep_rsp_preamble_phy_cinr_rep_configuration_1, + { + "The Estimation Of Physical CINR Measured From Preamble For Frequency Reuse Configuration=1", "wmx.rep_rsp.preamble_phy_cinr_report.configuration_1", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { /* 4.2 */ + &hf_rep_rsp_preamble_phy_cinr_rep_configuration_3, + { + "The Estimation Of Physical CINR Measured From Preamble For Frequency Reuse Configuration=3", "wmx.rep_rsp.preamble_phy_cinr_report.configuration_3", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + /* Report Response */ + { + &hf_rep_rsp_report_type, + { + "Report Type", "wmx.rep_rsp.report_type", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_rsp_report_type_basic_report, + { + "Basic Report", "wmx.rep_rsp.report_type.basic_report", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_rsp_report_type_basic_report_bit0, + { + "Wireless HUMAN Detected", "wmx.rep_rsp.report_type.basic_report.bit0", + FT_BOOLEAN, 8, NULL, REP_RSP_REPORT_TYPE_BASIC_REPORT_BIT0, NULL, HFILL + } + }, + { + &hf_rep_rsp_report_type_basic_report_bit1, + { + "Unknown Transmission Detected", "wmx.rep_rsp.report_type.basic_report.bit1", + FT_BOOLEAN, 8, NULL, REP_RSP_REPORT_TYPE_BASIC_REPORT_BIT1, NULL, HFILL + } + }, + { + &hf_rep_rsp_report_type_basic_report_bit2, + { + "Specific Spectrum User Detected", "wmx.rep_rsp.report_type.basic_report.bit2", + FT_BOOLEAN, 8, NULL, REP_RSP_REPORT_TYPE_BASIC_REPORT_BIT2, NULL, HFILL + } + }, + { + &hf_rep_rsp_report_type_basic_report_bit3, + { + "Channel Not Measured", "wmx.rep_rsp.report_type.basic_report.bit3", + FT_BOOLEAN, 8, NULL, REP_RSP_REPORT_TYPE_BASIC_REPORT_BIT3, NULL, HFILL + } + }, + { + &hf_rep_rsp_report_type_basic_report_reserved, + { + "Reserved", "wmx.rep_rsp.report_type.basic_report.reserved", + FT_UINT8, BASE_HEX, NULL, REP_RSP_REPORT_TYPE_BASIC_REPORT_RSV, NULL, HFILL + } + }, + { + &hf_rep_rsp_report_type_channel_number, + { + "Channel Number", "wmx.rep_rsp.report_type.channel_number", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_rsp_report_type_cinr_report, + { + "CINR Report", "wmx.rep_rsp.report_type.cinr_report", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_rsp_report_type_cinr_report_deviation, + { + "CINR Standard Deviation", "wmx.rep_rsp.report_type.cinr_report_deviation", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_rsp_report_type_cinr_report_mean, + { + "CINR Mean", "wmx.rep_rsp.report_type.cinr_report_mean", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_rsp_report_type_duration, + { + "Duration", "wmx.rep_rsp.report_type.duration", + FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_rsp_report_type_frame_number, + { + "Start Frame", "wmx.rep_rsp.report_type.frame_number", + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_rsp_report_type_rssi_report, + { + "RSSI Report", "wmx.rep_rsp.report_type.rssi_report", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_rsp_report_type_rssi_report_deviation, + { + "RSSI Standard Deviation", "wmx.rep_rsp.report_type.rssi_report_deviation", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_rsp_current_transmitted_power, + { + "Current Transmitted Power", "wmx.rep_rsp.current_transmitted_power", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_rsp_report_type_rssi_report_mean, + { + "RSSI Mean", "wmx.rep_rsp.report_type.rssi_report_mean", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_rsp_zone_spec_effective_cinr_report, + { + "Zone-specific Effective CINR Report", "wmx.rep_rsp.zone_spec_effective_cinr_report", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { /* 5.5 */ + &hf_rep_rsp_zone_spec_effective_cinr_rep_amc_aas, + { + "AMC AAS Zone", "wmx.rep_rsp.zone_spec_effective_cinr_report.amc_aas", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { /* 5.3 */ + &hf_rep_rsp_zone_spec_effective_cinr_rep_fusc, + { + "FUSC Zone", "wmx.rep_rsp.zone_spec_effective_cinr_report.fusc", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { /* 5.4 */ + &hf_rep_rsp_zone_spec_effective_cinr_rep_optional_fusc, + { + "Optional FUSC Zone", "wmx.rep_rsp.zone_spec_effective_cinr_report.optional_fusc", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { /* 5.1 */ + &hf_rep_rsp_zone_spec_effective_cinr_rep_pusc_sc0, + { + "PUSC Zone (use all SC=0)", "wmx.rep_rsp.zone_spec_effective_cinr_report.pusc_sc0", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { /* 5.2 */ + &hf_rep_rsp_zone_spec_effective_cinr_rep_pusc_sc1, + { + "PUSC Zone (use all SC=1)", "wmx.rep_rsp.zone_spec_effective_cinr_report.pusc_sc1", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_rsp_zone_spec_phy_cinr_report, + { + "Zone-specific Physical CINR Report", "wmx.rep_rsp.zone_spec_phy_cinr_report", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { /* 3.6 */ + &hf_rep_rsp_zone_spec_phy_cinr_rep_amc, + { + "AMC Zone", "wmx.rep_rsp.zone_spec_phy_cinr_report.amc", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { /* 3.3 */ + &hf_rep_rsp_zone_spec_phy_cinr_rep_fusc, + { + "FUSC Zone", "wmx.rep_rsp.zone_spec_phy_cinr_report.fusc", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { /* 3.4 */ + &hf_rep_rsp_zone_spec_phy_cinr_rep_optional_fusc, + { + "Optional FUSC Zone", "wmx.rep_rsp.zone_spec_phy_cinr_report.optional_fusc", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { /* 3.1 */ + &hf_rep_rsp_zone_spec_phy_cinr_rep_pusc_sc0, + { + "PUSC Zone (use all SC=0)", "wmx.rep_rsp.zone_spec_phy_cinr_report.pusc_sc0", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { /* 3.2 */ + &hf_rep_rsp_zone_spec_phy_cinr_rep_pusc_sc1, + { + "PUSC Zone (use all SC=1)", "wmx.rep_rsp.zone_spec_phy_cinr_report.pusc_sc1", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { /* 3.5 */ + &hf_rep_rsp_zone_spec_phy_cinr_rep_safety_channel, + { + "Safety Channel", "wmx.rep_rsp.zone_spec_phy_cinr_report.safety_channel", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_rep_unknown_type, + { + "Unknown TLV type", "wmx.rep.unknown_tlv_type", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + } + }; + + /* Setup protocol subtree array */ + static gint *ett_rep[] = + { + &ett_mac_mgmt_msg_rep_req_decoder, + &ett_mac_mgmt_msg_rep_rsp_decoder, + }; + + proto_mac_mgmt_msg_rep_decoder = proto_register_protocol ( + "WiMax REP-REQ/RSP Messages", /* name */ + "WiMax REP-REQ/RSP (rep)", /* short name */ + "wmx.rep" /* abbrev */ + ); + + proto_register_field_array(proto_mac_mgmt_msg_rep_decoder, hf_rep, array_length(hf_rep)); + proto_register_subtree_array(ett_rep, array_length(ett_rep)); } diff --git a/plugins/wimax/msg_res_cmd.c b/plugins/wimax/msg_res_cmd.c index 87fada7349..cfe80284dd 100644 --- a/plugins/wimax/msg_res_cmd.c +++ b/plugins/wimax/msg_res_cmd.c @@ -36,64 +36,20 @@ #include "config.h" #endif -#include "moduleinfo.h" - #include #include #include "wimax_tlv.h" #include "wimax_mac.h" #include "wimax_utils.h" -/* forward reference */ -void proto_register_mac_mgmt_msg_res_cmd(void); -void dissect_mac_mgmt_msg_res_cmd_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - static gint proto_mac_mgmt_msg_res_cmd_decoder = -1; static gint ett_mac_mgmt_msg_res_cmd_decoder = -1; -/* Setup protocol subtree array */ -static gint *ett_res_cmd[] = -{ - &ett_mac_mgmt_msg_res_cmd_decoder, -}; - /* fix fields */ static gint hf_res_cmd_message_type = -1; static gint hf_res_cmd_unknown_type = -1; static gint hf_res_cmd_invalid_tlv = -1; -/* Register Wimax Mac RES-CMD Message Dissector */ -void proto_register_mac_mgmt_msg_res_cmd(void) -{ - /* DSx display */ - static hf_register_info hf_res_cmd[] = - { - { - &hf_res_cmd_message_type, - {"MAC Management Message Type", "wmx.macmgtmsgtype.res_cmd", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} - }, - { - &hf_res_cmd_invalid_tlv, - {"Invalid TLV", "wmx.res_cmd.invalid_tlv", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL} - }, - { - &hf_res_cmd_unknown_type, - {"Unknown TLV type", "wmx.res_cmd.unknown_tlv_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} - } - }; - - if (proto_mac_mgmt_msg_res_cmd_decoder == -1) - { - proto_mac_mgmt_msg_res_cmd_decoder = proto_register_protocol ( - "WiMax RES-CMD Message", /* name */ - "WiMax RES-CMD (res)", /* short name */ - "wmx.res" /* abbrev */ - ); - - proto_register_field_array(proto_mac_mgmt_msg_res_cmd_decoder, hf_res_cmd, array_length(hf_res_cmd)); - proto_register_subtree_array(ett_res_cmd, array_length(ett_res_cmd)); - } -} /* Wimax Mac RES-CMD Message Dissector */ void dissect_mac_mgmt_msg_res_cmd_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) @@ -174,3 +130,39 @@ void dissect_mac_mgmt_msg_res_cmd_decoder(tvbuff_t *tvb, packet_info *pinfo, pro } /* end of TLV process while loop */ } } + +/* Register Wimax Mac RES-CMD Message Dissector */ +void proto_register_mac_mgmt_msg_res_cmd(void) +{ + /* DSx display */ + static hf_register_info hf_res_cmd[] = + { + { + &hf_res_cmd_message_type, + {"MAC Management Message Type", "wmx.macmgtmsgtype.res_cmd", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} + }, + { + &hf_res_cmd_invalid_tlv, + {"Invalid TLV", "wmx.res_cmd.invalid_tlv", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL} + }, + { + &hf_res_cmd_unknown_type, + {"Unknown TLV type", "wmx.res_cmd.unknown_tlv_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} + } + }; + + /* Setup protocol subtree array */ + static gint *ett_res_cmd[] = + { + &ett_mac_mgmt_msg_res_cmd_decoder, + }; + + proto_mac_mgmt_msg_res_cmd_decoder = proto_register_protocol ( + "WiMax RES-CMD Message", /* name */ + "WiMax RES-CMD (res)", /* short name */ + "wmx.res" /* abbrev */ + ); + + proto_register_field_array(proto_mac_mgmt_msg_res_cmd_decoder, hf_res_cmd, array_length(hf_res_cmd)); + proto_register_subtree_array(ett_res_cmd, array_length(ett_res_cmd)); +} diff --git a/plugins/wimax/msg_rng_req.c b/plugins/wimax/msg_rng_req.c index 0b8d9c1b0b..148c6dde39 100644 --- a/plugins/wimax/msg_rng_req.c +++ b/plugins/wimax/msg_rng_req.c @@ -32,8 +32,6 @@ #include "config.h" #endif -#include "moduleinfo.h" - #include #include #include "crc.h" @@ -46,18 +44,9 @@ extern gboolean include_cor2_changes; extern gint man_ofdma; -/* Forward reference */ -void dissect_mac_mgmt_msg_rng_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - gint proto_mac_mgmt_msg_rng_req_decoder = -1; static gint ett_mac_mgmt_msg_rng_req_decoder = -1; -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_mac_mgmt_msg_rng_req_decoder, -}; - /* RNG-REQ fields */ static gint hf_rng_req_message_type = -1; static gint hf_rng_req_reserved = -1; @@ -231,6 +220,151 @@ void dissect_power_saving_class(proto_tree *rng_req_tree, gint tlv_type, tvbuff_ } /* end of TLV process while loop */ } + +/* Decode RNG-REQ messages. */ +void dissect_mac_mgmt_msg_rng_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + guint offset = 0; + guint tlv_offset; + guint tvb_len, payload_type; + proto_item *rng_req_item = NULL; + proto_tree *rng_req_tree = NULL; + proto_tree *tlv_tree = NULL; + tlv_info_t tlv_info; + gint tlv_type; + gint tlv_len; + + /* Ensure the right payload type */ + payload_type = tvb_get_guint8(tvb, offset); + if(payload_type != MAC_MGMT_MSG_RNG_REQ) + { + return; + } + + if (tree) + { /* we are being asked for details */ + + /* Get the tvb reported length */ + tvb_len = tvb_reported_length(tvb); + /* display MAC payload type RNG-REQ */ + rng_req_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_rng_req_decoder, tvb, offset, tvb_len, "MAC Management Message, RNG-REQ (4)"); + /* add MAC RNG-REQ subtree */ + rng_req_tree = proto_item_add_subtree(rng_req_item, ett_mac_mgmt_msg_rng_req_decoder); + /* display the Message Type */ + proto_tree_add_item(rng_req_tree, hf_rng_req_message_type, tvb, offset, 1, FALSE); + proto_tree_add_item(rng_req_tree, hf_rng_req_reserved, tvb, 1, 1, FALSE); + offset += 2; + + while(offset < tvb_len) + { + /* Get the TLV data. */ + init_tlv_info(&tlv_info, tvb, offset); + /* get the TLV type */ + tlv_type = get_tlv_type(&tlv_info); + /* get the TLV length */ + tlv_len = get_tlv_length(&tlv_info); + if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1) + { /* invalid tlv info */ + if(check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "RNG-REQ TLV error"); + } + proto_tree_add_item(rng_req_tree, hf_rng_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE); + break; + } + /* get the offset to the TLV data */ + tlv_offset = offset + get_tlv_value_offset(&tlv_info); + + switch (tlv_type) { + case RNG_REQ_DL_BURST_PROFILE: + /* add TLV subtree */ + tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, proto_mac_mgmt_msg_rng_req_decoder, tvb, tlv_offset, tlv_len, "Requested Downlink Burst Profile 0x%02x", tvb_get_guint8(tvb, tlv_offset)); + proto_tree_add_item(tlv_tree, hf_rng_req_dl_burst_profile_diuc, tvb, tlv_offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_rng_req_dl_burst_profile_lsb_ccc, tvb, tlv_offset, 1, FALSE); + break; + case RNG_REQ_SS_MAC_ADDRESS: + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, hf_rng_req_ss_mac_address, tvb, tlv_offset, 6, FALSE); + proto_tree_add_item(tlv_tree, hf_rng_req_ss_mac_address, tvb, tlv_offset, 6, FALSE); + break; + case RNG_REQ_RANGING_ANOMALIES: + /* add TLV subtree */ + tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, proto_mac_mgmt_msg_rng_req_decoder, tvb, tlv_offset, tlv_len, "Ranging Anomalies %d", tvb_get_guint8(tvb, tlv_offset)); + proto_tree_add_item(tlv_tree, hf_rng_req_ranging_anomalies_max_power, tvb, tlv_offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_rng_req_ranging_anomalies_min_power, tvb, tlv_offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_rng_req_ranging_anomalies_timing_adj, tvb, tlv_offset, 1, FALSE); + break; + case RNG_REQ_AAS_BROADCAST: + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, hf_rng_req_aas_broadcast, tvb, tlv_offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_rng_req_aas_broadcast, tvb, tlv_offset, 1, FALSE); + break; + case RNG_REQ_SERVING_BS_ID: + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, hf_rng_req_serving_bs_id, tvb, tlv_offset, 6, FALSE); + proto_tree_add_item(tlv_tree, hf_rng_req_serving_bs_id, tvb, tlv_offset, 6, FALSE); + break; + case RNG_REQ_RANGING_PURPOSE_INDICATION: + /* display the Ranging Purpose Flags */ + /* add subtree */ + tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, proto_mac_mgmt_msg_rng_req_decoder, tvb, tlv_offset, tlv_len, "Ranging Purpose Flags (%u byte(s))", tlv_len); + proto_tree_add_item(tlv_tree, hf_rng_req_ranging_purpose_ho_indication, tvb, tlv_offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_rng_req_ranging_purpose_location_update_request, tvb, tlv_offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_rng_req_ranging_purpose_reserved, tvb, tlv_offset, 1, FALSE); + break; + case RNG_REQ_HO_ID: + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, hf_rng_req_ho_id, tvb, tlv_offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_rng_req_ho_id, tvb, tlv_offset, 1, FALSE); + break; + case RNG_REQ_POWER_DOWN_INDICATOR: + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, hf_rng_req_power_down_indicator, tvb, tlv_offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_rng_req_power_down_indicator, tvb, tlv_offset, 1, FALSE); + break; + case RNG_REQ_REQUESTED_DNLK_REP_CODING_LEVEL: + /* add subtree */ + tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, proto_mac_mgmt_msg_rng_req_decoder, tvb, tlv_offset, tlv_len, "Requested downlink repetition coding level (%u byte(s))", tlv_len); + proto_tree_add_item(tlv_tree, hf_rng_req_repetition_coding_level, tvb, tlv_offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_rng_req_requested_downlink_repetition_coding_level_reserved, tvb, tlv_offset, 1, FALSE); + break; + case RNG_REQ_CMAC_KEY_COUNT: + if (include_cor2_changes) { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, hf_rng_req_cmac_key_count, tvb, tlv_offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_rng_req_cmac_key_count, tvb, tlv_offset, 2, FALSE); + } else { + /* Unknown TLV type */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, hf_tlv_type, tvb, tlv_offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_tlv_type, tvb, tlv_offset, tlv_len, FALSE); + } + break; + case SHORT_HMAC_TUPLE: + case SHORT_HMAC_TUPLE_COR2: + if ((!include_cor2_changes && (tlv_type == SHORT_HMAC_TUPLE)) || + (include_cor2_changes && (tlv_type == SHORT_HMAC_TUPLE_COR2))) { + /* decode and display the Short HMAC Tuple */ + tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, proto_mac_mgmt_msg_rng_req_decoder, tvb, tlv_offset, tlv_len, "Short HMAC Tuple (%u byte(s))", tlv_len); + wimax_short_hmac_tuple_decoder(tlv_tree, tvb, tlv_offset, tvb_len - offset); + } else { + /* Unknown TLV Type */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, hf_tlv_type, tvb, tlv_offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_tlv_type, tvb, tlv_offset, tlv_len, FALSE); + } + break; + case MAC_VERSION_ENCODING: + offset += wimax_common_tlv_encoding_decoder(tvb_new_subset(tvb, offset, (tvb_len - offset), (tvb_len - offset)), pinfo, rng_req_tree); + continue; + break; + case RNG_REQ_POWER_SAVING_CLASS_PARAMETERS: + tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, proto_mac_mgmt_msg_rng_req_decoder, tvb, tlv_offset, tlv_len, "Power Saving Class Parameters (%u byte(s))", tlv_len); + dissect_power_saving_class(tlv_tree, tlv_type, tvb, tlv_len, pinfo, tlv_offset); + break; + default: + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, hf_tlv_type, tvb, tlv_offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_tlv_type, tvb, tlv_offset, tlv_len, FALSE); + break; + } + /* update the offset */ + offset = tlv_len + tlv_offset; + } /* end of TLV process while loop */ + } +} + /* Register Wimax Mac Payload Protocol and Dissector */ void proto_register_mac_mgmt_msg_rng_req(void) { @@ -477,159 +611,18 @@ void proto_register_mac_mgmt_msg_rng_req(void) } }; - if (proto_mac_mgmt_msg_rng_req_decoder == -1) - { - proto_mac_mgmt_msg_rng_req_decoder = proto_register_protocol ( - "WiMax RNG-REQ/RSP Messages", /* name */ - "WiMax RNG-REQ/RSP (rng)", /* short name */ - "wmx.rng" /* abbrev */ - ); - - proto_register_field_array(proto_mac_mgmt_msg_rng_req_decoder, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - } -} - -/* Decode RNG-REQ messages. */ -void dissect_mac_mgmt_msg_rng_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ - guint offset = 0; - guint tlv_offset; - guint tvb_len, payload_type; - proto_item *rng_req_item = NULL; - proto_tree *rng_req_tree = NULL; - proto_tree *tlv_tree = NULL; - tlv_info_t tlv_info; - gint tlv_type; - gint tlv_len; - - /* Ensure the right payload type */ - payload_type = tvb_get_guint8(tvb, offset); - if(payload_type != MAC_MGMT_MSG_RNG_REQ) - { - return; - } - - if (tree) - { /* we are being asked for details */ - - /* Get the tvb reported length */ - tvb_len = tvb_reported_length(tvb); - /* display MAC payload type RNG-REQ */ - rng_req_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_rng_req_decoder, tvb, offset, tvb_len, "MAC Management Message, RNG-REQ (4)"); - /* add MAC RNG-REQ subtree */ - rng_req_tree = proto_item_add_subtree(rng_req_item, ett_mac_mgmt_msg_rng_req_decoder); - /* display the Message Type */ - proto_tree_add_item(rng_req_tree, hf_rng_req_message_type, tvb, offset, 1, FALSE); - proto_tree_add_item(rng_req_tree, hf_rng_req_reserved, tvb, 1, 1, FALSE); - offset += 2; - - while(offset < tvb_len) + /* Setup protocol subtree array */ + static gint *ett[] = { - /* Get the TLV data. */ - init_tlv_info(&tlv_info, tvb, offset); - /* get the TLV type */ - tlv_type = get_tlv_type(&tlv_info); - /* get the TLV length */ - tlv_len = get_tlv_length(&tlv_info); - if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1) - { /* invalid tlv info */ - if(check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "RNG-REQ TLV error"); - } - proto_tree_add_item(rng_req_tree, hf_rng_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE); - break; - } - /* get the offset to the TLV data */ - tlv_offset = offset + get_tlv_value_offset(&tlv_info); + &ett_mac_mgmt_msg_rng_req_decoder, + }; - switch (tlv_type) { - case RNG_REQ_DL_BURST_PROFILE: - /* add TLV subtree */ - tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, proto_mac_mgmt_msg_rng_req_decoder, tvb, tlv_offset, tlv_len, "Requested Downlink Burst Profile 0x%02x", tvb_get_guint8(tvb, tlv_offset)); - proto_tree_add_item(tlv_tree, hf_rng_req_dl_burst_profile_diuc, tvb, tlv_offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_rng_req_dl_burst_profile_lsb_ccc, tvb, tlv_offset, 1, FALSE); - break; - case RNG_REQ_SS_MAC_ADDRESS: - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, hf_rng_req_ss_mac_address, tvb, tlv_offset, 6, FALSE); - proto_tree_add_item(tlv_tree, hf_rng_req_ss_mac_address, tvb, tlv_offset, 6, FALSE); - break; - case RNG_REQ_RANGING_ANOMALIES: - /* add TLV subtree */ - tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, proto_mac_mgmt_msg_rng_req_decoder, tvb, tlv_offset, tlv_len, "Ranging Anomalies %d", tvb_get_guint8(tvb, tlv_offset)); - proto_tree_add_item(tlv_tree, hf_rng_req_ranging_anomalies_max_power, tvb, tlv_offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_rng_req_ranging_anomalies_min_power, tvb, tlv_offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_rng_req_ranging_anomalies_timing_adj, tvb, tlv_offset, 1, FALSE); - break; - case RNG_REQ_AAS_BROADCAST: - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, hf_rng_req_aas_broadcast, tvb, tlv_offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_rng_req_aas_broadcast, tvb, tlv_offset, 1, FALSE); - break; - case RNG_REQ_SERVING_BS_ID: - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, hf_rng_req_serving_bs_id, tvb, tlv_offset, 6, FALSE); - proto_tree_add_item(tlv_tree, hf_rng_req_serving_bs_id, tvb, tlv_offset, 6, FALSE); - break; - case RNG_REQ_RANGING_PURPOSE_INDICATION: - /* display the Ranging Purpose Flags */ - /* add subtree */ - tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, proto_mac_mgmt_msg_rng_req_decoder, tvb, tlv_offset, tlv_len, "Ranging Purpose Flags (%u byte(s))", tlv_len); - proto_tree_add_item(tlv_tree, hf_rng_req_ranging_purpose_ho_indication, tvb, tlv_offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_rng_req_ranging_purpose_location_update_request, tvb, tlv_offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_rng_req_ranging_purpose_reserved, tvb, tlv_offset, 1, FALSE); - break; - case RNG_REQ_HO_ID: - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, hf_rng_req_ho_id, tvb, tlv_offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_rng_req_ho_id, tvb, tlv_offset, 1, FALSE); - break; - case RNG_REQ_POWER_DOWN_INDICATOR: - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, hf_rng_req_power_down_indicator, tvb, tlv_offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_rng_req_power_down_indicator, tvb, tlv_offset, 1, FALSE); - break; - case RNG_REQ_REQUESTED_DNLK_REP_CODING_LEVEL: - /* add subtree */ - tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, proto_mac_mgmt_msg_rng_req_decoder, tvb, tlv_offset, tlv_len, "Requested downlink repetition coding level (%u byte(s))", tlv_len); - proto_tree_add_item(tlv_tree, hf_rng_req_repetition_coding_level, tvb, tlv_offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_rng_req_requested_downlink_repetition_coding_level_reserved, tvb, tlv_offset, 1, FALSE); - break; - case RNG_REQ_CMAC_KEY_COUNT: - if (include_cor2_changes) { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, hf_rng_req_cmac_key_count, tvb, tlv_offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_rng_req_cmac_key_count, tvb, tlv_offset, 2, FALSE); - } else { - /* Unknown TLV type */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, hf_tlv_type, tvb, tlv_offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_tlv_type, tvb, tlv_offset, tlv_len, FALSE); - } - break; - case SHORT_HMAC_TUPLE: - case SHORT_HMAC_TUPLE_COR2: - if ((!include_cor2_changes && (tlv_type == SHORT_HMAC_TUPLE)) || - (include_cor2_changes && (tlv_type == SHORT_HMAC_TUPLE_COR2))) { - /* decode and display the Short HMAC Tuple */ - tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, proto_mac_mgmt_msg_rng_req_decoder, tvb, tlv_offset, tlv_len, "Short HMAC Tuple (%u byte(s))", tlv_len); - wimax_short_hmac_tuple_decoder(tlv_tree, tvb, tlv_offset, tvb_len - offset); - } else { - /* Unknown TLV Type */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, hf_tlv_type, tvb, tlv_offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_tlv_type, tvb, tlv_offset, tlv_len, FALSE); - } - break; - case MAC_VERSION_ENCODING: - offset += wimax_common_tlv_encoding_decoder(tvb_new_subset(tvb, offset, (tvb_len - offset), (tvb_len - offset)), pinfo, rng_req_tree); - continue; - break; - case RNG_REQ_POWER_SAVING_CLASS_PARAMETERS: - tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, proto_mac_mgmt_msg_rng_req_decoder, tvb, tlv_offset, tlv_len, "Power Saving Class Parameters (%u byte(s))", tlv_len); - dissect_power_saving_class(tlv_tree, tlv_type, tvb, tlv_len, pinfo, tlv_offset); - break; - default: - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rng_req_decoder, rng_req_tree, hf_tlv_type, tvb, tlv_offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_tlv_type, tvb, tlv_offset, tlv_len, FALSE); - break; - } - /* update the offset */ - offset = tlv_len + tlv_offset; - } /* end of TLV process while loop */ - } + proto_mac_mgmt_msg_rng_req_decoder = proto_register_protocol ( + "WiMax RNG-REQ/RSP Messages", /* name */ + "WiMax RNG-REQ/RSP (rng)", /* short name */ + "wmx.rng" /* abbrev */ + ); + + proto_register_field_array(proto_mac_mgmt_msg_rng_req_decoder, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); } diff --git a/plugins/wimax/msg_rng_rsp.c b/plugins/wimax/msg_rng_rsp.c index acf47f0aef..b671425157 100644 --- a/plugins/wimax/msg_rng_rsp.c +++ b/plugins/wimax/msg_rng_rsp.c @@ -32,8 +32,6 @@ #include "config.h" #endif -#include "moduleinfo.h" - #include #include #include "crc.h" @@ -44,9 +42,6 @@ extern gint proto_mac_mgmt_msg_rng_req_decoder; extern gboolean include_cor2_changes; -/* forward reference */ -void dissect_mac_mgmt_msg_rng_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - /* external reference */ extern void dissect_power_saving_class(proto_tree *rng_req_tree, gint tlv_type, tvbuff_t *tvb, guint compound_tlv_len, packet_info *pinfo, guint offset); extern void dissect_mac_mgmt_msg_sbc_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); @@ -56,13 +51,6 @@ static gint proto_mac_mgmt_msg_rng_rsp_decoder = -1; static gint ett_mac_mgmt_msg_rng_rsp_decoder = -1; static gint ett_rng_rsp_message_tree = -1; -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_mac_mgmt_msg_rng_rsp_decoder, - &ett_rng_rsp_message_tree -}; - /* RNG-RSP fields */ static gint hf_rng_rsp_message_type = -1; static gint hf_rng_req_reserved = -1; @@ -279,212 +267,516 @@ static const value_string vals_rng_rsp_location_update_response[] = { {0, NULL} }; -/* Register Wimax Mac Payload Protocol and Dissector */ -void proto_register_mac_mgmt_msg_rng_rsp(void) + +/* Decode RNG-RSP messages. */ +void dissect_mac_mgmt_msg_rng_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - /* RNG-RSP fields display */ - static hf_register_info hf[] = + proto_item *ranging_status_item = NULL; + proto_item *dl_freq_override_item = NULL; + proto_item *ss_mac_address_item = NULL; + proto_item *frame_number_item = NULL; + proto_item *opportunity_number_item = NULL; + + guint offset = 0; + guint tlv_offset; + guint tvb_len, payload_type; + proto_item *rng_rsp_item = NULL; + proto_item *tlv_item = NULL; + proto_tree *rng_rsp_tree = NULL; + proto_tree *sub_tree = NULL; + proto_tree *tlv_tree = NULL; + tlv_info_t tlv_info; + gint tlv_type; + guint tlv_len; + guint this_offset = 0; + tlv_info_t sub_tlv_info; + gint sub_tlv_type; + gint sub_tlv_len; + guint sub_tlv_offset; + float timing_adjust; + float power_level_adjust; + gint offset_freq_adjust; + + /* Ensure the right payload type */ + payload_type = tvb_get_guint8(tvb, offset); + if(payload_type != MAC_MGMT_MSG_RNG_RSP) { + return; + } + + if (tree) + { /* we are being asked for details */ + + /* Get the tvb reported length */ + tvb_len = tvb_reported_length(tvb); + /* display MAC payload type RNG-RSP */ + rng_rsp_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_rng_rsp_decoder, tvb, offset, tvb_len, "MAC Management Message, RNG-RSP (5)"); + /* add MAC RNG-RSP subtree */ + rng_rsp_tree = proto_item_add_subtree(rng_rsp_item, ett_mac_mgmt_msg_rng_rsp_decoder); + /* display the Message Type */ + proto_tree_add_item(rng_rsp_tree, hf_rng_rsp_message_type, tvb, offset, 1, FALSE); + proto_tree_add_item(rng_rsp_tree, hf_rng_req_reserved, tvb, 1, 1, FALSE); + offset += 2; + + while(offset < tvb_len) { - &hf_rng_rsp_message_type, - { - "MAC Management Message Type", "wmx.macmgtmsgtype.rng_rsp", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_rng_rsp_broadcast, - { - "AAS broadcast permission", "wmx.rng_rsp.aas_broadcast", - FT_BOOLEAN, BASE_NONE, TFS(&tfs_rng_rsp_aas_broadcast), 0x0, NULL, HFILL - } - }, - { - &hf_rng_rsp_akid, - { - "AKId", "wmx.rng_rsp.akid", - FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_rng_rsp_basic_cid, - { - "Basic CID", "wmx.rng_rsp.basic_cid", - FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_rng_rsp_bs_random, - { - "BS_Random", "wmx.rng_rsp.bs_random", - FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_rng_rsp_config_change_count_of_dcd, - { - "Configuration Change Count value of DCD defining DIUC associated burst profile", "wmx.rng_rsp.config_change_count_of_dcd", - FT_UINT16, BASE_HEX, NULL, 0xFF00, NULL, HFILL - } - }, - { - &hf_rng_rsp_dl_freq_override, - { - "Downlink Frequency Override", "wmx.rng_rsp.dl_freq_override", - FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_rng_rsp_dl_operational_burst_profile_ccc, - { - "CCC value of DCD defining the burst profile associated with DIUC", "wmx.rng_rsp.dl_op_burst_prof.ccc", - FT_UINT16, BASE_DEC, NULL, 0x00FF, NULL, HFILL - } - }, - { - &hf_rng_rsp_dl_operational_burst_profile_diuc, - { - "The least robust DIUC that may be used by the BS for transmissions to the SS", "wmx.rng_rsp.dl_op_burst_prof.diuc", - FT_UINT16, BASE_DEC, NULL, 0xFF00, NULL, HFILL - } - }, - { - &hf_rng_rsp_dl_operational_burst_profile, - { - "Downlink Operational Burst Profile", "wmx.rng_rsp.dl_op_burst_profile", - FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL - } - }, - /* Added the following to help implement RNG-RSP message encoding 33 (Table 367 in IEEE 802.16e-2007) */ - { - &hf_rng_rsp_dl_op_burst_profile_ofdma, - { - "Downlink Operational Burst Profile for OFDMA", "wmx.rng_rsp.dl_op_burst_profile_ofdma", - FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_rng_rsp_frame_number2, - { - "The 8 least significant bits of the frame number of the OFDMA frame where the SS sent the ranging code", "wmx.rng_rsp.eight_bit_frame_num", - FT_UINT32, BASE_DEC, NULL, 0x000000FF, NULL, HFILL - } - }, - { - &hf_rng_rsp_frame_number, - { - "Frame number", "wmx.rng_rsp.frame_number", - FT_UINT24, BASE_DEC, NULL, 0x00, NULL, HFILL - } - }, - /* Added the following to help implement RNG-RSP message encoding 22 (IEEE 802.16e-2007) */ - { - &hf_rng_rsp_ho_id, - { - "HO ID", "wmx.rng_rsp.ho_id", - FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_rng_rsp_ho_process_optimization, - { - "HO Process Optimization", "wmx.rng_rsp.ho_process_optimization", - FT_UINT16, BASE_HEX, NULL, 0x0000, NULL, HFILL - } - }, - { - &hf_rng_rsp_ho_process_optimization_0, - { - "Bit #0", "wmx.rng_rsp.ho_process_optimization.omit_sbc_req", - FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_0), 0x0001, NULL, HFILL - } - }, - { - &hf_rng_rsp_ho_process_optimization_1_2, - { - "Bits #1-2", "wmx.rng_rsp.ho_process_optimization.perform_reauthentication", - FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_1_2), 0x0006, NULL, HFILL - } - }, - { - &hf_rng_rsp_ho_process_optimization_3, - { - "Bit #3", "wmx.rng_rsp.ho_process_optimization.omit_network_address", - FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_3), 0x0008, NULL, HFILL - } - }, - { - &hf_rng_rsp_ho_process_optimization_4, - { - "Bit #4", "wmx.rng_rsp.ho_process_optimization.omit_time_of_day", - FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_4), 0x0010, NULL, HFILL - } - }, - { - &hf_rng_rsp_ho_process_optimization_5, - { - "Bit #5", "wmx.rng_rsp.ho_process_optimization.omit_tftp", - FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_5), 0x0020, NULL, HFILL - } - }, - { - &hf_rng_rsp_ho_process_optimization_6, - { - "Bit #6", "wmx.rng_rsp.ho_process_optimization.transfer_or_sharing", - FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_6), 0x0040, NULL, HFILL - } - }, - { - &hf_rng_rsp_ho_process_optimization_7, - { - "Bit #7", "wmx.rng_rsp.ho_process_optimization.omit_reg_req", - FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_7), 0x0080, NULL, HFILL - } - }, - { - &hf_rng_rsp_ho_process_optimization_8, - { - "Bit #8", "wmx.rng_rsp.ho_process_optimization.unsolicited_sbc_rsp", - FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_8), 0x0100, NULL, HFILL - } - }, - { - &hf_rng_rsp_ho_process_optimization_9, - { - "Bit #9", "wmx.rng_rsp.ho_process_optimization.post_ho_reentry", - FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_9), 0x0200, NULL, HFILL - } - }, - { - &hf_rng_rsp_ho_process_optimization_10, - { - "Bit #10", "wmx.rng_rsp.ho_process_optimization.unsolicited_reg_rsp", - FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_10), 0x0400, NULL, HFILL - } - }, - { - &hf_rng_rsp_ho_process_optimization_11, - { - "Bit #11", "wmx.rng_rsp.ho_process_optimization.virtual_sdu_sn", - FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_11), 0x0800, NULL, HFILL + /* Get the TLV data. */ + init_tlv_info(&tlv_info, tvb, offset); + /* get the TLV type */ + tlv_type = get_tlv_type(&tlv_info); + /* get the TLV length */ + tlv_len = get_tlv_length(&tlv_info); + if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1) + { /* invalid tlv info */ + if(check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "RNG-RSP TLV error"); + } + proto_tree_add_item(rng_rsp_tree, hf_rng_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE); + break; } - }, - { - &hf_rng_rsp_ho_process_optimization_12, + /* get the offset to the TLV data */ + tlv_offset = offset + get_tlv_value_offset(&tlv_info); + + switch (tlv_type) { + case RNG_RSP_TIMING_ADJUST: { + sub_tree = add_protocol_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, proto_mac_mgmt_msg_rng_rsp_decoder, tvb, tlv_offset, tlv_len, "Timing Adjust (%u byte(s))", tlv_len); + timing_adjust = (float)(gint32)tvb_get_ntohl(tvb, tlv_offset) / 4; + tlv_item = proto_tree_add_float_format_value(sub_tree, hf_rng_rsp_timing_adjust, tvb, + tlv_offset, 4, timing_adjust, " %.2f modulation symbols", timing_adjust); + if ((timing_adjust < -2) || (timing_adjust > 2)) + proto_item_append_text(tlv_item, " (during periodic ranging shall not exceed +- 2)"); + break; + } + case RNG_RSP_POWER_LEVEL_ADJUST: { + sub_tree = add_protocol_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, proto_mac_mgmt_msg_rng_rsp_decoder, tvb, tlv_offset, tlv_len, "Power Level Adjust (%u byte(s))", tlv_len); + power_level_adjust = (float)(gint8)tvb_get_guint8(tvb, tlv_offset) / 4; + proto_tree_add_float_format_value(sub_tree, hf_rng_rsp_power_level_adjust, tvb, tlv_offset, 1, + power_level_adjust, " %.2f dB", power_level_adjust); + break; + } + case RNG_RSP_OFFSET_FREQ_ADJUST: { + sub_tree = add_protocol_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, proto_mac_mgmt_msg_rng_rsp_decoder, tvb, tlv_offset, tlv_len, "Offset Frequency Adjust (%u byte(s))", tlv_len); + offset_freq_adjust = tvb_get_ntohl(tvb, tlv_offset); + proto_tree_add_int_format_value(sub_tree, hf_rng_rsp_offset_freq_adjust, tvb, tlv_offset, 4, + offset_freq_adjust, " %d Hz", offset_freq_adjust); + break; + } + case RNG_RSP_RANGING_STATUS: + sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_ranging_status, tvb, tlv_offset, 1, FALSE); + ranging_status_item = proto_tree_add_item(sub_tree, hf_rng_rsp_ranging_status, tvb, tlv_offset, 1, FALSE); + break; + case RNG_RSP_DL_FREQ_OVERRIDE: { + sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_dl_freq_override, tvb, tlv_offset, 4, FALSE); + dl_freq_override_item = proto_tree_add_item(sub_tree, hf_rng_rsp_dl_freq_override, tvb, tlv_offset, 4, FALSE); + proto_item_append_text(dl_freq_override_item, " kHz"); + break; + } + case RNG_RSP_UL_CHANNEL_ID_OVERRIDE: + sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_ul_chan_id_override, tvb, tlv_offset, 1, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_ul_chan_id_override, tvb, tlv_offset, 1, FALSE); + break; + case RNG_RSP_DL_OPERATIONAL_BURST_PROFILE: + sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_dl_operational_burst_profile, tvb, tlv_offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_dl_operational_burst_profile_diuc, tvb, tlv_offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_dl_operational_burst_profile_ccc, tvb, tlv_offset, 2, FALSE); + break; + case RNG_RSP_SS_MAC_ADDRESS: + if (tlv_len == 6) + { + sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_ss_mac_address, tvb, tlv_offset, 6, FALSE); + ss_mac_address_item = proto_tree_add_item(sub_tree, hf_rng_rsp_ss_mac_address, tvb, tlv_offset, 6, FALSE); + } else { + sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_invalid_tlv, tvb, tlv_offset, tlv_len, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_ss_mac_address, tvb, tlv_offset, 6, FALSE); + } + break; + case RNG_RSP_BASIC_CID: + sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_basic_cid, tvb, tlv_offset, 1, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_basic_cid, tvb, tlv_offset, 2, FALSE); + break; + case RNG_RSP_PRIMARY_MGMT_CID: + sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_primary_mgmt_cid, tvb, tlv_offset, 1, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_primary_mgmt_cid, tvb, tlv_offset, 2, FALSE); + break; + case RNG_RSP_AAS_BROADCAST_PERMISSION: + sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_broadcast, tvb, tlv_offset, 1, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_broadcast, tvb, tlv_offset, 1, FALSE); + break; + case RNG_RSP_FRAME_NUMBER: + sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_frame_number, tvb, tlv_offset, 3, FALSE); + frame_number_item = proto_tree_add_item(sub_tree, hf_rng_rsp_frame_number, tvb, tlv_offset, 3, FALSE); + break; + case RNG_RSP_OPPORTUNITY_NUMBER: + sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_opportunity_number, tvb, tlv_offset, 1, FALSE); + opportunity_number_item = proto_tree_add_item(sub_tree, hf_rng_rsp_opportunity_number, tvb, tlv_offset, 1, FALSE); + if (tvb_get_ntohl(tvb, tlv_offset) == 0) + proto_item_append_text(opportunity_number_item, " (may not be 0!)"); + break; + case RNG_RSP_SERVICE_LEVEL_PREDICTION: + sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_service_level_prediction, tvb, tlv_offset, 1, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_service_level_prediction, tvb, tlv_offset, 1, FALSE); + break; + case RNG_RSP_RESOURCE_RETAIN_FLAG: + sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_resource_retain_flag, tvb, tlv_offset, 1, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_resource_retain_flag, tvb, tlv_offset, 1, FALSE); + break; + case RNG_RSP_HO_PROCESS_OPTIMIZATION: + sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_ho_process_optimization, tvb, tlv_offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_0, tvb, tlv_offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_1_2, tvb, tlv_offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_3, tvb, tlv_offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_4, tvb, tlv_offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_5, tvb, tlv_offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_6, tvb, tlv_offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_7, tvb, tlv_offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_8, tvb, tlv_offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_9, tvb, tlv_offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_10, tvb, tlv_offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_11, tvb, tlv_offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_12, tvb, tlv_offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_13, tvb, tlv_offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_14, tvb, tlv_offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_15, tvb, tlv_offset, 2, FALSE); + break; + case RNG_RSP_SBC_RSP_ENCODINGS: + sub_tree = add_protocol_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, proto_mac_mgmt_msg_rng_rsp_decoder, tvb, tlv_offset, tlv_len, "SBC-RSP Encodings (%u byte(s))", tlv_len); + dissect_mac_mgmt_msg_sbc_rsp_decoder(tvb_new_subset(tvb, tlv_offset, tlv_len, tlv_len), pinfo, sub_tree); + break; + case RNG_RSP_REG_RSP_ENCODINGS: + sub_tree = add_protocol_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, proto_mac_mgmt_msg_rng_rsp_decoder, tvb, tlv_offset, tlv_len, "REG-RSP Encodings (%u byte(s))", tlv_len); + dissect_mac_mgmt_msg_reg_rsp_decoder(tvb_new_subset(tvb, tlv_offset, tlv_len, tlv_len), pinfo, sub_tree); + break; + /* Implemented message encoding 33 (Table 367 in IEEE 802.16e-2007) */ + case RNG_RSP_DL_OP_BURST_PROFILE_OFDMA: + sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_dl_op_burst_profile_ofdma, tvb, tlv_offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_least_robust_diuc, tvb, tlv_offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_repetition_coding_indication, tvb, tlv_offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_config_change_count_of_dcd, tvb, tlv_offset, 2, FALSE); + break; + case RNG_RSP_HO_ID: + sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_ho_id, tvb, tlv_offset, 1, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_ho_id, tvb, tlv_offset, 1, FALSE); + break; + case RNG_RSP_LOCATION_UPDATE_RESPONSE: + sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_location_update_response, tvb, tlv_offset, 1, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_location_update_response, tvb, tlv_offset, 1, FALSE); + break; + case RNG_RSP_PAGING_INFORMATION: + sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_paging_information, tvb, tlv_offset, 5, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_paging_cycle, tvb, tlv_offset, 2, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_paging_offset, tvb, tlv_offset+2, 1, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_paging_group_id, tvb, tlv_offset+3, 2, FALSE); + break; + case RNG_RSP_POWER_SAVING_CLASS_PARAMETERS: + sub_tree = add_protocol_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, proto_mac_mgmt_msg_rng_rsp_decoder, tvb, tlv_offset, tlv_len, "Power Saving Class Parameters (%u byte(s))", tlv_len); + dissect_power_saving_class(sub_tree, tlv_type, tvb, tlv_len, pinfo, tlv_offset); + break; + case RNG_RSP_SA_CHALLENGE_TUPLE: + /* Display SA Challenge Tuple header */ + sub_tree = add_protocol_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, proto_mac_mgmt_msg_rng_rsp_decoder, tvb, tlv_offset, tlv_len, "SA Challenge Tuple (%u byte(s))", tlv_len); + /* add subtree */ + /* Use a local copy of tlv_offset */ + this_offset = tlv_offset; + while(this_offset < tlv_len) { + /* Get the sub TLV data. */ + init_tlv_info(&sub_tlv_info, tvb, this_offset); + /* get the sub TLV type */ + sub_tlv_type = get_tlv_type(&sub_tlv_info); + /* get the TLV length */ + sub_tlv_len = get_tlv_length(&sub_tlv_info); + if(tlv_type == -1 || sub_tlv_len > MAX_TLV_LEN || sub_tlv_len < 1) + { /* invalid tlv info */ + if(check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "RNG-RSP TLV error"); + } + proto_tree_add_item(rng_rsp_tree, hf_rng_invalid_tlv, tvb, tlv_offset, (tvb_len - offset), FALSE); + break; + } + /* get the offset to the sub TLV data */ + sub_tlv_offset = this_offset + get_tlv_value_offset(&sub_tlv_info); + switch (sub_tlv_type) { + case RNG_RSP_SA_CHALLENGE_BS_RANDOM: + tlv_tree = add_tlv_subtree(&sub_tlv_info, ett_rng_rsp_message_tree, sub_tree, hf_rng_rsp_bs_random, tvb, sub_tlv_offset, sub_tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_rng_rsp_bs_random, tvb, sub_tlv_offset, sub_tlv_len, FALSE); + break; + case RNG_RSP_SA_CHALLENGE_AKID: + tlv_tree = add_tlv_subtree(&sub_tlv_info, ett_rng_rsp_message_tree, sub_tree, hf_rng_rsp_akid, tvb, sub_tlv_offset, sub_tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_rng_rsp_akid, tvb, sub_tlv_offset, sub_tlv_len, FALSE); + break; + default: + tlv_tree = add_tlv_subtree(&sub_tlv_info, ett_rng_rsp_message_tree, sub_tree, hf_tlv_type, tvb, sub_tlv_offset, sub_tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_tlv_type, tvb, sub_tlv_offset, sub_tlv_len, FALSE); + break; + } + this_offset = sub_tlv_len + sub_tlv_offset; + } + break; + case DSx_UPLINK_FLOW: + /* display Uplink Service Flow Encodings info */ + /* add subtree */ + sub_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_rng_rsp_decoder, rng_rsp_tree, proto_mac_mgmt_msg_rng_rsp_decoder, tvb, tlv_offset, tlv_len, "Uplink QOS Parameters (%u bytes)", tlv_len); + /* decode and display the DL Service Flow Encodings */ + wimax_service_flow_encodings_decoder(tvb_new_subset(tvb, tlv_offset, tlv_len, tlv_len), pinfo, sub_tree); + break; + case DSx_DOWNLINK_FLOW: + /* display Downlink Service Flow Encodings info */ + /* add subtree */ + sub_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_rng_rsp_decoder, rng_rsp_tree, proto_mac_mgmt_msg_rng_rsp_decoder, tvb, tlv_offset, tlv_len, "Downlink QOS Parameters (%u bytes)", tlv_len); + /* decode and display the DL Service Flow Encodings */ + wimax_service_flow_encodings_decoder(tvb_new_subset(tvb, tlv_offset, tlv_len, tlv_len), pinfo, sub_tree); + break; + case RNG_RSP_RANGING_CODE_ATTRIBUTES: + /* case SHORT_HMAC_TUPLE: */ + sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_ranging_subchan, tvb, tlv_offset, 4, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_time_symbol_reference, tvb, tlv_offset, 4, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_subchannel_reference, tvb, tlv_offset, 4, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_ranging_code_index, tvb, tlv_offset, 4, FALSE); + proto_tree_add_item(sub_tree, hf_rng_rsp_frame_number2, tvb, tlv_offset, 4, FALSE); + break; + case SHORT_HMAC_TUPLE_COR2: + if (include_cor2_changes) { + sub_tree = add_protocol_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, proto_mac_mgmt_msg_rng_rsp_decoder, tvb, tlv_offset, tlv_len, "Short HMAC Tuple (%u byte(s))", tlv_len); + wimax_short_hmac_tuple_decoder(sub_tree, tvb, tlv_offset, tvb_len - offset); + } else { + /* Unknown TLV type */ + sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_tlv_type, tvb, tlv_offset, 1, FALSE); + proto_tree_add_item(sub_tree, hf_tlv_type, tvb, tlv_offset, tlv_len, FALSE); + } + break; + + default: + sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_tlv_type, tvb, tlv_offset, 1, FALSE); + proto_tree_add_item(sub_tree, hf_tlv_type, tvb, tlv_offset, tlv_len, FALSE); + break; + + } + offset = tlv_len + tlv_offset; + } /* end of TLV process while loop */ + if (ranging_status_item && dl_freq_override_item) + proto_item_append_text(ranging_status_item, " (shall be set to 2 because Downlink Frequency Override is present)"); + if (ss_mac_address_item && frame_number_item) { + proto_item_append_text(frame_number_item, " (mutually exclusive with SS MAC Address!)"); + proto_item_append_text(ss_mac_address_item, " (mutually exclusive with Frame Number!)"); + } + if (ss_mac_address_item && opportunity_number_item) { + proto_item_append_text(opportunity_number_item, " (mutually exclusive with SS MAC Address!)"); + proto_item_append_text(ss_mac_address_item, " (mutually exclusive with Initial Ranging Opportunity Number!)"); + } + if (!ranging_status_item) + proto_item_append_text(rng_rsp_tree, " (Ranging status is missing!)"); + + } +} + + +/* Register Wimax Mac Payload Protocol and Dissector */ +void proto_register_mac_mgmt_msg_rng_rsp(void) +{ + /* RNG-RSP fields display */ + static hf_register_info hf[] = + { + { + &hf_rng_rsp_message_type, { - "Bit #12", "wmx.rng_rsp.ho_process_optimization.send_notification", - FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_12), 0x1000, NULL, HFILL + "MAC Management Message Type", "wmx.macmgtmsgtype.rng_rsp", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { - &hf_rng_rsp_ho_process_optimization_13, + &hf_rng_rsp_broadcast, { - "Bit #13", "wmx.rng_rsp.ho_process_optimization.trigger_higher_layer_protocol", - FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_13), 0x2000, NULL, HFILL + "AAS broadcast permission", "wmx.rng_rsp.aas_broadcast", + FT_BOOLEAN, BASE_NONE, TFS(&tfs_rng_rsp_aas_broadcast), 0x0, NULL, HFILL } }, { - &hf_rng_rsp_ho_process_optimization_14, + &hf_rng_rsp_akid, + { + "AKId", "wmx.rng_rsp.akid", + FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_rng_rsp_basic_cid, + { + "Basic CID", "wmx.rng_rsp.basic_cid", + FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_rng_rsp_bs_random, + { + "BS_Random", "wmx.rng_rsp.bs_random", + FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_rng_rsp_config_change_count_of_dcd, + { + "Configuration Change Count value of DCD defining DIUC associated burst profile", "wmx.rng_rsp.config_change_count_of_dcd", + FT_UINT16, BASE_HEX, NULL, 0xFF00, NULL, HFILL + } + }, + { + &hf_rng_rsp_dl_freq_override, + { + "Downlink Frequency Override", "wmx.rng_rsp.dl_freq_override", + FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_rng_rsp_dl_operational_burst_profile_ccc, + { + "CCC value of DCD defining the burst profile associated with DIUC", "wmx.rng_rsp.dl_op_burst_prof.ccc", + FT_UINT16, BASE_DEC, NULL, 0x00FF, NULL, HFILL + } + }, + { + &hf_rng_rsp_dl_operational_burst_profile_diuc, + { + "The least robust DIUC that may be used by the BS for transmissions to the SS", "wmx.rng_rsp.dl_op_burst_prof.diuc", + FT_UINT16, BASE_DEC, NULL, 0xFF00, NULL, HFILL + } + }, + { + &hf_rng_rsp_dl_operational_burst_profile, + { + "Downlink Operational Burst Profile", "wmx.rng_rsp.dl_op_burst_profile", + FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL + } + }, + /* Added the following to help implement RNG-RSP message encoding 33 (Table 367 in IEEE 802.16e-2007) */ + { + &hf_rng_rsp_dl_op_burst_profile_ofdma, + { + "Downlink Operational Burst Profile for OFDMA", "wmx.rng_rsp.dl_op_burst_profile_ofdma", + FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_rng_rsp_frame_number2, + { + "The 8 least significant bits of the frame number of the OFDMA frame where the SS sent the ranging code", "wmx.rng_rsp.eight_bit_frame_num", + FT_UINT32, BASE_DEC, NULL, 0x000000FF, NULL, HFILL + } + }, + { + &hf_rng_rsp_frame_number, + { + "Frame number", "wmx.rng_rsp.frame_number", + FT_UINT24, BASE_DEC, NULL, 0x00, NULL, HFILL + } + }, + /* Added the following to help implement RNG-RSP message encoding 22 (IEEE 802.16e-2007) */ + { + &hf_rng_rsp_ho_id, + { + "HO ID", "wmx.rng_rsp.ho_id", + FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_rng_rsp_ho_process_optimization, + { + "HO Process Optimization", "wmx.rng_rsp.ho_process_optimization", + FT_UINT16, BASE_HEX, NULL, 0x0000, NULL, HFILL + } + }, + { + &hf_rng_rsp_ho_process_optimization_0, + { + "Bit #0", "wmx.rng_rsp.ho_process_optimization.omit_sbc_req", + FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_0), 0x0001, NULL, HFILL + } + }, + { + &hf_rng_rsp_ho_process_optimization_1_2, + { + "Bits #1-2", "wmx.rng_rsp.ho_process_optimization.perform_reauthentication", + FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_1_2), 0x0006, NULL, HFILL + } + }, + { + &hf_rng_rsp_ho_process_optimization_3, + { + "Bit #3", "wmx.rng_rsp.ho_process_optimization.omit_network_address", + FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_3), 0x0008, NULL, HFILL + } + }, + { + &hf_rng_rsp_ho_process_optimization_4, + { + "Bit #4", "wmx.rng_rsp.ho_process_optimization.omit_time_of_day", + FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_4), 0x0010, NULL, HFILL + } + }, + { + &hf_rng_rsp_ho_process_optimization_5, + { + "Bit #5", "wmx.rng_rsp.ho_process_optimization.omit_tftp", + FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_5), 0x0020, NULL, HFILL + } + }, + { + &hf_rng_rsp_ho_process_optimization_6, + { + "Bit #6", "wmx.rng_rsp.ho_process_optimization.transfer_or_sharing", + FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_6), 0x0040, NULL, HFILL + } + }, + { + &hf_rng_rsp_ho_process_optimization_7, + { + "Bit #7", "wmx.rng_rsp.ho_process_optimization.omit_reg_req", + FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_7), 0x0080, NULL, HFILL + } + }, + { + &hf_rng_rsp_ho_process_optimization_8, + { + "Bit #8", "wmx.rng_rsp.ho_process_optimization.unsolicited_sbc_rsp", + FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_8), 0x0100, NULL, HFILL + } + }, + { + &hf_rng_rsp_ho_process_optimization_9, + { + "Bit #9", "wmx.rng_rsp.ho_process_optimization.post_ho_reentry", + FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_9), 0x0200, NULL, HFILL + } + }, + { + &hf_rng_rsp_ho_process_optimization_10, + { + "Bit #10", "wmx.rng_rsp.ho_process_optimization.unsolicited_reg_rsp", + FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_10), 0x0400, NULL, HFILL + } + }, + { + &hf_rng_rsp_ho_process_optimization_11, + { + "Bit #11", "wmx.rng_rsp.ho_process_optimization.virtual_sdu_sn", + FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_11), 0x0800, NULL, HFILL + } + }, + { + &hf_rng_rsp_ho_process_optimization_12, + { + "Bit #12", "wmx.rng_rsp.ho_process_optimization.send_notification", + FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_12), 0x1000, NULL, HFILL + } + }, + { + &hf_rng_rsp_ho_process_optimization_13, + { + "Bit #13", "wmx.rng_rsp.ho_process_optimization.trigger_higher_layer_protocol", + FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_13), 0x2000, NULL, HFILL + } + }, + { + &hf_rng_rsp_ho_process_optimization_14, { "Bit #14: Reserved", "wmx.rng_rsp.ho_process_optimization.reserved", FT_UINT16, BASE_HEX, NULL, 0x4000, NULL, HFILL @@ -681,314 +973,15 @@ void proto_register_mac_mgmt_msg_rng_rsp(void) } }; - if (proto_mac_mgmt_msg_rng_rsp_decoder == -1) - { - proto_mac_mgmt_msg_rng_rsp_decoder = proto_mac_mgmt_msg_rng_req_decoder; - - proto_register_field_array(proto_mac_mgmt_msg_rng_rsp_decoder, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - } -} - -/* Decode RNG-RSP messages. */ -void dissect_mac_mgmt_msg_rng_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ - proto_item *ranging_status_item = NULL; - proto_item *dl_freq_override_item = NULL; - proto_item *ss_mac_address_item = NULL; - proto_item *frame_number_item = NULL; - proto_item *opportunity_number_item = NULL; - - guint offset = 0; - guint tlv_offset; - guint tvb_len, payload_type; - proto_item *rng_rsp_item = NULL; - proto_item *tlv_item = NULL; - proto_tree *rng_rsp_tree = NULL; - proto_tree *sub_tree = NULL; - proto_tree *tlv_tree = NULL; - tlv_info_t tlv_info; - gint tlv_type; - guint tlv_len; - guint this_offset = 0; - tlv_info_t sub_tlv_info; - gint sub_tlv_type; - gint sub_tlv_len; - guint sub_tlv_offset; - float timing_adjust; - float power_level_adjust; - gint offset_freq_adjust; - - /* Ensure the right payload type */ - payload_type = tvb_get_guint8(tvb, offset); - if(payload_type != MAC_MGMT_MSG_RNG_RSP) - { - return; - } - - if (tree) - { /* we are being asked for details */ - - /* Get the tvb reported length */ - tvb_len = tvb_reported_length(tvb); - /* display MAC payload type RNG-RSP */ - rng_rsp_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_rng_rsp_decoder, tvb, offset, tvb_len, "MAC Management Message, RNG-RSP (5)"); - /* add MAC RNG-RSP subtree */ - rng_rsp_tree = proto_item_add_subtree(rng_rsp_item, ett_mac_mgmt_msg_rng_rsp_decoder); - /* display the Message Type */ - proto_tree_add_item(rng_rsp_tree, hf_rng_rsp_message_type, tvb, offset, 1, FALSE); - proto_tree_add_item(rng_rsp_tree, hf_rng_req_reserved, tvb, 1, 1, FALSE); - offset += 2; - - while(offset < tvb_len) + /* Setup protocol subtree array */ + static gint *ett[] = { - /* Get the TLV data. */ - init_tlv_info(&tlv_info, tvb, offset); - /* get the TLV type */ - tlv_type = get_tlv_type(&tlv_info); - /* get the TLV length */ - tlv_len = get_tlv_length(&tlv_info); - if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1) - { /* invalid tlv info */ - if(check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "RNG-RSP TLV error"); - } - proto_tree_add_item(rng_rsp_tree, hf_rng_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE); - break; - } - /* get the offset to the TLV data */ - tlv_offset = offset + get_tlv_value_offset(&tlv_info); + &ett_mac_mgmt_msg_rng_rsp_decoder, + &ett_rng_rsp_message_tree + }; - switch (tlv_type) { - case RNG_RSP_TIMING_ADJUST: { - sub_tree = add_protocol_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, proto_mac_mgmt_msg_rng_rsp_decoder, tvb, tlv_offset, tlv_len, "Timing Adjust (%u byte(s))", tlv_len); - timing_adjust = (float)(gint32)tvb_get_ntohl(tvb, tlv_offset) / 4; - tlv_item = proto_tree_add_float_format_value(sub_tree, hf_rng_rsp_timing_adjust, tvb, - tlv_offset, 4, timing_adjust, " %.2f modulation symbols", timing_adjust); - if ((timing_adjust < -2) || (timing_adjust > 2)) - proto_item_append_text(tlv_item, " (during periodic ranging shall not exceed +- 2)"); - break; - } - case RNG_RSP_POWER_LEVEL_ADJUST: { - sub_tree = add_protocol_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, proto_mac_mgmt_msg_rng_rsp_decoder, tvb, tlv_offset, tlv_len, "Power Level Adjust (%u byte(s))", tlv_len); - power_level_adjust = (float)(gint8)tvb_get_guint8(tvb, tlv_offset) / 4; - proto_tree_add_float_format_value(sub_tree, hf_rng_rsp_power_level_adjust, tvb, tlv_offset, 1, - power_level_adjust, " %.2f dB", power_level_adjust); - break; - } - case RNG_RSP_OFFSET_FREQ_ADJUST: { - sub_tree = add_protocol_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, proto_mac_mgmt_msg_rng_rsp_decoder, tvb, tlv_offset, tlv_len, "Offset Frequency Adjust (%u byte(s))", tlv_len); - offset_freq_adjust = tvb_get_ntohl(tvb, tlv_offset); - proto_tree_add_int_format_value(sub_tree, hf_rng_rsp_offset_freq_adjust, tvb, tlv_offset, 4, - offset_freq_adjust, " %d Hz", offset_freq_adjust); - break; - } - case RNG_RSP_RANGING_STATUS: - sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_ranging_status, tvb, tlv_offset, 1, FALSE); - ranging_status_item = proto_tree_add_item(sub_tree, hf_rng_rsp_ranging_status, tvb, tlv_offset, 1, FALSE); - break; - case RNG_RSP_DL_FREQ_OVERRIDE: { - sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_dl_freq_override, tvb, tlv_offset, 4, FALSE); - dl_freq_override_item = proto_tree_add_item(sub_tree, hf_rng_rsp_dl_freq_override, tvb, tlv_offset, 4, FALSE); - proto_item_append_text(dl_freq_override_item, " kHz"); - break; - } - case RNG_RSP_UL_CHANNEL_ID_OVERRIDE: - sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_ul_chan_id_override, tvb, tlv_offset, 1, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_ul_chan_id_override, tvb, tlv_offset, 1, FALSE); - break; - case RNG_RSP_DL_OPERATIONAL_BURST_PROFILE: - sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_dl_operational_burst_profile, tvb, tlv_offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_dl_operational_burst_profile_diuc, tvb, tlv_offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_dl_operational_burst_profile_ccc, tvb, tlv_offset, 2, FALSE); - break; - case RNG_RSP_SS_MAC_ADDRESS: - if (tlv_len == 6) - { - sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_ss_mac_address, tvb, tlv_offset, 6, FALSE); - ss_mac_address_item = proto_tree_add_item(sub_tree, hf_rng_rsp_ss_mac_address, tvb, tlv_offset, 6, FALSE); - } else { - sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_invalid_tlv, tvb, tlv_offset, tlv_len, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_ss_mac_address, tvb, tlv_offset, 6, FALSE); - } - break; - case RNG_RSP_BASIC_CID: - sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_basic_cid, tvb, tlv_offset, 1, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_basic_cid, tvb, tlv_offset, 2, FALSE); - break; - case RNG_RSP_PRIMARY_MGMT_CID: - sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_primary_mgmt_cid, tvb, tlv_offset, 1, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_primary_mgmt_cid, tvb, tlv_offset, 2, FALSE); - break; - case RNG_RSP_AAS_BROADCAST_PERMISSION: - sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_broadcast, tvb, tlv_offset, 1, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_broadcast, tvb, tlv_offset, 1, FALSE); - break; - case RNG_RSP_FRAME_NUMBER: - sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_frame_number, tvb, tlv_offset, 3, FALSE); - frame_number_item = proto_tree_add_item(sub_tree, hf_rng_rsp_frame_number, tvb, tlv_offset, 3, FALSE); - break; - case RNG_RSP_OPPORTUNITY_NUMBER: - sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_opportunity_number, tvb, tlv_offset, 1, FALSE); - opportunity_number_item = proto_tree_add_item(sub_tree, hf_rng_rsp_opportunity_number, tvb, tlv_offset, 1, FALSE); - if (tvb_get_ntohl(tvb, tlv_offset) == 0) - proto_item_append_text(opportunity_number_item, " (may not be 0!)"); - break; - case RNG_RSP_SERVICE_LEVEL_PREDICTION: - sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_service_level_prediction, tvb, tlv_offset, 1, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_service_level_prediction, tvb, tlv_offset, 1, FALSE); - break; - case RNG_RSP_RESOURCE_RETAIN_FLAG: - sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_resource_retain_flag, tvb, tlv_offset, 1, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_resource_retain_flag, tvb, tlv_offset, 1, FALSE); - break; - case RNG_RSP_HO_PROCESS_OPTIMIZATION: - sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_ho_process_optimization, tvb, tlv_offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_0, tvb, tlv_offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_1_2, tvb, tlv_offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_3, tvb, tlv_offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_4, tvb, tlv_offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_5, tvb, tlv_offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_6, tvb, tlv_offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_7, tvb, tlv_offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_8, tvb, tlv_offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_9, tvb, tlv_offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_10, tvb, tlv_offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_11, tvb, tlv_offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_12, tvb, tlv_offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_13, tvb, tlv_offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_14, tvb, tlv_offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_15, tvb, tlv_offset, 2, FALSE); - break; - case RNG_RSP_SBC_RSP_ENCODINGS: - sub_tree = add_protocol_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, proto_mac_mgmt_msg_rng_rsp_decoder, tvb, tlv_offset, tlv_len, "SBC-RSP Encodings (%u byte(s))", tlv_len); - dissect_mac_mgmt_msg_sbc_rsp_decoder(tvb_new_subset(tvb, tlv_offset, tlv_len, tlv_len), pinfo, sub_tree); - break; - case RNG_RSP_REG_RSP_ENCODINGS: - sub_tree = add_protocol_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, proto_mac_mgmt_msg_rng_rsp_decoder, tvb, tlv_offset, tlv_len, "REG-RSP Encodings (%u byte(s))", tlv_len); - dissect_mac_mgmt_msg_reg_rsp_decoder(tvb_new_subset(tvb, tlv_offset, tlv_len, tlv_len), pinfo, sub_tree); - break; - /* Implemented message encoding 33 (Table 367 in IEEE 802.16e-2007) */ - case RNG_RSP_DL_OP_BURST_PROFILE_OFDMA: - sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_dl_op_burst_profile_ofdma, tvb, tlv_offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_least_robust_diuc, tvb, tlv_offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_repetition_coding_indication, tvb, tlv_offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_config_change_count_of_dcd, tvb, tlv_offset, 2, FALSE); - break; - case RNG_RSP_HO_ID: - sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_ho_id, tvb, tlv_offset, 1, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_ho_id, tvb, tlv_offset, 1, FALSE); - break; - case RNG_RSP_LOCATION_UPDATE_RESPONSE: - sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_location_update_response, tvb, tlv_offset, 1, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_location_update_response, tvb, tlv_offset, 1, FALSE); - break; - case RNG_RSP_PAGING_INFORMATION: - sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_paging_information, tvb, tlv_offset, 5, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_paging_cycle, tvb, tlv_offset, 2, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_paging_offset, tvb, tlv_offset+2, 1, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_paging_group_id, tvb, tlv_offset+3, 2, FALSE); - break; - case RNG_RSP_POWER_SAVING_CLASS_PARAMETERS: - sub_tree = add_protocol_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, proto_mac_mgmt_msg_rng_rsp_decoder, tvb, tlv_offset, tlv_len, "Power Saving Class Parameters (%u byte(s))", tlv_len); - dissect_power_saving_class(sub_tree, tlv_type, tvb, tlv_len, pinfo, tlv_offset); - break; - case RNG_RSP_SA_CHALLENGE_TUPLE: - /* Display SA Challenge Tuple header */ - sub_tree = add_protocol_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, proto_mac_mgmt_msg_rng_rsp_decoder, tvb, tlv_offset, tlv_len, "SA Challenge Tuple (%u byte(s))", tlv_len); - /* add subtree */ - /* Use a local copy of tlv_offset */ - this_offset = tlv_offset; - while(this_offset < tlv_len) { - /* Get the sub TLV data. */ - init_tlv_info(&sub_tlv_info, tvb, this_offset); - /* get the sub TLV type */ - sub_tlv_type = get_tlv_type(&sub_tlv_info); - /* get the TLV length */ - sub_tlv_len = get_tlv_length(&sub_tlv_info); - if(tlv_type == -1 || sub_tlv_len > MAX_TLV_LEN || sub_tlv_len < 1) - { /* invalid tlv info */ - if(check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "RNG-RSP TLV error"); - } - proto_tree_add_item(rng_rsp_tree, hf_rng_invalid_tlv, tvb, tlv_offset, (tvb_len - offset), FALSE); - break; - } - /* get the offset to the sub TLV data */ - sub_tlv_offset = this_offset + get_tlv_value_offset(&sub_tlv_info); - switch (sub_tlv_type) { - case RNG_RSP_SA_CHALLENGE_BS_RANDOM: - tlv_tree = add_tlv_subtree(&sub_tlv_info, ett_rng_rsp_message_tree, sub_tree, hf_rng_rsp_bs_random, tvb, sub_tlv_offset, sub_tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_rng_rsp_bs_random, tvb, sub_tlv_offset, sub_tlv_len, FALSE); - break; - case RNG_RSP_SA_CHALLENGE_AKID: - tlv_tree = add_tlv_subtree(&sub_tlv_info, ett_rng_rsp_message_tree, sub_tree, hf_rng_rsp_akid, tvb, sub_tlv_offset, sub_tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_rng_rsp_akid, tvb, sub_tlv_offset, sub_tlv_len, FALSE); - break; - default: - tlv_tree = add_tlv_subtree(&sub_tlv_info, ett_rng_rsp_message_tree, sub_tree, hf_tlv_type, tvb, sub_tlv_offset, sub_tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_tlv_type, tvb, sub_tlv_offset, sub_tlv_len, FALSE); - break; - } - this_offset = sub_tlv_len + sub_tlv_offset; - } - break; - case DSx_UPLINK_FLOW: - /* display Uplink Service Flow Encodings info */ - /* add subtree */ - sub_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_rng_rsp_decoder, rng_rsp_tree, proto_mac_mgmt_msg_rng_rsp_decoder, tvb, tlv_offset, tlv_len, "Uplink QOS Parameters (%u bytes)", tlv_len); - /* decode and display the DL Service Flow Encodings */ - wimax_service_flow_encodings_decoder(tvb_new_subset(tvb, tlv_offset, tlv_len, tlv_len), pinfo, sub_tree); - break; - case DSx_DOWNLINK_FLOW: - /* display Downlink Service Flow Encodings info */ - /* add subtree */ - sub_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_rng_rsp_decoder, rng_rsp_tree, proto_mac_mgmt_msg_rng_rsp_decoder, tvb, tlv_offset, tlv_len, "Downlink QOS Parameters (%u bytes)", tlv_len); - /* decode and display the DL Service Flow Encodings */ - wimax_service_flow_encodings_decoder(tvb_new_subset(tvb, tlv_offset, tlv_len, tlv_len), pinfo, sub_tree); - break; - case RNG_RSP_RANGING_CODE_ATTRIBUTES: - /* case SHORT_HMAC_TUPLE: */ - sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_rng_rsp_ranging_subchan, tvb, tlv_offset, 4, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_time_symbol_reference, tvb, tlv_offset, 4, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_subchannel_reference, tvb, tlv_offset, 4, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_ranging_code_index, tvb, tlv_offset, 4, FALSE); - proto_tree_add_item(sub_tree, hf_rng_rsp_frame_number2, tvb, tlv_offset, 4, FALSE); - break; - case SHORT_HMAC_TUPLE_COR2: - if (include_cor2_changes) { - sub_tree = add_protocol_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, proto_mac_mgmt_msg_rng_rsp_decoder, tvb, tlv_offset, tlv_len, "Short HMAC Tuple (%u byte(s))", tlv_len); - wimax_short_hmac_tuple_decoder(sub_tree, tvb, tlv_offset, tvb_len - offset); - } else { - /* Unknown TLV type */ - sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_tlv_type, tvb, tlv_offset, 1, FALSE); - proto_tree_add_item(sub_tree, hf_tlv_type, tvb, tlv_offset, tlv_len, FALSE); - } - break; - - default: - sub_tree = add_tlv_subtree(&tlv_info, ett_rng_rsp_message_tree, rng_rsp_tree, hf_tlv_type, tvb, tlv_offset, 1, FALSE); - proto_tree_add_item(sub_tree, hf_tlv_type, tvb, tlv_offset, tlv_len, FALSE); - break; - - } - offset = tlv_len + tlv_offset; - } /* end of TLV process while loop */ - if (ranging_status_item && dl_freq_override_item) - proto_item_append_text(ranging_status_item, " (shall be set to 2 because Downlink Frequency Override is present)"); - if (ss_mac_address_item && frame_number_item) { - proto_item_append_text(frame_number_item, " (mutually exclusive with SS MAC Address!)"); - proto_item_append_text(ss_mac_address_item, " (mutually exclusive with Frame Number!)"); - } - if (ss_mac_address_item && opportunity_number_item) { - proto_item_append_text(opportunity_number_item, " (mutually exclusive with SS MAC Address!)"); - proto_item_append_text(ss_mac_address_item, " (mutually exclusive with Initial Ranging Opportunity Number!)"); - } - if (!ranging_status_item) - proto_item_append_text(rng_rsp_tree, " (Ranging status is missing!)"); + proto_mac_mgmt_msg_rng_rsp_decoder = proto_mac_mgmt_msg_rng_req_decoder; - } + proto_register_field_array(proto_mac_mgmt_msg_rng_rsp_decoder, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); } - diff --git a/plugins/wimax/msg_sbc.c b/plugins/wimax/msg_sbc.c index 6a4f225c27..f133a016d6 100644 --- a/plugins/wimax/msg_sbc.c +++ b/plugins/wimax/msg_sbc.c @@ -36,8 +36,6 @@ #include "config.h" #endif -#include "moduleinfo.h" - #include #include #include "wimax_tlv.h" @@ -48,24 +46,11 @@ * or not cor2 changes are included */ extern guint include_cor2_changes; -/* forward reference */ -void proto_register_mac_mgmt_msg_sbc(void); -void dissect_mac_mgmt_msg_sbc_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); -void dissect_mac_mgmt_msg_sbc_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - static gint proto_mac_mgmt_msg_sbc_decoder = -1; static gint ett_mac_mgmt_msg_sbc_decoder = -1; static gint ett_sbc_req_tlv_subtree = -1; static gint ett_sbc_rsp_tlv_subtree = -1; -/* Setup protocol subtree array */ -static gint *ett_sbc[] = -{ - &ett_mac_mgmt_msg_sbc_decoder, - &ett_sbc_req_tlv_subtree, - &ett_sbc_rsp_tlv_subtree, -}; - /* fix fields */ static gint hf_sbc_req_message_type = -1; static gint hf_sbc_rsp_message_type = -1; @@ -346,7 +331,7 @@ static const value_string diuc_msgs[] = { 13, "Reserved" }, { 14, "Gap" }, { 15, "End of DL-MAP" }, - {0, NULL} + {0, NULL} }; static const value_string vals_sbc_type[] = @@ -549,1731 +534,83 @@ static const value_string vals_sbc_sdma_str[ ] = {0, NULL} }; -/* Register Wimax Mac SBC-REQ/RSP Messages Dissectors */ -void proto_register_mac_mgmt_msg_sbc(void) + +/* Wimax Mac SBC-REQ Message Dissector */ +void dissect_mac_mgmt_msg_sbc_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - /* SBC display */ - static hf_register_info hf_sbc[] = + guint offset = 0; + guint tvb_len, payload_type, value; + gint tlv_type, tlv_len, tlv_value_offset; + guint num_dl_harq_chans; + proto_item *sbc_item = NULL; + proto_tree *sbc_tree = NULL; + proto_item *tlv_item = NULL; + proto_tree *tlv_tree = NULL; + proto_item *ti = NULL; + tlv_info_t tlv_info; + gfloat power_bpsk; + gfloat power_qpsk; + gfloat power_qam16; + gfloat power_qam64; + gfloat current_power; + + /* Ensure the right payload type */ + payload_type = tvb_get_guint8(tvb, offset); + if (payload_type != MAC_MGMT_MSG_SBC_REQ) { - { /* 11.8.8 */ - &hf_sbc_tlv_t_167_association_type_support, - { - "Association Type Support", "wmx.sbc.association_type_support", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_167_association_type_support_bit0, - { - "Scanning Without Association: association not supported", "wmx.sbc.association_type_support.bit0", - FT_BOOLEAN, 8, TFS(&tfs_yes_no_sbc), 0x1, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_167_association_type_support_bit1, - { - "Association Level 0: scanning or association without coordination", "wmx.sbc.association_type_support.bit1", - FT_BOOLEAN, 8, TFS(&tfs_yes_no_sbc), 0x2, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_167_association_type_support_bit2, - { - "Association Level 1: association with coordination", "wmx.sbc.association_type_support.bit2", - FT_BOOLEAN, 8, TFS(&tfs_yes_no_sbc), 0x4, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_167_association_type_support_bit3, - { - "Association Level 2: network assisted association", "wmx.sbc.association_type_support.bit3", - FT_BOOLEAN, 8, TFS(&tfs_yes_no_sbc), 0x8, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_167_association_type_support_bit4, - { - "Desired Association Support", "wmx.sbc.association_type_support.bit4", - FT_BOOLEAN, 8, TFS(&tfs_yes_no_sbc), 0x10, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_167_association_type_support_reserved, - { - "Reserved", "wmx.sbc.association_type_support.reserved", - FT_UINT8, BASE_HEX, NULL, 0xE0, NULL, HFILL - } - }, - { /* 11.7.8.7 */ - &hf_sbc_auth_policy, - { - "Authorization Policy Support", "wmx.sbc.auth_policy", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_privacy_802_16, - { - "IEEE 802.16 Privacy", "wmx.sbc.auth_policy.802_16", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL - } - }, - { - &hf_sbc_privacy_rsvd, - { - "Reserved", "wmx.sbc.auth_policy.rsvd", - FT_UINT8, BASE_HEX, NULL, 0xFE, NULL, HFILL - } - }, - { /* 11.8.1 */ - &hf_sbc_bw_alloc_support, - { - "Bandwidth Allocation Support", "wmx.sbc.bw_alloc_support", - FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_sbc_bw_alloc_support_duplex, - { - "Duplex", "wmx.sbc.bw_alloc_support.duplex", - FT_BOOLEAN, 8, TFS(&tfs_sbc_bw_alloc_support_duplex), 0x2, NULL, HFILL - } - }, - { - &hf_sbc_bw_alloc_support_rsvd0, - { - "Reserved", "wmx.sbc.bw_alloc_support.rsvd0", - FT_UINT8, BASE_HEX, NULL, 0x1, NULL, HFILL - } - }, - { - &hf_sbc_bw_alloc_support_rsvd1, - { - "Reserved", "wmx.sbc.bw_alloc_support.rsvd1", - FT_UINT8, BASE_HEX, NULL, 0xFC, NULL, HFILL - } - }, - { - &hf_sbc_curr_transmit_power, - { - "Current transmitted power", "wmx.sbc.curr_transmit_power", - FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_sbc_ss_effective_cinr_measurement_preamble, - { - "Effective CINR Measurement For A Permutation Zone From Preamble", "wmx.sbc.effective_cinr_measure_permutation_zone_preamble", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL - } - }, - { - &hf_sbc_ss_effective_cinr_measurement_permutation_zone_from_pilot_subcarriers, - { - "Effective CINR Measurement For A Permutation Zone From Pilot Subcarriers", "wmx.sbc.effective_cinr_measure_permutation_zone.pilot_subcarriers", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL - } - }, - { - &hf_sbc_ss_effective_cinr_measurement_permutation_zone_from_data_subcarriers, - { - "Effective CINR Measurement For A Permutation Zone From Data Subcarriers", "wmx.sbc.effective_cinr_measure_permutation_zone.data_subcarriers", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x20, NULL, HFILL - } - }, - { /* 11.8.6 */ - &hf_sbc_tlv_t_27_extension_capability, - { - "Extension Capability", "wmx.sbc.extension_capability", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_27_extension_capability_bit0, - { - "Supported Extended Subheader Format", "wmx.sbc.extension_capability.bit0", - FT_BOOLEAN, 8, TFS(&tfs_yes_no_sbc), 0x1, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_27_extension_capability_reserved, - { - "Reserved", "wmx.sbc.extension_capability.reserved", - FT_UINT8, BASE_HEX, NULL, 0xFE, NULL, HFILL - } - }, - { - &hf_sbc_ss_frequency_selectivity_characterization_report, - { - "Frequency Selectivity Characterization Report", "wmx.sbc.frequency_selectivity_characterization_report", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x80, NULL, HFILL - } - }, - { /* 11.8.3.7.19.2 */ - &hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability, - { - "HARQ Chase Combining And CC-IR Buffer Capability", "wmx.sbc.harq_chase_combining_and_cc_ir_buffer_capability", - FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, + return; + } + + if (tree) + { /* we are being asked for details */ + /* Get the tvb reported length */ + tvb_len = tvb_reported_length(tvb); + /* display MAC payload type SBC-REQ */ + sbc_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_sbc_decoder, tvb, offset, tvb_len, "SS Basic Capability Request (SBC-REQ) (%u bytes)", tvb_len); + /* add MAC SBC subtree */ + sbc_tree = proto_item_add_subtree(sbc_item, ett_mac_mgmt_msg_sbc_decoder); + /* Decode and display the SS Basic Capability Request (SBC-REQ) */ + /* display the Message Type */ + proto_tree_add_item(sbc_tree, hf_sbc_req_message_type, tvb, offset, 1, FALSE); + /* set the offset for the TLV Encoded info */ + offset++; + /* process the SBC TLVs */ + while(offset < tvb_len) { - &hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_aggregation_flag_dl, - { - "Aggregation Flag For DL", "wmx.sbc.harq_chase_combining_and_cc_ir_buffer_capability.aggregation_flag_dl", - FT_UINT16, BASE_HEX, NULL, 0x40, NULL, HFILL + /* get the TLV information */ + init_tlv_info(&tlv_info, tvb, offset); + /* get the TLV type */ + tlv_type = get_tlv_type(&tlv_info); + /* get the TLV length */ + tlv_len = get_tlv_length(&tlv_info); + if (tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1) + { /* invalid tlv info */ + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "SBC-REQ TLV error"); + } + proto_tree_add_item(sbc_tree, hf_sbc_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE); + break; } - }, - { - &hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_aggregation_flag_ul, - { - "Aggregation Flag for UL", "wmx.sbc.harq_chase_combining_and_cc_ir_buffer_capability.aggregation_flag_ul", - FT_UINT16, BASE_HEX, NULL, 0x4000, NULL, HFILL + if (tlv_type == 0) + { /* invalid tlv type */ + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid SBC TLV type"); + } + proto_tree_add_item(sbc_tree, hf_sbc_unknown_type, tvb, offset, 1, FALSE); + offset++; + continue; } - }, - { - &hf_sbc_tlv_t_163_dl_harq_buffering_capability_for_chase_combining, - { - "Downlink HARQ Buffering Capability For Chase Combining (K)", "wmx.sbc.harq_chase_combining_and_cc_ir_buffer_capability.dl_harq_buffering_capability_for_chase_combining", - FT_UINT16, BASE_HEX, NULL, 0x3F, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_reserved1, - { - "Reserved", "wmx.sbc.harq_chase_combining_and_cc_ir_buffer_capability.reserved1", - FT_UINT16, BASE_HEX, NULL, 0x80, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_reserved2, - { - "Reserved", "wmx.sbc.harq_chase_combining_and_cc_ir_buffer_capability.reserved2", - FT_UINT16, BASE_HEX, NULL, 0x8000, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_163_ul_harq_buffering_capability_for_chase_combining, - { - "Uplink HARQ buffering capability for chase combining (K)", "wmx.sbc.harq_chase_combining_and_cc_ir_buffer_capability.ul_harq_buffering_capability_for_chase_combining", - FT_UINT16, BASE_HEX, NULL, 0x3F00, NULL, HFILL - } - }, - { /* 11.8.3.7.19.1 */ - &hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability, - { - "HARQ Incremental Buffer Capability", "wmx.sbc.harq_incremental_redundancy_buffer_capability", - FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_aggregation_flag_for_dl, - { - "Aggregation Flag for DL", "wmx.sbc.harq_incremental_redundancy_buffer_capability.aggregation_flag_for_dl", - FT_UINT16, BASE_HEX, NULL, 0x10, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_aggregation_flag_for_ul, - { - "Aggregation Flag For UL", "wmx.sbc.harq_incremental_redundancy_buffer_capability.aggregation_flag_for_ul", - FT_UINT16, BASE_HEX, NULL, 0x1000, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_NEP, - { - "NEP Value Indicating Downlink HARQ Buffering Capability For Incremental Redundancy CTC", "wmx.sbc.harq_incremental_redundancy_buffer_capability.dl_incremental_redundancy_ctc", - FT_UINT16, BASE_HEX, NULL, 0xF, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_reserved1, - { - "Reserved", "wmx.sbc.harq_incremental_redundancy_buffer_capability.reserved", - FT_UINT16, BASE_HEX, NULL, 0xE0, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_reserved2, - { - "Reserved", "wmx.sbc.harq_incremental_redundancy_buffer_capability.reserved2", - FT_UINT16, BASE_HEX, NULL, 0xE000, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_162_ul_harq_incremental_redundancy_buffer_capability_NEP, - { - "NEP Value Indicating Uplink HARQ Buffering Capability For Incremental Redundancy CTC", "wmx.sbc.harq_incremental_redundancy_buffer_capability.ul_incremental_redundancy_ctc", - FT_UINT16,BASE_HEX, NULL, 0xF00, NULL, HFILL - } - }, - { - &hf_sbc_ofdma_aas_harq_map_capability, - { - "H-ARQ MAP Capability", "wmx.sbc.harq_map_capability", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL - } - }, - { /* 11.8.7 */ - &hf_sbc_tlv_t_28_ho_trigger_metric_support, - { - "HO Trigger Metric Support", "wmx.sbc.ho_trigger_metric_support", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_28_ho_trigger_metric_support_bit0, - { - "BS CINR Mean", "wmx.sbc.ho_trigger_metric_support.bit0", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_28_ho_trigger_metric_support_bit1, - { - "BS RSSI Mean", "wmx.sbc.ho_trigger_metric_support.bit1", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_28_ho_trigger_metric_support_bit2, - { - "BS Relative Delay", "wmx.sbc.ho_trigger_metric_support.bit2", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_28_ho_trigger_metric_support_bit3, - { - "BS RTD", "wmx.sbc.ho_trigger_metric_support.bit3", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_28_ho_trigger_metric_support_reserved, - { - "Reserved", "wmx.sbc.ho_trigger_metric_support.reserved", - FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL - } - }, - { - &hf_sbc_invalid_tlv, - { - "Invalid TLV", "wmx.sbc.invalid_tlv", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { /* 11.8.2 */ - &hf_sbc_mac_pdu, - { - "Capabilities For Construction And Transmission Of MAC PDUs", "wmx.sbc.mac_pdu", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_mac_pdu_piggybacked, - { - "Ability To Receive Requests Piggybacked With Data", "wmx.sbc.mac_pdu.bit0", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL - } - }, - { - &hf_sbc_mac_pdu_fsn, - { - "Ability To Use 3-bit FSN Values Used When Forming MAC PDUs On Non-ARQ Connections", "wmx.sbc.mac_pdu.bit1", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL - } - }, - { /* 11.8.3.7.15 */ - &hf_sbc_tlv_t_175_max_num_bst_per_frm_capability_harq, - { - "Maximum Number Of Burst Per Frame Capability In HARQ", "wmx.sbc.max_num_bst_per_frm_capability_harq", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_175_max_num_dl_harq_bst_per_harq_per_frm, - { - "Maximum Numbers Of DL HARQ Bursts Per HARQ Enabled Of MS Per Frame (default(0)=1)", "wmx.sbc.max_num_bst_per_frm_capability_harq.max_num_dl_harq_bst_per_harq_per_frm", - FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_175_max_num_ul_harq_bst, - { - "Maximum Number Of UL HARQ Burst Per HARQ Enabled MS Per Frame (default(0)=1)", "wmx.sbc.max_num_bst_per_frm_capability_harq.max_num_ul_harq_bst", - FT_UINT8, BASE_DEC, NULL, 0x7, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_175_max_num_ul_harq_per_frm_include_one_non_harq_bst, - { - "Whether The Maximum Number Of UL HARQ Bursts Per Frame (i.e. Bits# 2-0) Includes The One Non-HARQ Burst", "wmx.sbc.max_num_bst_per_frm_capability_harq.max_num_ul_harq_per_frm_include_one_non_harq_bst", - FT_BOOLEAN, 8, TFS(&tfs_yes_no_sbc), 0x8, NULL, HFILL - } - }, - { /* 11.7.8.8 */ - &hf_sbc_max_security_associations, - { - "Maximum Number Of Security Association Supported By The SS", "wmx.sbc.max_security_associations", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { /* 11.8.3.7.2 - type 161 */ - &hf_sbc_number_dl_arq_ack_channel, - { - "The Number Of DL HARQ ACK Channel", "wmx.sbc.number_dl_arq_ack_channel", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { /* 11.8.3.7.3 - type 153 */ - &hf_sbc_number_ul_arq_ack_channel, - { - "The Number Of UL HARQ ACK Channel", "wmx.sbc.number_ul_arq_ack_channel", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { /* 11.8.3.7.8 */ - &hf_sbc_ofdma_aas_capabilities, - { - "OFDMA AAS Capability", "wmx.sbc.ofdma_aas_capability", - FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_ss_ofdma_aas_capabilities_rsvd, - { - "Reserved", "wmx.sbc.ofdma_aas_capabilities.rsvd", - FT_UINT16, BASE_HEX, NULL, 0xFFE0, NULL, HFILL - } - }, - { - &hf_sbc_ss_ofdma_aas_diversity_map_scan, - { - "AAS Diversity Map Scan (AAS DLFP)", "wmx.sbc.ofdma_aas_diversity_map_scan", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x2, NULL, HFILL - } - }, - { - &hf_sbc_ss_ofdma_aas_fbck_rsp_support, - { - "AAS-FBCK-RSP Support", "wmx.sbc.ofdma_aas_fbck_rsp_support", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x4, NULL, HFILL - } - }, - { - &hf_sbc_ss_ofdma_aas_zone, - { - "AAS Zone", "wmx.sbc.ofdma_aas_zone", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x1, NULL, HFILL - } - }, - { - &hf_sbc_ss_ofdma_downlink_aas_preamble, - { - "Downlink AAS Preamble", "wmx.sbc.ofdma_downlink_aas_preamble", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x8, NULL, HFILL - } - }, - { /* 11.8.3.7.5 - 3 bytes */ - &hf_sbc_tlv_t_176, - { - "OFDMA MS Demodulator For MIMO Support In DL", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl", - FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported), 0x0, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_176_bit0, - { - "2-antenna STC Matrix A", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit0", - FT_BOOLEAN, 24, TFS(&tfs_supported), 0x1, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_176_bit1, - { - "2-antenna STC Matrix B, vertical coding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit1", - FT_BOOLEAN, 24, TFS(&tfs_supported), 0x2, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_176_bit2, - { - "Four Receive Antennas", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit2", - FT_BOOLEAN, 24, TFS(&tfs_supported), 0x4, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_176_bit2_cor2, - { - "2-antenna STC matrix B, horizontal coding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit2", - FT_BOOLEAN, 24, TFS(&tfs_supported), 0x4, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_176_bit3, - { - "4-antenna STC Matrix A", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit3", - FT_BOOLEAN, 24, TFS(&tfs_supported), 0x8, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_176_bit4, - { - "4-antenna STC Matrix B, vertical coding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit4", - FT_BOOLEAN, 24, TFS(&tfs_supported), 0x10, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_176_bit5, - { - "4-antenna STC Matrix B, horizontal coding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit5", - FT_BOOLEAN, 24, TFS(&tfs_supported), 0x20, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_176_bit6, - { - "4-antenna STC Matrix C, vertical coding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit6", - FT_BOOLEAN, 24, TFS(&tfs_supported), 0x40, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_176_bit7, - { - "4-antenna STC Matrix C, horizontal coding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit7", - FT_BOOLEAN, 24, TFS(&tfs_supported), 0x80, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_176_bit8, - { - "3-antenna STC Matrix A", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit8", - FT_BOOLEAN, 24, TFS(&tfs_supported), 0x100, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_176_bit9, - { - "3-antenna STC Matrix B", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit9", - FT_BOOLEAN, 24, TFS(&tfs_supported), 0x200, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_176_bit10, - { - "3-antenna STC Matrix C, vertical coding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit10", - FT_BOOLEAN, 24, TFS(&tfs_supported), 0x400, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_176_bit11, - { - "3-antenna STC Matrix C, horizontal coding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit11", - FT_BOOLEAN, 24, TFS(&tfs_supported), 0x800, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_176_bit12, - { - "Capable Of Calculating Precoding Weight", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit12", - FT_BOOLEAN, 24, TFS(&tfs_supported), 0x1000, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_176_bit13, - { - "Capable Of Adaptive Rate Control", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit13", - FT_BOOLEAN, 24, TFS(&tfs_supported), 0x2000, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_176_bit14, - { - "Capable Of Calculating Channel Matrix", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit14", - FT_BOOLEAN, 24, TFS(&tfs_supported), 0x4000, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_176_bit15, - { - "Capable Of Antenna Grouping", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit15", - FT_BOOLEAN, 24, TFS(&tfs_supported), 0x8000, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_176_bit16, - { - "Capable Of Antenna Selection", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit16", - FT_BOOLEAN, 24, TFS(&tfs_supported), 0x10000, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_176_bit17, - { - "Capable Of Codebook Based Precoding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit17", - FT_BOOLEAN, 24, TFS(&tfs_supported), 0x20000, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_176_bit18, - { - "Capable Of Long-term Precoding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit18", - FT_BOOLEAN, 24, TFS(&tfs_supported), 0x40000, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_176_bit19, - { - "Capable Of MIMO Midamble", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit19", - FT_BOOLEAN, 24, TFS(&tfs_supported), 0x80000, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_176_reserved, - { - "Reserved", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.reserved", - FT_UINT24, BASE_HEX, NULL, 0xF00000, NULL, HFILL - } - }, - { /* 11.8.3.7.18 */ - &hf_sbc_tlv_t_179_ofdma_multiple_dl_burst_profile_support, - { - "OFDMA Multiple Downlink Burst Profile Capability", "wmx.sbc.ofdma_multiple_dl_burst_profile_support", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_179_dl_bst_profile_for_multiple_fec, - { - "Downlink burst profile for multiple FEC types", "wmx.sbc.ofdma_multiple_dl_burst_profile_support.dl_bst_profile_for_multiple_fec", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_179_reserved, - { - "Reserved", "wmx.sbc.ofdma_multiple_dl_burst_profile_support.reserved", - FT_UINT8, BASE_HEX, NULL, 0xFC, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_179_ul_bst_profile_for_multiple_fec, - { - "Uplink burst profile for multiple FEC types", "wmx.sbc.ofdma_multiple_dl_burst_profile_support.ul_burst_profile_for_multiple_fec_types", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL - } - }, - { /* 11.8.3.7.9 */ - &hf_sbc_ss_cinr_measure_capability, - { - "OFDMA SS CINR Measurement Capability", "wmx.sbc.ofdma_ss_cinr_measure_capability", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { /* 11.8.3.7.6 */ - &hf_sbc_ss_mimo_uplink_support, - { - "OFDMA SS MIMO uplink support", "wmx.sbc.ofdma_ss_mimo_uplink_support", - FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL - } - }, - { - &hf_sbc_ss_mimo_uplink_support_2_ann_sttd, - { - "2-antenna STTD", "wmx.sbc.ofdma_ss_mimo_uplink_support.2_antenna_sttd", - FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL - } - }, - { - &hf_sbc_ss_mimo_uplink_support_2_ann_sm_vertical, - { - "2-antenna SM with vertical coding", "wmx.sbc.ofdma_ss_mimo_uplink_support.2_antenna_sm_with_vertical_coding", - FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL - } - }, - { - &hf_sbc_ss_mimo_uplink_support_1_ann_coop_sm, - { - "Single-antenna cooperative SM", "wmx.sbc.ofdma_ss_mimo_uplink_support.single_antenna_coop_sm", - FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL - } - }, - { - &hf_sbc_ss_ofdma_uplink_aas_preamble, - { - "Uplink AAS Preamble", "wmx.sbc.ofdma_uplink_aas_preamble", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x10, NULL, HFILL - } - }, - { - &hf_sbc_ss_phy_cinr_measurement_preamble, - { - "Physical CINR Measurement From The Preamble", "wmx.sbc.phy_cinr_measure_preamble", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL - } - }, - { - &hf_sbc_ss_phy_cinr_measurement_permutation_zone_from_pilot_subcarriers, - { - "Physical CINR Measurement For A Permutation Zone From Pilot Subcarriers", "wmx.sbc.phy_cinr_measure_permutation_zone.pilot_subcarriers", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL - } - }, - { - &hf_sbc_ss_phy_cinr_measurement_permutation_zone_from_data_subcarriers, - { - "Physical CINR Measurement For A Permutation Zone From Data Subcarriers", "wmx.sbc.phy_cinr_measure_permutation_zone.data_subcarriers", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL - } - }, - { /* 11.7.8.6 */ - &hf_sbc_pkm_flow_control, - { - "PKM Flow Control", "wmx.sbc.pkm_flow_control", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { /* 11.8.5 */ - &hf_sbc_power_save_class_types_capability, - { - "Power Save Class Types Capability", "wmx.sbc.power_save_class_types_capability", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_power_save_class_types_capability_bit0, - { - "Power Save Class Type I", "wmx.sbc.power_save_class_types_capability.bit0", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL - } - }, - { - &hf_sbc_power_save_class_types_capability_bit1, - { - "Power Save Class Type II", "wmx.sbc.power_save_class_types_capability.bit1", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL - } - }, - { - &hf_sbc_power_save_class_types_capability_bit2, - { - "Power Save Class Type III", "wmx.sbc.power_save_class_types_capability.bit2", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL - } - }, - { - &hf_sbc_power_save_class_types_capability_bits34, - { - "Number Of Power Save Class Type Instances Supported From Class Type I and II", "wmx.sbc.power_save_class_types_capability.bits34", - FT_UINT8, BASE_DEC, NULL, 0x18, NULL, HFILL - } - }, - { - &hf_sbc_power_save_class_types_capability_bits567, - { - "Number Of Power Save Class Type Instances Supported From Class Type III", "wmx.sbc.power_save_class_types_capability.bits567", - FT_UINT8, BASE_DEC, NULL, 0xE0, NULL, HFILL - } - }, - { /* 11.8.3.7.7 */ - &hf_sbc_ofdma_aas_private_chain_enable, - { - "Private Map Chain Enable", "wmx.sbc.private_chain_enable", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL - } - }, - { - &hf_sbc_ofdma_aas_private_map_concurrency, - { - "Private Map Chain Concurrency", "wmx.sbc.private_map_concurrency", - FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL - } - }, - { - &hf_sbc_ofdma_aas_private_map_dl_frame_offset, - { - "Private Map DL Frame Offset", "wmx.sbc.private_map_dl_frame_offset", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL - } - }, - { - &hf_sbc_ofdma_aas_private_map_support, - { - "Private Map Support", "wmx.sbc.private_map_support", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL - } - }, - { - &hf_sbc_ss_ofdma_aas_private, - { - "OFDMA AAS Private Map Support", "wmx.sbc.private_map_support.ofdma_aas", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_ofdma_aas_reduced_private_map_support, - { - "Reduced Private Map Support", "wmx.sbc.private_map_support.reduced", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL - } - }, - { - &hf_sbc_ofdma_aas_private_ul_frame_offset, - { - "Private Map UL Frame Offset", "wmx.sbc.private_ul_frame_offset", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x20, NULL, HFILL - } - }, - { - &hf_sbc_mac_pdu_rsvd, - { - "Reserved", "wmx.sbc.mac_pdu.rsvd", - FT_UINT8, BASE_HEX, NULL, 0xFC, NULL, HFILL - } - }, - { /* 11.8.3.2 */ - &hf_sbc_max_transmit_power, - { - "Maximum Transmit Power", "wmx.sbc.max_transmit_power", - FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL - } - }, - { /* 11.8.3.7.5 - 2 bytes */ - &hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_a, - { - "2-antenna STC Matrix A", "wmx.sbc.ss_demodulator.mimo.2.antenna.stc.matrix.a", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x1, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_b_horizontal, - { - "2-antenna STC Matrix B, horizontal coding", "wmx.sbc.ss_demodulator.mimo.2.antenna.stc.matrix.b.horizontal", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x4, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_b_vertical, - { - "2-antenna STC Matrix B, vertical coding", "wmx.sbc.ss_demodulator.mimo.2.antenna.stc.matrix.b.vertical", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x2, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_a, - { - "4-antenna STC Matrix A", "wmx.sbc.ss_demodulator.mimo.4.antenna.stc.matrix.a", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x8, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_b_horizontal, - { - "4-antenna STC Matrix B, horizontal coding", "wmx.sbc.ss_demodulator.mimo.4.antenna.stc.matrix.b.horizontal", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x20, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_b_vertical, - { - "4-antenna STC Matrix B, vertical coding", "wmx.sbc.ss_demodulator.mimo.4.antenna.stc.matrix.b.vertical", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x10, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_c_horizontal, - { - "4-antenna STC Matrix C, horizontal coding", "wmx.sbc.ss_demodulator.mimo.4.antenna.stc.matrix.c.horizontal", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x80, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_c_vertical, - { - "4-antenna STC Matrix C, vertical coding", "wmx.sbc.ss_demodulator.mimo.4.antenna.stc.matrix.c.vertical", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x40, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_mimo_rsvd, - { - "Reserved", "wmx.sbc.ss_demodulator.mimo.reserved", - FT_UINT16, BASE_HEX, NULL, 0xFF00, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_mimo_support, - { - "OFDMA SS Demodulator For MIMO Support", "wmx.sbc.ss_demodulator.mimo.support", - FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - /*11.8.3.7.11 ??? */ - { /* 11.8.3.7.12 - 170 */ - &hf_sbc_ofdma_ss_uplink_power_control_support, - { - "OFDMA SS uplink power control support", "wmx.sbc.ofdma_ss_uplink_power_control_support", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_ofdma_ss_uplink_power_control_support_open_loop, - { - "Open loop", "wmx.sbc.ofdma_ss_uplink_power_control_support.open_loop", - FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL - } - }, - { - &hf_sbc_ofdma_ss_uplink_power_control_support_aas_preamble, - { - "AAS preamble", "wmx.sbc.ofdma_ss_uplink_power_control_support.aas_preamble", - FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL - } - }, - { - &hf_sbc_ofdma_ss_uplink_power_control_support_rsvd, - { - "Reserved", "wmx.sbc.ofdma_ss_uplink_power_control_support.rsvd", - FT_UINT8, BASE_HEX, NULL, 0xFC, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_172_dl_region_definition_support, - { - "DL Region Definition Support", "wmx.sbc.ofdma_map_capability.dl_region_definition_support", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL - } - }, - { /* 11.8.3.7.12 - 172 */ - &hf_sbc_tlv_t_172, - { - "Support For Extended HARQ", "wmx.sbc.ofdma_map_capability.extended_harq", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_172_extended_harq_ie_capability, - { - "Extended HARQ IE Capability", "wmx.sbc.ofdma_map_capability.extended_harq_ie_capability", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_172_harq_map_capability, - { - "HARQ MAP Capability", "wmx.sbc.ofdma_map_capability.harq_map_capability", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL - } - }, - { /* 11.8.3.7.12 - 171 */ - &hf_sbc_tlv_t_171_minimum_num_of_frames, - { - "The Minimum Number Of Frames That SS Takes To Switch From The Open Loop Power Control Scheme To The Closed Loop Power Control Scheme Or Vice Versa", "wmx.sbc.ofdma_ss_uplink_power_control_support.minimum_num_of_frames", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_172_reserved, - { - "Reserved", "wmx.sbc.ofdma_map_capability.reserved", - FT_UINT8, BASE_HEX, NULL, 0xE0, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_172_sub_map_capability_first_zone, - { - "Sub MAP Capability For First Zone", "wmx.sbc.ofdma_map_capability.sub_map_capability_first_zone", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_172_sub_map_capability_other_zones, - { - "Sub MAP Capability For Other Zones", "wmx.sbc.ofdma_map_capability.sub_map_capability_other_zones", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL - } - }, - { /* 11.8.3.7.14 */ - &hf_sbc_tlv_t_174_ofdma_ms_csit_capability, - { - "OFDMA MS CSIT Capability", "wmx.sbc.ofdma_ms_csit_capability", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_174_csit_compatibility_type_a, - { - "CSIT Compatibility Type A", "wmx.sbc.ofdma_ms_csit_capability.csit_compatibility_type_a", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x1, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_174_csit_compatibility_type_b, - { - "CSIT Compatibility Type B", "wmx.sbc.ofdma_ms_csit_capability.csit_compatibility_type_b", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x2, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_174_max_num_simultanous_sounding_instructions, - { - "Max Number Of Simultaneous Sounding Instructions", "wmx.sbc.ofdma_ms_csit_capability.max_num_simultaneous_sounding_instructions", - FT_UINT16, BASE_DEC, NULL, 0x03C0, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_174_power_assignment_capability, - { - "Power Assignment Capability", "wmx.sbc.ofdma_ms_csit_capability.power_assignment_capability", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x4, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_174_ss_csit_reserved, - { - "Reserved", "wmx.sbc.ofdma_ms_csit_capability.reserved", - FT_UINT16, BASE_HEX, NULL, 0xF800, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_174_sounding_rsp_time_capability, - { - "Sounding Response Time Capability", "wmx.sbc.ofdma_ms_csit_capability.sounding_response_time_capability", - FT_UINT16, BASE_HEX, VALS(vals_sounding_rsp_time_cap_codings), 0x0038, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_174_ss_csit_type_a_support, - { - "SS Does Not Support P Values Of 9 And 18 When Supporting CSIT Type A", "wmx.sbc.ofdma_ms_csit_capability.type_a_support", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x0400, NULL, HFILL - } - }, - { - /* 11.8.3.7.20 */ - &hf_sbc_tlv_t_204_ofdma_parameters_sets, - { - "OFDMA parameters sets", "wmx.sbc.ofdma_parameters_sets", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_204_ofdma_parameters_sets_phy_set_a, - { - "Support OFDMA PHY parameter set A", "wmx.sbc.ofdma_parameters_sets.phy_set_a", - FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_204_ofdma_parameters_sets_phy_set_b, - { - "Support OFDMA PHY parameter set B", "wmx.sbc.ofdma_parameters_sets.phy_set_b", - FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_204_ofdma_parameters_sets_harq_parameters_set, - { - "HARQ parameters set", "wmx.sbc.ofdma_parameters_sets.harq_parameters_set", - FT_UINT8, BASE_HEX, VALS(vals_sbc_harq_parameters_set), 0x1C, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_204_ofdma_parameters_sets_mac_set_a, - { - "Support OFDMA MAC parameters set A", "wmx.sbc.ofdma_parameters_sets.mac_set_a", - FT_UINT8, BASE_HEX, NULL, 0x20, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_204_ofdma_parameters_sets_mac_set_b, - { - "Support OFDMA MAC parameters set B", "wmx.sbc.ofdma_parameters_sets.mac_set_b", - FT_UINT8, BASE_HEX, NULL, 0x40, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_204_ofdma_parameters_sets_reserved, - { - "Reserved", "wmx.sbc.ofdma_parameters_sets.reserved", - FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL - } - }, - { /* 11.8.3.7.16 */ - &hf_sbc_tlv_t_177_ofdma_ss_modulator_for_mimo_support, - { - "OFDMA SS Modulator For MIMO Support", "wmx.sbc.ofdma_ss_modulator_for_mimo_support", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_177_adaptive_rate_ctl, - { - "Capable Of Adaptive Rate Control", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.capable_adaptive_rate_control", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_177_beamforming, - { - "Capable Of Beamforming", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.capable_beamforming", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_177_single_antenna, - { - "Capable of single antenna transmission", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.capable_single_antenna", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x20, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_177_stc_matrix_b_horizontal, - { - "Capable of 2-antenna STC Matrix B, Horizontal coding", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.stc_matrix_b_horizontal", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_177_two_transmit_antennas, - { - "Two transmit antennas", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.two_transmit_antennas", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_177_capable_of_transmit_diversity, - { - "Capable of transmit diversity", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.capable_of_transmit_diversity", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_177_capable_of_spacial_multiplexing, - { - "Capable of spatial multiplexing", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.capable_of_spatial_multiplexing", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_177_stc_matrix_b_vertical, - { - "Capable of 2-antenna STC Matrix B, Vertical coding", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.stc_matrix_b_vertical", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_177_collaborative_sm_with_one_antenna, - { - "Capable of collaborative SM with one antenna", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.collaborative_sm_with_one_antenna", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x40, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_177_collaborative_sm_with_two_antennas, - { - "Collaborative SM with two antennas", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.collaborative_sm_with_two_antennas", - FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_177_capable_of_two_antenna, - { - "Capable of two antenna", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.capable_of_two_antenna", - FT_UINT8, BASE_HEX, NULL, 0x40, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_177_rsvd, - { - "Reserved", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.rsvd", - FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_177_stc_matrix_a, - { - "Capable of 2-antenna STC Matrix A", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.stc_matrix_a", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL - } - }, - { /* 11.8.3.7.17 */ - &hf_sbc_tlv_t_178_sdma_pilot_capability, - { - "SDMA Pilot Capability", "wmx.sbc.sdma_pilot_capability", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_178_reserved, - { - "Reserved", "wmx.sbc.sdma_pilot_capability.reserved", - FT_UINT8, BASE_HEX, NULL, 0xFC, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_178_sdma_pilot_pattern_support_for_amc_zone, - { - "SDMA Pilot Patterns Support For AMC Zone", "wmx.sbc.sdma_pilot_capability.sdma_pilot_pattern_support_for_amc_zone", - FT_UINT8, BASE_HEX, VALS(vals_sbc_sdma_str), 0x03, NULL, HFILL - } - }, - { /* 11.8.3.7.2 - type 151 */ - &hf_sbc_ss_demodulator, - { - "OFDMA SS Demodulator", "wmx.sbc.ss_demodulator", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - /* tlv length = 1 byte */ - { - &hf_sbc_ss_demodulator_64qam, - { - "64-QAM", "wmx.sbc.ss_demodulator.64qam", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_btc, - { - "BTC", "wmx.sbc.ss_demodulator.btc", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_cc_with_optional_interleaver, - { - "CC with Optional Interleaver", "wmx.sbc.ss_demodulator.cc_with_optional_interleaver", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_ctc, - { - "CTC", "wmx.sbc.ss_demodulator.ctc", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL - } - }, - /* tlv length = 2 bytes */ - { - &hf_sbc_ss_demodulator_64qam_2, - { - "64-QAM", "wmx.sbc.ss_demodulator.64qam", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x1, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_btc_2, - { - "BTC", "wmx.sbc.ss_demodulator.btc", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x2, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_cc_with_optional_interleaver_2, - { - "CC with Optional Interleaver", "wmx.sbc.ss_demodulator.cc_with_optional_interleaver", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x10, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_ctc_2, - { - "CTC", "wmx.sbc.ss_demodulator.ctc", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x4, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_dedicated_pilots_2, - { - "Dedicated Pilots", "wmx.sbc.ss_demodulator.dedicated_pilots", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x400, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_harq_cc_ir_2, - { - "HARQ CC_IR", "wmx.sbc.ss_demodulator.harq.cc.ir", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x100, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_harq_chase, - { - "HARQ Chase", "wmx.sbc.ss_demodulator.harq.chase", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x20, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_harq_chase_2, - { - "HARQ Chase", "wmx.sbc.ss_demodulator.harq.chase", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x20, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_harq_ctc_ir, - { - "HARQ CTC_IR", "wmx.sbc.ss_demodulator.harq.ctc.ir", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x40, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_harq_ctc_ir_2, - { - "HARQ CTC_IR", "wmx.sbc.ss_demodulator.harq.ctc.ir", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x40, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_ldpc_2, - { - "LDPC", "wmx.sbc.ss_demodulator.ldpc", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x200, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_reserved, - { - "Reserved", "wmx.sbc.ss_demodulator.reserved1", - FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_reserved_2, - { - "Reserved", "wmx.sbc.ss_demodulator.reserved2", - FT_UINT16, BASE_HEX, NULL, 0x80, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_reserved1_2, - { - "Reserved", "wmx.sbc.ss_demodulator.reserved2", - FT_UINT16, BASE_HEX, NULL, 0x800, NULL, HFILL - } - }, - { /* if the number of DL H-ARQ channels > 7 but tlv length = 1 */ - &hf_sbc_ss_demodulator_reserved1, - { - "Reserved", "wmx.sbc.ss_demodulator.reserved1", - FT_UINT16, BASE_HEX, NULL, 0xFFFF, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_stc, - { - "STC", "wmx.sbc.ss_demodulator.stc", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL - } - }, - { - &hf_sbc_ss_demodulator_stc_2, - { - "STC", "wmx.sbc.ss_demodulator.stc", - FT_BOOLEAN, 16, TFS(&tfs_supported), 0x8, NULL, HFILL - } - }, - /* 11.8.3.4 - 11.8.3.6 are not supported for now */ - { /* 11.8.3.7.1 */ - &hf_sbc_ss_fft_sizes, - { - "OFDMA SS FFT Sizes", "wmx.sbc.ss_fft_sizes", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_ss_fft_128, - { - "FFT-128", "wmx.sbc.ss_fft_sizes.128", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL - } - }, - { - &hf_sbc_ss_fft_256, - { - "FFT-256", "wmx.sbc.ss_fft_sizes.256", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL - } - }, - { - &hf_sbc_ss_fft_512, - { - "FFT-512", "wmx.sbc.ss_fft_sizes.512", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL - } - }, - { - &hf_sbc_ss_fft_1024, - { - "FFT-1024", "wmx.sbc.ss_fft_sizes.1024", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL - } - }, - { - &hf_sbc_ss_fft_2048, - { - "FFT-2048", "wmx.sbc.ss_fft_sizes.2048", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL - } - }, - { - &hf_sbc_ss_fft_rsvd1, - { - "Reserved", "wmx.sbc_ss_fft_sizes_rsvd1", - FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL - } - }, - { - &hf_sbc_ss_fft_rsvd2, - { - "Reserved", "wmx.sbc.ss_fft_sizes.rsvd2", - FT_UINT8, BASE_HEX, NULL, 0xE0, NULL, HFILL - } - }, - { - &hf_sbc_ofdm_ss_minimum_num_of_frames, - { - "SS minimum number of frames", "wmx.sbc.ss_minimum_num_of_frames", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_ss_mimo_uplink_support_rsvd, - { - "Reserved", "wmx.sbc.ss_mimo_ul_support.rsvd", - FT_UINT8, BASE_HEX, NULL, 0xF8, NULL, HFILL - } - }, - { /* 11.8.3.7.3 - type 152 */ - &hf_sbc_ss_modulator, - { - "OFDMA SS Modulator", "wmx.sbc.ss_modulator", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_ss_modulator_64qam, - { - "64-QAM", "wmx.sbc.ss_modulator.64qam", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL - } - }, - { - &hf_sbc_ss_modulator_btc, - { - "BTC", "wmx.sbc.ss_modulator.btc", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL - } - }, - { - &hf_sbc_ss_modulator_cc_ir, - { - "CC_IR", "wmx.sbc.ss_modulator.cc_ir", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x40, NULL, HFILL - } - }, - { - &hf_sbc_ss_modulator_ctc, - { - "CTC", "wmx.sbc.ss_modulator.ctc", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL - } - }, - { - &hf_sbc_ss_modulator_ctc_ir, - { - "CTC_IR", "wmx.sbc.ss_modulator.ctc_ir", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x20, NULL, HFILL - } - }, - { - &hf_sbc_ss_modulator_harq_chase, - { - "HARQ Chase", "wmx.sbc.ss_modulator.harq_chase", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL - } - }, - { - &hf_sbc_ss_modulator_ldpc, - { - "LDPC", "wmx.sbc.ss_modulator.ldpc", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x80, NULL, HFILL - } - }, - { - &hf_sbc_ss_modulator_stc, - { - "STC", "wmx.sbc.ss_modulator.stc", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL - } - }, - { /* 11.8.3.7.4 */ - &hf_sbc_ss_permutation_support, - { - "OFMDA SS Permutation Support", "wmx.sbc.ss_permutation_support", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_ss_amc_1x6, - { - "AMC 1x6", "wmx.sbc.ss_permutation_support.amc_1x6", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL - } - }, - { - &hf_sbc_ss_amc_2x3, - { - "AMC 2x3", "wmx.sbc.ss_permutation_support.amc_2x3", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL - } - }, - { - &hf_sbc_ss_amc_3x2, - { - "AMC 3x2", "wmx.sbc.ss_permutation_support.amc_3x2", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL - } - }, - { - &hf_sbc_ss_amc_with_harq_map, - { - "AMC Support With H-ARQ Map", "wmx.sbc.ss_permutation_support.amc_support_harq_map", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x20, NULL, HFILL - } - }, - { - &hf_sbc_ss_optimal_fusc, - { - "Optional FUSC", "wmx.sbc.ss_permutation_support.optimal_fusc", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL - } - }, - { - &hf_sbc_ss_optimal_pusc, - { - "Optional PUSC", "wmx.sbc.ss_permutation_support.optimal_pusc", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL - } - }, - { - &hf_sbc_ss_tusc1_support, - { - "TUSC1", "wmx.sbc.ss_permutation_support.tusc1_support", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x40, NULL, HFILL - } - }, - { - &hf_sbc_ss_tusc2_support, - { - "TUSC2", "wmx.sbc.ss_permutation_support.tusc2_support", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x80, NULL, HFILL - } - }, - { - &hf_sbc_ssrtg, - { - "SSRTG", "wmx.sbc.ssrtg", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_ssttg, - { - "SSTTG", "wmx.sbc.ssttg", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_ss_support_2_concurrent_cqi_channels, - { - "Support for 2 Concurrent CQI Channels", "wmx.sbc.support_2_concurrent_cqi_channels", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x40, NULL, HFILL - } - }, - { /* 11.8.3.1 */ - &hf_sbc_transition_gaps, - { - "Subscriber Transition Gaps", "wmx.sbc.transition_gaps", - FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL - } - }, - { /* 11.8.3.7.13 */ - &hf_sbc_tlv_t_173_ul_ctl_channel_support, - { - "Uplink Control Channel Support", "wmx.sbc.ul_ctl_channel_support", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_173_3_bit_mimo_fast_feedback, - { - "3-bit MIMO Fast-feedback", "wmx.sbc.ul_ctl_channel_support.3bit_mimo_fast_feedback", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_173_diuc_cqi_fast_feedback, - { - "DIUC-CQI Fast-feedback", "wmx.sbc.ul_ctl_channel_support.diuc_cqi_fast_feedback", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x80, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_173_enhanced_fast_feedback, - { - "Enhanced Fast_feedback", "wmx.sbc.ul_ctl_channel_support.enhanced_fast_feedback", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_173_measurement_report, - { - "A Measurement Report Shall Be Performed On The Last DL Burst", "wmx.sbc.ul_ctl_channel_support.measurement_report", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x20, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_173_primary_secondary_fast_feedback, - { - "Primary/Secondary FAST_FEEDBACK", "wmx.sbc.ul_ctl_channel_support.primary_secondary_fast_feedback", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x40, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_173_reserved, - { - "Reserved", "wmx.sbc.ul_ctl_channel_support.reserved", - FT_UINT8, BASE_HEX, NULL, 0x8, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_173_uep_fast_feedback, - { - "UEP Fast-feedback", "wmx.sbc.ul_ctl_channel_support.uep_fast_feedback", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL - } - }, - { - &hf_sbc_tlv_t_173_ul_ack, - { - "UL ACK", "wmx.sbc.ul_ctl_channel_support.ul_ack", - FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL - } - }, - { - &hf_sbc_req_message_type, - { - "MAC Management Message Type", "wmx.macmgtmsgtype.sbc_req", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { &hf_sbc_rsp_message_type, - { - "MAC Management Message Type", "wmx.macmgtmsgtype.sbc_rsp", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_sbc_unknown_type, - { - "Unknown SBC type", "wmx.sbc.unknown_tlv_type", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - } - }; - - if (proto_mac_mgmt_msg_sbc_decoder == -1) - { - proto_mac_mgmt_msg_sbc_decoder = proto_register_protocol ( - "WiMax SBC-REQ/RSP Messages", /* name */ - "WiMax SBC-REQ/RSP (sbc)", /* short name */ - "wmx.sbc" /* abbrev */ - ); - - proto_register_field_array(proto_mac_mgmt_msg_sbc_decoder, hf_sbc, array_length(hf_sbc)); - proto_register_subtree_array(ett_sbc, array_length(ett_sbc)); - } -} - -/* Wimax Mac SBC-REQ Message Dissector */ -void dissect_mac_mgmt_msg_sbc_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ - guint offset = 0; - guint tvb_len, payload_type, value; - gint tlv_type, tlv_len, tlv_value_offset; - guint num_dl_harq_chans; - proto_item *sbc_item = NULL; - proto_tree *sbc_tree = NULL; - proto_item *tlv_item = NULL; - proto_tree *tlv_tree = NULL; - proto_item *ti = NULL; - tlv_info_t tlv_info; - gfloat power_bpsk; - gfloat power_qpsk; - gfloat power_qam16; - gfloat power_qam64; - gfloat current_power; - - /* Ensure the right payload type */ - payload_type = tvb_get_guint8(tvb, offset); - if (payload_type != MAC_MGMT_MSG_SBC_REQ) - { - return; - } - - if (tree) - { /* we are being asked for details */ - /* Get the tvb reported length */ - tvb_len = tvb_reported_length(tvb); - /* display MAC payload type SBC-REQ */ - sbc_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_sbc_decoder, tvb, offset, tvb_len, "SS Basic Capability Request (SBC-REQ) (%u bytes)", tvb_len); - /* add MAC SBC subtree */ - sbc_tree = proto_item_add_subtree(sbc_item, ett_mac_mgmt_msg_sbc_decoder); - /* Decode and display the SS Basic Capability Request (SBC-REQ) */ - /* display the Message Type */ - proto_tree_add_item(sbc_tree, hf_sbc_req_message_type, tvb, offset, 1, FALSE); - /* set the offset for the TLV Encoded info */ - offset++; - /* process the SBC TLVs */ - while(offset < tvb_len) - { - /* get the TLV information */ - init_tlv_info(&tlv_info, tvb, offset); - /* get the TLV type */ - tlv_type = get_tlv_type(&tlv_info); - /* get the TLV length */ - tlv_len = get_tlv_length(&tlv_info); - if (tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1) - { /* invalid tlv info */ - if (check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "SBC-REQ TLV error"); - } - proto_tree_add_item(sbc_tree, hf_sbc_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE); - break; - } - if (tlv_type == 0) - { /* invalid tlv type */ - if (check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid SBC TLV type"); - } - proto_tree_add_item(sbc_tree, hf_sbc_unknown_type, tvb, offset, 1, FALSE); - offset++; - continue; - } - /* get the TLV value offset */ - tlv_value_offset = get_tlv_value_offset(&tlv_info); -#ifdef DEBUG /* for debug only */ - proto_tree_add_protocol_format(sbc_tree, proto_mac_mgmt_msg_sbc_decoder, tvb, offset, (tlv_len + tlv_value_offset), "SBC-REQ Type: %u (%u bytes, offset=%u, tlv_len=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tlv_len, tvb_len); -#endif - /* update the offset for the TLV value */ - offset += tlv_value_offset; - /* process SBC TLV Encoded information */ - switch (tlv_type) + /* get the TLV value offset */ + tlv_value_offset = get_tlv_value_offset(&tlv_info); +#ifdef DEBUG /* for debug only */ + proto_tree_add_protocol_format(sbc_tree, proto_mac_mgmt_msg_sbc_decoder, tvb, offset, (tlv_len + tlv_value_offset), "SBC-REQ Type: %u (%u bytes, offset=%u, tlv_len=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tlv_len, tvb_len); +#endif + /* update the offset for the TLV value */ + offset += tlv_value_offset; + /* process SBC TLV Encoded information */ + switch (tlv_type) { case SBC_BW_ALLOC_SUPPORT: /* add TLV subtree */ @@ -3268,7 +1605,1661 @@ void dissect_mac_mgmt_msg_sbc_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, pro proto_tree_add_item(tlv_tree, hf_sbc_unknown_type, tvb, offset, tlv_len, FALSE); break; } - offset += tlv_len; - } /* end of TLV process while loop */ - } + offset += tlv_len; + } /* end of TLV process while loop */ + } +} + +/* Register Wimax Mac SBC-REQ/RSP Messages Dissectors */ +void proto_register_mac_mgmt_msg_sbc(void) +{ + /* SBC display */ + static hf_register_info hf_sbc[] = + { + { /* 11.8.8 */ + &hf_sbc_tlv_t_167_association_type_support, + { + "Association Type Support", "wmx.sbc.association_type_support", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_167_association_type_support_bit0, + { + "Scanning Without Association: association not supported", "wmx.sbc.association_type_support.bit0", + FT_BOOLEAN, 8, TFS(&tfs_yes_no_sbc), 0x1, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_167_association_type_support_bit1, + { + "Association Level 0: scanning or association without coordination", "wmx.sbc.association_type_support.bit1", + FT_BOOLEAN, 8, TFS(&tfs_yes_no_sbc), 0x2, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_167_association_type_support_bit2, + { + "Association Level 1: association with coordination", "wmx.sbc.association_type_support.bit2", + FT_BOOLEAN, 8, TFS(&tfs_yes_no_sbc), 0x4, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_167_association_type_support_bit3, + { + "Association Level 2: network assisted association", "wmx.sbc.association_type_support.bit3", + FT_BOOLEAN, 8, TFS(&tfs_yes_no_sbc), 0x8, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_167_association_type_support_bit4, + { + "Desired Association Support", "wmx.sbc.association_type_support.bit4", + FT_BOOLEAN, 8, TFS(&tfs_yes_no_sbc), 0x10, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_167_association_type_support_reserved, + { + "Reserved", "wmx.sbc.association_type_support.reserved", + FT_UINT8, BASE_HEX, NULL, 0xE0, NULL, HFILL + } + }, + { /* 11.7.8.7 */ + &hf_sbc_auth_policy, + { + "Authorization Policy Support", "wmx.sbc.auth_policy", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_privacy_802_16, + { + "IEEE 802.16 Privacy", "wmx.sbc.auth_policy.802_16", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL + } + }, + { + &hf_sbc_privacy_rsvd, + { + "Reserved", "wmx.sbc.auth_policy.rsvd", + FT_UINT8, BASE_HEX, NULL, 0xFE, NULL, HFILL + } + }, + { /* 11.8.1 */ + &hf_sbc_bw_alloc_support, + { + "Bandwidth Allocation Support", "wmx.sbc.bw_alloc_support", + FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_sbc_bw_alloc_support_duplex, + { + "Duplex", "wmx.sbc.bw_alloc_support.duplex", + FT_BOOLEAN, 8, TFS(&tfs_sbc_bw_alloc_support_duplex), 0x2, NULL, HFILL + } + }, + { + &hf_sbc_bw_alloc_support_rsvd0, + { + "Reserved", "wmx.sbc.bw_alloc_support.rsvd0", + FT_UINT8, BASE_HEX, NULL, 0x1, NULL, HFILL + } + }, + { + &hf_sbc_bw_alloc_support_rsvd1, + { + "Reserved", "wmx.sbc.bw_alloc_support.rsvd1", + FT_UINT8, BASE_HEX, NULL, 0xFC, NULL, HFILL + } + }, + { + &hf_sbc_curr_transmit_power, + { + "Current transmitted power", "wmx.sbc.curr_transmit_power", + FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_sbc_ss_effective_cinr_measurement_preamble, + { + "Effective CINR Measurement For A Permutation Zone From Preamble", "wmx.sbc.effective_cinr_measure_permutation_zone_preamble", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL + } + }, + { + &hf_sbc_ss_effective_cinr_measurement_permutation_zone_from_pilot_subcarriers, + { + "Effective CINR Measurement For A Permutation Zone From Pilot Subcarriers", "wmx.sbc.effective_cinr_measure_permutation_zone.pilot_subcarriers", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL + } + }, + { + &hf_sbc_ss_effective_cinr_measurement_permutation_zone_from_data_subcarriers, + { + "Effective CINR Measurement For A Permutation Zone From Data Subcarriers", "wmx.sbc.effective_cinr_measure_permutation_zone.data_subcarriers", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x20, NULL, HFILL + } + }, + { /* 11.8.6 */ + &hf_sbc_tlv_t_27_extension_capability, + { + "Extension Capability", "wmx.sbc.extension_capability", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_27_extension_capability_bit0, + { + "Supported Extended Subheader Format", "wmx.sbc.extension_capability.bit0", + FT_BOOLEAN, 8, TFS(&tfs_yes_no_sbc), 0x1, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_27_extension_capability_reserved, + { + "Reserved", "wmx.sbc.extension_capability.reserved", + FT_UINT8, BASE_HEX, NULL, 0xFE, NULL, HFILL + } + }, + { + &hf_sbc_ss_frequency_selectivity_characterization_report, + { + "Frequency Selectivity Characterization Report", "wmx.sbc.frequency_selectivity_characterization_report", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x80, NULL, HFILL + } + }, + { /* 11.8.3.7.19.2 */ + &hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability, + { + "HARQ Chase Combining And CC-IR Buffer Capability", "wmx.sbc.harq_chase_combining_and_cc_ir_buffer_capability", + FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_aggregation_flag_dl, + { + "Aggregation Flag For DL", "wmx.sbc.harq_chase_combining_and_cc_ir_buffer_capability.aggregation_flag_dl", + FT_UINT16, BASE_HEX, NULL, 0x40, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_aggregation_flag_ul, + { + "Aggregation Flag for UL", "wmx.sbc.harq_chase_combining_and_cc_ir_buffer_capability.aggregation_flag_ul", + FT_UINT16, BASE_HEX, NULL, 0x4000, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_163_dl_harq_buffering_capability_for_chase_combining, + { + "Downlink HARQ Buffering Capability For Chase Combining (K)", "wmx.sbc.harq_chase_combining_and_cc_ir_buffer_capability.dl_harq_buffering_capability_for_chase_combining", + FT_UINT16, BASE_HEX, NULL, 0x3F, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_reserved1, + { + "Reserved", "wmx.sbc.harq_chase_combining_and_cc_ir_buffer_capability.reserved1", + FT_UINT16, BASE_HEX, NULL, 0x80, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_reserved2, + { + "Reserved", "wmx.sbc.harq_chase_combining_and_cc_ir_buffer_capability.reserved2", + FT_UINT16, BASE_HEX, NULL, 0x8000, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_163_ul_harq_buffering_capability_for_chase_combining, + { + "Uplink HARQ buffering capability for chase combining (K)", "wmx.sbc.harq_chase_combining_and_cc_ir_buffer_capability.ul_harq_buffering_capability_for_chase_combining", + FT_UINT16, BASE_HEX, NULL, 0x3F00, NULL, HFILL + } + }, + { /* 11.8.3.7.19.1 */ + &hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability, + { + "HARQ Incremental Buffer Capability", "wmx.sbc.harq_incremental_redundancy_buffer_capability", + FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_aggregation_flag_for_dl, + { + "Aggregation Flag for DL", "wmx.sbc.harq_incremental_redundancy_buffer_capability.aggregation_flag_for_dl", + FT_UINT16, BASE_HEX, NULL, 0x10, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_aggregation_flag_for_ul, + { + "Aggregation Flag For UL", "wmx.sbc.harq_incremental_redundancy_buffer_capability.aggregation_flag_for_ul", + FT_UINT16, BASE_HEX, NULL, 0x1000, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_NEP, + { + "NEP Value Indicating Downlink HARQ Buffering Capability For Incremental Redundancy CTC", "wmx.sbc.harq_incremental_redundancy_buffer_capability.dl_incremental_redundancy_ctc", + FT_UINT16, BASE_HEX, NULL, 0xF, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_reserved1, + { + "Reserved", "wmx.sbc.harq_incremental_redundancy_buffer_capability.reserved", + FT_UINT16, BASE_HEX, NULL, 0xE0, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_reserved2, + { + "Reserved", "wmx.sbc.harq_incremental_redundancy_buffer_capability.reserved2", + FT_UINT16, BASE_HEX, NULL, 0xE000, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_162_ul_harq_incremental_redundancy_buffer_capability_NEP, + { + "NEP Value Indicating Uplink HARQ Buffering Capability For Incremental Redundancy CTC", "wmx.sbc.harq_incremental_redundancy_buffer_capability.ul_incremental_redundancy_ctc", + FT_UINT16,BASE_HEX, NULL, 0xF00, NULL, HFILL + } + }, + { + &hf_sbc_ofdma_aas_harq_map_capability, + { + "H-ARQ MAP Capability", "wmx.sbc.harq_map_capability", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL + } + }, + { /* 11.8.7 */ + &hf_sbc_tlv_t_28_ho_trigger_metric_support, + { + "HO Trigger Metric Support", "wmx.sbc.ho_trigger_metric_support", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_28_ho_trigger_metric_support_bit0, + { + "BS CINR Mean", "wmx.sbc.ho_trigger_metric_support.bit0", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_28_ho_trigger_metric_support_bit1, + { + "BS RSSI Mean", "wmx.sbc.ho_trigger_metric_support.bit1", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_28_ho_trigger_metric_support_bit2, + { + "BS Relative Delay", "wmx.sbc.ho_trigger_metric_support.bit2", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_28_ho_trigger_metric_support_bit3, + { + "BS RTD", "wmx.sbc.ho_trigger_metric_support.bit3", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_28_ho_trigger_metric_support_reserved, + { + "Reserved", "wmx.sbc.ho_trigger_metric_support.reserved", + FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL + } + }, + { + &hf_sbc_invalid_tlv, + { + "Invalid TLV", "wmx.sbc.invalid_tlv", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { /* 11.8.2 */ + &hf_sbc_mac_pdu, + { + "Capabilities For Construction And Transmission Of MAC PDUs", "wmx.sbc.mac_pdu", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_mac_pdu_piggybacked, + { + "Ability To Receive Requests Piggybacked With Data", "wmx.sbc.mac_pdu.bit0", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL + } + }, + { + &hf_sbc_mac_pdu_fsn, + { + "Ability To Use 3-bit FSN Values Used When Forming MAC PDUs On Non-ARQ Connections", "wmx.sbc.mac_pdu.bit1", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL + } + }, + { /* 11.8.3.7.15 */ + &hf_sbc_tlv_t_175_max_num_bst_per_frm_capability_harq, + { + "Maximum Number Of Burst Per Frame Capability In HARQ", "wmx.sbc.max_num_bst_per_frm_capability_harq", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_175_max_num_dl_harq_bst_per_harq_per_frm, + { + "Maximum Numbers Of DL HARQ Bursts Per HARQ Enabled Of MS Per Frame (default(0)=1)", "wmx.sbc.max_num_bst_per_frm_capability_harq.max_num_dl_harq_bst_per_harq_per_frm", + FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_175_max_num_ul_harq_bst, + { + "Maximum Number Of UL HARQ Burst Per HARQ Enabled MS Per Frame (default(0)=1)", "wmx.sbc.max_num_bst_per_frm_capability_harq.max_num_ul_harq_bst", + FT_UINT8, BASE_DEC, NULL, 0x7, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_175_max_num_ul_harq_per_frm_include_one_non_harq_bst, + { + "Whether The Maximum Number Of UL HARQ Bursts Per Frame (i.e. Bits# 2-0) Includes The One Non-HARQ Burst", "wmx.sbc.max_num_bst_per_frm_capability_harq.max_num_ul_harq_per_frm_include_one_non_harq_bst", + FT_BOOLEAN, 8, TFS(&tfs_yes_no_sbc), 0x8, NULL, HFILL + } + }, + { /* 11.7.8.8 */ + &hf_sbc_max_security_associations, + { + "Maximum Number Of Security Association Supported By The SS", "wmx.sbc.max_security_associations", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { /* 11.8.3.7.2 - type 161 */ + &hf_sbc_number_dl_arq_ack_channel, + { + "The Number Of DL HARQ ACK Channel", "wmx.sbc.number_dl_arq_ack_channel", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { /* 11.8.3.7.3 - type 153 */ + &hf_sbc_number_ul_arq_ack_channel, + { + "The Number Of UL HARQ ACK Channel", "wmx.sbc.number_ul_arq_ack_channel", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { /* 11.8.3.7.8 */ + &hf_sbc_ofdma_aas_capabilities, + { + "OFDMA AAS Capability", "wmx.sbc.ofdma_aas_capability", + FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_ss_ofdma_aas_capabilities_rsvd, + { + "Reserved", "wmx.sbc.ofdma_aas_capabilities.rsvd", + FT_UINT16, BASE_HEX, NULL, 0xFFE0, NULL, HFILL + } + }, + { + &hf_sbc_ss_ofdma_aas_diversity_map_scan, + { + "AAS Diversity Map Scan (AAS DLFP)", "wmx.sbc.ofdma_aas_diversity_map_scan", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x2, NULL, HFILL + } + }, + { + &hf_sbc_ss_ofdma_aas_fbck_rsp_support, + { + "AAS-FBCK-RSP Support", "wmx.sbc.ofdma_aas_fbck_rsp_support", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x4, NULL, HFILL + } + }, + { + &hf_sbc_ss_ofdma_aas_zone, + { + "AAS Zone", "wmx.sbc.ofdma_aas_zone", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x1, NULL, HFILL + } + }, + { + &hf_sbc_ss_ofdma_downlink_aas_preamble, + { + "Downlink AAS Preamble", "wmx.sbc.ofdma_downlink_aas_preamble", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x8, NULL, HFILL + } + }, + { /* 11.8.3.7.5 - 3 bytes */ + &hf_sbc_tlv_t_176, + { + "OFDMA MS Demodulator For MIMO Support In DL", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl", + FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported), 0x0, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_176_bit0, + { + "2-antenna STC Matrix A", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit0", + FT_BOOLEAN, 24, TFS(&tfs_supported), 0x1, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_176_bit1, + { + "2-antenna STC Matrix B, vertical coding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit1", + FT_BOOLEAN, 24, TFS(&tfs_supported), 0x2, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_176_bit2, + { + "Four Receive Antennas", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit2", + FT_BOOLEAN, 24, TFS(&tfs_supported), 0x4, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_176_bit2_cor2, + { + "2-antenna STC matrix B, horizontal coding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit2", + FT_BOOLEAN, 24, TFS(&tfs_supported), 0x4, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_176_bit3, + { + "4-antenna STC Matrix A", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit3", + FT_BOOLEAN, 24, TFS(&tfs_supported), 0x8, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_176_bit4, + { + "4-antenna STC Matrix B, vertical coding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit4", + FT_BOOLEAN, 24, TFS(&tfs_supported), 0x10, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_176_bit5, + { + "4-antenna STC Matrix B, horizontal coding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit5", + FT_BOOLEAN, 24, TFS(&tfs_supported), 0x20, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_176_bit6, + { + "4-antenna STC Matrix C, vertical coding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit6", + FT_BOOLEAN, 24, TFS(&tfs_supported), 0x40, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_176_bit7, + { + "4-antenna STC Matrix C, horizontal coding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit7", + FT_BOOLEAN, 24, TFS(&tfs_supported), 0x80, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_176_bit8, + { + "3-antenna STC Matrix A", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit8", + FT_BOOLEAN, 24, TFS(&tfs_supported), 0x100, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_176_bit9, + { + "3-antenna STC Matrix B", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit9", + FT_BOOLEAN, 24, TFS(&tfs_supported), 0x200, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_176_bit10, + { + "3-antenna STC Matrix C, vertical coding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit10", + FT_BOOLEAN, 24, TFS(&tfs_supported), 0x400, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_176_bit11, + { + "3-antenna STC Matrix C, horizontal coding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit11", + FT_BOOLEAN, 24, TFS(&tfs_supported), 0x800, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_176_bit12, + { + "Capable Of Calculating Precoding Weight", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit12", + FT_BOOLEAN, 24, TFS(&tfs_supported), 0x1000, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_176_bit13, + { + "Capable Of Adaptive Rate Control", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit13", + FT_BOOLEAN, 24, TFS(&tfs_supported), 0x2000, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_176_bit14, + { + "Capable Of Calculating Channel Matrix", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit14", + FT_BOOLEAN, 24, TFS(&tfs_supported), 0x4000, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_176_bit15, + { + "Capable Of Antenna Grouping", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit15", + FT_BOOLEAN, 24, TFS(&tfs_supported), 0x8000, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_176_bit16, + { + "Capable Of Antenna Selection", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit16", + FT_BOOLEAN, 24, TFS(&tfs_supported), 0x10000, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_176_bit17, + { + "Capable Of Codebook Based Precoding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit17", + FT_BOOLEAN, 24, TFS(&tfs_supported), 0x20000, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_176_bit18, + { + "Capable Of Long-term Precoding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit18", + FT_BOOLEAN, 24, TFS(&tfs_supported), 0x40000, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_176_bit19, + { + "Capable Of MIMO Midamble", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit19", + FT_BOOLEAN, 24, TFS(&tfs_supported), 0x80000, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_176_reserved, + { + "Reserved", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.reserved", + FT_UINT24, BASE_HEX, NULL, 0xF00000, NULL, HFILL + } + }, + { /* 11.8.3.7.18 */ + &hf_sbc_tlv_t_179_ofdma_multiple_dl_burst_profile_support, + { + "OFDMA Multiple Downlink Burst Profile Capability", "wmx.sbc.ofdma_multiple_dl_burst_profile_support", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_179_dl_bst_profile_for_multiple_fec, + { + "Downlink burst profile for multiple FEC types", "wmx.sbc.ofdma_multiple_dl_burst_profile_support.dl_bst_profile_for_multiple_fec", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_179_reserved, + { + "Reserved", "wmx.sbc.ofdma_multiple_dl_burst_profile_support.reserved", + FT_UINT8, BASE_HEX, NULL, 0xFC, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_179_ul_bst_profile_for_multiple_fec, + { + "Uplink burst profile for multiple FEC types", "wmx.sbc.ofdma_multiple_dl_burst_profile_support.ul_burst_profile_for_multiple_fec_types", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL + } + }, + { /* 11.8.3.7.9 */ + &hf_sbc_ss_cinr_measure_capability, + { + "OFDMA SS CINR Measurement Capability", "wmx.sbc.ofdma_ss_cinr_measure_capability", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { /* 11.8.3.7.6 */ + &hf_sbc_ss_mimo_uplink_support, + { + "OFDMA SS MIMO uplink support", "wmx.sbc.ofdma_ss_mimo_uplink_support", + FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL + } + }, + { + &hf_sbc_ss_mimo_uplink_support_2_ann_sttd, + { + "2-antenna STTD", "wmx.sbc.ofdma_ss_mimo_uplink_support.2_antenna_sttd", + FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL + } + }, + { + &hf_sbc_ss_mimo_uplink_support_2_ann_sm_vertical, + { + "2-antenna SM with vertical coding", "wmx.sbc.ofdma_ss_mimo_uplink_support.2_antenna_sm_with_vertical_coding", + FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL + } + }, + { + &hf_sbc_ss_mimo_uplink_support_1_ann_coop_sm, + { + "Single-antenna cooperative SM", "wmx.sbc.ofdma_ss_mimo_uplink_support.single_antenna_coop_sm", + FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL + } + }, + { + &hf_sbc_ss_ofdma_uplink_aas_preamble, + { + "Uplink AAS Preamble", "wmx.sbc.ofdma_uplink_aas_preamble", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x10, NULL, HFILL + } + }, + { + &hf_sbc_ss_phy_cinr_measurement_preamble, + { + "Physical CINR Measurement From The Preamble", "wmx.sbc.phy_cinr_measure_preamble", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL + } + }, + { + &hf_sbc_ss_phy_cinr_measurement_permutation_zone_from_pilot_subcarriers, + { + "Physical CINR Measurement For A Permutation Zone From Pilot Subcarriers", "wmx.sbc.phy_cinr_measure_permutation_zone.pilot_subcarriers", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL + } + }, + { + &hf_sbc_ss_phy_cinr_measurement_permutation_zone_from_data_subcarriers, + { + "Physical CINR Measurement For A Permutation Zone From Data Subcarriers", "wmx.sbc.phy_cinr_measure_permutation_zone.data_subcarriers", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL + } + }, + { /* 11.7.8.6 */ + &hf_sbc_pkm_flow_control, + { + "PKM Flow Control", "wmx.sbc.pkm_flow_control", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { /* 11.8.5 */ + &hf_sbc_power_save_class_types_capability, + { + "Power Save Class Types Capability", "wmx.sbc.power_save_class_types_capability", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_power_save_class_types_capability_bit0, + { + "Power Save Class Type I", "wmx.sbc.power_save_class_types_capability.bit0", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL + } + }, + { + &hf_sbc_power_save_class_types_capability_bit1, + { + "Power Save Class Type II", "wmx.sbc.power_save_class_types_capability.bit1", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL + } + }, + { + &hf_sbc_power_save_class_types_capability_bit2, + { + "Power Save Class Type III", "wmx.sbc.power_save_class_types_capability.bit2", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL + } + }, + { + &hf_sbc_power_save_class_types_capability_bits34, + { + "Number Of Power Save Class Type Instances Supported From Class Type I and II", "wmx.sbc.power_save_class_types_capability.bits34", + FT_UINT8, BASE_DEC, NULL, 0x18, NULL, HFILL + } + }, + { + &hf_sbc_power_save_class_types_capability_bits567, + { + "Number Of Power Save Class Type Instances Supported From Class Type III", "wmx.sbc.power_save_class_types_capability.bits567", + FT_UINT8, BASE_DEC, NULL, 0xE0, NULL, HFILL + } + }, + { /* 11.8.3.7.7 */ + &hf_sbc_ofdma_aas_private_chain_enable, + { + "Private Map Chain Enable", "wmx.sbc.private_chain_enable", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL + } + }, + { + &hf_sbc_ofdma_aas_private_map_concurrency, + { + "Private Map Chain Concurrency", "wmx.sbc.private_map_concurrency", + FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL + } + }, + { + &hf_sbc_ofdma_aas_private_map_dl_frame_offset, + { + "Private Map DL Frame Offset", "wmx.sbc.private_map_dl_frame_offset", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL + } + }, + { + &hf_sbc_ofdma_aas_private_map_support, + { + "Private Map Support", "wmx.sbc.private_map_support", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL + } + }, + { + &hf_sbc_ss_ofdma_aas_private, + { + "OFDMA AAS Private Map Support", "wmx.sbc.private_map_support.ofdma_aas", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_ofdma_aas_reduced_private_map_support, + { + "Reduced Private Map Support", "wmx.sbc.private_map_support.reduced", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL + } + }, + { + &hf_sbc_ofdma_aas_private_ul_frame_offset, + { + "Private Map UL Frame Offset", "wmx.sbc.private_ul_frame_offset", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x20, NULL, HFILL + } + }, + { + &hf_sbc_mac_pdu_rsvd, + { + "Reserved", "wmx.sbc.mac_pdu.rsvd", + FT_UINT8, BASE_HEX, NULL, 0xFC, NULL, HFILL + } + }, + { /* 11.8.3.2 */ + &hf_sbc_max_transmit_power, + { + "Maximum Transmit Power", "wmx.sbc.max_transmit_power", + FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL + } + }, + { /* 11.8.3.7.5 - 2 bytes */ + &hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_a, + { + "2-antenna STC Matrix A", "wmx.sbc.ss_demodulator.mimo.2.antenna.stc.matrix.a", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x1, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_b_horizontal, + { + "2-antenna STC Matrix B, horizontal coding", "wmx.sbc.ss_demodulator.mimo.2.antenna.stc.matrix.b.horizontal", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x4, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_b_vertical, + { + "2-antenna STC Matrix B, vertical coding", "wmx.sbc.ss_demodulator.mimo.2.antenna.stc.matrix.b.vertical", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x2, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_a, + { + "4-antenna STC Matrix A", "wmx.sbc.ss_demodulator.mimo.4.antenna.stc.matrix.a", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x8, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_b_horizontal, + { + "4-antenna STC Matrix B, horizontal coding", "wmx.sbc.ss_demodulator.mimo.4.antenna.stc.matrix.b.horizontal", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x20, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_b_vertical, + { + "4-antenna STC Matrix B, vertical coding", "wmx.sbc.ss_demodulator.mimo.4.antenna.stc.matrix.b.vertical", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x10, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_c_horizontal, + { + "4-antenna STC Matrix C, horizontal coding", "wmx.sbc.ss_demodulator.mimo.4.antenna.stc.matrix.c.horizontal", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x80, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_c_vertical, + { + "4-antenna STC Matrix C, vertical coding", "wmx.sbc.ss_demodulator.mimo.4.antenna.stc.matrix.c.vertical", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x40, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_mimo_rsvd, + { + "Reserved", "wmx.sbc.ss_demodulator.mimo.reserved", + FT_UINT16, BASE_HEX, NULL, 0xFF00, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_mimo_support, + { + "OFDMA SS Demodulator For MIMO Support", "wmx.sbc.ss_demodulator.mimo.support", + FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + /*11.8.3.7.11 ??? */ + { /* 11.8.3.7.12 - 170 */ + &hf_sbc_ofdma_ss_uplink_power_control_support, + { + "OFDMA SS uplink power control support", "wmx.sbc.ofdma_ss_uplink_power_control_support", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_ofdma_ss_uplink_power_control_support_open_loop, + { + "Open loop", "wmx.sbc.ofdma_ss_uplink_power_control_support.open_loop", + FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL + } + }, + { + &hf_sbc_ofdma_ss_uplink_power_control_support_aas_preamble, + { + "AAS preamble", "wmx.sbc.ofdma_ss_uplink_power_control_support.aas_preamble", + FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL + } + }, + { + &hf_sbc_ofdma_ss_uplink_power_control_support_rsvd, + { + "Reserved", "wmx.sbc.ofdma_ss_uplink_power_control_support.rsvd", + FT_UINT8, BASE_HEX, NULL, 0xFC, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_172_dl_region_definition_support, + { + "DL Region Definition Support", "wmx.sbc.ofdma_map_capability.dl_region_definition_support", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL + } + }, + { /* 11.8.3.7.12 - 172 */ + &hf_sbc_tlv_t_172, + { + "Support For Extended HARQ", "wmx.sbc.ofdma_map_capability.extended_harq", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_172_extended_harq_ie_capability, + { + "Extended HARQ IE Capability", "wmx.sbc.ofdma_map_capability.extended_harq_ie_capability", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_172_harq_map_capability, + { + "HARQ MAP Capability", "wmx.sbc.ofdma_map_capability.harq_map_capability", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL + } + }, + { /* 11.8.3.7.12 - 171 */ + &hf_sbc_tlv_t_171_minimum_num_of_frames, + { + "The Minimum Number Of Frames That SS Takes To Switch From The Open Loop Power Control Scheme To The Closed Loop Power Control Scheme Or Vice Versa", "wmx.sbc.ofdma_ss_uplink_power_control_support.minimum_num_of_frames", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_172_reserved, + { + "Reserved", "wmx.sbc.ofdma_map_capability.reserved", + FT_UINT8, BASE_HEX, NULL, 0xE0, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_172_sub_map_capability_first_zone, + { + "Sub MAP Capability For First Zone", "wmx.sbc.ofdma_map_capability.sub_map_capability_first_zone", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_172_sub_map_capability_other_zones, + { + "Sub MAP Capability For Other Zones", "wmx.sbc.ofdma_map_capability.sub_map_capability_other_zones", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL + } + }, + { /* 11.8.3.7.14 */ + &hf_sbc_tlv_t_174_ofdma_ms_csit_capability, + { + "OFDMA MS CSIT Capability", "wmx.sbc.ofdma_ms_csit_capability", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_174_csit_compatibility_type_a, + { + "CSIT Compatibility Type A", "wmx.sbc.ofdma_ms_csit_capability.csit_compatibility_type_a", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x1, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_174_csit_compatibility_type_b, + { + "CSIT Compatibility Type B", "wmx.sbc.ofdma_ms_csit_capability.csit_compatibility_type_b", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x2, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_174_max_num_simultanous_sounding_instructions, + { + "Max Number Of Simultaneous Sounding Instructions", "wmx.sbc.ofdma_ms_csit_capability.max_num_simultaneous_sounding_instructions", + FT_UINT16, BASE_DEC, NULL, 0x03C0, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_174_power_assignment_capability, + { + "Power Assignment Capability", "wmx.sbc.ofdma_ms_csit_capability.power_assignment_capability", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x4, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_174_ss_csit_reserved, + { + "Reserved", "wmx.sbc.ofdma_ms_csit_capability.reserved", + FT_UINT16, BASE_HEX, NULL, 0xF800, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_174_sounding_rsp_time_capability, + { + "Sounding Response Time Capability", "wmx.sbc.ofdma_ms_csit_capability.sounding_response_time_capability", + FT_UINT16, BASE_HEX, VALS(vals_sounding_rsp_time_cap_codings), 0x0038, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_174_ss_csit_type_a_support, + { + "SS Does Not Support P Values Of 9 And 18 When Supporting CSIT Type A", "wmx.sbc.ofdma_ms_csit_capability.type_a_support", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x0400, NULL, HFILL + } + }, + { + /* 11.8.3.7.20 */ + &hf_sbc_tlv_t_204_ofdma_parameters_sets, + { + "OFDMA parameters sets", "wmx.sbc.ofdma_parameters_sets", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_204_ofdma_parameters_sets_phy_set_a, + { + "Support OFDMA PHY parameter set A", "wmx.sbc.ofdma_parameters_sets.phy_set_a", + FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_204_ofdma_parameters_sets_phy_set_b, + { + "Support OFDMA PHY parameter set B", "wmx.sbc.ofdma_parameters_sets.phy_set_b", + FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_204_ofdma_parameters_sets_harq_parameters_set, + { + "HARQ parameters set", "wmx.sbc.ofdma_parameters_sets.harq_parameters_set", + FT_UINT8, BASE_HEX, VALS(vals_sbc_harq_parameters_set), 0x1C, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_204_ofdma_parameters_sets_mac_set_a, + { + "Support OFDMA MAC parameters set A", "wmx.sbc.ofdma_parameters_sets.mac_set_a", + FT_UINT8, BASE_HEX, NULL, 0x20, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_204_ofdma_parameters_sets_mac_set_b, + { + "Support OFDMA MAC parameters set B", "wmx.sbc.ofdma_parameters_sets.mac_set_b", + FT_UINT8, BASE_HEX, NULL, 0x40, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_204_ofdma_parameters_sets_reserved, + { + "Reserved", "wmx.sbc.ofdma_parameters_sets.reserved", + FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL + } + }, + { /* 11.8.3.7.16 */ + &hf_sbc_tlv_t_177_ofdma_ss_modulator_for_mimo_support, + { + "OFDMA SS Modulator For MIMO Support", "wmx.sbc.ofdma_ss_modulator_for_mimo_support", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_177_adaptive_rate_ctl, + { + "Capable Of Adaptive Rate Control", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.capable_adaptive_rate_control", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_177_beamforming, + { + "Capable Of Beamforming", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.capable_beamforming", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_177_single_antenna, + { + "Capable of single antenna transmission", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.capable_single_antenna", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x20, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_177_stc_matrix_b_horizontal, + { + "Capable of 2-antenna STC Matrix B, Horizontal coding", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.stc_matrix_b_horizontal", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_177_two_transmit_antennas, + { + "Two transmit antennas", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.two_transmit_antennas", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_177_capable_of_transmit_diversity, + { + "Capable of transmit diversity", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.capable_of_transmit_diversity", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_177_capable_of_spacial_multiplexing, + { + "Capable of spatial multiplexing", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.capable_of_spatial_multiplexing", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_177_stc_matrix_b_vertical, + { + "Capable of 2-antenna STC Matrix B, Vertical coding", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.stc_matrix_b_vertical", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_177_collaborative_sm_with_one_antenna, + { + "Capable of collaborative SM with one antenna", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.collaborative_sm_with_one_antenna", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x40, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_177_collaborative_sm_with_two_antennas, + { + "Collaborative SM with two antennas", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.collaborative_sm_with_two_antennas", + FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_177_capable_of_two_antenna, + { + "Capable of two antenna", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.capable_of_two_antenna", + FT_UINT8, BASE_HEX, NULL, 0x40, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_177_rsvd, + { + "Reserved", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.rsvd", + FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_177_stc_matrix_a, + { + "Capable of 2-antenna STC Matrix A", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.stc_matrix_a", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL + } + }, + { /* 11.8.3.7.17 */ + &hf_sbc_tlv_t_178_sdma_pilot_capability, + { + "SDMA Pilot Capability", "wmx.sbc.sdma_pilot_capability", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_178_reserved, + { + "Reserved", "wmx.sbc.sdma_pilot_capability.reserved", + FT_UINT8, BASE_HEX, NULL, 0xFC, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_178_sdma_pilot_pattern_support_for_amc_zone, + { + "SDMA Pilot Patterns Support For AMC Zone", "wmx.sbc.sdma_pilot_capability.sdma_pilot_pattern_support_for_amc_zone", + FT_UINT8, BASE_HEX, VALS(vals_sbc_sdma_str), 0x03, NULL, HFILL + } + }, + { /* 11.8.3.7.2 - type 151 */ + &hf_sbc_ss_demodulator, + { + "OFDMA SS Demodulator", "wmx.sbc.ss_demodulator", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + /* tlv length = 1 byte */ + { + &hf_sbc_ss_demodulator_64qam, + { + "64-QAM", "wmx.sbc.ss_demodulator.64qam", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_btc, + { + "BTC", "wmx.sbc.ss_demodulator.btc", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_cc_with_optional_interleaver, + { + "CC with Optional Interleaver", "wmx.sbc.ss_demodulator.cc_with_optional_interleaver", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_ctc, + { + "CTC", "wmx.sbc.ss_demodulator.ctc", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL + } + }, + /* tlv length = 2 bytes */ + { + &hf_sbc_ss_demodulator_64qam_2, + { + "64-QAM", "wmx.sbc.ss_demodulator.64qam", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x1, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_btc_2, + { + "BTC", "wmx.sbc.ss_demodulator.btc", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x2, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_cc_with_optional_interleaver_2, + { + "CC with Optional Interleaver", "wmx.sbc.ss_demodulator.cc_with_optional_interleaver", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x10, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_ctc_2, + { + "CTC", "wmx.sbc.ss_demodulator.ctc", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x4, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_dedicated_pilots_2, + { + "Dedicated Pilots", "wmx.sbc.ss_demodulator.dedicated_pilots", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x400, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_harq_cc_ir_2, + { + "HARQ CC_IR", "wmx.sbc.ss_demodulator.harq.cc.ir", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x100, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_harq_chase, + { + "HARQ Chase", "wmx.sbc.ss_demodulator.harq.chase", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x20, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_harq_chase_2, + { + "HARQ Chase", "wmx.sbc.ss_demodulator.harq.chase", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x20, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_harq_ctc_ir, + { + "HARQ CTC_IR", "wmx.sbc.ss_demodulator.harq.ctc.ir", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x40, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_harq_ctc_ir_2, + { + "HARQ CTC_IR", "wmx.sbc.ss_demodulator.harq.ctc.ir", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x40, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_ldpc_2, + { + "LDPC", "wmx.sbc.ss_demodulator.ldpc", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x200, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_reserved, + { + "Reserved", "wmx.sbc.ss_demodulator.reserved1", + FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_reserved_2, + { + "Reserved", "wmx.sbc.ss_demodulator.reserved2", + FT_UINT16, BASE_HEX, NULL, 0x80, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_reserved1_2, + { + "Reserved", "wmx.sbc.ss_demodulator.reserved2", + FT_UINT16, BASE_HEX, NULL, 0x800, NULL, HFILL + } + }, + { /* if the number of DL H-ARQ channels > 7 but tlv length = 1 */ + &hf_sbc_ss_demodulator_reserved1, + { + "Reserved", "wmx.sbc.ss_demodulator.reserved1", + FT_UINT16, BASE_HEX, NULL, 0xFFFF, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_stc, + { + "STC", "wmx.sbc.ss_demodulator.stc", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL + } + }, + { + &hf_sbc_ss_demodulator_stc_2, + { + "STC", "wmx.sbc.ss_demodulator.stc", + FT_BOOLEAN, 16, TFS(&tfs_supported), 0x8, NULL, HFILL + } + }, + /* 11.8.3.4 - 11.8.3.6 are not supported for now */ + { /* 11.8.3.7.1 */ + &hf_sbc_ss_fft_sizes, + { + "OFDMA SS FFT Sizes", "wmx.sbc.ss_fft_sizes", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_ss_fft_128, + { + "FFT-128", "wmx.sbc.ss_fft_sizes.128", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL + } + }, + { + &hf_sbc_ss_fft_256, + { + "FFT-256", "wmx.sbc.ss_fft_sizes.256", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL + } + }, + { + &hf_sbc_ss_fft_512, + { + "FFT-512", "wmx.sbc.ss_fft_sizes.512", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL + } + }, + { + &hf_sbc_ss_fft_1024, + { + "FFT-1024", "wmx.sbc.ss_fft_sizes.1024", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL + } + }, + { + &hf_sbc_ss_fft_2048, + { + "FFT-2048", "wmx.sbc.ss_fft_sizes.2048", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL + } + }, + { + &hf_sbc_ss_fft_rsvd1, + { + "Reserved", "wmx.sbc_ss_fft_sizes_rsvd1", + FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL + } + }, + { + &hf_sbc_ss_fft_rsvd2, + { + "Reserved", "wmx.sbc.ss_fft_sizes.rsvd2", + FT_UINT8, BASE_HEX, NULL, 0xE0, NULL, HFILL + } + }, + { + &hf_sbc_ofdm_ss_minimum_num_of_frames, + { + "SS minimum number of frames", "wmx.sbc.ss_minimum_num_of_frames", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_ss_mimo_uplink_support_rsvd, + { + "Reserved", "wmx.sbc.ss_mimo_ul_support.rsvd", + FT_UINT8, BASE_HEX, NULL, 0xF8, NULL, HFILL + } + }, + { /* 11.8.3.7.3 - type 152 */ + &hf_sbc_ss_modulator, + { + "OFDMA SS Modulator", "wmx.sbc.ss_modulator", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_ss_modulator_64qam, + { + "64-QAM", "wmx.sbc.ss_modulator.64qam", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL + } + }, + { + &hf_sbc_ss_modulator_btc, + { + "BTC", "wmx.sbc.ss_modulator.btc", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL + } + }, + { + &hf_sbc_ss_modulator_cc_ir, + { + "CC_IR", "wmx.sbc.ss_modulator.cc_ir", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x40, NULL, HFILL + } + }, + { + &hf_sbc_ss_modulator_ctc, + { + "CTC", "wmx.sbc.ss_modulator.ctc", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL + } + }, + { + &hf_sbc_ss_modulator_ctc_ir, + { + "CTC_IR", "wmx.sbc.ss_modulator.ctc_ir", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x20, NULL, HFILL + } + }, + { + &hf_sbc_ss_modulator_harq_chase, + { + "HARQ Chase", "wmx.sbc.ss_modulator.harq_chase", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL + } + }, + { + &hf_sbc_ss_modulator_ldpc, + { + "LDPC", "wmx.sbc.ss_modulator.ldpc", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x80, NULL, HFILL + } + }, + { + &hf_sbc_ss_modulator_stc, + { + "STC", "wmx.sbc.ss_modulator.stc", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL + } + }, + { /* 11.8.3.7.4 */ + &hf_sbc_ss_permutation_support, + { + "OFMDA SS Permutation Support", "wmx.sbc.ss_permutation_support", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_ss_amc_1x6, + { + "AMC 1x6", "wmx.sbc.ss_permutation_support.amc_1x6", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL + } + }, + { + &hf_sbc_ss_amc_2x3, + { + "AMC 2x3", "wmx.sbc.ss_permutation_support.amc_2x3", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL + } + }, + { + &hf_sbc_ss_amc_3x2, + { + "AMC 3x2", "wmx.sbc.ss_permutation_support.amc_3x2", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL + } + }, + { + &hf_sbc_ss_amc_with_harq_map, + { + "AMC Support With H-ARQ Map", "wmx.sbc.ss_permutation_support.amc_support_harq_map", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x20, NULL, HFILL + } + }, + { + &hf_sbc_ss_optimal_fusc, + { + "Optional FUSC", "wmx.sbc.ss_permutation_support.optimal_fusc", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL + } + }, + { + &hf_sbc_ss_optimal_pusc, + { + "Optional PUSC", "wmx.sbc.ss_permutation_support.optimal_pusc", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL + } + }, + { + &hf_sbc_ss_tusc1_support, + { + "TUSC1", "wmx.sbc.ss_permutation_support.tusc1_support", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x40, NULL, HFILL + } + }, + { + &hf_sbc_ss_tusc2_support, + { + "TUSC2", "wmx.sbc.ss_permutation_support.tusc2_support", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x80, NULL, HFILL + } + }, + { + &hf_sbc_ssrtg, + { + "SSRTG", "wmx.sbc.ssrtg", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_ssttg, + { + "SSTTG", "wmx.sbc.ssttg", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_ss_support_2_concurrent_cqi_channels, + { + "Support for 2 Concurrent CQI Channels", "wmx.sbc.support_2_concurrent_cqi_channels", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x40, NULL, HFILL + } + }, + { /* 11.8.3.1 */ + &hf_sbc_transition_gaps, + { + "Subscriber Transition Gaps", "wmx.sbc.transition_gaps", + FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL + } + }, + { /* 11.8.3.7.13 */ + &hf_sbc_tlv_t_173_ul_ctl_channel_support, + { + "Uplink Control Channel Support", "wmx.sbc.ul_ctl_channel_support", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_173_3_bit_mimo_fast_feedback, + { + "3-bit MIMO Fast-feedback", "wmx.sbc.ul_ctl_channel_support.3bit_mimo_fast_feedback", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_173_diuc_cqi_fast_feedback, + { + "DIUC-CQI Fast-feedback", "wmx.sbc.ul_ctl_channel_support.diuc_cqi_fast_feedback", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x80, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_173_enhanced_fast_feedback, + { + "Enhanced Fast_feedback", "wmx.sbc.ul_ctl_channel_support.enhanced_fast_feedback", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_173_measurement_report, + { + "A Measurement Report Shall Be Performed On The Last DL Burst", "wmx.sbc.ul_ctl_channel_support.measurement_report", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x20, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_173_primary_secondary_fast_feedback, + { + "Primary/Secondary FAST_FEEDBACK", "wmx.sbc.ul_ctl_channel_support.primary_secondary_fast_feedback", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x40, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_173_reserved, + { + "Reserved", "wmx.sbc.ul_ctl_channel_support.reserved", + FT_UINT8, BASE_HEX, NULL, 0x8, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_173_uep_fast_feedback, + { + "UEP Fast-feedback", "wmx.sbc.ul_ctl_channel_support.uep_fast_feedback", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL + } + }, + { + &hf_sbc_tlv_t_173_ul_ack, + { + "UL ACK", "wmx.sbc.ul_ctl_channel_support.ul_ack", + FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL + } + }, + { + &hf_sbc_req_message_type, + { + "MAC Management Message Type", "wmx.macmgtmsgtype.sbc_req", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { &hf_sbc_rsp_message_type, + { + "MAC Management Message Type", "wmx.macmgtmsgtype.sbc_rsp", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_sbc_unknown_type, + { + "Unknown SBC type", "wmx.sbc.unknown_tlv_type", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + } + }; + + /* Setup protocol subtree array */ + static gint *ett_sbc[] = + { + &ett_mac_mgmt_msg_sbc_decoder, + &ett_sbc_req_tlv_subtree, + &ett_sbc_rsp_tlv_subtree, + }; + + proto_mac_mgmt_msg_sbc_decoder = proto_register_protocol ( + "WiMax SBC-REQ/RSP Messages", /* name */ + "WiMax SBC-REQ/RSP (sbc)", /* short name */ + "wmx.sbc" /* abbrev */ + ); + + proto_register_field_array(proto_mac_mgmt_msg_sbc_decoder, hf_sbc, array_length(hf_sbc)); + proto_register_subtree_array(ett_sbc, array_length(ett_sbc)); } diff --git a/plugins/wimax/msg_ucd.c b/plugins/wimax/msg_ucd.c index 9a7cf745e5..5414936609 100644 --- a/plugins/wimax/msg_ucd.c +++ b/plugins/wimax/msg_ucd.c @@ -46,19 +46,9 @@ extern gboolean include_cor2_changes; guint cqich_id_size; /* Set for CQICH_Alloc_IE */ -/* forward reference */ -void proto_register_mac_mgmt_msg_ucd(void); -void dissect_mac_mgmt_msg_ucd_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - static gint proto_mac_mgmt_msg_ucd_decoder = -1; static gint ett_mac_mgmt_msg_ucd_decoder = -1; -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_mac_mgmt_msg_ucd_decoder, -}; - /* fix fields */ static gint hf_ucd_message_type = -1; static gint hf_ucd_res_timeout = -1; @@ -214,616 +204,156 @@ static const value_string vals_yes_no_str[] = {0, NULL} }; -/* Register Wimax Mac Payload Protocol and Dissector */ -void proto_register_mac_mgmt_msg_ucd(void) + +/* UCD dissector */ +void dissect_mac_mgmt_msg_ucd_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - /* UCD display */ - static hf_register_info hf[] = + guint offset = 0; + guint tvb_len, payload_type, length; + guint ucd_config_change_count; + guint ucd_ranging_backoff_start; + guint ucd_ranging_backoff_end; + guint ucd_request_backoff_start; + guint ucd_request_backoff_end; + gint tlv_type, tlv_len, tlv_offset, tlv_value_offset; + guint ul_burst_uiuc, utemp; + proto_item *ucd_item = NULL; + proto_tree *ucd_tree = NULL; + proto_item *tlv_item = NULL; + proto_tree *tlv_tree = NULL; + proto_tree *sub_tree = NULL; + tlv_info_t tlv_info; + + /* Ensure the right payload type */ + payload_type = tvb_get_guint8(tvb, offset); + if(payload_type != MAC_MGMT_MSG_UCD) { + return; + } + + if(tree) + { /* we are being asked for details */ + /* Get the tvb reported length */ + tvb_len = tvb_reported_length(tvb); + /* display MAC payload type UCD */ + ucd_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_ucd_decoder, tvb, offset, tvb_len, "Uplink Channel Descriptor (UCD) (%u bytes)", tvb_len); + /* add MAC UCD subtree */ + ucd_tree = proto_item_add_subtree(ucd_item, ett_mac_mgmt_msg_ucd_decoder); + /* Decode and display the Uplink Channel Descriptor (UCD) */ + /* display the Message Type */ + proto_tree_add_item(ucd_tree, hf_ucd_message_type, tvb, offset, 1, FALSE); + /* move to next field */ + offset++; + /* get the Configuration Change Count */ + ucd_config_change_count = tvb_get_guint8(tvb, offset); + /* display the Configuration Change Count */ + proto_tree_add_text(ucd_tree, tvb, offset, 1, "Configuration Change Count: %u", ucd_config_change_count); + /* move to next field */ + offset++; + /* get the ranging backoff start */ + ucd_ranging_backoff_start = tvb_get_guint8(tvb, offset); + /* display the ranging backoff start */ + proto_tree_add_text(ucd_tree, tvb, offset, 1, "Ranging Backoff Start: 2^%u = %u", ucd_ranging_backoff_start, (1 << ucd_ranging_backoff_start)); + /* move to next field */ + offset++; + /* get the ranging backoff end */ + ucd_ranging_backoff_end = tvb_get_guint8(tvb, offset); + /* display the ranging backoff end */ + proto_tree_add_text(ucd_tree, tvb, offset, 1, "Ranging Backoff End: 2^%u = %u", ucd_ranging_backoff_end, (1 << ucd_ranging_backoff_end)); + /* move to next field */ + offset++; + /* get the request backoff start */ + ucd_request_backoff_start = tvb_get_guint8(tvb, offset); + /* display the request backoff start */ + proto_tree_add_text(ucd_tree, tvb, offset, 1, "Request Backoff Start: 2^%u = %u", ucd_request_backoff_start, (1 << ucd_request_backoff_start)); + /* move to next field */ + offset++; + /* get the request backoff end */ + ucd_request_backoff_end = tvb_get_guint8(tvb, offset); + /* display the request backoff end */ + proto_tree_add_text(ucd_tree, tvb, offset, 1, "Request Backoff End: 2^%u = %u", ucd_request_backoff_end, (1 << ucd_request_backoff_end)); + /* move to next field */ + offset++; + while(offset < tvb_len) { - &hf_ucd_message_type, - { - "MAC Management Message Type", "wmx.macmgtmsgtype.ucd", - FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_188_allow_aas_beam_select_message, - { - "Allow AAS Beam Select Message", "wmx.ucd.allow_aas_beam_select_message", - FT_INT8, BASE_DEC, VALS(vals_yes_no_str), 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_159_band_amc_allocation_threshold, - { - "Band AMC Allocation Threshold", "wmx.ucd.band_amc.allocation_threshold", - FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_161_band_amc_allocation_timer, - { - "Band AMC Allocation Timer", "wmx.ucd.band_amc.allocation_timer", - FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_160_band_amc_release_threshold, - { - "Band AMC Release Threshold", "wmx.ucd.band_amc.release_threshold", - FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_162_band_amc_release_timer, - { - "Band AMC Release Timer", "wmx.ucd.band_amc.release_timer", - FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_164_band_amc_retry_timer, - { - "Band AMC Retry Timer", "wmx.ucd.band_amc.retry_timer", - FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_163_band_status_report_max_period, - { - "Band Status Report MAC Period", "wmx.ucd.band_status.report_max_period", - FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_152_bandwidth_request_codes, - { - "Bandwidth Request Codes", "wmx.ucd.bandwidth_request", - FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_burst_fec, - { - "FEC Code Type", "wmx.ucd.burst.fec", - FT_UINT8, BASE_HEX, VALS(vals_dcd_burst_fec), 0, NULL, HFILL - } - }, - { - &hf_ucd_burst_ranging_data_ratio, - { - "Ranging Data Ratio", "wmx.ucd.burst.ranging_data_ratio", - FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_ul_burst_reserved, - { - "Reserved", "wmx.ucd.burst.reserved", - FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL - } - }, - { - &hf_ucd_ul_burst_uiuc, - { - "UIUC", "wmx.ucd.burst.uiuc", - FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL + /* get the TLV information */ + init_tlv_info(&tlv_info, tvb, offset); + /* get the TLV type */ + tlv_type = get_tlv_type(&tlv_info); + /* get the TLV length */ + tlv_len = get_tlv_length(&tlv_info); + if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1) + { /* invalid tlv info */ + if(check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "UCD TLV error"); + } + proto_tree_add_item(ucd_tree,hf_ucd_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE); + break; } - }, -#if 0 - { - &hf_ucd_burst_power_boost, - {"Focused Contention Power Boost", "wmx.ucd.burst.power_boost", FT_UINT8, BASE_HEX, NULL, 0, "", HFILL} - }, - { - &hf_ucd_burst_tcs_enable, - {"TCS", "wmx.ucd.burst.tcs", FT_UINT8, BASE_DEC, VALS(vals_dcd_burst_tcs), 0, "", HFILL} - }, + /* get the TLV value offset */ + tlv_value_offset = get_tlv_value_offset(&tlv_info); +#ifdef DEBUG /* for debug only */ + tlv_item = proto_tree_add_protocol_format(ucd_tree, proto_mac_mgmt_msg_ucd_decoder, tvb, offset, (tlv_len + tlv_value_offset), "UCD Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, tlv_len, offset, tvb_len); #endif - { - &hf_ucd_bw_req_size, + /* update the offset */ + offset += tlv_value_offset; + /* process UCD TLV Encoded information */ + if (include_cor2_changes) { - "Bandwidth Request Opportunity Size", "wmx.ucd.bw_req_size", - FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL + switch (tlv_type) + { + case UCD_TLV_T_203_UL_PUSC_SUBCHANNEL_ROTATION: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, hf_ucd_tlv_t_203_ul_pusc_subchannel_rotation, tvb, offset, tlv_len, FALSE); + tlv_item = proto_tree_add_item(tlv_tree, hf_ucd_tlv_t_203_ul_pusc_subchannel_rotation, tvb, offset, tlv_len, FALSE); + break; + } + case UCD_TLV_T_205_RELATIVE_POWER_OFFSET_UL_HARQ_BURST: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, hf_ucd_tlv_t_205_relative_power_offset_ul_harq_burst, tvb, offset, tlv_len, FALSE); + tlv_item = proto_tree_add_item(tlv_tree, hf_ucd_tlv_t_205_relative_power_offset_ul_harq_burst, tvb, offset, tlv_len, FALSE); + break; + } + case UCD_TLV_T_206_RELATIVE_POWER_OFFSET_UL_BURST_CONTAINING_MAC_MGMT_MSG: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, hf_ucd_tlv_t_206_relative_power_offset_ul_burst_containing_mac_mgmt_msg, tvb, offset, tlv_len, FALSE); + tlv_item = proto_tree_add_item(tlv_tree, hf_ucd_tlv_t_206_relative_power_offset_ul_burst_containing_mac_mgmt_msg, tvb, offset, tlv_len, FALSE); + break; + } + case UCD_TLV_T_207_UL_INITIAL_TRANSMIT_TIMING: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, hf_ucd_tlv_t_207_ul_initial_transmit_timing, tvb, offset, tlv_len, FALSE); + tlv_item = proto_tree_add_item(tlv_tree, hf_ucd_tlv_t_207_ul_initial_transmit_timing, tvb, offset, tlv_len, FALSE); + break; + } + case UCD_TLV_T_210_FAST_FEEDBACK_REGION: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, hf_ucd_tlv_t_210_fast_feedback_region, tvb, offset, tlv_len, FALSE); + tlv_item = proto_tree_add_item(tlv_tree, hf_ucd_tlv_t_210_fast_feedback_region, tvb, offset, tlv_len, FALSE); + break; + } + case UCD_TLV_T_211_HARQ_ACK_REGION: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, hf_ucd_tlv_t_211_harq_ack_region, tvb, offset, tlv_len, FALSE); + tlv_item = proto_tree_add_item(tlv_tree, hf_ucd_tlv_t_211_harq_ack_region, tvb, offset, tlv_len, FALSE); + break; + } + case UCD_TLV_T_212_RANGING_REGION: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, hf_ucd_tlv_t_212_ranging_region, tvb, offset, tlv_len, FALSE); + tlv_item = proto_tree_add_item(tlv_tree, hf_ucd_tlv_t_212_ranging_region, tvb, offset, tlv_len, FALSE); + break; + } + case UCD_TLV_T_213_SOUNDING_REGION: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, hf_ucd_tlv_t_213_sounding_region, tvb, offset, tlv_len, FALSE); + tlv_item = proto_tree_add_item(tlv_tree, hf_ucd_tlv_t_213_sounding_region, tvb, offset, tlv_len, FALSE); + break; + } + } } - }, - { - &hf_ucd_tlv_t_172_cqich_band_amc_transition_delay, - { - "CQICH Band AMC-Transition Delay", "wmx.ucd.cqich_band_amc_transition_delay", - FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_freq, - { - "Frequency", "wmx.ucd.frequency", - FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_194_handover_ranging_codes, - { - "Handover Ranging Codes", "wmx.ucd.handover_ranging_codes", - FT_INT8, BASE_DEC, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_171_harq_ack_delay_dl_burst, - { - "HARQ ACK Delay for DL Burst", "wmx.ucd.harq_ack_delay_dl_burst", - FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_150_initial_ranging_codes, - { - "Initial Ranging Codes", "wmx.ucd.initial_ranging_codes", - FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_195_initial_ranging_interval, - { - "Number of Frames Between Initial Ranging Interval Allocation", "wmx.ucd.initial_ranging_interval", - FT_INT8, BASE_DEC, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_invalid_tlv, - { - "Invalid TLV", "wmx.ucd.invalid_tlv", - FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_187_lower_bound_aas_preamble, - { - "Lower Bound AAS Preamble (in units of 0.25 dB)", "wmx.ucd.lower_bound_aas_preamble", - FT_INT8, BASE_DEC, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_192_min_level_power_offset_adjustment, - { - "Minimum Level of Power Offset Adjustment (in units of 0.1 dB)", "wmx.ucd.min_level_power_offset_adjustment", - FT_INT8, BASE_DEC, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_193_max_level_power_offset_adjustment, - { - "Maximum Level of Power Offset Adjustment (in units of 0.1 dB)", "wmx.ucd.max_level_power_offset_adjustment", - FT_INT8, BASE_DEC, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_174_maximum_retransmission, - { - "Maximum Number of Retransmission in UL-HARQ", "wmx.ucd.max_number_of_retransmission_in_ul_harq", - FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_191_ms_specific_down_power_addjustment_step, - { - "MS-specific Down Power Offset Adjustment Step (in units of 0.01 dB)", "wmx.ucd.ms_specific_down_power_offset_adjustment_step", - FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_190_ms_specific_up_power_addjustment_step, - { - "MS-specific Up Power Offset Adjustment Step (in units of 0.01 dB)", "wmx.ucd.ms_specific_up_power_offset_adjustment_step", - FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_197_normalized_cn_channel_sounding, - { - "Normalized C/N for Channel Sounding", "wmx.ucd.normalized_cn.channel_sounding", - FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_177_normalized_cn_override2, - { - "Normalized C/N Override 2", "wmx.ucd.normalized_cn.override_2", - FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_177_normalized_cn_override2_first_line, - { - "Normalized C/N Value", "wmx.ucd.normalized_cn.override_first_line", - FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_177_normalized_cn_override2_list, - { - "Normalized C/N Value List", "wmx.ucd.normalized_cn.override_list", - FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_158_optional_permutation_ul_allocated_subchannels_bitmap, - { - "Optional permutation UL allocated subchannels bitmap", "wmx.ucd.optional_permutation_ul_allocated_subchannels_bitmap", - FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_151_periodic_ranging_codes, - { - "Periodic Ranging Codes", "wmx.ucd.periodic_ranging_codes", - FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_156_permutation_base, - { - "Permutation Base", "wmx.ucd.permutation_base", - FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_ranging_req_size, - { - "Ranging Request Opportunity Size", "wmx.ucd.ranging_req_size", - FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_res_timeout, - { - "Contention-based Reservation Timeout", "wmx.ucd.res_timeout", - FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_170_safety_channel_retry_timer, - { - "Safety Channel Release Timer", "wmx.ucd.safety_channel_release_timer", - FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_176_size_of_cqich_id_field, - { - "Size of CQICH_ID Field", "wmx.ucd.size_of_cqich_id_field", - FT_UINT8, BASE_DEC, VALS(vals_ucd_cqich_size), 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_155_start_of_ranging_codes_group, - { - "Start of Ranging Codes Group", "wmx.ucd.start_of_ranging_codes_group", - FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_ul_allocated_subchannles_bitmap, - { - "UL Allocated Subchannels Bitmap", "wmx.ucd.subchan.bitmap", - FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_subchan_codes, - { - "Periodic Ranging Codes", "wmx.ucd.subchan.codes", - FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_subchan_params_num_chan, - { - "Number of Subchannels", "wmx.ucd.subchan.num_chan", - FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_subchan_params_num_sym, - { - "Number of OFDMA Symbols", "wmx.ucd.subchan.num_sym", - FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_196_tx_power_report, - { - "Tx Power Report", "wmx.ucd.tx_power_report", - FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_196_tx_power_report_a_p_avg, - { - "A p_avg (in multiples of 1/16)", "wmx.ucd.tx_power_report.a_p_avg", - FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_196_tx_power_report_a_p_avg_icqch, - { - "A p_avg (in multiples of 1/16) when ICQCH is allocated", "wmx.ucd.tx_power_report.a_p_avg_icqch", - FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_196_tx_power_report_interval, - { - "Interval (expressed as power of 2)", "wmx.ucd.tx_power_report.interval", - FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_196_tx_power_report_interval_icqch, - { - "Interval When ICQCH is Allocated (expressed as power of 2)", "wmx.ucd.tx_power_report.interval_icqch", - FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_196_tx_power_report_threshold, - { - "Threshold", "wmx.ucd.tx_power_report.threshold", - FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_196_tx_power_report_threshold_icqch, - { - "Threshold When ICQCH is Allocated to SS (in dB)", "wmx.ucd.tx_power_report.threshold_icqch", - FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL - } - }, - { - &hf_ucd_unknown_type, - { - "Unknown UCD Type", "wmx.ucd.unknown_tlv_type", - FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_202_uplink_burst_profile_for_multiple_fec_types, - { - "Uplink Burst Profile for Multiple FEC Types", "wmx.ucd.uplink_burst_profile.multiple_fec_types", - FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_203_ul_pusc_subchannel_rotation, - { - "Uplink PUSC Subchannel Rotation", "wmx.ucd.uplink_burst_profile.ul_pusc_subchannel_rotation", - FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_205_relative_power_offset_ul_harq_burst, - { - "Relative Power Offset UL HARQ Burst", "wmx.ucd.uplink_burst_profile.relative_power_offset_ul_harq_burst", - FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_206_relative_power_offset_ul_burst_containing_mac_mgmt_msg, - { - "Relative Power Offset UL Burst Containing MAC Mgmt Msg", "wmx.ucd.uplink_burst_profile.relative_power_offset_ul_burst_mac_mgmt_msg", - FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_207_ul_initial_transmit_timing, - { - "UL Initial Transmit Timing", "wmx.ucd.uplink_burst_profile.ul_initial_transmit_timing", - FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_210_fast_feedback_region, - { - "Fast Feedback Region", "wmx.ucd.uplink_burst_profile.fast_feedback_region", - FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_211_harq_ack_region, - { - "HARQ ACK Region", "wmx.ucd.uplink_burst_profile.harq_ack_region", - FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_212_ranging_region, - { - "Ranging Region", "wmx.ucd.uplink_burst_profile.ranging_region", - FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_213_sounding_region, - { - "Sounding Region", "wmx.ucd.uplink_burst_profile.sounding_region", - FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_186_upper_bound_aas_preamble, - { - "Upper Bound AAS Preamble (in units of 0.25 dB)", "wmx.ucd.upper_bound_aas_preamble", - FT_INT8, BASE_DEC, NULL, 0, NULL, HFILL - } - }, - { - &hf_ucd_tlv_t_189_use_cqich_indication_flag, - { - "Use CQICH Indication Flag", "wmx.ucd.use_cqich_indication_flag", - FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL - } - } - }; - - if (proto_mac_mgmt_msg_ucd_decoder == -1) - { - proto_mac_mgmt_msg_ucd_decoder = proto_mac_mgmt_msg_dcd_decoder; - - proto_register_field_array(proto_mac_mgmt_msg_ucd_decoder, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - } -} - -/* UCD dissector */ -void dissect_mac_mgmt_msg_ucd_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ - guint offset = 0; - guint tvb_len, payload_type, length; - guint ucd_config_change_count; - guint ucd_ranging_backoff_start; - guint ucd_ranging_backoff_end; - guint ucd_request_backoff_start; - guint ucd_request_backoff_end; - gint tlv_type, tlv_len, tlv_offset, tlv_value_offset; - guint ul_burst_uiuc, utemp; - proto_item *ucd_item = NULL; - proto_tree *ucd_tree = NULL; - proto_item *tlv_item = NULL; - proto_tree *tlv_tree = NULL; - proto_tree *sub_tree = NULL; - tlv_info_t tlv_info; - - /* Ensure the right payload type */ - payload_type = tvb_get_guint8(tvb, offset); - if(payload_type != MAC_MGMT_MSG_UCD) - { - return; - } - - if(tree) - { /* we are being asked for details */ - /* Get the tvb reported length */ - tvb_len = tvb_reported_length(tvb); - /* display MAC payload type UCD */ - ucd_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_ucd_decoder, tvb, offset, tvb_len, "Uplink Channel Descriptor (UCD) (%u bytes)", tvb_len); - /* add MAC UCD subtree */ - ucd_tree = proto_item_add_subtree(ucd_item, ett_mac_mgmt_msg_ucd_decoder); - /* Decode and display the Uplink Channel Descriptor (UCD) */ - /* display the Message Type */ - proto_tree_add_item(ucd_tree, hf_ucd_message_type, tvb, offset, 1, FALSE); - /* move to next field */ - offset++; - /* get the Configuration Change Count */ - ucd_config_change_count = tvb_get_guint8(tvb, offset); - /* display the Configuration Change Count */ - proto_tree_add_text(ucd_tree, tvb, offset, 1, "Configuration Change Count: %u", ucd_config_change_count); - /* move to next field */ - offset++; - /* get the ranging backoff start */ - ucd_ranging_backoff_start = tvb_get_guint8(tvb, offset); - /* display the ranging backoff start */ - proto_tree_add_text(ucd_tree, tvb, offset, 1, "Ranging Backoff Start: 2^%u = %u", ucd_ranging_backoff_start, (1 << ucd_ranging_backoff_start)); - /* move to next field */ - offset++; - /* get the ranging backoff end */ - ucd_ranging_backoff_end = tvb_get_guint8(tvb, offset); - /* display the ranging backoff end */ - proto_tree_add_text(ucd_tree, tvb, offset, 1, "Ranging Backoff End: 2^%u = %u", ucd_ranging_backoff_end, (1 << ucd_ranging_backoff_end)); - /* move to next field */ - offset++; - /* get the request backoff start */ - ucd_request_backoff_start = tvb_get_guint8(tvb, offset); - /* display the request backoff start */ - proto_tree_add_text(ucd_tree, tvb, offset, 1, "Request Backoff Start: 2^%u = %u", ucd_request_backoff_start, (1 << ucd_request_backoff_start)); - /* move to next field */ - offset++; - /* get the request backoff end */ - ucd_request_backoff_end = tvb_get_guint8(tvb, offset); - /* display the request backoff end */ - proto_tree_add_text(ucd_tree, tvb, offset, 1, "Request Backoff End: 2^%u = %u", ucd_request_backoff_end, (1 << ucd_request_backoff_end)); - /* move to next field */ - offset++; - while(offset < tvb_len) - { - /* get the TLV information */ - init_tlv_info(&tlv_info, tvb, offset); - /* get the TLV type */ - tlv_type = get_tlv_type(&tlv_info); - /* get the TLV length */ - tlv_len = get_tlv_length(&tlv_info); - if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1) - { /* invalid tlv info */ - if(check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "UCD TLV error"); - } - proto_tree_add_item(ucd_tree,hf_ucd_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE); - break; - } - /* get the TLV value offset */ - tlv_value_offset = get_tlv_value_offset(&tlv_info); -#ifdef DEBUG /* for debug only */ - tlv_item = proto_tree_add_protocol_format(ucd_tree, proto_mac_mgmt_msg_ucd_decoder, tvb, offset, (tlv_len + tlv_value_offset), "UCD Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, tlv_len, offset, tvb_len); -#endif - /* update the offset */ - offset += tlv_value_offset; - /* process UCD TLV Encoded information */ - if (include_cor2_changes) - { - switch (tlv_type) - { - case UCD_TLV_T_203_UL_PUSC_SUBCHANNEL_ROTATION: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, hf_ucd_tlv_t_203_ul_pusc_subchannel_rotation, tvb, offset, tlv_len, FALSE); - tlv_item = proto_tree_add_item(tlv_tree, hf_ucd_tlv_t_203_ul_pusc_subchannel_rotation, tvb, offset, tlv_len, FALSE); - break; - } - case UCD_TLV_T_205_RELATIVE_POWER_OFFSET_UL_HARQ_BURST: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, hf_ucd_tlv_t_205_relative_power_offset_ul_harq_burst, tvb, offset, tlv_len, FALSE); - tlv_item = proto_tree_add_item(tlv_tree, hf_ucd_tlv_t_205_relative_power_offset_ul_harq_burst, tvb, offset, tlv_len, FALSE); - break; - } - case UCD_TLV_T_206_RELATIVE_POWER_OFFSET_UL_BURST_CONTAINING_MAC_MGMT_MSG: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, hf_ucd_tlv_t_206_relative_power_offset_ul_burst_containing_mac_mgmt_msg, tvb, offset, tlv_len, FALSE); - tlv_item = proto_tree_add_item(tlv_tree, hf_ucd_tlv_t_206_relative_power_offset_ul_burst_containing_mac_mgmt_msg, tvb, offset, tlv_len, FALSE); - break; - } - case UCD_TLV_T_207_UL_INITIAL_TRANSMIT_TIMING: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, hf_ucd_tlv_t_207_ul_initial_transmit_timing, tvb, offset, tlv_len, FALSE); - tlv_item = proto_tree_add_item(tlv_tree, hf_ucd_tlv_t_207_ul_initial_transmit_timing, tvb, offset, tlv_len, FALSE); - break; - } - case UCD_TLV_T_210_FAST_FEEDBACK_REGION: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, hf_ucd_tlv_t_210_fast_feedback_region, tvb, offset, tlv_len, FALSE); - tlv_item = proto_tree_add_item(tlv_tree, hf_ucd_tlv_t_210_fast_feedback_region, tvb, offset, tlv_len, FALSE); - break; - } - case UCD_TLV_T_211_HARQ_ACK_REGION: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, hf_ucd_tlv_t_211_harq_ack_region, tvb, offset, tlv_len, FALSE); - tlv_item = proto_tree_add_item(tlv_tree, hf_ucd_tlv_t_211_harq_ack_region, tvb, offset, tlv_len, FALSE); - break; - } - case UCD_TLV_T_212_RANGING_REGION: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, hf_ucd_tlv_t_212_ranging_region, tvb, offset, tlv_len, FALSE); - tlv_item = proto_tree_add_item(tlv_tree, hf_ucd_tlv_t_212_ranging_region, tvb, offset, tlv_len, FALSE); - break; - } - case UCD_TLV_T_213_SOUNDING_REGION: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, hf_ucd_tlv_t_213_sounding_region, tvb, offset, tlv_len, FALSE); - tlv_item = proto_tree_add_item(tlv_tree, hf_ucd_tlv_t_213_sounding_region, tvb, offset, tlv_len, FALSE); - break; - } - } - } - switch (tlv_type) + switch (tlv_type) { case UCD_UPLINK_BURST_PROFILE: { @@ -1163,55 +693,519 @@ void dissect_mac_mgmt_msg_ucd_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_t proto_tree_add_text(tlv_tree, tvb, offset, tlv_len, "Periodic Ranging Backoff Start: 2^%u = %u", utemp, (1 << utemp)); break; - } - case UCD_PERIODIC_RANGING_BACKOFF_END: - { - tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, proto_mac_mgmt_msg_ucd_decoder, tvb, offset, tlv_len, "Periodic ranging backoff end (%u bytes(s))", tlv_len); - utemp = tvb_get_guint8(tvb, offset); - proto_tree_add_text(tlv_tree, tvb, offset, tlv_len, "Periodic Ranging Backoff End: 2^%u = %u", utemp, (1 << utemp)); - break; - } - case UCD_START_OF_RANGING_CODES_GROUP: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, hf_ucd_tlv_t_155_start_of_ranging_codes_group, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree,hf_ucd_tlv_t_155_start_of_ranging_codes_group, tvb, offset, tlv_len, FALSE); - break; + } + case UCD_PERIODIC_RANGING_BACKOFF_END: + { + tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, proto_mac_mgmt_msg_ucd_decoder, tvb, offset, tlv_len, "Periodic ranging backoff end (%u bytes(s))", tlv_len); + utemp = tvb_get_guint8(tvb, offset); + proto_tree_add_text(tlv_tree, tvb, offset, tlv_len, "Periodic Ranging Backoff End: 2^%u = %u", utemp, (1 << utemp)); + break; + } + case UCD_START_OF_RANGING_CODES_GROUP: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, hf_ucd_tlv_t_155_start_of_ranging_codes_group, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree,hf_ucd_tlv_t_155_start_of_ranging_codes_group, tvb, offset, tlv_len, FALSE); + break; + + } + case UCD_PERMUTATION_BASE: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, hf_ucd_tlv_t_156_permutation_base, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree,hf_ucd_tlv_t_156_permutation_base, tvb, offset, tlv_len, FALSE); + break; + } + case UCD_UL_ALLOCATED_SUBCHANNELS_BITMAP: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, hf_ucd_ul_allocated_subchannles_bitmap, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_ucd_ul_allocated_subchannles_bitmap, tvb, offset, tlv_len, FALSE); + break; + } + case UCD_TLV_T_203_UL_PUSC_SUBCHANNEL_ROTATION: + case UCD_TLV_T_205_RELATIVE_POWER_OFFSET_UL_HARQ_BURST: + case UCD_TLV_T_206_RELATIVE_POWER_OFFSET_UL_BURST_CONTAINING_MAC_MGMT_MSG: + case UCD_TLV_T_207_UL_INITIAL_TRANSMIT_TIMING: + case UCD_TLV_T_210_FAST_FEEDBACK_REGION: + case UCD_TLV_T_211_HARQ_ACK_REGION: + case UCD_TLV_T_212_RANGING_REGION: + case UCD_TLV_T_213_SOUNDING_REGION: + { + /* Unknown TLV type if cor2 not enabled. */ + if (!include_cor2_changes) + { + proto_tree_add_protocol_format(ucd_tree, proto_mac_mgmt_msg_ucd_decoder, tvb, offset, tlv_len, "Unknown TLV Type"); + } + break; + } + default: + { + proto_tree_add_protocol_format(ucd_tree, proto_mac_mgmt_msg_ucd_decoder, tvb, offset, tlv_len, "Unknown TLV Type"); + } + } /* end of switch */ + offset += tlv_len; + } /* end of TLV process while loop */ + } +} + +/* Register Wimax Mac Payload Protocol and Dissector */ +void proto_register_mac_mgmt_msg_ucd(void) +{ + /* UCD display */ + static hf_register_info hf[] = + { + { + &hf_ucd_message_type, + { + "MAC Management Message Type", "wmx.macmgtmsgtype.ucd", + FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_188_allow_aas_beam_select_message, + { + "Allow AAS Beam Select Message", "wmx.ucd.allow_aas_beam_select_message", + FT_INT8, BASE_DEC, VALS(vals_yes_no_str), 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_159_band_amc_allocation_threshold, + { + "Band AMC Allocation Threshold", "wmx.ucd.band_amc.allocation_threshold", + FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_161_band_amc_allocation_timer, + { + "Band AMC Allocation Timer", "wmx.ucd.band_amc.allocation_timer", + FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_160_band_amc_release_threshold, + { + "Band AMC Release Threshold", "wmx.ucd.band_amc.release_threshold", + FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_162_band_amc_release_timer, + { + "Band AMC Release Timer", "wmx.ucd.band_amc.release_timer", + FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_164_band_amc_retry_timer, + { + "Band AMC Retry Timer", "wmx.ucd.band_amc.retry_timer", + FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_163_band_status_report_max_period, + { + "Band Status Report MAC Period", "wmx.ucd.band_status.report_max_period", + FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_152_bandwidth_request_codes, + { + "Bandwidth Request Codes", "wmx.ucd.bandwidth_request", + FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_burst_fec, + { + "FEC Code Type", "wmx.ucd.burst.fec", + FT_UINT8, BASE_HEX, VALS(vals_dcd_burst_fec), 0, NULL, HFILL + } + }, + { + &hf_ucd_burst_ranging_data_ratio, + { + "Ranging Data Ratio", "wmx.ucd.burst.ranging_data_ratio", + FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_ul_burst_reserved, + { + "Reserved", "wmx.ucd.burst.reserved", + FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL + } + }, + { + &hf_ucd_ul_burst_uiuc, + { + "UIUC", "wmx.ucd.burst.uiuc", + FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL + } + }, +#if 0 + { + &hf_ucd_burst_power_boost, + {"Focused Contention Power Boost", "wmx.ucd.burst.power_boost", FT_UINT8, BASE_HEX, NULL, 0, "", HFILL} + }, + { + &hf_ucd_burst_tcs_enable, + {"TCS", "wmx.ucd.burst.tcs", FT_UINT8, BASE_DEC, VALS(vals_dcd_burst_tcs), 0, "", HFILL} + }, +#endif + { + &hf_ucd_bw_req_size, + { + "Bandwidth Request Opportunity Size", "wmx.ucd.bw_req_size", + FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_172_cqich_band_amc_transition_delay, + { + "CQICH Band AMC-Transition Delay", "wmx.ucd.cqich_band_amc_transition_delay", + FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_freq, + { + "Frequency", "wmx.ucd.frequency", + FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_194_handover_ranging_codes, + { + "Handover Ranging Codes", "wmx.ucd.handover_ranging_codes", + FT_INT8, BASE_DEC, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_171_harq_ack_delay_dl_burst, + { + "HARQ ACK Delay for DL Burst", "wmx.ucd.harq_ack_delay_dl_burst", + FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_150_initial_ranging_codes, + { + "Initial Ranging Codes", "wmx.ucd.initial_ranging_codes", + FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_195_initial_ranging_interval, + { + "Number of Frames Between Initial Ranging Interval Allocation", "wmx.ucd.initial_ranging_interval", + FT_INT8, BASE_DEC, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_invalid_tlv, + { + "Invalid TLV", "wmx.ucd.invalid_tlv", + FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_187_lower_bound_aas_preamble, + { + "Lower Bound AAS Preamble (in units of 0.25 dB)", "wmx.ucd.lower_bound_aas_preamble", + FT_INT8, BASE_DEC, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_192_min_level_power_offset_adjustment, + { + "Minimum Level of Power Offset Adjustment (in units of 0.1 dB)", "wmx.ucd.min_level_power_offset_adjustment", + FT_INT8, BASE_DEC, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_193_max_level_power_offset_adjustment, + { + "Maximum Level of Power Offset Adjustment (in units of 0.1 dB)", "wmx.ucd.max_level_power_offset_adjustment", + FT_INT8, BASE_DEC, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_174_maximum_retransmission, + { + "Maximum Number of Retransmission in UL-HARQ", "wmx.ucd.max_number_of_retransmission_in_ul_harq", + FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_191_ms_specific_down_power_addjustment_step, + { + "MS-specific Down Power Offset Adjustment Step (in units of 0.01 dB)", "wmx.ucd.ms_specific_down_power_offset_adjustment_step", + FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_190_ms_specific_up_power_addjustment_step, + { + "MS-specific Up Power Offset Adjustment Step (in units of 0.01 dB)", "wmx.ucd.ms_specific_up_power_offset_adjustment_step", + FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_197_normalized_cn_channel_sounding, + { + "Normalized C/N for Channel Sounding", "wmx.ucd.normalized_cn.channel_sounding", + FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_177_normalized_cn_override2, + { + "Normalized C/N Override 2", "wmx.ucd.normalized_cn.override_2", + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_177_normalized_cn_override2_first_line, + { + "Normalized C/N Value", "wmx.ucd.normalized_cn.override_first_line", + FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_177_normalized_cn_override2_list, + { + "Normalized C/N Value List", "wmx.ucd.normalized_cn.override_list", + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_158_optional_permutation_ul_allocated_subchannels_bitmap, + { + "Optional permutation UL allocated subchannels bitmap", "wmx.ucd.optional_permutation_ul_allocated_subchannels_bitmap", + FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_151_periodic_ranging_codes, + { + "Periodic Ranging Codes", "wmx.ucd.periodic_ranging_codes", + FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_156_permutation_base, + { + "Permutation Base", "wmx.ucd.permutation_base", + FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_ranging_req_size, + { + "Ranging Request Opportunity Size", "wmx.ucd.ranging_req_size", + FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_res_timeout, + { + "Contention-based Reservation Timeout", "wmx.ucd.res_timeout", + FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_170_safety_channel_retry_timer, + { + "Safety Channel Release Timer", "wmx.ucd.safety_channel_release_timer", + FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_176_size_of_cqich_id_field, + { + "Size of CQICH_ID Field", "wmx.ucd.size_of_cqich_id_field", + FT_UINT8, BASE_DEC, VALS(vals_ucd_cqich_size), 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_155_start_of_ranging_codes_group, + { + "Start of Ranging Codes Group", "wmx.ucd.start_of_ranging_codes_group", + FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_ul_allocated_subchannles_bitmap, + { + "UL Allocated Subchannels Bitmap", "wmx.ucd.subchan.bitmap", + FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_subchan_codes, + { + "Periodic Ranging Codes", "wmx.ucd.subchan.codes", + FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_subchan_params_num_chan, + { + "Number of Subchannels", "wmx.ucd.subchan.num_chan", + FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_subchan_params_num_sym, + { + "Number of OFDMA Symbols", "wmx.ucd.subchan.num_sym", + FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_196_tx_power_report, + { + "Tx Power Report", "wmx.ucd.tx_power_report", + FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_196_tx_power_report_a_p_avg, + { + "A p_avg (in multiples of 1/16)", "wmx.ucd.tx_power_report.a_p_avg", + FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_196_tx_power_report_a_p_avg_icqch, + { + "A p_avg (in multiples of 1/16) when ICQCH is allocated", "wmx.ucd.tx_power_report.a_p_avg_icqch", + FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_196_tx_power_report_interval, + { + "Interval (expressed as power of 2)", "wmx.ucd.tx_power_report.interval", + FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_196_tx_power_report_interval_icqch, + { + "Interval When ICQCH is Allocated (expressed as power of 2)", "wmx.ucd.tx_power_report.interval_icqch", + FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_196_tx_power_report_threshold, + { + "Threshold", "wmx.ucd.tx_power_report.threshold", + FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_196_tx_power_report_threshold_icqch, + { + "Threshold When ICQCH is Allocated to SS (in dB)", "wmx.ucd.tx_power_report.threshold_icqch", + FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL + } + }, + { + &hf_ucd_unknown_type, + { + "Unknown UCD Type", "wmx.ucd.unknown_tlv_type", + FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_202_uplink_burst_profile_for_multiple_fec_types, + { + "Uplink Burst Profile for Multiple FEC Types", "wmx.ucd.uplink_burst_profile.multiple_fec_types", + FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_203_ul_pusc_subchannel_rotation, + { + "Uplink PUSC Subchannel Rotation", "wmx.ucd.uplink_burst_profile.ul_pusc_subchannel_rotation", + FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_205_relative_power_offset_ul_harq_burst, + { + "Relative Power Offset UL HARQ Burst", "wmx.ucd.uplink_burst_profile.relative_power_offset_ul_harq_burst", + FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_206_relative_power_offset_ul_burst_containing_mac_mgmt_msg, + { + "Relative Power Offset UL Burst Containing MAC Mgmt Msg", "wmx.ucd.uplink_burst_profile.relative_power_offset_ul_burst_mac_mgmt_msg", + FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_207_ul_initial_transmit_timing, + { + "UL Initial Transmit Timing", "wmx.ucd.uplink_burst_profile.ul_initial_transmit_timing", + FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_210_fast_feedback_region, + { + "Fast Feedback Region", "wmx.ucd.uplink_burst_profile.fast_feedback_region", + FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_211_harq_ack_region, + { + "HARQ ACK Region", "wmx.ucd.uplink_burst_profile.harq_ack_region", + FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_212_ranging_region, + { + "Ranging Region", "wmx.ucd.uplink_burst_profile.ranging_region", + FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_213_sounding_region, + { + "Sounding Region", "wmx.ucd.uplink_burst_profile.sounding_region", + FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_186_upper_bound_aas_preamble, + { + "Upper Bound AAS Preamble (in units of 0.25 dB)", "wmx.ucd.upper_bound_aas_preamble", + FT_INT8, BASE_DEC, NULL, 0, NULL, HFILL + } + }, + { + &hf_ucd_tlv_t_189_use_cqich_indication_flag, + { + "Use CQICH Indication Flag", "wmx.ucd.use_cqich_indication_flag", + FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL + } + } + }; + + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_mac_mgmt_msg_ucd_decoder, + }; - } - case UCD_PERMUTATION_BASE: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, hf_ucd_tlv_t_156_permutation_base, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree,hf_ucd_tlv_t_156_permutation_base, tvb, offset, tlv_len, FALSE); - break; - } - case UCD_UL_ALLOCATED_SUBCHANNELS_BITMAP: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, hf_ucd_ul_allocated_subchannles_bitmap, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_ucd_ul_allocated_subchannles_bitmap, tvb, offset, tlv_len, FALSE); - break; - } - case UCD_TLV_T_203_UL_PUSC_SUBCHANNEL_ROTATION: - case UCD_TLV_T_205_RELATIVE_POWER_OFFSET_UL_HARQ_BURST: - case UCD_TLV_T_206_RELATIVE_POWER_OFFSET_UL_BURST_CONTAINING_MAC_MGMT_MSG: - case UCD_TLV_T_207_UL_INITIAL_TRANSMIT_TIMING: - case UCD_TLV_T_210_FAST_FEEDBACK_REGION: - case UCD_TLV_T_211_HARQ_ACK_REGION: - case UCD_TLV_T_212_RANGING_REGION: - case UCD_TLV_T_213_SOUNDING_REGION: - { - /* Unknown TLV type if cor2 not enabled. */ - if (!include_cor2_changes) - { - proto_tree_add_protocol_format(ucd_tree, proto_mac_mgmt_msg_ucd_decoder, tvb, offset, tlv_len, "Unknown TLV Type"); - } - break; - } - default: - { - proto_tree_add_protocol_format(ucd_tree, proto_mac_mgmt_msg_ucd_decoder, tvb, offset, tlv_len, "Unknown TLV Type"); - } - } /* end of switch */ - offset += tlv_len; - } /* end of TLV process while loop */ - } + proto_mac_mgmt_msg_ucd_decoder = proto_mac_mgmt_msg_dcd_decoder; + + proto_register_field_array(proto_mac_mgmt_msg_ucd_decoder, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); } diff --git a/plugins/wimax/msg_ulmap.c b/plugins/wimax/msg_ulmap.c index cf4409aa83..89f0b9ba38 100644 --- a/plugins/wimax/msg_ulmap.c +++ b/plugins/wimax/msg_ulmap.c @@ -32,8 +32,6 @@ #include "config.h" #endif -#include "moduleinfo.h" - #include #include #include "crc.h" @@ -70,19 +68,15 @@ extern gint N_layer; extern gint RCID_Type; extern gint RCID_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb, gint RCID_Type); - -/* forward reference */ -void dissect_mac_mgmt_msg_ulmap_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - static gint proto_mac_mgmt_msg_ulmap_decoder = -1; static gint ett_ulmap = -1; static gint ett_ulmap_ie = -1; static gint ett_ulmap_ffb = -1; -static gint ett_ulmap_c = -1; -static gint ett_ulmap_c_ie = -1; -static gint ett_ulmap_s = -1; -static gint ett_ulmap_s_ie = -1; +/* static gint ett_ulmap_c = -1; */ +/* static gint ett_ulmap_c_ie = -1; */ +/* static gint ett_ulmap_s = -1; */ +/* static gint ett_ulmap_s_ie = -1; */ static gint ett_287_1 = -1; static gint ett_287_2 = -1; static gint ett_289 = -1; @@ -123,57 +117,6 @@ static gint ett_306_ul = -1; static gint ett_308b = -1; static gint ett_315d = -1; -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_ulmap, - &ett_ulmap_ie, - &ett_ulmap_ffb, - &ett_ulmap_c, - &ett_ulmap_c_ie, - &ett_ulmap_s, - &ett_ulmap_s_ie, - &ett_287_1, - &ett_287_2, - &ett_289, - &ett_290, - &ett_290b, - &ett_291, - &ett_292, - &ett_293, - &ett_294, - &ett_295, - &ett_299, - &ett_300, - &ett_302, - &ett_302a, - &ett_302b, - &ett_302c, - &ett_302d, - &ett_302e, - &ett_302f, - &ett_302h, - &ett_302g, - &ett_302i, - &ett_302j, - &ett_302k, - &ett_302l, - &ett_302m, - &ett_302n, - &ett_302o, - &ett_302p, - &ett_302q, - &ett_302r, - &ett_302s, - &ett_302t, - &ett_302u, - &ett_302v, - &ett_306, - &ett_306_ul, - &ett_308b, - &ett_315d, -}; - #define DCD_DOWNLINK_BURST_PROFILE 1 #define DCD_BS_EIRP 2 #define DCD_FRAME_DURATION 3 @@ -1656,326 +1599,9 @@ void lshift_bits(guint8 *buffer, gint bytes, gint bits) } } -/* Register Wimax Mac Payload Protocol and Dissector */ -void proto_register_mac_mgmt_msg_ulmap(void) -{ - /* UL-MAP fields display */ - static hf_register_info hf[] = - { - { - &hf_ulmap_message_type, - { - "MAC Management Message Type", "wmx.macmgtmsgtype.ulmap", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_ulmap_fch_expected, - { - "FCH Expected", "wmx.ulmap.fch.expected", - FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_ulmap_ie, - { - "UL-MAP IE", "wmx.ulmap.ie", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_ulmap_ie_cid, - { - "CID", "wmx.ulmap.ie.cid", - FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_ulmap_ie_uiuc, - { - "UIUC", "wmx.ulmap.ie.uiuc", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_ulmap_ofdma_sym, - { - "Num OFDMA Symbols", "wmx.ulmap.ofdma.sym", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_ulmap_reserved, - { - "Reserved", "wmx.ulmap.rsv", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_ulmap_alloc_start_time, - { - "Uplink Channel ID", "wmx.ulmap.start", - FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_ulmap_ucd_count, - { - "UCD Count", "wmx.ulmap.ucd", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc0_numsub, - { - "No. subchannels", "wmx.ulmap.uiuc0.numsub", - FT_UINT32, BASE_DEC, NULL, 0x000003f8, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc0_numsym, - { - "No. OFDMA symbols", "wmx.ulmap.uiuc0.numsym", - FT_UINT32, BASE_DEC, NULL, 0x0001fc00, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc0_rsv, - { - "Reserved", "wmx.ulmap.uiuc0.rsv", - FT_UINT32, BASE_DEC, NULL, 0x00000007, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc0_subofs, - { - "Subchannel offset", "wmx.ulmap.uiuc0.subofs", - FT_UINT32, BASE_DEC, NULL, 0x00fe0000, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc0_symofs, - { - "OFDMA symbol offset", "wmx.ulmap.uiuc0.symofs", - FT_UINT32, BASE_DEC, NULL, 0xff000000, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc11_data, - { - "Data", "wmx.ulmap.uiuc11.data", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc11_ext, - { - "Extended 2 UIUC", "wmx.ulmap.uiuc11.ext", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc11_len, - { - "Length", "wmx.ulmap.uiuc11.len", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc12_dri, - { - "Dedicated ranging indicator", "wmx.ulmap.uiuc12.dri", - FT_UINT32, BASE_DEC, NULL, 0x00000001, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc10_dur, - { - "Duration", "wmx.ulmap.uiuc12.dur", - FT_UINT16, BASE_DEC, NULL, 0xFFc0, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc12_method, - { - "Ranging Method", "wmx.ulmap.uiuc12.method", - FT_UINT32, BASE_DEC, NULL, 0x00000006, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc12_numsub, - { - "No. Subchannels", "wmx.ulmap.uiuc12.numsub", - FT_UINT32, BASE_DEC, NULL, 0x000003F8, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc12_numsym, - { - "No. OFDMA Symbols", "wmx.ulmap.uiuc12.numsym", - FT_UINT32, BASE_DEC, NULL, 0x0001Fc00, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc10_rep, - { - "Repetition Coding indication", "wmx.ulmap.uiuc12.rep", - FT_UINT16, BASE_DEC, NULL, 0x0030, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc12_subofs, - { - "Subchannel Offset", "wmx.ulmap.uiuc12.subofs", - FT_UINT32, BASE_DEC, NULL, 0x00Fe0000, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc12_symofs, - { - "OFDMA Symbol Offset", "wmx.ulmap.uiuc12.symofs", - FT_UINT32, BASE_DEC, NULL, 0xFF000000, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc13_numsub, - { - "No. Subchannels/SZ Shift Value", "wmx.ulmap.uiuc13.numsub", - FT_UINT32, BASE_DEC, NULL, 0x000003f8, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc13_numsym, - { - "No. OFDMA symbols", "wmx.ulmap.uiuc13.numsym", - FT_UINT32, BASE_DEC, NULL, 0x0001fc00, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc13_papr, - { - "PAPR Reduction/Safety Zone", "wmx.ulmap.uiuc13.papr", - FT_UINT32, BASE_DEC, NULL, 0x00000004, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc13_rsv, - { - "Reserved", "wmx.ulmap.uiuc13.rsv", - FT_UINT32, BASE_DEC, NULL, 0x00000001, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc13_subofs, - { - "Subchannel offset", "wmx.ulmap.uiuc13.subofs", - FT_UINT32, BASE_DEC, NULL, 0x00fe0000, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc13_symofs, - { - "OFDMA symbol offset", "wmx.ulmap.uiuc13.symofs", - FT_UINT32, BASE_DEC, NULL, 0xff000000, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc13_zone, - { - "Sounding Zone", "wmx.ulmap.uiuc13.zone", - FT_UINT32, BASE_DEC, NULL, 0x00000002, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc14_bwr, - { - "BW request mandatory", "wmx.ulmap.uiuc14.bwr", - FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc14_code, - { - "Ranging code", "wmx.ulmap.uiuc14.code", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc14_dur, - { - "Duration", "wmx.ulmap.uiuc14.dur", - FT_UINT16, BASE_DEC, NULL, 0xfc00, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc14_idx, - { - "Frame Number Index", "wmx.ulmap.uiuc14.idx", - FT_UINT16, BASE_DEC, NULL, 0x000F, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc14_rep, - { - "Repetition Coding Indication", "wmx.ulmap.uiuc14.rep", - FT_UINT16, BASE_DEC, NULL, 0x0030, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc14_sub, - { - "Ranging subchannel", "wmx.ulmap.uiuc14.sub", - FT_UINT8, BASE_DEC, NULL, 0xfe, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc14_sym, - { - "Ranging symbol", "wmx.ulmap.uiuc14.sym", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc14_uiuc, - { - "UIUC", "wmx.ulmap.uiuc14.uiuc", - FT_UINT16, BASE_DEC, NULL, 0x03c0, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc15_data, - { - "Data", "wmx.ulmap.uiuc15.data", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc15_ext, - { - "Extended UIUC", "wmx.ulmap.uiuc15.ext", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - }, - { - &hf_ulmap_uiuc15_len, - { - "Length", "wmx.ulmap.uiuc15.len", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL - } - } - }; - - if (proto_mac_mgmt_msg_ulmap_decoder == -1) - { - proto_mac_mgmt_msg_ulmap_decoder = proto_mac_mgmt_msg_dlmap_decoder; - - proto_register_field_array(proto_mac_mgmt_msg_ulmap_decoder, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - } -} - - -gint dissect_ulmap_ie( proto_tree *ie_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) + + +gint dissect_ulmap_ie( proto_tree *ie_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) { /* decode a single UL-MAP IE and return the * length of the IE in nibbles @@ -2441,3 +2067,369 @@ gint wimax_decode_ulmap_reduced_aas(proto_tree *base_tree, const guint8 *bufptr, return (bit - offset); /* length in bits */ } + +/* Register Wimax Mac Payload Protocol and Dissector */ +void proto_register_mac_mgmt_msg_ulmap(void) +{ + /* UL-MAP fields display */ + static hf_register_info hf[] = + { + { + &hf_ulmap_message_type, + { + "MAC Management Message Type", "wmx.macmgtmsgtype.ulmap", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_ulmap_fch_expected, + { + "FCH Expected", "wmx.ulmap.fch.expected", + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_ulmap_ie, + { + "UL-MAP IE", "wmx.ulmap.ie", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_ulmap_ie_cid, + { + "CID", "wmx.ulmap.ie.cid", + FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_ulmap_ie_uiuc, + { + "UIUC", "wmx.ulmap.ie.uiuc", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_ulmap_ofdma_sym, + { + "Num OFDMA Symbols", "wmx.ulmap.ofdma.sym", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_ulmap_reserved, + { + "Reserved", "wmx.ulmap.rsv", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_ulmap_alloc_start_time, + { + "Uplink Channel ID", "wmx.ulmap.start", + FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_ulmap_ucd_count, + { + "UCD Count", "wmx.ulmap.ucd", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc0_numsub, + { + "No. subchannels", "wmx.ulmap.uiuc0.numsub", + FT_UINT32, BASE_DEC, NULL, 0x000003f8, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc0_numsym, + { + "No. OFDMA symbols", "wmx.ulmap.uiuc0.numsym", + FT_UINT32, BASE_DEC, NULL, 0x0001fc00, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc0_rsv, + { + "Reserved", "wmx.ulmap.uiuc0.rsv", + FT_UINT32, BASE_DEC, NULL, 0x00000007, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc0_subofs, + { + "Subchannel offset", "wmx.ulmap.uiuc0.subofs", + FT_UINT32, BASE_DEC, NULL, 0x00fe0000, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc0_symofs, + { + "OFDMA symbol offset", "wmx.ulmap.uiuc0.symofs", + FT_UINT32, BASE_DEC, NULL, 0xff000000, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc11_data, + { + "Data", "wmx.ulmap.uiuc11.data", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc11_ext, + { + "Extended 2 UIUC", "wmx.ulmap.uiuc11.ext", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc11_len, + { + "Length", "wmx.ulmap.uiuc11.len", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc12_dri, + { + "Dedicated ranging indicator", "wmx.ulmap.uiuc12.dri", + FT_UINT32, BASE_DEC, NULL, 0x00000001, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc10_dur, + { + "Duration", "wmx.ulmap.uiuc12.dur", + FT_UINT16, BASE_DEC, NULL, 0xFFc0, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc12_method, + { + "Ranging Method", "wmx.ulmap.uiuc12.method", + FT_UINT32, BASE_DEC, NULL, 0x00000006, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc12_numsub, + { + "No. Subchannels", "wmx.ulmap.uiuc12.numsub", + FT_UINT32, BASE_DEC, NULL, 0x000003F8, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc12_numsym, + { + "No. OFDMA Symbols", "wmx.ulmap.uiuc12.numsym", + FT_UINT32, BASE_DEC, NULL, 0x0001Fc00, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc10_rep, + { + "Repetition Coding indication", "wmx.ulmap.uiuc12.rep", + FT_UINT16, BASE_DEC, NULL, 0x0030, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc12_subofs, + { + "Subchannel Offset", "wmx.ulmap.uiuc12.subofs", + FT_UINT32, BASE_DEC, NULL, 0x00Fe0000, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc12_symofs, + { + "OFDMA Symbol Offset", "wmx.ulmap.uiuc12.symofs", + FT_UINT32, BASE_DEC, NULL, 0xFF000000, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc13_numsub, + { + "No. Subchannels/SZ Shift Value", "wmx.ulmap.uiuc13.numsub", + FT_UINT32, BASE_DEC, NULL, 0x000003f8, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc13_numsym, + { + "No. OFDMA symbols", "wmx.ulmap.uiuc13.numsym", + FT_UINT32, BASE_DEC, NULL, 0x0001fc00, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc13_papr, + { + "PAPR Reduction/Safety Zone", "wmx.ulmap.uiuc13.papr", + FT_UINT32, BASE_DEC, NULL, 0x00000004, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc13_rsv, + { + "Reserved", "wmx.ulmap.uiuc13.rsv", + FT_UINT32, BASE_DEC, NULL, 0x00000001, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc13_subofs, + { + "Subchannel offset", "wmx.ulmap.uiuc13.subofs", + FT_UINT32, BASE_DEC, NULL, 0x00fe0000, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc13_symofs, + { + "OFDMA symbol offset", "wmx.ulmap.uiuc13.symofs", + FT_UINT32, BASE_DEC, NULL, 0xff000000, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc13_zone, + { + "Sounding Zone", "wmx.ulmap.uiuc13.zone", + FT_UINT32, BASE_DEC, NULL, 0x00000002, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc14_bwr, + { + "BW request mandatory", "wmx.ulmap.uiuc14.bwr", + FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc14_code, + { + "Ranging code", "wmx.ulmap.uiuc14.code", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc14_dur, + { + "Duration", "wmx.ulmap.uiuc14.dur", + FT_UINT16, BASE_DEC, NULL, 0xfc00, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc14_idx, + { + "Frame Number Index", "wmx.ulmap.uiuc14.idx", + FT_UINT16, BASE_DEC, NULL, 0x000F, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc14_rep, + { + "Repetition Coding Indication", "wmx.ulmap.uiuc14.rep", + FT_UINT16, BASE_DEC, NULL, 0x0030, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc14_sub, + { + "Ranging subchannel", "wmx.ulmap.uiuc14.sub", + FT_UINT8, BASE_DEC, NULL, 0xfe, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc14_sym, + { + "Ranging symbol", "wmx.ulmap.uiuc14.sym", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc14_uiuc, + { + "UIUC", "wmx.ulmap.uiuc14.uiuc", + FT_UINT16, BASE_DEC, NULL, 0x03c0, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc15_data, + { + "Data", "wmx.ulmap.uiuc15.data", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc15_ext, + { + "Extended UIUC", "wmx.ulmap.uiuc15.ext", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_ulmap_uiuc15_len, + { + "Length", "wmx.ulmap.uiuc15.len", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + } + }; + + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_ulmap, + &ett_ulmap_ie, + &ett_ulmap_ffb, + /* &ett_ulmap_c, */ + /* &ett_ulmap_c_ie, */ + /* &ett_ulmap_s, */ + /* &ett_ulmap_s_ie, */ + &ett_287_1, + &ett_287_2, + &ett_289, + &ett_290, + &ett_290b, + &ett_291, + &ett_292, + &ett_293, + &ett_294, + &ett_295, + &ett_299, + &ett_300, + &ett_302, + &ett_302a, + &ett_302b, + &ett_302c, + &ett_302d, + &ett_302e, + &ett_302f, + &ett_302h, + &ett_302g, + &ett_302i, + &ett_302j, + &ett_302k, + &ett_302l, + &ett_302m, + &ett_302n, + &ett_302o, + &ett_302p, + &ett_302q, + &ett_302r, + &ett_302s, + &ett_302t, + &ett_302u, + &ett_302v, + &ett_306, + &ett_306_ul, + &ett_308b, + &ett_315d, + }; + + proto_mac_mgmt_msg_ulmap_decoder = proto_mac_mgmt_msg_dlmap_decoder; + + proto_register_field_array(proto_mac_mgmt_msg_ulmap_decoder, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); +} diff --git a/plugins/wimax/packet-wmx.c b/plugins/wimax/packet-wmx.c index efcf7df88f..d5fcf556a0 100644 --- a/plugins/wimax/packet-wmx.c +++ b/plugins/wimax/packet-wmx.c @@ -32,8 +32,6 @@ #include "config.h" #endif -#include "moduleinfo.h" - #include #include #include @@ -833,9 +831,9 @@ void proto_register_wimax(void) /* Register the WiMax protocols here */ proto_wimax = proto_register_protocol ( - "WiMax Protocol", /* name */ - "WiMax (wmx)", /* short name */ - "wmx" /* abbrev */ + "WiMax Protocol", /* name */ + "WiMax (wmx)", /* short name */ + "wmx" /* abbrev */ ); #if 0 /* XXX: not used ?? */ diff --git a/plugins/wimax/wimax_cdma_code_decoder.c b/plugins/wimax/wimax_cdma_code_decoder.c index 1d2a712b6a..244167f029 100644 --- a/plugins/wimax/wimax_cdma_code_decoder.c +++ b/plugins/wimax/wimax_cdma_code_decoder.c @@ -37,10 +37,6 @@ extern gint proto_wimax; -/* forward reference */ -void proto_register_wimax_cdma(void); -static void dissect_wimax_cdma_code_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - static int proto_wimax_cdma_code_decoder = -1; static gint ett_wimax_cdma_code_decoder = -1; @@ -48,11 +44,35 @@ static int hf_wimax_ranging_code = -1; static int hf_wimax_ranging_symbol_offset = -1; static int hf_wimax_ranging_subchannel_offset = -1; -/* Setup protocol subtree array */ -static gint *ett[] = +static void dissect_wimax_cdma_code_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - &ett_wimax_cdma_code_decoder, -}; + gint offset = 0; + guint length; + proto_item *cdma_item = NULL; + + proto_tree *cdma_tree = NULL; + + /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "CDMA Code Attribute"); + } + if (tree) + { /* we are being asked for details */ + /* get the tvb reported length */ + length = tvb_reported_length(tvb); + /* display CDMA dissector info */ + cdma_item = proto_tree_add_protocol_format(tree, proto_wimax_cdma_code_decoder, tvb, offset, length, "CDMA Code Attribute (%u bytes)", length); + /* add CDMA Code subtree */ + cdma_tree = proto_item_add_subtree(cdma_item, ett_wimax_cdma_code_decoder); + /* display the first CDMA Code */ + proto_tree_add_item(cdma_tree, hf_wimax_ranging_code, tvb, offset, 1, FALSE); + /* display the 2nd CDMA Code */ + proto_tree_add_item(cdma_tree, hf_wimax_ranging_symbol_offset, tvb, offset+1, 1, FALSE); + /* display the 3rd CDMA Code */ + proto_tree_add_item(cdma_tree, hf_wimax_ranging_subchannel_offset, tvb, offset+2, 1, FALSE); + } +} /* Register Wimax CDMA Protocol */ void proto_register_wimax_cdma(void) @@ -86,42 +106,18 @@ void proto_register_wimax_cdma(void) } }; - if (proto_wimax_cdma_code_decoder == -1) - { - proto_wimax_cdma_code_decoder = proto_wimax; + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_wimax_cdma_code_decoder, + }; - /* register the field display messages */ - proto_register_field_array(proto_wimax_cdma_code_decoder, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - } - register_dissector("wimax_cdma_code_burst_handler", dissect_wimax_cdma_code_decoder, -1); -} + proto_wimax_cdma_code_decoder = proto_wimax; -static void dissect_wimax_cdma_code_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ - gint offset = 0; - guint length; - proto_item *cdma_item = NULL; - proto_tree *cdma_tree = NULL; + /* register the field display messages */ + proto_register_field_array(proto_wimax_cdma_code_decoder, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); - /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "CDMA Code Attribute"); - } - if (tree) - { /* we are being asked for details */ - /* get the tvb reported length */ - length = tvb_reported_length(tvb); - /* display CDMA dissector info */ - cdma_item = proto_tree_add_protocol_format(tree, proto_wimax_cdma_code_decoder, tvb, offset, length, "CDMA Code Attribute (%u bytes)", length); - /* add CDMA Code subtree */ - cdma_tree = proto_item_add_subtree(cdma_item, ett_wimax_cdma_code_decoder); - /* display the first CDMA Code */ - proto_tree_add_item(cdma_tree, hf_wimax_ranging_code, tvb, offset, 1, FALSE); - /* display the 2nd CDMA Code */ - proto_tree_add_item(cdma_tree, hf_wimax_ranging_symbol_offset, tvb, offset+1, 1, FALSE); - /* display the 3rd CDMA Code */ - proto_tree_add_item(cdma_tree, hf_wimax_ranging_subchannel_offset, tvb, offset+2, 1, FALSE); - } + register_dissector("wimax_cdma_code_burst_handler", dissect_wimax_cdma_code_decoder, -1); } + diff --git a/plugins/wimax/wimax_compact_dlmap_ie_decoder.c b/plugins/wimax/wimax_compact_dlmap_ie_decoder.c index 3f23883f01..1b316e1520 100644 --- a/plugins/wimax/wimax_compact_dlmap_ie_decoder.c +++ b/plugins/wimax/wimax_compact_dlmap_ie_decoder.c @@ -67,6 +67,8 @@ static guint wimax_cdlmap_extension_ie_decoder(proto_tree *tree, packet_info *pi guint wimax_extended_diuc_dependent_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset); static gint proto_wimax_compact_dlmap_ie_decoder = -1; + +#if 0 /* not used ?? */ static gint ett_wimax_compact_dlmap_ie_decoder = -1; static gint ett_wimax_format_configuration_ie_decoder = -1; static gint ett_wimax_rcid_ie_decoder = -1; @@ -74,18 +76,7 @@ static gint ett_wimax_harq_control_ie_decoder = -1; static gint ett_wimax_extended_diuc_dependent_ie_decoder = -1; static gint ett_wimax_cqich_control_ie_decoder = -1; static gint ett_wimax_extension_type_ie_decoder = -1; - -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_wimax_compact_dlmap_ie_decoder, - &ett_wimax_format_configuration_ie_decoder, - &ett_wimax_rcid_ie_decoder, - &ett_wimax_harq_control_ie_decoder, - &ett_wimax_extended_diuc_dependent_ie_decoder, - &ett_wimax_cqich_control_ie_decoder, - &ett_wimax_extension_type_ie_decoder, -}; +#endif /* New Format Indications */ static const true_false_string tfs_indication = @@ -377,591 +368,37 @@ static gint hf_extended_diuc_dependent_ie_dl_pusc_burst_allocation = -1; static gint hf_extended_diuc_dependent_ie_ul_interference_and_noise_level = -1; static gint hf_extended_diuc_dependent_ie_unknown_diuc = -1; -/* Register Wimax Compact DL-MAP IE Protocol */ -void proto_register_wimax_compact_dlmap_ie(void) + +/* Compact DL-MAP IE Types (table 89) */ +#define COMPACT_DL_MAP_TYPE_NORMAL_SUBCHANNEL 0 +#define COMPACT_DL_MAP_TYPE_BAND_AMC 1 +#define COMPACT_DL_MAP_TYPE_SAFETY 2 +#define COMPACT_DL_MAP_TYPE_UIUC 3 +#define COMPACT_DL_MAP_TYPE_FORMAT_CONF_IE 4 +#define COMPACT_DL_MAP_TYPE_HARQ_ACK_BITMAP_IE 5 +#define COMPACT_DL_MAP_TYPE_RESERVED 6 +#define COMPACT_DL_MAP_TYPE_EXTENSION 7 + +/* Compact DL-MAP IE decoder */ +guint wimax_compact_dlmap_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset) { - /* Compact DL-MAP IE display */ - static hf_register_info hf_compact_dlmap[] = + guint diuc, byte, length = 0; + guint dl_map_type, ul_map_append; + guint dl_map_offset, nibble_length, bit_map_length; + guint nband, band_count, i, allocation_mode; + +#ifdef DEBUG + /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) { - { - &hf_cdlmap_dl_map_type, - {"DL-MAP Type", "wmx.compact_dlmap.dl_map_type", FT_UINT8, BASE_DEC, NULL, DL_MAP_TYPE_MASK, NULL, HFILL} - }, - { - &hf_cdlmap_dl_map_type_1, - {"DL-MAP Type", "wmx.compact_dlmap.dl_map_type", FT_UINT8, BASE_DEC, NULL, DL_MAP_TYPE_MASK_1, NULL, HFILL} - }, - { - &hf_cdlmap_ul_map_append, - {"UL-MAP Append", "wmx.compact_dlmap.ul_map_append", FT_UINT8, BASE_HEX, NULL, UL_MAP_APPEND_MASK, NULL, HFILL} - }, - { - &hf_cdlmap_ul_map_append_1, - {"UL-MAP Append", "wmx.compact_dlmap.ul_map_append", FT_UINT8, BASE_HEX, NULL, UL_MAP_APPEND_MASK_1, NULL, HFILL} - }, - { - &hf_cdlmap_reserved, - {"Reserved", "wmx.compact_dlmap.reserved", FT_UINT8, BASE_HEX, NULL, UL_MAP_APPEND_MASK, NULL, HFILL} - }, - { - &hf_cdlmap_reserved_1, - {"Reserved", "wmx.compact_dlmap.reserved", FT_UINT8, BASE_HEX, NULL, UL_MAP_APPEND_MASK_1, NULL, HFILL} - }, - { - &hf_cdlmap_nep_code, - {"Nep Code", "wmx.compact_dlmap.nep_code", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL} - }, - { - &hf_cdlmap_nep_code_1, - {"Nep Code", "wmx.compact_dlmap.nep_code", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL} - }, - { - &hf_cdlmap_nsch_code, - {"Nsch Code", "wmx.compact_dlmap.nsch_code", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL} - }, - { - &hf_cdlmap_nsch_code_1, - {"Nsch Code", "wmx.compact_dlmap.nsch_code", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL} - }, - { - &hf_cdlmap_num_bands, - {"Number Of Bands", "wmx.compact_dlmap.num_bands", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL} - }, - { - &hf_cdlmap_num_bands_1, - {"Number Of Bands", "wmx.compact_dlmap.num_bands", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL} - }, - { - &hf_cdlmap_band_index, - {"Band Index", "wmx.compact_dlmap.band_index", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} - }, -#if 0 - { - &hf_cdlmap_band_index_1, - {"Band Index", "wmx.compact_dlmap.band_index", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL} - }, + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Compact DL-MAP IEs"); + } #endif - { - &hf_cdlmap_nb_bitmap, - {"Number Of Bits For Band BITMAP", "wmx.compact_dlmap.nb_bitmap", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL} - }, - { - &hf_cdlmap_nb_bitmap_1, - {"Number Of Bits For Band BITMAP", "wmx.compact_dlmap.nb_bitmap", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL} - }, - { - &hf_cdlmap_shortened_uiuc, - {"Shortened UIUC", "wmx.compact_dlmap.shortened_uiuc", FT_UINT8, BASE_HEX, NULL, SHORTENED_DIUC_MASK, NULL, HFILL} - }, - { - &hf_cdlmap_shortened_uiuc_1, - {"Shortened UIUC", "wmx.compact_dlmap.shortened_uiuc", FT_UINT16, BASE_HEX, NULL, SHORTENED_DIUC_MASK_1, NULL, HFILL} - }, - { - &hf_cdlmap_shortened_diuc, - {"Shortened DIUC", "wmx.compact_dlmap.shortened_diuc", FT_UINT8, BASE_HEX, NULL, SHORTENED_DIUC_MASK, NULL, HFILL} - }, - { - &hf_cdlmap_shortened_diuc_1, - {"Shortened DIUC", "wmx.compact_dlmap.shortened_diuc", FT_UINT16, BASE_HEX, NULL, SHORTENED_DIUC_MASK_1, NULL, HFILL} - }, - { - &hf_cdlmap_companded_sc, - {"Companded SC", "wmx.compact_dlmap.companded_sc", FT_UINT8, BASE_HEX, NULL, COMPANDED_SC_MASK, NULL, HFILL} - }, - { - &hf_cdlmap_companded_sc_1, - {"Companded SC", "wmx.compact_dlmap.companded_sc", FT_UINT16, BASE_HEX, NULL, COMPANDED_SC_MASK_1, NULL, HFILL} - }, - { - &hf_cdlmap_bin_offset, - {"BIN Offset", "wmx.compact_dlmap.bin_offset", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} - }, - { - &hf_cdlmap_bin_offset_1, - {"BIN Offset", "wmx.compact_dlmap.bin_offset", FT_UINT16, BASE_HEX, NULL, 0x0FF0, NULL, HFILL} - }, - { - &hf_cdlmap_diuc_num_of_subchannels, - {"Number Of Subchannels", "wmx.compact_dlmap.diuc_num_of_subchannels", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} - }, - { - &hf_cdlmap_diuc_num_of_subchannels_1, - {"Number Of Subchannels", "wmx.compact_dlmap.diuc_num_of_subchannels", FT_UINT16, BASE_DEC, NULL, 0x0FF0, NULL, HFILL} - }, - { - &hf_cdlmap_diuc_repetition_coding_indication, - {"Repetition Coding Indication", "wmx.compact_dlmap.diuc_repetition_coding_indication", FT_UINT8, BASE_DEC, VALS(rep_msgs), 0xC0, NULL, HFILL} - }, - { - &hf_cdlmap_diuc_repetition_coding_indication_1, - {"Repetition Coding Indication", "wmx.compact_dlmap.diuc_repetition_coding_indication", FT_UINT8, BASE_DEC, VALS(rep_msgs), 0x0C, NULL, HFILL} - }, - { - &hf_cdlmap_diuc_reserved, - {"Reserved", "wmx.compact_dlmap.diuc_reserved", FT_UINT8, BASE_HEX, NULL, 0x30, NULL, HFILL} - }, - { - &hf_cdlmap_diuc_reserved_1, - {"Reserved", "wmx.compact_dlmap.diuc_reserved", FT_UINT8, BASE_HEX, NULL, 0x03, NULL, HFILL} - }, - { - &hf_cdlmap_bit_map_length, - {"BIT MAP Length", "wmx.compact_dlmap.bit_map_length", FT_UINT8, BASE_DEC, NULL, MSB_NIBBLE_MASK, NULL, HFILL} - }, - { - &hf_cdlmap_bit_map_length_1, - {"BIT MAP Length", "wmx.compact_dlmap.bit_map_length", FT_UINT8, BASE_DEC, NULL, LSB_NIBBLE_MASK, NULL, HFILL} - }, - { - &hf_cdlmap_bit_map, - {"BIT MAP", "wmx.compact_dlmap.bit_map", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} - }, - { - &hf_cdlmap_diuc, - {"DIUC", "wmx.compact_dlmap.diuc", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL} - }, - { - &hf_cdlmap_diuc_1, - {"DIUC", "wmx.compact_dlmap.diuc", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL} - }, - { - &hf_cdlmap_allocation_mode, - {"Allocation Mode", "wmx.compact_dlmap.allocation_mode", FT_UINT8, BASE_DEC, VALS(vals_allocation_modes), 0xC0, NULL, HFILL} - }, - { - &hf_cdlmap_allocation_mode_1, - {"Allocation Mode", "wmx.compact_dlmap.allocation_mode", FT_UINT8, BASE_DEC, VALS(vals_allocation_modes), 0x0C, NULL, HFILL} - }, - { - &hf_cdlmap_allocation_mode_rsvd, - {"Reserved", "wmx.compact_dlmap.allocation_mode_rsvd", FT_UINT8, BASE_DEC, NULL, 0x30, NULL, HFILL} - }, - { - &hf_cdlmap_allocation_mode_rsvd_1, - {"Reserved", "wmx.compact_dlmap.allocation_mode_rsvd", FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL} - }, - { - &hf_cdlmap_num_subchannels, - {"Number Of Subchannels", "wmx.compact_dlmap.num_subchannels", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} - }, - { - &hf_cdlmap_num_subchannels_1, - {"Number Of Subchannels", "wmx.compact_dlmap.num_subchannels", FT_UINT16, BASE_DEC, NULL, 0x0FF0, NULL, HFILL} - }, - { - &hf_cdlmap_reserved_type, - {"DL-MAP Reserved Type", "wmx.compact_dlmap.reserved_type", FT_UINT8, BASE_DEC, NULL, DL_MAP_TYPE_MASK, NULL, HFILL} - }, - { - &hf_cdlmap_reserved_type_1, - {"DL-MAP Reserved Type", "wmx.compact_dlmap.reserved_type", FT_UINT8, BASE_DEC, NULL, DL_MAP_TYPE_MASK_1, NULL, HFILL} - } - }; - - /* HARQ MAP Format Configuration IE display */ - static hf_register_info hf_format_config[] = - { - { - &hf_format_config_ie_dl_map_type, - {"DL-MAP Type", "wmx.format_config_ie.dl_map_type", FT_UINT8, BASE_DEC, NULL, DL_MAP_TYPE_MASK, NULL, HFILL} - }, - { - &hf_format_config_ie_dl_map_type_1, - {"DL-MAP Type", "wmx.format_config_ie.dl_map_type", FT_UINT8, BASE_DEC, NULL, DL_MAP_TYPE_MASK_1, NULL, HFILL} - }, - { - &hf_format_config_ie_dl_map_type_32, - {"DL-MAP Type", "wmx.format_config_ie.dl_map_type", FT_UINT32, BASE_DEC, NULL, FORMAT_CONFIG_IE_DL_MAP_TYPE_MASK, NULL, HFILL} - }, - { - &hf_format_config_ie_new_format_indication, - {"New Format Indication", "wmx.format_config_ie.new_format_indication", FT_BOOLEAN, 8, TFS(&tfs_indication), UL_MAP_APPEND_MASK, NULL, HFILL} - }, - { - &hf_format_config_ie_new_format_indication_1, - {"New Format Indication", "wmx.format_config_ie.new_format_indication", FT_BOOLEAN, 8, TFS(&tfs_indication), UL_MAP_APPEND_MASK_1, NULL, HFILL} - }, - { - &hf_format_config_ie_new_format_indication_32, - {"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} - }, - { - &hf_format_config_ie_cid_type, - {"HARQ MAP Indicator", "wmx.harq_map.format_config_ie.indicator", FT_UINT32, BASE_HEX, VALS(vals_cid_types), CID_TYPE_MASK, NULL, HFILL} - }, - { - &hf_format_config_ie_cid_type_1, - {"CID Type", "wmx.harq_map.format_config_ie.cid_type", FT_UINT32, BASE_HEX, VALS(vals_cid_types), CID_TYPE_MASK_1, NULL, HFILL} - }, - { - &hf_format_config_ie_safety_pattern, - {"Safety Pattern", "wmx.harq_map.format_config_ie.safety_pattern", FT_UINT32, BASE_HEX, NULL, SAFETY_PATTERN_MASK, NULL, HFILL} - }, - { - &hf_format_config_ie_safety_pattern_1, - {"Safety Pattern", "wmx.harq_map.format_config_ie.safety_pattern", FT_UINT32, BASE_HEX, NULL, SAFETY_PATTERN_MASK_1, NULL, HFILL} - }, - { - &hf_format_config_ie_subchannel_type, - {"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} - }, - { - &hf_format_config_ie_subchannel_type_1, - {"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} - }, - { - &hf_format_config_ie_max_logical_bands, - {"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} - }, - { - &hf_format_config_ie_max_logical_bands_1, - {"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} - }, - { - &hf_format_config_ie_num_of_broadcast_symbol, - {"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} - }, - { - &hf_format_config_ie_num_of_broadcast_symbol_1, - {"Number Of Symbols for Broadcast", "wmx.harq_map.num_of_broadcast_symbol", FT_UINT32, BASE_HEX, NULL, NUM_BROADCAST_SYMBOLS_MASK_1, NULL, HFILL} - }, - { - &hf_format_config_ie_num_of_dl_band_amc_symbol, - {"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} - }, - { - &hf_format_config_ie_num_of_dl_band_amc_symbol_1, - {"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} - }, - { - &hf_format_config_ie_num_of_ul_band_amc_symbol, - {"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} - }, - { - &hf_format_config_ie_num_of_ul_band_amc_symbol_1, - {"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} - } - }; - - /* HARQ MAP Reduced CID IE display */ - static hf_register_info hf_rcid[] = - { - { - &hf_harq_rcid_ie_normal_cid, - {"Normal CID", "wmx.harq_map.rcid_ie.normal_cid", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL} - }, - { - &hf_harq_rcid_ie_normal_cid_1, - {"Normal CID", "wmx.harq_map.rcid_ie.normal_cid", FT_UINT24, BASE_HEX, NULL, WIMAX_RCID_IE_NORMAL_CID_MASK_1, NULL, HFILL} - }, - { - &hf_harq_rcid_ie_prefix, - {"Prefix", "wmx.harq_map.rcid_ie.prefix", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_PREFIX_MASK, NULL, HFILL} - }, - { - &hf_harq_rcid_ie_prefix_1, - {"Prefix", "wmx.harq_map.rcid_ie.prefix", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_PREFIX_MASK_1, NULL, HFILL} - }, - { - &hf_harq_rcid_ie_cid3, - {"3 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid3", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID3_MASK, NULL, HFILL} - }, - { - &hf_harq_rcid_ie_cid3_1, - {"3 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid3", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID3_MASK_1, NULL, HFILL} - }, - { - &hf_harq_rcid_ie_cid7, - {"7 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid7", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID7_MASK, NULL, HFILL} - }, - { - &hf_harq_rcid_ie_cid7_1, - {"7 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid7", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID7_MASK_1, NULL, HFILL} - }, - { - &hf_harq_rcid_ie_cid11, - {"11 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid11", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID11_MASK, NULL, HFILL} - }, - { - &hf_harq_rcid_ie_cid11_1, - {"11 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid11", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID11_MASK_1, NULL, HFILL} - }, - { - &hf_harq_rcid_ie_cid11_2, - {"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} - }, - { - &hf_harq_rcid_ie_cid11_3, - {"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} - } - }; - - /* HARQ MAP HARQ Control IE display */ - static hf_register_info hf_harq_control[] = - { - { - &hf_harq_control_ie_prefix, - {"Prefix", "wmx.harq_map.harq_control_ie.prefix", FT_BOOLEAN, 8, TFS(&tfs_prefix), WIMAX_HARQ_CONTROL_IE_PREFIX_MASK, NULL, HFILL} - }, - { - &hf_harq_control_ie_ai_sn, - {"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} - }, - { - &hf_harq_control_ie_spid, - {"Subpacket ID (SPID)", "wmx.harq_map.harq_control_ie.spid", FT_UINT8, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_SPID_MASK, NULL, HFILL} - }, - { - &hf_harq_control_ie_acid, - {"HARQ CH ID (ACID)", "wmx.harq_map.harq_control_ie.acid", FT_UINT8, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_ACID_MASK, NULL, HFILL} - }, - { - &hf_harq_control_ie_reserved, - {"Reserved", "wmx.harq_map.harq_control_ie.reserved", FT_UINT8, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_RESERVED_MASK, NULL, HFILL} - }, - { - &hf_harq_control_ie_prefix_1, - {"Prefix", "wmx.harq_map.harq_control_ie.prefix", FT_BOOLEAN, 16, TFS(&tfs_prefix), WIMAX_HARQ_CONTROL_IE_PREFIX_MASK_1, NULL, HFILL} - }, - { - &hf_harq_control_ie_ai_sn_1, - {"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} - }, - { - &hf_harq_control_ie_spid_1, - {"Subpacket ID (SPID)", "wmx.harq_map.harq_control_ie.spid", FT_UINT16, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_SPID_MASK_1, NULL, HFILL} - }, - { - &hf_harq_control_ie_acid_1, - {"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} - }, - { - &hf_harq_control_ie_reserved_1, - {"Reserved", "wmx.harq_map.harq_control_ie.reserved", FT_UINT16, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_RESERVED_MASK_1, NULL, HFILL} - } - }; - - /* HARQ MAP CQICH Control IE display */ - static hf_register_info hf_cqich_control[] = - { - { - &hf_cqich_control_ie_indicator, - {"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} - }, - { - &hf_cqich_control_ie_alloc_id, - {"Allocation Index", "wmx.harq_map.cqich_control_ie.alloc_id", FT_UINT16, BASE_HEX, NULL, WIMAX_CQICH_CONTROL_IE_ALLOCATION_INDEX_MASK, NULL, HFILL} - }, - { - &hf_cqich_control_ie_period, - {"PERIOD", "wmx.harq_map.cqich_control_ie.period", FT_UINT16, BASE_HEX, NULL, WIMAX_CQICH_CONTROL_IE_PERIOD_MASK, NULL, HFILL} - }, - { - &hf_cqich_control_ie_frame_offset, - {"Frame Offset", "wmx.harq_map.cqich_control_ie.frame_offset", FT_UINT16, BASE_HEX, NULL, WIMAX_CQICH_CONTROL_IE_FRAME_OFFSET_MASK, NULL, HFILL} - }, - { - &hf_cqich_control_ie_duration, - {"Duration", "wmx.harq_map.cqich_control_ie.duration", FT_UINT16, BASE_HEX, NULL, WIMAX_CQICH_CONTROL_IE_DURATION_MASK, NULL, HFILL} - }, - { - &hf_cqich_control_ie_cqi_rep_threshold, - {"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} - }, - { - &hf_cqich_control_ie_indicator_1, - {"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} - }, - { - &hf_cqich_control_ie_alloc_id_1, - {"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} - }, - { - &hf_cqich_control_ie_period_1, - {"PERIOD", "wmx.harq_map.cqich_control_ie.period", FT_UINT24, BASE_HEX, NULL, WIMAX_CQICH_CONTROL_IE_PERIOD_MASK_1, NULL, HFILL} - }, - { - &hf_cqich_control_ie_frame_offset_1, - {"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} - }, - { - &hf_cqich_control_ie_duration_1, - {"Duration", "wmx.harq_map.cqich_control_ie.duration", FT_UINT24, BASE_HEX, NULL, WIMAX_CQICH_CONTROL_IE_DURATION_MASK_1, NULL, HFILL} - }, - { - &hf_cqich_control_ie_cqi_rep_threshold_1, - {"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} - } - }; - - static hf_register_info hf_extension_type[] = - { - { - &hf_cdlmap_extension_type, - {"DL-MAP Type", "wmx.extension_type.dl_map_type", FT_UINT16, BASE_DEC, NULL, EXTENSION_TYPE_MASK, NULL, HFILL} - }, - { - &hf_cdlmap_extension_type_1, - {"DL-MAP Type", "wmx.extension_type.dl_map_type", FT_UINT16, BASE_DEC, NULL, EXTENSION_TYPE_MASK_1, NULL, HFILL} - }, - { - &hf_cdlmap_extension_subtype, - {"Extension Subtype", "wmx.extension_type.subtype", FT_UINT16, BASE_DEC, NULL, EXTENSION_SUBTYPE_MASK, NULL, HFILL} - }, - { - &hf_cdlmap_extension_subtype_1, - {"Extension Subtype", "wmx.extension_type.subtype", FT_UINT16, BASE_DEC, NULL, EXTENSION_SUBTYPE_MASK_1, NULL, HFILL} - }, - { - &hf_cdlmap_extension_length, - {"Extension Length", "wmx.extension_type.length", FT_UINT16, BASE_DEC, NULL, EXTENSION_LENGTH_MASK, NULL, HFILL} - }, - { - &hf_cdlmap_extension_length_1, - {"Extension Length", "wmx.extension_type.length", FT_UINT16, BASE_DEC, NULL, EXTENSION_LENGTH_MASK_1, NULL, HFILL} - }, - { - &hf_cdlmap_extension_time_diversity_mbs, - {"Time Diversity MBS", "wmx.extension_type.time_diversity_mbs", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} - }, - { - &hf_cdlmap_extension_time_diversity_mbs_1, - {"Time Diversity MBS", "wmx.extension_type.time_diversity_mbs", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} - }, - { - &hf_cdlmap_extension_harq_mode_1, - {"HARQ Mode Switch", "wmx.extension_type.harq_mode", FT_UINT16, BASE_HEX, NULL, 0x000F, NULL, HFILL} - }, - { - &hf_cdlmap_extension_harq_mode, - {"HARQ Mode Switch", "wmx.extension_type.harq_mode", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL} - }, - { - &hf_cdlmap_extension_unknown_sub_type, - {"Unknown Extension Subtype", "wmx.extension_type.unknown_sub_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} - }, - { - &hf_cdlmap_extension_unknown_sub_type_1, - {"Unknown Extension Subtype", "wmx.extension_type.unknown_sub_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} - } - }; - - /* Extended DIUC dependent IE */ - static hf_register_info hf_extended_diuc[] = - { - { - &hf_extended_diuc_dependent_ie_diuc, - {"Extended DIUC", "wmx.extended_diuc_dependent_ie.diuc", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL } - }, - { - &hf_extended_diuc_dependent_ie_diuc_1, - {"Extended DIUC", "wmx.extended_diuc_dependent_ie.diuc", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL } - }, - { - &hf_extended_diuc_dependent_ie_length, - {"Length", "wmx.extended_diuc_dependent_ie.length", FT_UINT8, BASE_DEC, NULL, MSB_NIBBLE_MASK, NULL, HFILL } - }, - { - &hf_extended_diuc_dependent_ie_length_1, - {"Length", "wmx.extended_diuc_dependent_ie.length", FT_UINT8, BASE_DEC, NULL, LSB_NIBBLE_MASK, NULL, HFILL } - }, - { /* 8.4.5.3.? Channel_Measurement_IE */ - &hf_extended_diuc_dependent_ie_channel_measurement, - {"Channel_Measurement_IE (not implemented)", "wmx.extended_diuc_dependent_ie.channel_measurement", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } - }, - { /* 8.4.5.3.4 STC_Zone_IE */ - &hf_extended_diuc_dependent_ie_stc_zone, - {"STC_Zone_IE (not implemented)", "wmx.extended_diuc_dependent_ie.stc_zone", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } - }, - { /* 8.4.5.3.3 AAS_DL_IE */ - &hf_extended_diuc_dependent_ie_aas_dl, - {"AAS_DL_IE (not implemented)", "wmx.extended_diuc_dependent_ie.aas_dl", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } - }, - { /* 8.4.5.3.6 Data_location_in_another_BS_IE */ - &hf_extended_diuc_dependent_ie_data_location, - {"Data_location_in_another_BS_IE (not implemented)", "wmx.extended_diuc_dependent_ie.data_location", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } - }, - { /* 8.4.5.3.7 CID_Switch_IE */ - &hf_extended_diuc_dependent_ie_cid_switch, - {"CID_Switch_IE (not implemented)", "wmx.extended_diuc_dependent_ie.cid_switch", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } - }, - - { /* 8.4.5.3.8 MIMO_DL_Basic_IE */ - &hf_extended_diuc_dependent_ie_mimo_dl_basic, - {"MIMO_DL_Basic_IE (not implemented)", "wmx.extended_diuc_dependent_ie.mimo_dl_basic", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } - }, - { /* 8.4.5.3.9 MIMO_DL_Enhanced_IE */ - &hf_extended_diuc_dependent_ie_mimo_dl_enhanced, - {"MIMO_DL_Enhanced_IE (not implemented)", "wmx.extended_diuc_dependent_ie.mimo_dl_enhanced", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } - }, - { /* 8.4.5.3.10 HARQ_Map_Pointer_IE */ - &hf_extended_diuc_dependent_ie_harq_map_pointer, - {"HARQ_Map_Pointer_IE (not implemented)", "wmx.extended_diuc_dependent_ie.harq_map_pointer", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } - }, - { /* 8.4.5.3.11 PHYMOD_DL_IE */ - &hf_extended_diuc_dependent_ie_phymod_dl, - {"PHYMOD_DL_IE (not implemented)", "wmx.extended_diuc_dependent_ie.phymod_dl", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } - }, - { /* 8.4.5.3.13 DL PUSC Burst Allocation in Other Segment IE */ - &hf_extended_diuc_dependent_ie_dl_pusc_burst_allocation, - {"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 } - }, - { /* 8.4.5.3.19 UL_interference_and_noise_level_IE */ - &hf_extended_diuc_dependent_ie_ul_interference_and_noise_level, - {"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 } - }, - { /* unknown DIUC */ - &hf_extended_diuc_dependent_ie_unknown_diuc, - {"Unknown Extended DIUC", "wmx.extended_diuc_dependent_ie.unknown_diuc", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } - } - }; - - if (proto_wimax_compact_dlmap_ie_decoder == -1) - { - proto_wimax_compact_dlmap_ie_decoder = proto_wimax; - - proto_register_subtree_array(ett, array_length(ett)); - proto_register_field_array(proto_wimax_compact_dlmap_ie_decoder, hf_compact_dlmap, array_length(hf_compact_dlmap)); - proto_register_field_array(proto_wimax_compact_dlmap_ie_decoder, hf_format_config, array_length(hf_format_config)); - proto_register_field_array(proto_wimax_compact_dlmap_ie_decoder, hf_rcid, array_length(hf_rcid)); - proto_register_field_array(proto_wimax_compact_dlmap_ie_decoder, hf_harq_control, array_length(hf_harq_control)); - proto_register_field_array(proto_wimax_compact_dlmap_ie_decoder, hf_cqich_control, array_length(hf_cqich_control)); - proto_register_field_array(proto_wimax_compact_dlmap_ie_decoder, hf_extension_type, array_length(hf_extension_type)); - proto_register_field_array(proto_wimax_compact_dlmap_ie_decoder, hf_extended_diuc, array_length(hf_extended_diuc)); - } -} - -/* Compact DL-MAP IE Types (table 89) */ -#define COMPACT_DL_MAP_TYPE_NORMAL_SUBCHANNEL 0 -#define COMPACT_DL_MAP_TYPE_BAND_AMC 1 -#define COMPACT_DL_MAP_TYPE_SAFETY 2 -#define COMPACT_DL_MAP_TYPE_UIUC 3 -#define COMPACT_DL_MAP_TYPE_FORMAT_CONF_IE 4 -#define COMPACT_DL_MAP_TYPE_HARQ_ACK_BITMAP_IE 5 -#define COMPACT_DL_MAP_TYPE_RESERVED 6 -#define COMPACT_DL_MAP_TYPE_EXTENSION 7 - -/* Compact DL-MAP IE decoder */ -guint wimax_compact_dlmap_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset) -{ - guint diuc, byte, length = 0; - guint dl_map_type, ul_map_append; - guint dl_map_offset, nibble_length, bit_map_length; - guint nband, band_count, i, allocation_mode; - -#ifdef DEBUG - /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Compact DL-MAP IEs"); - } -#endif - /* set the local offset */ - dl_map_offset = offset; - /* Get the first byte */ - byte = tvb_get_guint8(tvb, dl_map_offset); - if(nibble_offset & 1) + /* set the local offset */ + dl_map_offset = offset; + /* Get the first byte */ + byte = tvb_get_guint8(tvb, dl_map_offset); + if(nibble_offset & 1) { dl_map_type = ((byte & DL_MAP_TYPE_MASK_1) >> 1); ul_map_append = (byte & UL_MAP_APPEND_MASK_1); @@ -1761,381 +1198,947 @@ static guint wimax_compact_dlmap_rcid_ie_decoder(proto_tree *tree, packet_info * } } /* return the IE length in nibbles */ - return length; + return length; +} + +/* Compact DL-MAP HARQ Control IE (6.3.2.3.43.4) decoder */ +static guint wimax_compact_dlmap_harq_control_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset) +{ + guint byte, prefix, length = 0; + + UNREFERENCED_PARAMETER(pinfo); + +#ifdef DEBUG + /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "HARQ Control IE"); + } +#endif + /* Get the first byte */ + byte = tvb_get_guint8(tvb, offset); + if(nibble_offset & 1) + { /* Get the prefix bit */ + prefix = (byte & 0x08); + /* display the prefix */ + proto_tree_add_item(tree, hf_harq_control_ie_prefix_1, tvb, offset, 2, FALSE); + if(prefix) + { /* display the ai_sn */ + proto_tree_add_item(tree, hf_harq_control_ie_ai_sn_1, tvb, offset, 2, FALSE); + /* display the spid */ + proto_tree_add_item(tree, hf_harq_control_ie_spid_1, tvb, offset, 2, FALSE); + /* display the acid */ + proto_tree_add_item(tree, hf_harq_control_ie_acid_1, tvb, offset, 2, FALSE); + length = 2; + } + else + { /* display the reserved bits */ + proto_tree_add_item(tree, hf_harq_control_ie_reserved_1, tvb, offset, 2, FALSE); + length = 1; + } + } + else + { /* Get the prefix bit */ + prefix = (byte & 0x80); + /* display the prefix */ + proto_tree_add_item(tree, hf_harq_control_ie_prefix, tvb, offset, 1, FALSE); + if(prefix) + { /* display the ai_sn */ + proto_tree_add_item(tree, hf_harq_control_ie_ai_sn, tvb, offset, 1, FALSE); + /* display the spid */ + proto_tree_add_item(tree, hf_harq_control_ie_spid, tvb, offset, 1, FALSE); + /* display the acid */ + proto_tree_add_item(tree, hf_harq_control_ie_acid, tvb, offset, 1, FALSE); + length = 2; + } + else + { /* display the reserved bits */ + proto_tree_add_item(tree, hf_harq_control_ie_reserved, tvb, offset, 1, FALSE); + length = 1; + } + } + /* return the IE length in nibbles */ + return length; +} + +/* Compact DL-MAP CQICH Control IE (6.3.2.3.43.5) decoder */ +static guint wimax_compact_dlmap_cqich_control_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset) +{ + guint byte, cqich_indicator, length = 0; + + UNREFERENCED_PARAMETER(pinfo); + +#ifdef DEBUG + /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "CQICH Control IE"); + } +#endif + /* Get the first byte */ + byte = tvb_get_guint8(tvb, offset); + if(nibble_offset & 1) + { /* Get the CQICH indicator */ + cqich_indicator = (byte & 0x08); + if(cqich_indicator) + { /* display the CQICH indicator */ + proto_tree_add_item(tree, hf_cqich_control_ie_indicator_1, tvb, offset, 3, FALSE); + /* display the allocation index */ + proto_tree_add_item(tree, hf_cqich_control_ie_alloc_id_1, tvb, offset, 3, FALSE); + /* display the period */ + proto_tree_add_item(tree, hf_cqich_control_ie_period_1, tvb, offset, 3, FALSE); + /* display the frame offset */ + proto_tree_add_item(tree, hf_cqich_control_ie_frame_offset_1, tvb, offset, 3, FALSE); + /* display the duration */ + proto_tree_add_item(tree, hf_cqich_control_ie_duration_1, tvb, offset, 3, FALSE); + length = 4; + } + else + { /* display the CQICH indicator */ + proto_tree_add_item(tree, hf_cqich_control_ie_indicator_1, tvb, offset, 1, FALSE); + /* display the CQI reporting threshold */ + proto_tree_add_item(tree, hf_cqich_control_ie_cqi_rep_threshold_1, tvb, offset, 1, FALSE); + length = 1; + } + } + else + { /* Get the CQICH indicator */ + cqich_indicator = (byte & 0x80); + if(cqich_indicator) + { /* display the CQICH indicator */ + proto_tree_add_item(tree, hf_cqich_control_ie_indicator, tvb, offset, 2, FALSE); + /* display the allocation index */ + proto_tree_add_item(tree, hf_cqich_control_ie_alloc_id, tvb, offset, 2, FALSE); + /* display the period */ + proto_tree_add_item(tree, hf_cqich_control_ie_period, tvb, offset, 2, FALSE); + /* display the frame offset */ + proto_tree_add_item(tree, hf_cqich_control_ie_frame_offset, tvb, offset, 2, FALSE); + /* display the duration */ + proto_tree_add_item(tree, hf_cqich_control_ie_duration, tvb, offset, 2, FALSE); + length = 4; + } + else + { /* display the CQICH indicator */ + proto_tree_add_item(tree, hf_cqich_control_ie_indicator, tvb, offset, 1, FALSE); + /* display the CQI reporting threshold */ + proto_tree_add_item(tree, hf_cqich_control_ie_cqi_rep_threshold, tvb, offset, 1, FALSE); + length = 1; + } + } + /* return the IE length in nibbles */ + return length; +} + +/* DL-MAP Extension IE sub-types */ +#define TIME_DIVERSITY_MBS 0 +#define HARQ_MODE_SWITCH 1 + +/* Compact DL-MAP Extension IE (6.3.2.3.43.6.6) decoder */ +static guint wimax_cdlmap_extension_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset) +{ + guint tvb_value, dl_map_type, sub_type, length; + + UNREFERENCED_PARAMETER(pinfo); + +#ifdef DEBUG + /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "DL-MAP Extension IE"); + } +#endif + /* Get the first 16-bit word */ + tvb_value = tvb_get_ntohs(tvb, offset); + if(nibble_offset & 1) + { /* Get the dl-map type */ + dl_map_type = ((tvb_value & 0x0E00) >> 9); + if(dl_map_type != COMPACT_DL_MAP_TYPE_EXTENSION) + return 0; + /* Get the sub-type */ + sub_type = ((tvb_value & 0x01F0) >> 4); + /* Get the IE length */ + length = (tvb_value & 0x000F); + /* display the DL-MAP type */ + proto_tree_add_item(tree, hf_cdlmap_extension_type_1, tvb, offset, 2, FALSE); + /* display the DL-MAP extension subtype */ + proto_tree_add_item(tree, hf_cdlmap_extension_subtype_1, tvb, offset, 2, FALSE); + /* display the IE length */ + proto_tree_add_item(tree, hf_cdlmap_extension_length_1, tvb, offset, 2, FALSE); + offset += 2; + switch (sub_type) + { + case TIME_DIVERSITY_MBS: + /* display the time-diversity MBS in HEX */ + proto_tree_add_item(tree, hf_cdlmap_extension_time_diversity_mbs_1, tvb, offset, (length - 2), FALSE); + break; + case HARQ_MODE_SWITCH: + /* display the HARQ mode */ + proto_tree_add_item(tree, hf_cdlmap_extension_harq_mode, tvb, offset, 1, FALSE); + /* Get the next byte */ + tvb_value = tvb_get_guint8(tvb, offset); + /* get the HARQ mode */ + harq_mode = ((tvb_value & MSB_NIBBLE_MASK) >> 4); + break; + default: + /* display the unknown sub-type in HEX */ + proto_tree_add_item(tree, hf_cdlmap_extension_unknown_sub_type_1, tvb, offset, (length - 2), FALSE); + break; + } + } + else + { /* Get the dl-map type */ + dl_map_type = ((tvb_value & 0xE000) >> 13); + if(dl_map_type != COMPACT_DL_MAP_TYPE_EXTENSION) + return 0; + /* Get the sub-type */ + sub_type = ((tvb_value & 0x1F00) >> 8); + /* Get the IE length */ + length = ((tvb_value & 0x00F0) >> 4); + /* display the DL-MAP type */ + proto_tree_add_item(tree, hf_cdlmap_extension_type, tvb, offset, 2, FALSE); + /* display the DL-MAP extension subtype */ + proto_tree_add_item(tree, hf_cdlmap_extension_subtype, tvb, offset, 2, FALSE); + /* display the IE length */ + proto_tree_add_item(tree, hf_cdlmap_extension_length, tvb, offset, 2, FALSE); + switch (sub_type) + { + case TIME_DIVERSITY_MBS: + /* display the time-diversity MBS in HEX */ + proto_tree_add_item(tree, hf_cdlmap_extension_time_diversity_mbs, tvb, (offset + 1), (length - 1), FALSE); + break; + case HARQ_MODE_SWITCH: + /* display the HARQ mode */ + proto_tree_add_item(tree, hf_cdlmap_extension_harq_mode_1, tvb, offset, 2, FALSE); + /* get the HARQ mode */ + harq_mode = (tvb_value & 0x000F); + break; + default: + /* display the unknown sub-type in HEX */ + proto_tree_add_item(tree, hf_cdlmap_extension_unknown_sub_type, tvb, (offset + 1), (length - 1), FALSE); + break; + } + } + /* return the IE length in nibbles */ + return (length * 2); } -/* Compact DL-MAP HARQ Control IE (6.3.2.3.43.4) decoder */ -static guint wimax_compact_dlmap_harq_control_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset) +/* Extended DIUCs (table 277a) */ +#define CHANNEL_MEASUREMENT_IE 0 +#define STC_ZONE_IE 1 +#define AAS_DL_IE 2 +#define DATA_LOCATION_IN_ANOTHER_BS_IE 3 +#define CID_SWITCH_IE 4 +#define MIMO_DL_BASIC_IE 5 +#define MIMO_DL_ENHANCED_IE 6 +#define HARQ_MAP_POINTER_IE 7 +#define PHYMOD_DL_IE 8 +#define DL_PUSC_BURST_ALLOCATION_IN_OTHER_SEGMENT_IE 11 +#define UL_INTERFERENCE_AND_NOISE_LEVEL_IE 15 + +/* Extended DIUC IE (8.4.5.3.2) */ +guint wimax_extended_diuc_dependent_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset) { - guint byte, prefix, length = 0; + guint ext_diuc, length; + guint8 byte; UNREFERENCED_PARAMETER(pinfo); -#ifdef DEBUG - /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "HARQ Control IE"); - } -#endif - /* Get the first byte */ - byte = tvb_get_guint8(tvb, offset); + /* get the first byte */ + byte = tvb_get_guint8(tvb, offset); if(nibble_offset & 1) - { /* Get the prefix bit */ - prefix = (byte & 0x08); - /* display the prefix */ - proto_tree_add_item(tree, hf_harq_control_ie_prefix_1, tvb, offset, 2, FALSE); - if(prefix) - { /* display the ai_sn */ - proto_tree_add_item(tree, hf_harq_control_ie_ai_sn_1, tvb, offset, 2, FALSE); - /* display the spid */ - proto_tree_add_item(tree, hf_harq_control_ie_spid_1, tvb, offset, 2, FALSE); - /* display the acid */ - proto_tree_add_item(tree, hf_harq_control_ie_acid_1, tvb, offset, 2, FALSE); - length = 2; - } - else - { /* display the reserved bits */ - proto_tree_add_item(tree, hf_harq_control_ie_reserved_1, tvb, offset, 2, FALSE); - length = 1; + { /* get the extended DIUC */ + ext_diuc = (byte & LSB_NIBBLE_MASK); + /* display extended DIUC */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_diuc_1, tvb, offset, 1, FALSE); + /* move to next byte */ + offset++; + /* get the 2nd byte */ + byte = tvb_get_guint8(tvb, offset); + /* get the length */ + length = ((byte & MSB_NIBBLE_MASK) >> 4); + /* display extended DIUC length */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_length, tvb, offset, 1, FALSE); + /* 8.4.5.3.2.1 (table 277a) */ + switch (ext_diuc) + { + case CHANNEL_MEASUREMENT_IE: + /* 8.4.5.3.? Channel_Measurement_IE */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_channel_measurement, tvb, offset, (length + 1), FALSE); + break; + case STC_ZONE_IE: + /* 8.4.5.3.4 STC_Zone_IE */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_stc_zone, tvb, offset, (length + 1), FALSE); + break; + case AAS_DL_IE: + /* 8.4.5.3.3 AAS_DL_IE */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_aas_dl, tvb, offset, (length + 1), FALSE); + break; + case DATA_LOCATION_IN_ANOTHER_BS_IE: + /* 8.4.5.3.6 Data_location_in_another_BS_IE */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_data_location, tvb, offset, (length + 1), FALSE); + break; + case CID_SWITCH_IE: + /* 8.4.5.3.7 CID_Switch_IE */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_cid_switch, tvb, offset, (length + 1), FALSE); + break; + case MIMO_DL_BASIC_IE: + /* 8.4.5.3.8 MIMO_DL_Basic_IE */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_mimo_dl_basic, tvb, offset, (length + 1), FALSE); + break; + case MIMO_DL_ENHANCED_IE: + /* 8.4.5.3.9 MIMO_DL_Enhanced_IE */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_mimo_dl_enhanced, tvb, offset, (length + 1), FALSE); + break; + case HARQ_MAP_POINTER_IE: + /* 8.4.5.3.10 HARQ_Map_Pointer_IE */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_harq_map_pointer, tvb, offset, (length + 1), FALSE); + break; + case PHYMOD_DL_IE: + /* 8.4.5.3.11 PHYMOD_DL_IE */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_phymod_dl, tvb, offset, (length + 1), FALSE); + break; + case DL_PUSC_BURST_ALLOCATION_IN_OTHER_SEGMENT_IE: + /* 8.4.5.3.13 DL PUSC Burst Allocation in Other Segment IE */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_dl_pusc_burst_allocation, tvb, offset, (length + 1), FALSE); + break; + case UL_INTERFERENCE_AND_NOISE_LEVEL_IE: + /* 8.4.5.3.19 UL_interference_and_noise_level_IE */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_ul_interference_and_noise_level, tvb, offset, (length + 1), FALSE); + break; + default: + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_unknown_diuc, tvb, offset, (length + 1), FALSE); + break; } } else - { /* Get the prefix bit */ - prefix = (byte & 0x80); - /* display the prefix */ - proto_tree_add_item(tree, hf_harq_control_ie_prefix, tvb, offset, 1, FALSE); - if(prefix) - { /* display the ai_sn */ - proto_tree_add_item(tree, hf_harq_control_ie_ai_sn, tvb, offset, 1, FALSE); - /* display the spid */ - proto_tree_add_item(tree, hf_harq_control_ie_spid, tvb, offset, 1, FALSE); - /* display the acid */ - proto_tree_add_item(tree, hf_harq_control_ie_acid, tvb, offset, 1, FALSE); - length = 2; + { /* get the extended DIUC */ + ext_diuc = ((byte & MSB_NIBBLE_MASK) >> 4); + /* get the length */ + length = (byte & LSB_NIBBLE_MASK); + /* display extended DIUC */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_diuc, tvb, offset, 1, FALSE); + /* display extended DIUC length */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_length_1, tvb, offset, 1, FALSE); + /* move to next byte */ + offset++; + /* 8.4.5.3.2.1 (table 277a) */ + switch (ext_diuc) + { + case CHANNEL_MEASUREMENT_IE: + /* 8.4.5.3.? Channel_Measurement_IE */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_channel_measurement, tvb, offset, length, FALSE); + break; + case STC_ZONE_IE: + /* 8.4.5.3.4 STC_Zone_IE */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_stc_zone, tvb, offset, length, FALSE); + break; + case AAS_DL_IE: + /* 8.4.5.3.3 AAS_DL_IE */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_aas_dl, tvb, offset, length, FALSE); + break; + case DATA_LOCATION_IN_ANOTHER_BS_IE: + /* 8.4.5.3.6 Data_location_in_another_BS_IE */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_data_location, tvb, offset, length, FALSE); + break; + case CID_SWITCH_IE: + /* 8.4.5.3.7 CID_Switch_IE */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_cid_switch, tvb, offset, length, FALSE); + break; + case MIMO_DL_BASIC_IE: + /* 8.4.5.3.8 MIMO_DL_Basic_IE */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_mimo_dl_basic, tvb, offset, length, FALSE); + break; + case MIMO_DL_ENHANCED_IE: + /* 8.4.5.3.9 MIMO_DL_Enhanced_IE */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_mimo_dl_enhanced, tvb, offset, length, FALSE); + break; + case HARQ_MAP_POINTER_IE: + /* 8.4.5.3.10 HARQ_Map_Pointer_IE */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_harq_map_pointer, tvb, offset, length, FALSE); + break; + case PHYMOD_DL_IE: + /* 8.4.5.3.11 PHYMOD_DL_IE */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_phymod_dl, tvb, offset, length, FALSE); + break; + case DL_PUSC_BURST_ALLOCATION_IN_OTHER_SEGMENT_IE: + /* 8.4.5.3.13 DL PUSC Burst Allocation in Other Segment IE */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_dl_pusc_burst_allocation, tvb, offset, length, FALSE); + break; + case UL_INTERFERENCE_AND_NOISE_LEVEL_IE: + /* 8.4.5.3.19 UL_interference_and_noise_level_IE */ + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_ul_interference_and_noise_level, tvb, offset, length, FALSE); + break; + default: + proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_unknown_diuc, tvb, offset, length, FALSE); + break; } - else - { /* display the reserved bits */ - proto_tree_add_item(tree, hf_harq_control_ie_reserved, tvb, offset, 1, FALSE); - length = 1; + } + return ((length + 1) * 2 ); /* length in nibbles */ + +} + +/* Register Wimax Compact DL-MAP IE Protocol */ +void proto_register_wimax_compact_dlmap_ie(void) +{ + /* Compact DL-MAP IE display */ + static hf_register_info hf_compact_dlmap[] = + { + { + &hf_cdlmap_dl_map_type, + {"DL-MAP Type", "wmx.compact_dlmap.dl_map_type", FT_UINT8, BASE_DEC, NULL, DL_MAP_TYPE_MASK, NULL, HFILL} + }, + { + &hf_cdlmap_dl_map_type_1, + {"DL-MAP Type", "wmx.compact_dlmap.dl_map_type", FT_UINT8, BASE_DEC, NULL, DL_MAP_TYPE_MASK_1, NULL, HFILL} + }, + { + &hf_cdlmap_ul_map_append, + {"UL-MAP Append", "wmx.compact_dlmap.ul_map_append", FT_UINT8, BASE_HEX, NULL, UL_MAP_APPEND_MASK, NULL, HFILL} + }, + { + &hf_cdlmap_ul_map_append_1, + {"UL-MAP Append", "wmx.compact_dlmap.ul_map_append", FT_UINT8, BASE_HEX, NULL, UL_MAP_APPEND_MASK_1, NULL, HFILL} + }, + { + &hf_cdlmap_reserved, + {"Reserved", "wmx.compact_dlmap.reserved", FT_UINT8, BASE_HEX, NULL, UL_MAP_APPEND_MASK, NULL, HFILL} + }, + { + &hf_cdlmap_reserved_1, + {"Reserved", "wmx.compact_dlmap.reserved", FT_UINT8, BASE_HEX, NULL, UL_MAP_APPEND_MASK_1, NULL, HFILL} + }, + { + &hf_cdlmap_nep_code, + {"Nep Code", "wmx.compact_dlmap.nep_code", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL} + }, + { + &hf_cdlmap_nep_code_1, + {"Nep Code", "wmx.compact_dlmap.nep_code", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL} + }, + { + &hf_cdlmap_nsch_code, + {"Nsch Code", "wmx.compact_dlmap.nsch_code", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL} + }, + { + &hf_cdlmap_nsch_code_1, + {"Nsch Code", "wmx.compact_dlmap.nsch_code", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL} + }, + { + &hf_cdlmap_num_bands, + {"Number Of Bands", "wmx.compact_dlmap.num_bands", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL} + }, + { + &hf_cdlmap_num_bands_1, + {"Number Of Bands", "wmx.compact_dlmap.num_bands", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL} + }, + { + &hf_cdlmap_band_index, + {"Band Index", "wmx.compact_dlmap.band_index", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} + }, +#if 0 + { + &hf_cdlmap_band_index_1, + {"Band Index", "wmx.compact_dlmap.band_index", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL} + }, +#endif + { + &hf_cdlmap_nb_bitmap, + {"Number Of Bits For Band BITMAP", "wmx.compact_dlmap.nb_bitmap", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL} + }, + { + &hf_cdlmap_nb_bitmap_1, + {"Number Of Bits For Band BITMAP", "wmx.compact_dlmap.nb_bitmap", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL} + }, + { + &hf_cdlmap_shortened_uiuc, + {"Shortened UIUC", "wmx.compact_dlmap.shortened_uiuc", FT_UINT8, BASE_HEX, NULL, SHORTENED_DIUC_MASK, NULL, HFILL} + }, + { + &hf_cdlmap_shortened_uiuc_1, + {"Shortened UIUC", "wmx.compact_dlmap.shortened_uiuc", FT_UINT16, BASE_HEX, NULL, SHORTENED_DIUC_MASK_1, NULL, HFILL} + }, + { + &hf_cdlmap_shortened_diuc, + {"Shortened DIUC", "wmx.compact_dlmap.shortened_diuc", FT_UINT8, BASE_HEX, NULL, SHORTENED_DIUC_MASK, NULL, HFILL} + }, + { + &hf_cdlmap_shortened_diuc_1, + {"Shortened DIUC", "wmx.compact_dlmap.shortened_diuc", FT_UINT16, BASE_HEX, NULL, SHORTENED_DIUC_MASK_1, NULL, HFILL} + }, + { + &hf_cdlmap_companded_sc, + {"Companded SC", "wmx.compact_dlmap.companded_sc", FT_UINT8, BASE_HEX, NULL, COMPANDED_SC_MASK, NULL, HFILL} + }, + { + &hf_cdlmap_companded_sc_1, + {"Companded SC", "wmx.compact_dlmap.companded_sc", FT_UINT16, BASE_HEX, NULL, COMPANDED_SC_MASK_1, NULL, HFILL} + }, + { + &hf_cdlmap_bin_offset, + {"BIN Offset", "wmx.compact_dlmap.bin_offset", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} + }, + { + &hf_cdlmap_bin_offset_1, + {"BIN Offset", "wmx.compact_dlmap.bin_offset", FT_UINT16, BASE_HEX, NULL, 0x0FF0, NULL, HFILL} + }, + { + &hf_cdlmap_diuc_num_of_subchannels, + {"Number Of Subchannels", "wmx.compact_dlmap.diuc_num_of_subchannels", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} + }, + { + &hf_cdlmap_diuc_num_of_subchannels_1, + {"Number Of Subchannels", "wmx.compact_dlmap.diuc_num_of_subchannels", FT_UINT16, BASE_DEC, NULL, 0x0FF0, NULL, HFILL} + }, + { + &hf_cdlmap_diuc_repetition_coding_indication, + {"Repetition Coding Indication", "wmx.compact_dlmap.diuc_repetition_coding_indication", FT_UINT8, BASE_DEC, VALS(rep_msgs), 0xC0, NULL, HFILL} + }, + { + &hf_cdlmap_diuc_repetition_coding_indication_1, + {"Repetition Coding Indication", "wmx.compact_dlmap.diuc_repetition_coding_indication", FT_UINT8, BASE_DEC, VALS(rep_msgs), 0x0C, NULL, HFILL} + }, + { + &hf_cdlmap_diuc_reserved, + {"Reserved", "wmx.compact_dlmap.diuc_reserved", FT_UINT8, BASE_HEX, NULL, 0x30, NULL, HFILL} + }, + { + &hf_cdlmap_diuc_reserved_1, + {"Reserved", "wmx.compact_dlmap.diuc_reserved", FT_UINT8, BASE_HEX, NULL, 0x03, NULL, HFILL} + }, + { + &hf_cdlmap_bit_map_length, + {"BIT MAP Length", "wmx.compact_dlmap.bit_map_length", FT_UINT8, BASE_DEC, NULL, MSB_NIBBLE_MASK, NULL, HFILL} + }, + { + &hf_cdlmap_bit_map_length_1, + {"BIT MAP Length", "wmx.compact_dlmap.bit_map_length", FT_UINT8, BASE_DEC, NULL, LSB_NIBBLE_MASK, NULL, HFILL} + }, + { + &hf_cdlmap_bit_map, + {"BIT MAP", "wmx.compact_dlmap.bit_map", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} + }, + { + &hf_cdlmap_diuc, + {"DIUC", "wmx.compact_dlmap.diuc", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL} + }, + { + &hf_cdlmap_diuc_1, + {"DIUC", "wmx.compact_dlmap.diuc", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL} + }, + { + &hf_cdlmap_allocation_mode, + {"Allocation Mode", "wmx.compact_dlmap.allocation_mode", FT_UINT8, BASE_DEC, VALS(vals_allocation_modes), 0xC0, NULL, HFILL} + }, + { + &hf_cdlmap_allocation_mode_1, + {"Allocation Mode", "wmx.compact_dlmap.allocation_mode", FT_UINT8, BASE_DEC, VALS(vals_allocation_modes), 0x0C, NULL, HFILL} + }, + { + &hf_cdlmap_allocation_mode_rsvd, + {"Reserved", "wmx.compact_dlmap.allocation_mode_rsvd", FT_UINT8, BASE_DEC, NULL, 0x30, NULL, HFILL} + }, + { + &hf_cdlmap_allocation_mode_rsvd_1, + {"Reserved", "wmx.compact_dlmap.allocation_mode_rsvd", FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL} + }, + { + &hf_cdlmap_num_subchannels, + {"Number Of Subchannels", "wmx.compact_dlmap.num_subchannels", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} + }, + { + &hf_cdlmap_num_subchannels_1, + {"Number Of Subchannels", "wmx.compact_dlmap.num_subchannels", FT_UINT16, BASE_DEC, NULL, 0x0FF0, NULL, HFILL} + }, + { + &hf_cdlmap_reserved_type, + {"DL-MAP Reserved Type", "wmx.compact_dlmap.reserved_type", FT_UINT8, BASE_DEC, NULL, DL_MAP_TYPE_MASK, NULL, HFILL} + }, + { + &hf_cdlmap_reserved_type_1, + {"DL-MAP Reserved Type", "wmx.compact_dlmap.reserved_type", FT_UINT8, BASE_DEC, NULL, DL_MAP_TYPE_MASK_1, NULL, HFILL} } - } - /* return the IE length in nibbles */ - return length; -} - -/* Compact DL-MAP CQICH Control IE (6.3.2.3.43.5) decoder */ -static guint wimax_compact_dlmap_cqich_control_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset) -{ - guint byte, cqich_indicator, length = 0; - - UNREFERENCED_PARAMETER(pinfo); + }; -#ifdef DEBUG - /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) + /* HARQ MAP Format Configuration IE display */ + static hf_register_info hf_format_config[] = { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "CQICH Control IE"); - } -#endif - /* Get the first byte */ - byte = tvb_get_guint8(tvb, offset); - if(nibble_offset & 1) - { /* Get the CQICH indicator */ - cqich_indicator = (byte & 0x08); - if(cqich_indicator) - { /* display the CQICH indicator */ - proto_tree_add_item(tree, hf_cqich_control_ie_indicator_1, tvb, offset, 3, FALSE); - /* display the allocation index */ - proto_tree_add_item(tree, hf_cqich_control_ie_alloc_id_1, tvb, offset, 3, FALSE); - /* display the period */ - proto_tree_add_item(tree, hf_cqich_control_ie_period_1, tvb, offset, 3, FALSE); - /* display the frame offset */ - proto_tree_add_item(tree, hf_cqich_control_ie_frame_offset_1, tvb, offset, 3, FALSE); - /* display the duration */ - proto_tree_add_item(tree, hf_cqich_control_ie_duration_1, tvb, offset, 3, FALSE); - length = 4; - } - else - { /* display the CQICH indicator */ - proto_tree_add_item(tree, hf_cqich_control_ie_indicator_1, tvb, offset, 1, FALSE); - /* display the CQI reporting threshold */ - proto_tree_add_item(tree, hf_cqich_control_ie_cqi_rep_threshold_1, tvb, offset, 1, FALSE); - length = 1; - } - } - else - { /* Get the CQICH indicator */ - cqich_indicator = (byte & 0x80); - if(cqich_indicator) - { /* display the CQICH indicator */ - proto_tree_add_item(tree, hf_cqich_control_ie_indicator, tvb, offset, 2, FALSE); - /* display the allocation index */ - proto_tree_add_item(tree, hf_cqich_control_ie_alloc_id, tvb, offset, 2, FALSE); - /* display the period */ - proto_tree_add_item(tree, hf_cqich_control_ie_period, tvb, offset, 2, FALSE); - /* display the frame offset */ - proto_tree_add_item(tree, hf_cqich_control_ie_frame_offset, tvb, offset, 2, FALSE); - /* display the duration */ - proto_tree_add_item(tree, hf_cqich_control_ie_duration, tvb, offset, 2, FALSE); - length = 4; - } - else - { /* display the CQICH indicator */ - proto_tree_add_item(tree, hf_cqich_control_ie_indicator, tvb, offset, 1, FALSE); - /* display the CQI reporting threshold */ - proto_tree_add_item(tree, hf_cqich_control_ie_cqi_rep_threshold, tvb, offset, 1, FALSE); - length = 1; + { + &hf_format_config_ie_dl_map_type, + {"DL-MAP Type", "wmx.format_config_ie.dl_map_type", FT_UINT8, BASE_DEC, NULL, DL_MAP_TYPE_MASK, NULL, HFILL} + }, + { + &hf_format_config_ie_dl_map_type_1, + {"DL-MAP Type", "wmx.format_config_ie.dl_map_type", FT_UINT8, BASE_DEC, NULL, DL_MAP_TYPE_MASK_1, NULL, HFILL} + }, + { + &hf_format_config_ie_dl_map_type_32, + {"DL-MAP Type", "wmx.format_config_ie.dl_map_type", FT_UINT32, BASE_DEC, NULL, FORMAT_CONFIG_IE_DL_MAP_TYPE_MASK, NULL, HFILL} + }, + { + &hf_format_config_ie_new_format_indication, + {"New Format Indication", "wmx.format_config_ie.new_format_indication", FT_BOOLEAN, 8, TFS(&tfs_indication), UL_MAP_APPEND_MASK, NULL, HFILL} + }, + { + &hf_format_config_ie_new_format_indication_1, + {"New Format Indication", "wmx.format_config_ie.new_format_indication", FT_BOOLEAN, 8, TFS(&tfs_indication), UL_MAP_APPEND_MASK_1, NULL, HFILL} + }, + { + &hf_format_config_ie_new_format_indication_32, + {"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} + }, + { + &hf_format_config_ie_cid_type, + {"HARQ MAP Indicator", "wmx.harq_map.format_config_ie.indicator", FT_UINT32, BASE_HEX, VALS(vals_cid_types), CID_TYPE_MASK, NULL, HFILL} + }, + { + &hf_format_config_ie_cid_type_1, + {"CID Type", "wmx.harq_map.format_config_ie.cid_type", FT_UINT32, BASE_HEX, VALS(vals_cid_types), CID_TYPE_MASK_1, NULL, HFILL} + }, + { + &hf_format_config_ie_safety_pattern, + {"Safety Pattern", "wmx.harq_map.format_config_ie.safety_pattern", FT_UINT32, BASE_HEX, NULL, SAFETY_PATTERN_MASK, NULL, HFILL} + }, + { + &hf_format_config_ie_safety_pattern_1, + {"Safety Pattern", "wmx.harq_map.format_config_ie.safety_pattern", FT_UINT32, BASE_HEX, NULL, SAFETY_PATTERN_MASK_1, NULL, HFILL} + }, + { + &hf_format_config_ie_subchannel_type, + {"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} + }, + { + &hf_format_config_ie_subchannel_type_1, + {"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} + }, + { + &hf_format_config_ie_max_logical_bands, + {"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} + }, + { + &hf_format_config_ie_max_logical_bands_1, + {"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} + }, + { + &hf_format_config_ie_num_of_broadcast_symbol, + {"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} + }, + { + &hf_format_config_ie_num_of_broadcast_symbol_1, + {"Number Of Symbols for Broadcast", "wmx.harq_map.num_of_broadcast_symbol", FT_UINT32, BASE_HEX, NULL, NUM_BROADCAST_SYMBOLS_MASK_1, NULL, HFILL} + }, + { + &hf_format_config_ie_num_of_dl_band_amc_symbol, + {"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} + }, + { + &hf_format_config_ie_num_of_dl_band_amc_symbol_1, + {"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} + }, + { + &hf_format_config_ie_num_of_ul_band_amc_symbol, + {"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} + }, + { + &hf_format_config_ie_num_of_ul_band_amc_symbol_1, + {"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} } - } - /* return the IE length in nibbles */ - return length; -} - -/* DL-MAP Extension IE sub-types */ -#define TIME_DIVERSITY_MBS 0 -#define HARQ_MODE_SWITCH 1 + }; -/* Compact DL-MAP Extension IE (6.3.2.3.43.6.6) decoder */ -static guint wimax_cdlmap_extension_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset) -{ - guint tvb_value, dl_map_type, sub_type, length; + /* HARQ MAP Reduced CID IE display */ + static hf_register_info hf_rcid[] = + { + { + &hf_harq_rcid_ie_normal_cid, + {"Normal CID", "wmx.harq_map.rcid_ie.normal_cid", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL} + }, + { + &hf_harq_rcid_ie_normal_cid_1, + {"Normal CID", "wmx.harq_map.rcid_ie.normal_cid", FT_UINT24, BASE_HEX, NULL, WIMAX_RCID_IE_NORMAL_CID_MASK_1, NULL, HFILL} + }, + { + &hf_harq_rcid_ie_prefix, + {"Prefix", "wmx.harq_map.rcid_ie.prefix", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_PREFIX_MASK, NULL, HFILL} + }, + { + &hf_harq_rcid_ie_prefix_1, + {"Prefix", "wmx.harq_map.rcid_ie.prefix", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_PREFIX_MASK_1, NULL, HFILL} + }, + { + &hf_harq_rcid_ie_cid3, + {"3 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid3", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID3_MASK, NULL, HFILL} + }, + { + &hf_harq_rcid_ie_cid3_1, + {"3 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid3", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID3_MASK_1, NULL, HFILL} + }, + { + &hf_harq_rcid_ie_cid7, + {"7 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid7", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID7_MASK, NULL, HFILL} + }, + { + &hf_harq_rcid_ie_cid7_1, + {"7 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid7", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID7_MASK_1, NULL, HFILL} + }, + { + &hf_harq_rcid_ie_cid11, + {"11 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid11", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID11_MASK, NULL, HFILL} + }, + { + &hf_harq_rcid_ie_cid11_1, + {"11 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid11", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID11_MASK_1, NULL, HFILL} + }, + { + &hf_harq_rcid_ie_cid11_2, + {"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} + }, + { + &hf_harq_rcid_ie_cid11_3, + {"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} + } + }; - UNREFERENCED_PARAMETER(pinfo); + /* HARQ MAP HARQ Control IE display */ + static hf_register_info hf_harq_control[] = + { + { + &hf_harq_control_ie_prefix, + {"Prefix", "wmx.harq_map.harq_control_ie.prefix", FT_BOOLEAN, 8, TFS(&tfs_prefix), WIMAX_HARQ_CONTROL_IE_PREFIX_MASK, NULL, HFILL} + }, + { + &hf_harq_control_ie_ai_sn, + {"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} + }, + { + &hf_harq_control_ie_spid, + {"Subpacket ID (SPID)", "wmx.harq_map.harq_control_ie.spid", FT_UINT8, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_SPID_MASK, NULL, HFILL} + }, + { + &hf_harq_control_ie_acid, + {"HARQ CH ID (ACID)", "wmx.harq_map.harq_control_ie.acid", FT_UINT8, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_ACID_MASK, NULL, HFILL} + }, + { + &hf_harq_control_ie_reserved, + {"Reserved", "wmx.harq_map.harq_control_ie.reserved", FT_UINT8, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_RESERVED_MASK, NULL, HFILL} + }, + { + &hf_harq_control_ie_prefix_1, + {"Prefix", "wmx.harq_map.harq_control_ie.prefix", FT_BOOLEAN, 16, TFS(&tfs_prefix), WIMAX_HARQ_CONTROL_IE_PREFIX_MASK_1, NULL, HFILL} + }, + { + &hf_harq_control_ie_ai_sn_1, + {"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} + }, + { + &hf_harq_control_ie_spid_1, + {"Subpacket ID (SPID)", "wmx.harq_map.harq_control_ie.spid", FT_UINT16, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_SPID_MASK_1, NULL, HFILL} + }, + { + &hf_harq_control_ie_acid_1, + {"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} + }, + { + &hf_harq_control_ie_reserved_1, + {"Reserved", "wmx.harq_map.harq_control_ie.reserved", FT_UINT16, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_RESERVED_MASK_1, NULL, HFILL} + } + }; -#ifdef DEBUG - /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) + /* HARQ MAP CQICH Control IE display */ + static hf_register_info hf_cqich_control[] = { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "DL-MAP Extension IE"); - } -#endif - /* Get the first 16-bit word */ - tvb_value = tvb_get_ntohs(tvb, offset); - if(nibble_offset & 1) - { /* Get the dl-map type */ - dl_map_type = ((tvb_value & 0x0E00) >> 9); - if(dl_map_type != COMPACT_DL_MAP_TYPE_EXTENSION) - return 0; - /* Get the sub-type */ - sub_type = ((tvb_value & 0x01F0) >> 4); - /* Get the IE length */ - length = (tvb_value & 0x000F); - /* display the DL-MAP type */ - proto_tree_add_item(tree, hf_cdlmap_extension_type_1, tvb, offset, 2, FALSE); - /* display the DL-MAP extension subtype */ - proto_tree_add_item(tree, hf_cdlmap_extension_subtype_1, tvb, offset, 2, FALSE); - /* display the IE length */ - proto_tree_add_item(tree, hf_cdlmap_extension_length_1, tvb, offset, 2, FALSE); - offset += 2; - switch (sub_type) { - case TIME_DIVERSITY_MBS: - /* display the time-diversity MBS in HEX */ - proto_tree_add_item(tree, hf_cdlmap_extension_time_diversity_mbs_1, tvb, offset, (length - 2), FALSE); - break; - case HARQ_MODE_SWITCH: - /* display the HARQ mode */ - proto_tree_add_item(tree, hf_cdlmap_extension_harq_mode, tvb, offset, 1, FALSE); - /* Get the next byte */ - tvb_value = tvb_get_guint8(tvb, offset); - /* get the HARQ mode */ - harq_mode = ((tvb_value & MSB_NIBBLE_MASK) >> 4); - break; - default: - /* display the unknown sub-type in HEX */ - proto_tree_add_item(tree, hf_cdlmap_extension_unknown_sub_type_1, tvb, offset, (length - 2), FALSE); - break; + &hf_cqich_control_ie_indicator, + {"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} + }, + { + &hf_cqich_control_ie_alloc_id, + {"Allocation Index", "wmx.harq_map.cqich_control_ie.alloc_id", FT_UINT16, BASE_HEX, NULL, WIMAX_CQICH_CONTROL_IE_ALLOCATION_INDEX_MASK, NULL, HFILL} + }, + { + &hf_cqich_control_ie_period, + {"PERIOD", "wmx.harq_map.cqich_control_ie.period", FT_UINT16, BASE_HEX, NULL, WIMAX_CQICH_CONTROL_IE_PERIOD_MASK, NULL, HFILL} + }, + { + &hf_cqich_control_ie_frame_offset, + {"Frame Offset", "wmx.harq_map.cqich_control_ie.frame_offset", FT_UINT16, BASE_HEX, NULL, WIMAX_CQICH_CONTROL_IE_FRAME_OFFSET_MASK, NULL, HFILL} + }, + { + &hf_cqich_control_ie_duration, + {"Duration", "wmx.harq_map.cqich_control_ie.duration", FT_UINT16, BASE_HEX, NULL, WIMAX_CQICH_CONTROL_IE_DURATION_MASK, NULL, HFILL} + }, + { + &hf_cqich_control_ie_cqi_rep_threshold, + {"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} + }, + { + &hf_cqich_control_ie_indicator_1, + {"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} + }, + { + &hf_cqich_control_ie_alloc_id_1, + {"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} + }, + { + &hf_cqich_control_ie_period_1, + {"PERIOD", "wmx.harq_map.cqich_control_ie.period", FT_UINT24, BASE_HEX, NULL, WIMAX_CQICH_CONTROL_IE_PERIOD_MASK_1, NULL, HFILL} + }, + { + &hf_cqich_control_ie_frame_offset_1, + {"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} + }, + { + &hf_cqich_control_ie_duration_1, + {"Duration", "wmx.harq_map.cqich_control_ie.duration", FT_UINT24, BASE_HEX, NULL, WIMAX_CQICH_CONTROL_IE_DURATION_MASK_1, NULL, HFILL} + }, + { + &hf_cqich_control_ie_cqi_rep_threshold_1, + {"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} } - } - else - { /* Get the dl-map type */ - dl_map_type = ((tvb_value & 0xE000) >> 13); - if(dl_map_type != COMPACT_DL_MAP_TYPE_EXTENSION) - return 0; - /* Get the sub-type */ - sub_type = ((tvb_value & 0x1F00) >> 8); - /* Get the IE length */ - length = ((tvb_value & 0x00F0) >> 4); - /* display the DL-MAP type */ - proto_tree_add_item(tree, hf_cdlmap_extension_type, tvb, offset, 2, FALSE); - /* display the DL-MAP extension subtype */ - proto_tree_add_item(tree, hf_cdlmap_extension_subtype, tvb, offset, 2, FALSE); - /* display the IE length */ - proto_tree_add_item(tree, hf_cdlmap_extension_length, tvb, offset, 2, FALSE); - switch (sub_type) + }; + + static hf_register_info hf_extension_type[] = + { + { + &hf_cdlmap_extension_type, + {"DL-MAP Type", "wmx.extension_type.dl_map_type", FT_UINT16, BASE_DEC, NULL, EXTENSION_TYPE_MASK, NULL, HFILL} + }, + { + &hf_cdlmap_extension_type_1, + {"DL-MAP Type", "wmx.extension_type.dl_map_type", FT_UINT16, BASE_DEC, NULL, EXTENSION_TYPE_MASK_1, NULL, HFILL} + }, + { + &hf_cdlmap_extension_subtype, + {"Extension Subtype", "wmx.extension_type.subtype", FT_UINT16, BASE_DEC, NULL, EXTENSION_SUBTYPE_MASK, NULL, HFILL} + }, + { + &hf_cdlmap_extension_subtype_1, + {"Extension Subtype", "wmx.extension_type.subtype", FT_UINT16, BASE_DEC, NULL, EXTENSION_SUBTYPE_MASK_1, NULL, HFILL} + }, + { + &hf_cdlmap_extension_length, + {"Extension Length", "wmx.extension_type.length", FT_UINT16, BASE_DEC, NULL, EXTENSION_LENGTH_MASK, NULL, HFILL} + }, + { + &hf_cdlmap_extension_length_1, + {"Extension Length", "wmx.extension_type.length", FT_UINT16, BASE_DEC, NULL, EXTENSION_LENGTH_MASK_1, NULL, HFILL} + }, + { + &hf_cdlmap_extension_time_diversity_mbs, + {"Time Diversity MBS", "wmx.extension_type.time_diversity_mbs", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} + }, { - case TIME_DIVERSITY_MBS: - /* display the time-diversity MBS in HEX */ - proto_tree_add_item(tree, hf_cdlmap_extension_time_diversity_mbs, tvb, (offset + 1), (length - 1), FALSE); - break; - case HARQ_MODE_SWITCH: - /* display the HARQ mode */ - proto_tree_add_item(tree, hf_cdlmap_extension_harq_mode_1, tvb, offset, 2, FALSE); - /* get the HARQ mode */ - harq_mode = (tvb_value & 0x000F); - break; - default: - /* display the unknown sub-type in HEX */ - proto_tree_add_item(tree, hf_cdlmap_extension_unknown_sub_type, tvb, (offset + 1), (length - 1), FALSE); - break; + &hf_cdlmap_extension_time_diversity_mbs_1, + {"Time Diversity MBS", "wmx.extension_type.time_diversity_mbs", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} + }, + { + &hf_cdlmap_extension_harq_mode_1, + {"HARQ Mode Switch", "wmx.extension_type.harq_mode", FT_UINT16, BASE_HEX, NULL, 0x000F, NULL, HFILL} + }, + { + &hf_cdlmap_extension_harq_mode, + {"HARQ Mode Switch", "wmx.extension_type.harq_mode", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL} + }, + { + &hf_cdlmap_extension_unknown_sub_type, + {"Unknown Extension Subtype", "wmx.extension_type.unknown_sub_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} + }, + { + &hf_cdlmap_extension_unknown_sub_type_1, + {"Unknown Extension Subtype", "wmx.extension_type.unknown_sub_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} } - } - /* return the IE length in nibbles */ - return (length * 2); -} - -/* Extended DIUCs (table 277a) */ -#define CHANNEL_MEASUREMENT_IE 0 -#define STC_ZONE_IE 1 -#define AAS_DL_IE 2 -#define DATA_LOCATION_IN_ANOTHER_BS_IE 3 -#define CID_SWITCH_IE 4 -#define MIMO_DL_BASIC_IE 5 -#define MIMO_DL_ENHANCED_IE 6 -#define HARQ_MAP_POINTER_IE 7 -#define PHYMOD_DL_IE 8 -#define DL_PUSC_BURST_ALLOCATION_IN_OTHER_SEGMENT_IE 11 -#define UL_INTERFERENCE_AND_NOISE_LEVEL_IE 15 - -/* Extended DIUC IE (8.4.5.3.2) */ -guint wimax_extended_diuc_dependent_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset) -{ - guint ext_diuc, length; - guint8 byte; - - UNREFERENCED_PARAMETER(pinfo); + }; - /* get the first byte */ - byte = tvb_get_guint8(tvb, offset); - if(nibble_offset & 1) - { /* get the extended DIUC */ - ext_diuc = (byte & LSB_NIBBLE_MASK); - /* display extended DIUC */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_diuc_1, tvb, offset, 1, FALSE); - /* move to next byte */ - offset++; - /* get the 2nd byte */ - byte = tvb_get_guint8(tvb, offset); - /* get the length */ - length = ((byte & MSB_NIBBLE_MASK) >> 4); - /* display extended DIUC length */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_length, tvb, offset, 1, FALSE); - /* 8.4.5.3.2.1 (table 277a) */ - switch (ext_diuc) + /* Extended DIUC dependent IE */ + static hf_register_info hf_extended_diuc[] = + { { - case CHANNEL_MEASUREMENT_IE: - /* 8.4.5.3.? Channel_Measurement_IE */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_channel_measurement, tvb, offset, (length + 1), FALSE); - break; - case STC_ZONE_IE: - /* 8.4.5.3.4 STC_Zone_IE */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_stc_zone, tvb, offset, (length + 1), FALSE); - break; - case AAS_DL_IE: - /* 8.4.5.3.3 AAS_DL_IE */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_aas_dl, tvb, offset, (length + 1), FALSE); - break; - case DATA_LOCATION_IN_ANOTHER_BS_IE: - /* 8.4.5.3.6 Data_location_in_another_BS_IE */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_data_location, tvb, offset, (length + 1), FALSE); - break; - case CID_SWITCH_IE: - /* 8.4.5.3.7 CID_Switch_IE */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_cid_switch, tvb, offset, (length + 1), FALSE); - break; - case MIMO_DL_BASIC_IE: - /* 8.4.5.3.8 MIMO_DL_Basic_IE */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_mimo_dl_basic, tvb, offset, (length + 1), FALSE); - break; - case MIMO_DL_ENHANCED_IE: - /* 8.4.5.3.9 MIMO_DL_Enhanced_IE */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_mimo_dl_enhanced, tvb, offset, (length + 1), FALSE); - break; - case HARQ_MAP_POINTER_IE: - /* 8.4.5.3.10 HARQ_Map_Pointer_IE */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_harq_map_pointer, tvb, offset, (length + 1), FALSE); - break; - case PHYMOD_DL_IE: - /* 8.4.5.3.11 PHYMOD_DL_IE */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_phymod_dl, tvb, offset, (length + 1), FALSE); - break; - case DL_PUSC_BURST_ALLOCATION_IN_OTHER_SEGMENT_IE: - /* 8.4.5.3.13 DL PUSC Burst Allocation in Other Segment IE */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_dl_pusc_burst_allocation, tvb, offset, (length + 1), FALSE); - break; - case UL_INTERFERENCE_AND_NOISE_LEVEL_IE: - /* 8.4.5.3.19 UL_interference_and_noise_level_IE */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_ul_interference_and_noise_level, tvb, offset, (length + 1), FALSE); - break; - default: - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_unknown_diuc, tvb, offset, (length + 1), FALSE); - break; - } - } - else - { /* get the extended DIUC */ - ext_diuc = ((byte & MSB_NIBBLE_MASK) >> 4); - /* get the length */ - length = (byte & LSB_NIBBLE_MASK); - /* display extended DIUC */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_diuc, tvb, offset, 1, FALSE); - /* display extended DIUC length */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_length_1, tvb, offset, 1, FALSE); - /* move to next byte */ - offset++; - /* 8.4.5.3.2.1 (table 277a) */ - switch (ext_diuc) + &hf_extended_diuc_dependent_ie_diuc, + {"Extended DIUC", "wmx.extended_diuc_dependent_ie.diuc", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL } + }, { - case CHANNEL_MEASUREMENT_IE: - /* 8.4.5.3.? Channel_Measurement_IE */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_channel_measurement, tvb, offset, length, FALSE); - break; - case STC_ZONE_IE: - /* 8.4.5.3.4 STC_Zone_IE */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_stc_zone, tvb, offset, length, FALSE); - break; - case AAS_DL_IE: - /* 8.4.5.3.3 AAS_DL_IE */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_aas_dl, tvb, offset, length, FALSE); - break; - case DATA_LOCATION_IN_ANOTHER_BS_IE: - /* 8.4.5.3.6 Data_location_in_another_BS_IE */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_data_location, tvb, offset, length, FALSE); - break; - case CID_SWITCH_IE: - /* 8.4.5.3.7 CID_Switch_IE */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_cid_switch, tvb, offset, length, FALSE); - break; - case MIMO_DL_BASIC_IE: - /* 8.4.5.3.8 MIMO_DL_Basic_IE */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_mimo_dl_basic, tvb, offset, length, FALSE); - break; - case MIMO_DL_ENHANCED_IE: - /* 8.4.5.3.9 MIMO_DL_Enhanced_IE */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_mimo_dl_enhanced, tvb, offset, length, FALSE); - break; - case HARQ_MAP_POINTER_IE: - /* 8.4.5.3.10 HARQ_Map_Pointer_IE */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_harq_map_pointer, tvb, offset, length, FALSE); - break; - case PHYMOD_DL_IE: - /* 8.4.5.3.11 PHYMOD_DL_IE */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_phymod_dl, tvb, offset, length, FALSE); - break; - case DL_PUSC_BURST_ALLOCATION_IN_OTHER_SEGMENT_IE: - /* 8.4.5.3.13 DL PUSC Burst Allocation in Other Segment IE */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_dl_pusc_burst_allocation, tvb, offset, length, FALSE); - break; - case UL_INTERFERENCE_AND_NOISE_LEVEL_IE: - /* 8.4.5.3.19 UL_interference_and_noise_level_IE */ - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_ul_interference_and_noise_level, tvb, offset, length, FALSE); - break; - default: - proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_unknown_diuc, tvb, offset, length, FALSE); - break; + &hf_extended_diuc_dependent_ie_diuc_1, + {"Extended DIUC", "wmx.extended_diuc_dependent_ie.diuc", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL } + }, + { + &hf_extended_diuc_dependent_ie_length, + {"Length", "wmx.extended_diuc_dependent_ie.length", FT_UINT8, BASE_DEC, NULL, MSB_NIBBLE_MASK, NULL, HFILL } + }, + { + &hf_extended_diuc_dependent_ie_length_1, + {"Length", "wmx.extended_diuc_dependent_ie.length", FT_UINT8, BASE_DEC, NULL, LSB_NIBBLE_MASK, NULL, HFILL } + }, + { /* 8.4.5.3.? Channel_Measurement_IE */ + &hf_extended_diuc_dependent_ie_channel_measurement, + {"Channel_Measurement_IE (not implemented)", "wmx.extended_diuc_dependent_ie.channel_measurement", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } + }, + { /* 8.4.5.3.4 STC_Zone_IE */ + &hf_extended_diuc_dependent_ie_stc_zone, + {"STC_Zone_IE (not implemented)", "wmx.extended_diuc_dependent_ie.stc_zone", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } + }, + { /* 8.4.5.3.3 AAS_DL_IE */ + &hf_extended_diuc_dependent_ie_aas_dl, + {"AAS_DL_IE (not implemented)", "wmx.extended_diuc_dependent_ie.aas_dl", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } + }, + { /* 8.4.5.3.6 Data_location_in_another_BS_IE */ + &hf_extended_diuc_dependent_ie_data_location, + {"Data_location_in_another_BS_IE (not implemented)", "wmx.extended_diuc_dependent_ie.data_location", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } + }, + { /* 8.4.5.3.7 CID_Switch_IE */ + &hf_extended_diuc_dependent_ie_cid_switch, + {"CID_Switch_IE (not implemented)", "wmx.extended_diuc_dependent_ie.cid_switch", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } + }, + + { /* 8.4.5.3.8 MIMO_DL_Basic_IE */ + &hf_extended_diuc_dependent_ie_mimo_dl_basic, + {"MIMO_DL_Basic_IE (not implemented)", "wmx.extended_diuc_dependent_ie.mimo_dl_basic", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } + }, + { /* 8.4.5.3.9 MIMO_DL_Enhanced_IE */ + &hf_extended_diuc_dependent_ie_mimo_dl_enhanced, + {"MIMO_DL_Enhanced_IE (not implemented)", "wmx.extended_diuc_dependent_ie.mimo_dl_enhanced", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } + }, + { /* 8.4.5.3.10 HARQ_Map_Pointer_IE */ + &hf_extended_diuc_dependent_ie_harq_map_pointer, + {"HARQ_Map_Pointer_IE (not implemented)", "wmx.extended_diuc_dependent_ie.harq_map_pointer", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } + }, + { /* 8.4.5.3.11 PHYMOD_DL_IE */ + &hf_extended_diuc_dependent_ie_phymod_dl, + {"PHYMOD_DL_IE (not implemented)", "wmx.extended_diuc_dependent_ie.phymod_dl", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } + }, + { /* 8.4.5.3.13 DL PUSC Burst Allocation in Other Segment IE */ + &hf_extended_diuc_dependent_ie_dl_pusc_burst_allocation, + {"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 } + }, + { /* 8.4.5.3.19 UL_interference_and_noise_level_IE */ + &hf_extended_diuc_dependent_ie_ul_interference_and_noise_level, + {"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 } + }, + { /* unknown DIUC */ + &hf_extended_diuc_dependent_ie_unknown_diuc, + {"Unknown Extended DIUC", "wmx.extended_diuc_dependent_ie.unknown_diuc", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } } - } - return ((length + 1) * 2 ); /* length in nibbles */ + }; + +#if 0 /* Not used ?? */ + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_wimax_compact_dlmap_ie_decoder, + &ett_wimax_format_configuration_ie_decoder, + &ett_wimax_rcid_ie_decoder, + &ett_wimax_harq_control_ie_decoder, + &ett_wimax_extended_diuc_dependent_ie_decoder, + &ett_wimax_cqich_control_ie_decoder, + &ett_wimax_extension_type_ie_decoder, + }; + proto_register_subtree_array(ett, array_length(ett)); +#endif + + proto_wimax_compact_dlmap_ie_decoder = proto_wimax; + proto_register_field_array(proto_wimax_compact_dlmap_ie_decoder, hf_compact_dlmap, array_length(hf_compact_dlmap)); + proto_register_field_array(proto_wimax_compact_dlmap_ie_decoder, hf_format_config, array_length(hf_format_config)); + proto_register_field_array(proto_wimax_compact_dlmap_ie_decoder, hf_rcid, array_length(hf_rcid)); + proto_register_field_array(proto_wimax_compact_dlmap_ie_decoder, hf_harq_control, array_length(hf_harq_control)); + proto_register_field_array(proto_wimax_compact_dlmap_ie_decoder, hf_cqich_control, array_length(hf_cqich_control)); + proto_register_field_array(proto_wimax_compact_dlmap_ie_decoder, hf_extension_type, array_length(hf_extension_type)); + proto_register_field_array(proto_wimax_compact_dlmap_ie_decoder, hf_extended_diuc, array_length(hf_extended_diuc)); } diff --git a/plugins/wimax/wimax_compact_ulmap_ie_decoder.c b/plugins/wimax/wimax_compact_ulmap_ie_decoder.c index bf8673dd4e..183c03e651 100644 --- a/plugins/wimax/wimax_compact_ulmap_ie_decoder.c +++ b/plugins/wimax/wimax_compact_ulmap_ie_decoder.c @@ -63,21 +63,14 @@ static guint wimax_compact_ulmap_harq_control_ie_decoder(proto_tree *tree, packe static guint wimax_culmap_extension_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset); static gint proto_wimax_compact_ulmap_ie_decoder = -1; + +#if 0 /* not used ?? */ static gint ett_wimax_compact_ulmap_ie_decoder = -1; static gint ett_wimax_rcid_ie_decoder = -1; static gint ett_wimax_harq_control_ie_decoder = -1; static gint ett_wimax_extended_uiuc_dependent_ie_decoder = -1; static gint ett_wimax_extension_type_ie_decoder = -1; - -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_wimax_compact_ulmap_ie_decoder, - &ett_wimax_rcid_ie_decoder, - &ett_wimax_harq_control_ie_decoder, - &ett_wimax_extended_uiuc_dependent_ie_decoder, - &ett_wimax_extension_type_ie_decoder, -}; +#endif /* Prefixes */ static const true_false_string tfs_prefix = @@ -372,1767 +365,1777 @@ static gint hf_extended_uiuc_ie_fast_ranging = -1; static gint hf_extended_uiuc_ie_ul_allocation_start = -1; static gint hf_extended_uiuc_ie_unknown_uiuc = -1; -/* Register Wimax Compact UL-MAP IE Protocol */ -void proto_register_wimax_compact_ulmap_ie(void) -{ - /* Compact UL-MAP IE display */ - static hf_register_info hf_compact_ulmap[] = - { - { - &hf_culmap_ul_map_type, - {"UL-MAP Type", "wmx.compact_ulmap.ul_map_type", FT_UINT8, BASE_DEC, NULL, UL_MAP_TYPE_MASK, NULL, HFILL} - }, - { - &hf_culmap_ul_map_type_1, - {"UL-MAP Type", "wmx.compact_ulmap.ul_map_type", FT_UINT8, BASE_DEC, NULL, UL_MAP_TYPE_MASK_1, NULL, HFILL} - }, - { - &hf_culmap_reserved, - {"Reserved", "wmx.compact_ulmap.reserved", FT_UINT8, BASE_HEX, NULL, UL_MAP_RESERVED_MASK, NULL, HFILL} - }, - { - &hf_culmap_reserved_1, - {"Reserved", "wmx.compact_ulmap.reserved", FT_UINT8, BASE_HEX, NULL, UL_MAP_RESERVED_MASK_1, NULL, HFILL} - }, - { - &hf_culmap_nep_code, - {"Nep Code", "wmx.compact_ulmap.nep_code", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL} - }, - { - &hf_culmap_nep_code_1, - {"Nep Code", "wmx.compact_ulmap.nep_code", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL} - }, - { - &hf_culmap_nsch_code, - {"Nsch Code", "wmx.compact_ulmap.nsch_code", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL} - }, - { - &hf_culmap_nsch_code_1, - {"Nsch Code", "wmx.compact_ulmap.nsch_code", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL} - }, - { - &hf_culmap_shortened_uiuc, - {"Shortened UIUC", "wmx.compact_ulmap.shortened_uiuc", FT_UINT8, BASE_HEX, NULL, SHORTENED_UIUC_MASK, NULL, HFILL} - }, - { - &hf_culmap_companded_sc, - {"Companded SC", "wmx.compact_ulmap.companded_sc", FT_UINT8, BASE_HEX, NULL, COMPANDED_SC_MASK, NULL, HFILL} - }, - { - &hf_culmap_shortened_uiuc_1, - {"Shortened UIUC", "wmx.compact_ulmap.shortened_uiuc", FT_UINT16, BASE_HEX, NULL, SHORTENED_UIUC_MASK_1, NULL, HFILL} - }, - { - &hf_culmap_companded_sc_1, - {"Companded SC", "wmx.compact_ulmap.companded_sc", FT_UINT16, BASE_HEX, NULL, COMPANDED_SC_MASK_1, NULL, HFILL} - }, - { - &hf_culmap_num_bands, - {"Number Of Bands", "wmx.compact_ulmap.num_bands", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL} - }, - { - &hf_culmap_num_bands_1, - {"Number Of Bands", "wmx.compact_ulmap.num_bands", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL} - }, - { - &hf_culmap_band_index, - {"Band Index", "wmx.compact_ulmap.band_index", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} - }, - { - &hf_culmap_nb_bitmap, - {"Number Of Bits For Band BITMAP", "wmx.compact_ulmap.nb_bitmap", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL} - }, - { - &hf_culmap_nb_bitmap_1, - {"Number Of Bits For Band BITMAP", "wmx.compact_ulmap.nb_bitmap", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL} - }, - { - &hf_culmap_allocation_mode, - {"Allocation Mode", "wmx.compact_ulmap.allocation_mode", FT_UINT8, BASE_DEC, VALS(vals_allocation_modes), ALLOCATION_MODE_MASK, NULL, HFILL} - }, - { - &hf_culmap_allocation_mode_1, - {"Allocation Mode", "wmx.compact_ulmap.allocation_mode", FT_UINT8, BASE_DEC, VALS(vals_allocation_modes), ALLOCATION_MODE_MASK_1, NULL, HFILL} - }, - { - &hf_culmap_allocation_mode_rsvd, - {"Reserved", "wmx.compact_ulmap.allocation_mode_rsvd", FT_UINT8, BASE_DEC, NULL, 0x30, NULL, HFILL} - }, - { - &hf_culmap_allocation_mode_rsvd_1, - {"Reserved", "wmx.compact_ulmap.allocation_mode_rsvd", FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL} - }, - { - &hf_culmap_num_subchannels, - {"Number Of Subchannels", "wmx.compact_ulmap.num_subchannels", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} - }, - { - &hf_culmap_num_subchannels_1, - {"Number Of Subchannels", "wmx.compact_ulmap.num_subchannels", FT_UINT16, BASE_DEC, NULL, MIDDLE_BYTE_MASK, NULL, HFILL} - }, - { - &hf_culmap_bin_offset, - {"BIN Offset", "wmx.compact_ulmap.bin_offset", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} - }, - { - &hf_culmap_bin_offset_1, - {"BIN Offset", "wmx.compact_ulmap.bin_offset", FT_UINT16, BASE_HEX, NULL, MIDDLE_BYTE_MASK, NULL, HFILL} - }, - { - &hf_culmap_uiuc, - {"UIUC", "wmx.compact_ulmap.uiuc", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL} - }, - { - &hf_culmap_uiuc_1, - {"UIUC", "wmx.compact_ulmap.uiuc", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL} - }, - { - &hf_culmap_uiuc_ofdma_symbol_offset, - {"OFDMA Symbol Offset", "wmx.compact_ulmap.uiuc_ofdma_symbol_offset", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} - }, - { - &hf_culmap_uiuc_ofdma_symbol_offset_1, - {"OFDMA Symbol Offset", "wmx.compact_ulmap.uiuc_ofdma_symbol_offset", FT_UINT16, BASE_DEC, NULL, MIDDLE_BYTE_MASK, NULL, HFILL} - }, - { - &hf_culmap_uiuc_subchannel_offset_7, - {"Subchannel Offset", "wmx.compact_ulmap.uiuc_subchannel_offset", FT_UINT24, BASE_DEC, NULL, 0xFE0000, NULL, HFILL} - }, - { - &hf_culmap_uiuc_num_of_ofdma_symbols_7, - {"Number Of OFDMA Symbols", "wmx.compact_ulmap.uiuc_num_of_ofdma_symbols", FT_UINT24, BASE_DEC, NULL, 0x01FC00, NULL, HFILL} - }, - { - &hf_culmap_uiuc_num_of_subchannels_7, - {"Number Of Subchannels", "wmx.compact_ulmap.uiuc_num_of_subchannels", FT_UINT24, BASE_DEC, NULL, 0x0003F8, NULL, HFILL} - }, - { - &hf_culmap_uiuc_ranging_method, - {"Ranging Method", "wmx.compact_ulmap.uiuc_ranging_method", FT_UINT24, BASE_DEC, NULL, 0x000006, NULL, HFILL} - }, - { - &hf_culmap_uiuc_reserved, - {"Reserved", "wmx.compact_ulmap.uiuc_reserved", FT_UINT24, BASE_HEX, NULL, 0x000001, NULL, HFILL} - }, - { - &hf_culmap_uiuc_subchannel_offset_7_1, - {"Subchannel Offset", "wmx.compact_ulmap.uiuc_subchannel_offset", FT_UINT32, BASE_DEC, NULL, 0x00FE0000, NULL, HFILL} - }, - { - &hf_culmap_uiuc_num_of_ofdma_symbols_7_1, - {"Number Of OFDMA Symbols", "wmx.compact_ulmap.uiuc_num_of_ofdma_symbols", FT_UINT32, BASE_DEC, NULL, 0x0001FC00, NULL, HFILL} - }, - { - &hf_culmap_uiuc_num_of_subchannels_7_1, - {"Number Of Subchannels", "wmx.compact_ulmap.uiuc_num_of_subchannels", FT_UINT32, BASE_DEC, NULL, 0x000003F80, NULL, HFILL} - }, - { - &hf_culmap_uiuc_ranging_method_1, - {"Ranging Method", "wmx.compact_ulmap.uiuc_ranging_method", FT_UINT32, BASE_DEC, NULL, 0x00000006, NULL, HFILL} - }, - { - &hf_culmap_uiuc_reserved_1, - {"Reserved", "wmx.compact_ulmap.uiuc_reserved", FT_UINT32, BASE_HEX, NULL, 0x00000001, NULL, HFILL} - }, - { - &hf_culmap_uiuc_repetition_coding_indication, - {"Repetition Coding Indication", "wmx.compact_ulmap.uiuc_repetition_coding_indication", FT_UINT8, BASE_DEC, VALS(vals_repetitions), ALLOCATION_MODE_MASK, NULL, HFILL} - }, - { - &hf_culmap_uiuc_repetition_coding_indication_1, - {"Repetition Coding Indication", "wmx.compact_ulmap.uiuc_repetition_coding_indication", FT_UINT8, BASE_DEC, VALS(vals_repetitions), ALLOCATION_MODE_MASK_1, NULL, HFILL} - }, - { - &hf_culmap_uiuc_reserved1, - {"Reserved", "wmx.compact_ulmap.uiuc_reserved1", FT_UINT8, BASE_HEX, NULL, 0x30, NULL, HFILL} - }, - { - &hf_culmap_uiuc_reserved11_1, - {"Reserved", "wmx.compact_ulmap.uiuc_reserved1", FT_UINT8, BASE_HEX, NULL, 0x03, NULL, HFILL} - }, - { - &hf_culmap_uiuc_subchannel_offset, - {"Subchannel Offset", "wmx.compact_ulmap.uiuc_subchannel_offset", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} - }, - { - &hf_culmap_uiuc_subchannel_offset_1, - {"Subchannel Offset", "wmx.compact_ulmap.uiuc_subchannel_offset", FT_UINT16, BASE_DEC, NULL, MIDDLE_BYTE_MASK, NULL, HFILL} - }, - { - &hf_culmap_uiuc_num_of_ofdma_symbols, - {"Number Of OFDMA Symbols", "wmx.compact_ulmap.uiuc_num_of_ofdma_symbols", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} - }, - { - &hf_culmap_uiuc_num_of_ofdma_symbols_1, - {"Number Of OFDMA Symbols", "wmx.compact_ulmap.uiuc_num_of_ofdma_symbols", FT_UINT16, BASE_DEC, NULL, MIDDLE_BYTE_MASK, NULL, HFILL} - }, - { - &hf_culmap_uiuc_num_of_subchannels, - {"Number Of Subchannels", "wmx.compact_ulmap.uiuc_num_of_subchannels", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} - }, - { - &hf_culmap_uiuc_num_of_subchannels_1, - {"Number Of Subchannels", "wmx.compact_ulmap.uiuc_num_of_subchannels", FT_UINT16, BASE_DEC, NULL, MIDDLE_BYTE_MASK, NULL, HFILL} - }, - { - &hf_culmap_harq_region_change_indication, - {"HARQ Region Change Indication", "wmx.compact_ulmap.harq_region_change_indication", FT_BOOLEAN, 8, TFS(&tfs_region_change), 0x10, NULL, HFILL} - }, - { - &hf_culmap_harq_region_change_indication_1, - {"HARQ Region Change Indication", "wmx.compact_ulmap.harq_region_change_indication", FT_BOOLEAN, 8, TFS(&tfs_region_change), 0x01, NULL, HFILL} - }, - { - &hf_culmap_cqi_region_change_indication, - {"CQI Region Change Indication", "wmx.compact_ulmap.cqi_region_change_indication", FT_BOOLEAN, 8, TFS(&tfs_region_change), 0x10, NULL, HFILL} - }, - { - &hf_culmap_cqi_region_change_indication_1, - {"CQI Region Change Indication", "wmx.compact_ulmap.cqi_region_change_indication", FT_BOOLEAN, 8, TFS(&tfs_region_change), 0x01, NULL, HFILL} - }, - { - &hf_culmap_reserved_type, - {"UL-MAP Reserved Type", "wmx.compact_ulmap.reserved_type", FT_UINT8, BASE_DEC, NULL, UL_MAP_TYPE_MASK, NULL, HFILL} - }, - { - &hf_culmap_reserved_type_1, - {"UL-MAP Reserved Type", "wmx.compact_ulmap.reserved_type", FT_UINT8, BASE_DEC, NULL, UL_MAP_TYPE_MASK_1, NULL, HFILL} - } - }; +/* Compact UL-MAP IE Types (table 90) */ +#define COMPACT_UL_MAP_TYPE_NORMAL_SUBCHANNEL 0 +#define COMPACT_UL_MAP_TYPE_BAND_AMC 1 +#define COMPACT_UL_MAP_TYPE_SAFETY 2 +#define COMPACT_UL_MAP_TYPE_UIUC 3 +#define COMPACT_UL_MAP_TYPE_HARQ_REGION_IE 4 +#define COMPACT_UL_MAP_TYPE_CQICH_REGION_IE 5 +#define COMPACT_UL_MAP_TYPE_RESERVED 6 +#define COMPACT_UL_MAP_TYPE_EXTENSION 7 - /* HARQ MAP Reduced CID IE display */ - static hf_register_info hf_rcid[] = +/* Compact UL-MAP IE decoder */ +guint wimax_compact_ulmap_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset) +{ + guint uiuc, byte, length = 0; + guint ul_map_type; + guint harq_region_change_indication; + guint cqi_region_change_indication; + guint ul_map_offset, nibble_length; + guint nband, band_count, i, allocation_mode; + +#ifdef DEBUG + /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) { - { - &hf_rcid_ie_normal_cid, - {"Normal CID", "wmx.harq_map.rcid_ie.normal_cid", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL} - }, - { - &hf_rcid_ie_normal_cid_1, - {"Normal CID", "wmx.harq_map.rcid_ie.normal_cid", FT_UINT24, BASE_HEX, NULL, WIMAX_RCID_IE_NORMAL_CID_MASK_1, NULL, HFILL} - }, - { - &hf_rcid_ie_prefix, - {"Prefix", "wmx.harq_map.rcid_ie.prefix", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_PREFIX_MASK, NULL, HFILL} - }, - { - &hf_rcid_ie_prefix_1, - {"Prefix", "wmx.harq_map.rcid_ie.prefix", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_PREFIX_MASK_1, NULL, HFILL} - }, - { - &hf_rcid_ie_cid3, - {"3 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid3", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID3_MASK, NULL, HFILL} - }, - { - &hf_rcid_ie_cid3_1, - {"3 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid3", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID3_MASK_1, NULL, HFILL} - }, - { - &hf_rcid_ie_cid7, - {"7 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid7", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID7_MASK, NULL, HFILL} - }, - { - &hf_rcid_ie_cid7_1, - {"7 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid7", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID7_MASK_1, NULL, HFILL} - }, - { - &hf_rcid_ie_cid11, - {"11 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid11", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID11_MASK, NULL, HFILL} - }, - { - &hf_rcid_ie_cid11_1, - {"11 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid11", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID11_MASK_1, NULL, HFILL} - }, - { - &hf_rcid_ie_cid11_2, - {"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} - }, - { - &hf_rcid_ie_cid11_3, - {"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} - } - }; - - /* HARQ MAP HARQ Control IE display */ - static hf_register_info hf_harq_control[] = + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Compact UL-MAP IEs"); + } +#endif + /* set the local offset */ + ul_map_offset = offset; + /* Get the first byte */ + byte = tvb_get_guint8(tvb, ul_map_offset); + /* get the ul-map type */ + if(nibble_offset & 1) { - { - &hf_harq_control_ie_prefix, - {"Prefix", "wmx.harq_map.harq_control_ie.prefix", FT_BOOLEAN, 8, TFS(&tfs_prefix), WIMAX_HARQ_CONTROL_IE_PREFIX_MASK, NULL, HFILL} - }, - { - &hf_harq_control_ie_ai_sn, - {"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} - }, - { - &hf_harq_control_ie_spid, - {"Subpacket ID (SPID)", "wmx.harq_map.harq_control_ie.spid", FT_UINT8, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_SPID_MASK, NULL, HFILL} - }, - { - &hf_harq_control_ie_acid, - {"HARQ CH ID (ACID)", "wmx.harq_map.harq_control_ie.acid", FT_UINT8, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_ACID_MASK, NULL, HFILL} - }, - { - &hf_harq_control_ie_reserved, - {"Reserved", "wmx.harq_map.harq_control_ie.reserved", FT_UINT8, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_RESERVED_MASK, NULL, HFILL} - }, - { - &hf_harq_control_ie_prefix_1, - {"Prefix", "wmx.harq_map.harq_control_ie.prefix", FT_BOOLEAN, 16, TFS(&tfs_prefix), WIMAX_HARQ_CONTROL_IE_PREFIX_MASK_1, NULL, HFILL} - }, - { - &hf_harq_control_ie_ai_sn_1, - {"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} - }, - { - &hf_harq_control_ie_spid_1, - {"Subpacket ID (SPID)", "wmx.harq_map.harq_control_ie.spid", FT_UINT16, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_SPID_MASK_1, NULL, HFILL} - }, - { - &hf_harq_control_ie_acid_1, - {"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} - }, - { - &hf_harq_control_ie_reserved_1, - {"Reserved", "wmx.harq_map.harq_control_ie.reserved", FT_UINT16, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_RESERVED_MASK_1, NULL, HFILL} - } - }; - - static hf_register_info hf_extension_type[] = + ul_map_type = ((byte & UL_MAP_TYPE_MASK_1) >> 1); + } + else { - { - &hf_culmap_extension_type, - {"UL-MAP Type", "wmx.extension_type.ul_map_type", FT_UINT16, BASE_DEC, NULL, EXTENSION_TYPE_MASK, NULL, HFILL} - }, - { - &hf_culmap_extension_type_1, - {"UL-MAP Type", "wmx.extension_type.ul_map_type", FT_UINT16, BASE_DEC, NULL, EXTENSION_TYPE_MASK_1, NULL, HFILL} - }, - { - &hf_culmap_extension_subtype, - {"Extension Subtype", "wmx.extension_type.subtype", FT_UINT16, BASE_DEC, NULL, EXTENSION_SUBTYPE_MASK, NULL, HFILL} - }, - { - &hf_culmap_extension_subtype_1, - {"Extension Subtype", "wmx.extension_type.subtype", FT_UINT16, BASE_DEC, NULL, EXTENSION_SUBTYPE_MASK_1, NULL, HFILL} - }, - { - &hf_culmap_extension_length, - {"Extension Length", "wmx.extension_type.length", FT_UINT16, BASE_DEC, NULL, EXTENSION_LENGTH_MASK, NULL, HFILL} - }, - { - &hf_culmap_extension_length_1, - {"Extension Length", "wmx.extension_type.length", FT_UINT16, BASE_DEC, NULL, EXTENSION_LENGTH_MASK_1, NULL, HFILL} - }, - { - &hf_culmap_extension_time_diversity_mbs, - {"Time Diversity MBS", "wmx.extension_type.time_diversity_mbs", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} - }, - { - &hf_culmap_extension_time_diversity_mbs_1, - {"Time Diversity MBS", "wmx.extension_type.time_diversity_mbs", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} - }, - { - &hf_culmap_extension_harq_mode_1, - {"HARQ Mode Switch", "wmx.extension_type.harq_mode", FT_UINT16, BASE_HEX, NULL, 0x000F, NULL, HFILL} - }, - { - &hf_culmap_extension_harq_mode, - {"HARQ Mode Switch", "wmx.extension_type.harq_mode", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL} - }, - { - &hf_culmap_extension_unknown_sub_type, - {"Unknown Extension Subtype", "wmx.extension_type.unknown_sub_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} - }, - { - &hf_culmap_extension_unknown_sub_type_1, - {"Unknown Extension Subtype", "wmx.extension_type.unknown_sub_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} - } - }; + ul_map_type = ((byte & UL_MAP_TYPE_MASK) >> 5); + } + /* process the Compact UL-MAP IE (table 90) */ + switch (ul_map_type) + { + case COMPACT_UL_MAP_TYPE_NORMAL_SUBCHANNEL:/* 6.3.2.3.43.7.1 */ + /* display the UL-MAP type and reserved bit */ + if(nibble_offset & 1) + { + proto_tree_add_item(tree, hf_culmap_ul_map_type_1, tvb, ul_map_offset, 1, FALSE); + /* display the reserved */ + proto_tree_add_item(tree, hf_culmap_reserved_1, tvb, ul_map_offset, 1, FALSE); + /* move to next byte */ + ul_map_offset++; + nibble_offset = 0; + } + else + { + proto_tree_add_item(tree, hf_culmap_ul_map_type, tvb, ul_map_offset, 1, FALSE); + /* display the reserved */ + proto_tree_add_item(tree, hf_culmap_reserved, tvb, ul_map_offset, 1, FALSE); + nibble_offset = 1; + } + length = 1; + /* decode RCID IE */ + nibble_length = wimax_compact_ulmap_rcid_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset); + length += nibble_length; + ul_map_offset += (nibble_length >> 1); + nibble_offset = (nibble_length & 1); + /* check harq mode */ + if(!harq_mode) + { /* display the Nep and Nsch Code */ + if(nibble_offset & 1) + { + proto_tree_add_item(tree, hf_culmap_nep_code_1, tvb, ul_map_offset, 1, FALSE); + /* move to next byte */ + ul_map_offset++; + proto_tree_add_item(tree, hf_culmap_nsch_code, tvb, ul_map_offset, 1, FALSE); + } + else + { + proto_tree_add_item(tree, hf_culmap_nep_code, tvb, ul_map_offset, 1, FALSE); + proto_tree_add_item(tree, hf_culmap_nsch_code_1, tvb, ul_map_offset, 1, FALSE); + /* move to next byte */ + ul_map_offset++; + } + length += 2; + } + else if(harq_mode == 1) + { /* display the Shortened UIUC and Companded SC */ + if(nibble_offset & 1) + { + proto_tree_add_item(tree, hf_culmap_shortened_uiuc_1, tvb, ul_map_offset, 2, FALSE); + proto_tree_add_item(tree, hf_culmap_companded_sc_1, tvb, ul_map_offset, 2, FALSE); + } + else + { + proto_tree_add_item(tree, hf_culmap_shortened_uiuc, tvb, ul_map_offset, 1, FALSE); + proto_tree_add_item(tree, hf_culmap_companded_sc, tvb, ul_map_offset, 1, FALSE); + } + /* move to next byte */ + ul_map_offset++; + length += 2; + } + /* decode HARQ Control IE */ + nibble_length = wimax_compact_ulmap_harq_control_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset); + length += nibble_length; + break; + case COMPACT_UL_MAP_TYPE_BAND_AMC:/* 6.3.2.3.43.7.2 */ + /* display the UL-MAP type and reserved bit */ + if(nibble_offset & 1) + { + proto_tree_add_item(tree, hf_culmap_ul_map_type_1, tvb, ul_map_offset, 1, FALSE); + /* display the reserved */ + proto_tree_add_item(tree, hf_culmap_reserved_1, tvb, ul_map_offset, 1, FALSE); + /* move to next byte */ + ul_map_offset++; + nibble_offset = 0; + } + else + { + proto_tree_add_item(tree, hf_culmap_ul_map_type, tvb, ul_map_offset, 1, FALSE); + /* display the reserved */ + proto_tree_add_item(tree, hf_culmap_reserved, tvb, ul_map_offset, 1, FALSE); + nibble_offset = 1; + } + length = 1; + /* decode RCID IE */ + nibble_length = wimax_compact_ulmap_rcid_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset); + length += nibble_length; + ul_map_offset += (nibble_length >> 1); + nibble_offset = (nibble_length & 1); + /* check harq mode */ + if(!harq_mode) + { /* display the Nep and Nsch Code */ + if(nibble_offset & 1) + { + proto_tree_add_item(tree, hf_culmap_nep_code_1, tvb, ul_map_offset, 1, FALSE); + /* move to next byte */ + ul_map_offset++; + proto_tree_add_item(tree, hf_culmap_nsch_code, tvb, ul_map_offset, 1, FALSE); + } + else + { + proto_tree_add_item(tree, hf_culmap_nep_code, tvb, ul_map_offset, 1, FALSE); + proto_tree_add_item(tree, hf_culmap_nsch_code_1, tvb, ul_map_offset, 1, FALSE); + /* move to next byte */ + ul_map_offset++; + } + length += 2; + } + else if(harq_mode == 1) + { /* display the Shortened UIUC and Companded SC */ + if(nibble_offset & 1) + { + proto_tree_add_item(tree, hf_culmap_shortened_uiuc_1, tvb, ul_map_offset, 2, FALSE); + proto_tree_add_item(tree, hf_culmap_companded_sc_1, tvb, ul_map_offset, 2, FALSE); + } + else + { + proto_tree_add_item(tree, hf_culmap_shortened_uiuc, tvb, ul_map_offset, 1, FALSE); + proto_tree_add_item(tree, hf_culmap_companded_sc, tvb, ul_map_offset, 1, FALSE); + } + /* move to next byte */ + ul_map_offset++; + length += 2; + } + /* get the Nband */ + if(max_logical_bands) + { /* get and display the Nband */ + nband = tvb_get_guint8(tvb, ul_map_offset); + length++; + if(nibble_offset & 1) + { + nband = (nband & LSB_NIBBLE_MASK); + /* display the Nband */ + proto_tree_add_item(tree, hf_culmap_num_bands_1, tvb, ul_map_offset, 1, FALSE); + /* move to next byte */ + ul_map_offset++; + nibble_offset = 0; + if(max_logical_bands == 3) + { + proto_tree_add_item(tree, hf_culmap_band_index, tvb, ul_map_offset, nband, FALSE); + length += (nband * 2); + /* update offset */ + ul_map_offset += nband; + } + else + { + nibble_offset = (nband & 1); + proto_tree_add_item(tree, hf_culmap_band_index, tvb, ul_map_offset, ((nband >> 1) + nibble_offset), FALSE); + length += nband; + /* update offset */ + ul_map_offset += (nband >> 1); + } + } + else + { + nband = ((nband & MSB_NIBBLE_MASK) >> 4); + /* display the Nband */ + proto_tree_add_item(tree, hf_culmap_num_bands, tvb, ul_map_offset, 1, FALSE); + nibble_offset = 1; + if(max_logical_bands == 3) + { + proto_tree_add_item(tree, hf_culmap_band_index, tvb, ul_map_offset, (nband + nibble_offset), FALSE); + length += (nband * 2); + /* update offset */ + ul_map_offset += nband; + } + else + { + proto_tree_add_item(tree, hf_culmap_band_index, tvb, ul_map_offset, ((nband >> 1) + nibble_offset), FALSE); + length += nband; + /* update offset */ + ul_map_offset += ((nband + nibble_offset) >> 1); + if(nband & 1) + nibble_offset = 0; + } + } + band_count = nband; + } + else + { + nband = 0; + band_count = 1; + /* display the Nb-BITMAP */ + if(nibble_offset & 1) + { + proto_tree_add_item(tree, hf_culmap_nb_bitmap_1, tvb, ul_map_offset, 1, FALSE); + /* move to next byte */ + ul_map_offset++; + nibble_offset = 0; + } + else + { + proto_tree_add_item(tree, hf_culmap_nb_bitmap, tvb, ul_map_offset, 1, FALSE); + nibble_offset = 1; + } + length++; + } + /* Get the Allocation Mode */ + byte = tvb_get_guint8(tvb, ul_map_offset); + if(nibble_offset & 1) + { + allocation_mode = ((byte & ALLOCATION_MODE_MASK_1) >> 2); + proto_tree_add_item(tree, hf_culmap_allocation_mode_1, tvb, ul_map_offset, 1, FALSE); + proto_tree_add_item(tree, hf_culmap_allocation_mode_rsvd_1, tvb, ul_map_offset, 1, FALSE); + nibble_offset = 0; + ul_map_offset++; + } + else + { + allocation_mode = ((byte & ALLOCATION_MODE_MASK) >> 6); + proto_tree_add_item(tree, hf_culmap_allocation_mode, tvb, ul_map_offset, 1, FALSE); + proto_tree_add_item(tree, hf_culmap_allocation_mode_rsvd, tvb, ul_map_offset, 1, FALSE); + nibble_offset = 1; + } + length++; + /* Decode Allocation Mode - need to be done */ + if(!allocation_mode) + { + if(nibble_offset & 1) + { + proto_tree_add_item(tree, hf_culmap_num_subchannels_1, tvb, ul_map_offset, 2, FALSE); + } + else + { + proto_tree_add_item(tree, hf_culmap_num_subchannels, tvb, ul_map_offset, 1, FALSE); + } + ul_map_offset++; + length += 2; + } + else if(allocation_mode == 1) + { + for(i=0; i> 1); + nibble_offset = (nibble_length & 1); + /* check harq mode */ + if(!harq_mode) + { /* display the Nep and Nsch Code */ + if(nibble_offset & 1) + { + proto_tree_add_item(tree, hf_culmap_nep_code_1, tvb, ul_map_offset, 1, FALSE); + /* move to next byte */ + ul_map_offset++; + proto_tree_add_item(tree, hf_culmap_nsch_code, tvb, ul_map_offset, 1, FALSE); + } + else + { + proto_tree_add_item(tree, hf_culmap_nep_code, tvb, ul_map_offset, 1, FALSE); + proto_tree_add_item(tree, hf_culmap_nsch_code_1, tvb, ul_map_offset, 1, FALSE); + /* move to next byte */ + ul_map_offset++; + } + length += 2; + } + else if(harq_mode == 1) + { /* display the Shortened UIUC and Companded SC */ + if(nibble_offset & 1) + { + proto_tree_add_item(tree, hf_culmap_shortened_uiuc_1, tvb, ul_map_offset, 2, FALSE); + proto_tree_add_item(tree, hf_culmap_companded_sc_1, tvb, ul_map_offset, 2, FALSE); + } + else + { + proto_tree_add_item(tree, hf_culmap_shortened_uiuc, tvb, ul_map_offset, 1, FALSE); + proto_tree_add_item(tree, hf_culmap_companded_sc, tvb, ul_map_offset, 1, FALSE); + } + /* move to next byte */ + ul_map_offset++; + length += 2; + } + /* display BIN offset */ + if(nibble_offset & 1) + { + proto_tree_add_item(tree, hf_culmap_bin_offset_1, tvb, ul_map_offset, 2, FALSE); + /* move to next byte */ + ul_map_offset++; + } + else + { + proto_tree_add_item(tree, hf_culmap_bin_offset, tvb, ul_map_offset, 1, FALSE); + /* move to next byte */ + ul_map_offset++; + } + length += 2; + /* decode HARQ Control IE */ + nibble_length = wimax_compact_ulmap_harq_control_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset); + length += nibble_length; + break; + case COMPACT_UL_MAP_TYPE_UIUC:/* 6.3.2.3.43.7.4 */ + /* display the UL-MAP type and reserved bit */ + if(nibble_offset & 1) + { + proto_tree_add_item(tree, hf_culmap_ul_map_type_1, tvb, ul_map_offset, 1, FALSE); + /* display the reserved */ + proto_tree_add_item(tree, hf_culmap_reserved_1, tvb, ul_map_offset, 1, FALSE); + /* move to next byte */ + ul_map_offset++; + /* get the new byte */ + byte = tvb_get_guint8(tvb, ul_map_offset); + /* get the UIUC */ + uiuc = ((byte & MSB_NIBBLE_MASK) >> 4); + /* display the UIUC */ + proto_tree_add_item(tree, hf_culmap_uiuc, tvb, ul_map_offset, 1, FALSE); + } + else + { + /* display the UL-MAP type */ + proto_tree_add_item(tree, hf_culmap_ul_map_type, tvb, ul_map_offset, 1, FALSE); + /* display the reserved */ + proto_tree_add_item(tree, hf_culmap_reserved, tvb, ul_map_offset, 1, FALSE); + /* get the UIUC */ + uiuc = (byte & LSB_NIBBLE_MASK); + /* display the UIUC */ + proto_tree_add_item(tree, hf_culmap_uiuc_1, tvb, ul_map_offset, 1, FALSE); + } + length = 2; + /* decode RCID IE */ + nibble_length = wimax_compact_ulmap_rcid_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset); + length += nibble_length; + ul_map_offset += (nibble_length >> 1); + nibble_offset = (nibble_length & 1); + if(uiuc == 15) + { /* Extended UIUC dependent IE */ + nibble_length = wimax_extended_uiuc_dependent_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset); + length += nibble_length; + ul_map_offset += (nibble_length >> 1); + nibble_offset = (nibble_length & 1); + } + else if(uiuc == 14) + { /* CDMA Allocation IE */ + nibble_length = wimax_cdma_allocation_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset); + length += nibble_length; + ul_map_offset += (nibble_length >> 1); + nibble_offset = (nibble_length & 1); + } + else if(uiuc == 12) + { + if(nibble_offset & 1) + { + /* display the OFDMA symbol offset */ + proto_tree_add_item(tree, hf_culmap_uiuc_ofdma_symbol_offset_1, tvb, ul_map_offset, 2, FALSE); + ul_map_offset++; + /* display the subchannel offset */ + proto_tree_add_item(tree, hf_culmap_uiuc_subchannel_offset_7_1, tvb, ul_map_offset, 4, FALSE); + /* display the number of OFDMA symbols */ + proto_tree_add_item(tree, hf_culmap_uiuc_num_of_ofdma_symbols_7_1, tvb, ul_map_offset, 4, FALSE); + /* display the number of subchannels */ + proto_tree_add_item(tree, hf_culmap_uiuc_num_of_subchannels_7_1, tvb, ul_map_offset, 4, FALSE); + /* display the ranging method */ + proto_tree_add_item(tree, hf_culmap_uiuc_ranging_method_1, tvb, ul_map_offset, 4, FALSE); + /* display the reserved */ + proto_tree_add_item(tree, hf_culmap_uiuc_reserved_1, tvb, ul_map_offset, 4, FALSE); + ul_map_offset += 3; + } + else + { /* display the OFDMA symbol offset */ + proto_tree_add_item(tree, hf_culmap_uiuc_ofdma_symbol_offset, tvb, ul_map_offset, 1, FALSE); + ul_map_offset++; + /* display the subchannel offset */ + proto_tree_add_item(tree, hf_culmap_uiuc_subchannel_offset_7, tvb, ul_map_offset, 3, FALSE); + /* display the number of OFDMA symbols */ + proto_tree_add_item(tree, hf_culmap_uiuc_num_of_ofdma_symbols_7, tvb, ul_map_offset, 3, FALSE); + /* display the number of subchannels */ + proto_tree_add_item(tree, hf_culmap_uiuc_num_of_subchannels_7, tvb, ul_map_offset, 3, FALSE); + /* display the ranging method */ + proto_tree_add_item(tree, hf_culmap_uiuc_ranging_method, tvb, ul_map_offset, 3, FALSE); + /* display the reserved */ + proto_tree_add_item(tree, hf_culmap_uiuc_reserved, tvb, ul_map_offset, 3, FALSE); + ul_map_offset += 3; + } + length += 8; + } + else + { /* display Number of subchannels */ + if(nibble_offset & 1) + proto_tree_add_item(tree, hf_culmap_uiuc_num_of_subchannels_1, tvb, ul_map_offset, 2, FALSE); + else + proto_tree_add_item(tree, hf_culmap_uiuc_num_of_subchannels, tvb, ul_map_offset, 1, FALSE); + length += 2; + /* display the repetition coding indication and reserved bits */ + if(nibble_offset & 1) + { + proto_tree_add_item(tree, hf_culmap_uiuc_repetition_coding_indication_1, tvb, ul_map_offset, 1, FALSE); + proto_tree_add_item(tree, hf_culmap_uiuc_reserved_1, tvb, ul_map_offset, 1, FALSE); + nibble_offset = 0; + } + else + { + proto_tree_add_item(tree, hf_culmap_uiuc_repetition_coding_indication, tvb, ul_map_offset, 1, FALSE); + proto_tree_add_item(tree, hf_culmap_uiuc_reserved, tvb, ul_map_offset, 1, FALSE); + nibble_offset = 1; + } + length += 1; + } + /* decode HARQ Control IE */ + nibble_length = wimax_compact_ulmap_harq_control_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset); + length += nibble_length; + break; + case COMPACT_UL_MAP_TYPE_HARQ_REGION_IE:/* 6.3.2.3.43.7.5 */ + if(nibble_offset & 1) + { /* display the UL-MAP type */ + proto_tree_add_item(tree, hf_culmap_ul_map_type_1, tvb, ul_map_offset, 1, FALSE); + /* display the HARQ Region Change Indication */ + proto_tree_add_item(tree, hf_culmap_harq_region_change_indication_1, tvb, ul_map_offset, 1, FALSE); + /* get the HARQ Region Change Indication */ + harq_region_change_indication = (byte & 0x01); + /* move to next byte */ + ul_map_offset++; + nibble_offset = 0; + } + else + { /* display the UL-MAP type */ + proto_tree_add_item(tree, hf_culmap_ul_map_type, tvb, ul_map_offset, 1, FALSE); + /* display the HARQ Region Change Indication */ + proto_tree_add_item(tree, hf_culmap_harq_region_change_indication, tvb, ul_map_offset, 1, FALSE); + /* get the HARQ Region Change Indication */ + harq_region_change_indication = (byte & 0x10); + nibble_offset = 1; + } + length = 1; + if(harq_region_change_indication == 1) + { + if(nibble_offset & 1) + { + /* display the OFDMA symbol offset */ + proto_tree_add_item(tree, hf_culmap_uiuc_ofdma_symbol_offset_1, tvb, ul_map_offset, 2, FALSE); + ul_map_offset++; + /* display the subchannel offset */ + proto_tree_add_item(tree, hf_culmap_uiuc_subchannel_offset_1, tvb, ul_map_offset, 2, FALSE); + ul_map_offset++; + /* display the number of OFDMA symbols */ + proto_tree_add_item(tree, hf_culmap_uiuc_num_of_ofdma_symbols_1, tvb, ul_map_offset, 2, FALSE); + ul_map_offset++; + /* display the number of subchannels */ + proto_tree_add_item(tree, hf_culmap_uiuc_num_of_subchannels_1, tvb, ul_map_offset, 2, FALSE); + ul_map_offset++; + } + else + { /* display the OFDMA symbol offset */ + proto_tree_add_item(tree, hf_culmap_uiuc_ofdma_symbol_offset, tvb, ul_map_offset, 1, FALSE); + ul_map_offset++; + /* display the subchannel offset */ + proto_tree_add_item(tree, hf_culmap_uiuc_subchannel_offset, tvb, ul_map_offset, 1, FALSE); + ul_map_offset++; + /* display the number of OFDMA symbols */ + proto_tree_add_item(tree, hf_culmap_uiuc_num_of_ofdma_symbols, tvb, ul_map_offset, 1, FALSE); + ul_map_offset++; + /* display the number of subchannels */ + proto_tree_add_item(tree, hf_culmap_uiuc_num_of_subchannels, tvb, ul_map_offset, 1, FALSE); + ul_map_offset++; + } + length += 8; + } + break; + case COMPACT_UL_MAP_TYPE_CQICH_REGION_IE:/* 6.3.2.3.43.7.6 */ + if(nibble_offset & 1) + { /* display the UL-MAP type */ + proto_tree_add_item(tree, hf_culmap_ul_map_type_1, tvb, ul_map_offset, 1, FALSE); + /* display the CQI Region Change Indication */ + proto_tree_add_item(tree, hf_culmap_cqi_region_change_indication_1, tvb, ul_map_offset, 1, FALSE); + /* get the CQI Region Change Indication */ + cqi_region_change_indication = (byte & 0x01); + /* move to next byte */ + ul_map_offset++; + nibble_offset = 0; + } + else + { /* display the UL-MAP type */ + proto_tree_add_item(tree, hf_culmap_ul_map_type, tvb, ul_map_offset, 1, FALSE); + /* display the CQI Region Change Indication */ + proto_tree_add_item(tree, hf_culmap_cqi_region_change_indication, tvb, ul_map_offset, 1, FALSE); + /* get the CQI Region Change Indication */ + cqi_region_change_indication = (byte & 0x10); + nibble_offset = 1; + } + length = 1; + if(cqi_region_change_indication == 1) + { + if(nibble_offset & 1) + { + /* display the OFDMA symbol offset */ + proto_tree_add_item(tree, hf_culmap_uiuc_ofdma_symbol_offset_1, tvb, ul_map_offset, 2, FALSE); + ul_map_offset++; + /* display the subchannel offset */ + proto_tree_add_item(tree, hf_culmap_uiuc_subchannel_offset_1, tvb, ul_map_offset, 2, FALSE); + ul_map_offset++; + /* display the number of OFDMA symbols */ + proto_tree_add_item(tree, hf_culmap_uiuc_num_of_ofdma_symbols_1, tvb, ul_map_offset, 2, FALSE); + ul_map_offset++; + /* display the number of subchannels */ + proto_tree_add_item(tree, hf_culmap_uiuc_num_of_subchannels_1, tvb, ul_map_offset, 2, FALSE); + ul_map_offset++; + } + else + { /* display the OFDMA symbol offset */ + proto_tree_add_item(tree, hf_culmap_uiuc_ofdma_symbol_offset, tvb, ul_map_offset, 1, FALSE); + ul_map_offset++; + /* display the subchannel offset */ + proto_tree_add_item(tree, hf_culmap_uiuc_subchannel_offset, tvb, ul_map_offset, 1, FALSE); + ul_map_offset++; + /* display the number of OFDMA symbols */ + proto_tree_add_item(tree, hf_culmap_uiuc_num_of_ofdma_symbols, tvb, ul_map_offset, 1, FALSE); + ul_map_offset++; + /* display the number of subchannels */ + proto_tree_add_item(tree, hf_culmap_uiuc_num_of_subchannels, tvb, ul_map_offset, 1, FALSE); + ul_map_offset++; + } + length += 8; + } + break; + case COMPACT_UL_MAP_TYPE_EXTENSION:/* 6.3.2.3.43.7.7 */ + /* decode the Compact UL-MAP externsion IE */ + nibble_length = wimax_culmap_extension_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset);/*, cqich_indicator);*/ + length = nibble_length; + break; + default:/* Reserved Type */ + /* display the reserved type */ + proto_tree_add_item(tree, hf_culmap_reserved_type_1, tvb, ul_map_offset, 1, FALSE); + length = 1; + break; + } + /* Update the nibble_offset and length */ + return length; +} + +/* Compact UL-MAP Reduced CID IE (6.3.2.3.43.3) decoder */ +static guint wimax_compact_ulmap_rcid_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset) +{ + guint length = 0; + guint prefix; - static hf_register_info hf_cdma_allocation[] = +#ifdef DEBUG + /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) { - { /* display the Duration */ - &hf_cdma_allocation_duration, - {"Duration", "wmx.cdma_allocation.duration", FT_UINT16, BASE_DEC, NULL, CDMA_ALLOCATION_DURATION_MASK, NULL, HFILL} - }, - { /* display the UIUC */ - &hf_cdma_allocation_uiuc, - {"UIUC For Transmission", "wmx.cdma_allocation.uiuc", FT_UINT16, BASE_DEC, NULL, CDMA_ALLOCATION_UIUC_MASK, NULL, HFILL} - }, - { /* display the Repetition Coding Indication */ - &hf_cdma_allocation_repetition, - {"Repetition Coding Indication", "wmx.cdma_allocation.allocation_repetition", FT_UINT16, BASE_DEC, VALS(vals_repetitions), CDMA_ALLOCATION_REPETITION_CODE_MASK, NULL, HFILL} - }, - { /* display the Frame Number Index */ - &hf_cdma_allocation_frame_number_index, - {"Frame Number Index (LSBs of relevant frame number)", "wmx.cdma_allocation.frame_number_index", FT_UINT16, BASE_DEC, NULL, CDMA_ALLOCATION_FRAME_NUMBER_INDEX_MASK, NULL, HFILL} - }, - { /* display the Ranging Code */ - &hf_cdma_allocation_ranging_code, - {"Ranging Code", "wmx.cdma_allocation.ranging_code", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} - }, - { /* display the Ranging Symbol */ - &hf_cdma_allocation_ranging_symbol, - {"Ranging Symbol", "wmx.cdma_allocation.ranging_symbol", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} - }, - { /* display the Ranging Subchannel */ - &hf_cdma_allocation_ranging_subchannel, - {"Ranging Subchannel", "wmx.cdma_allocation.ranging_subchannel", FT_UINT8, BASE_DEC, NULL, CDMA_ALLOCATION_RANGING_SUBCHANNEL_MASK, NULL, HFILL} - }, - { /* display the BW Request Mandatory */ - &hf_cdma_allocation_bw_req, - {"BW Request Mandatory", "wmx.cdma_allocation.bw_req", FT_BOOLEAN, 8, TFS(&tfs_yes_no_ie), CDMA_ALLOCATION_BW_REQUEST_MANDATORY_MASK, NULL, HFILL} - }, - { /* display the Duration */ - &hf_cdma_allocation_duration_1, - {"Duration", "wmx.cdma_allocation.duration", FT_UINT16, BASE_DEC, NULL, CDMA_ALLOCATION_DURATION_MASK_1, NULL, HFILL} - }, - { /* display the UIUC */ - &hf_cdma_allocation_uiuc_1, - {"UIUC For Transmission", "wmx.cdma_allocation.uiuc", FT_UINT16, BASE_DEC, NULL, CDMA_ALLOCATION_UIUC_MASK_1, NULL, HFILL} - }, - { /* display the Repetition Coding Indication */ - &hf_cdma_allocation_repetition_1, - {"Repetition Coding Indication", "wmx.cdma_allocation.allocation_repetition", FT_UINT16, BASE_DEC, VALS(vals_repetitions), CDMA_ALLOCATION_REPETITION_CODE_MASK_1, NULL, HFILL} - }, - { /* display the Frame Number Index */ - &hf_cdma_allocation_frame_number_index_1, - {"Frame Number Index (LSBs of relevant frame number)", "wmx.cdma_allocation.frame_number_index", FT_UINT32, BASE_DEC, NULL, CDMA_ALLOCATION_FRAME_NUMBER_INDEX_MASK_1, NULL, HFILL} - }, - { /* display the Ranging Code */ - &hf_cdma_allocation_ranging_code_1, - {"Ranging Code", "wmx.cdma_allocation.ranging_code", FT_UINT32, BASE_DEC, NULL, CDMA_ALLOCATION_RANGING_CODE_MASK_1, NULL, HFILL} - }, - { /* display the Ranging Symbol */ - &hf_cdma_allocation_ranging_symbol_1, - {"Ranging Symbol", "wmx.cdma_allocation.ranging_symbol", FT_UINT32, BASE_DEC, NULL, CDMA_ALLOCATION_RANGING_SYMBOL_MASK_1, NULL, HFILL} - }, - { /* display the Ranging Subchannel */ - &hf_cdma_allocation_ranging_subchannel_1, - {"Ranging Subchannel", "wmx.cdma_allocation.ranging_subchannel", FT_UINT32, BASE_DEC, NULL, CDMA_ALLOCATION_RANGING_SUBCHANNEL_MASK_1, NULL, HFILL} - }, - { /* display the BW Request Mandatory */ - &hf_cdma_allocation_bw_req_1, - {"BW Request Mandatory", "wmx.cdma_allocation.bw_req", FT_BOOLEAN, 32, TFS(&tfs_yes_no_ie), CDMA_ALLOCATION_BW_REQUEST_MANDATORY_MASK_1, NULL, HFILL} + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "RCID IE"); + } +#endif + if(nibble_offset & 1) + { + if(cid_type == CID_TYPE_NORMAL) + { /* display the normal CID */ + proto_tree_add_item(tree, hf_rcid_ie_normal_cid_1, tvb, offset, 3, FALSE); + length = 4; } - }; - - static hf_register_info hf_extended_uiuc[] = + else + { /* Get the prefix bit */ + prefix = (tvb_get_guint8(tvb, offset) & 0x08); + /* display the prefix */ + proto_tree_add_item(tree, hf_rcid_ie_prefix_1, tvb, offset, 2, FALSE); + if(prefix) + { /* display the CID11 */ + proto_tree_add_item(tree, hf_rcid_ie_cid11_3, tvb, offset, 2, FALSE); + length = 3; + } + else + { + if(cid_type == CID_TYPE_RCID11) + { /* display the CID11 */ + proto_tree_add_item(tree, hf_rcid_ie_cid11_1, tvb, offset, 2, FALSE); + length = 3; + } + else if(cid_type == CID_TYPE_RCID7) + { /* display the normal CID7 */ + proto_tree_add_item(tree, hf_rcid_ie_cid7_1, tvb, offset, 2, FALSE); + length = 2; + } + else if(cid_type == CID_TYPE_RCID3) + { /* display the CID3 */ + proto_tree_add_item(tree, hf_rcid_ie_cid3_1, tvb, offset, 2, FALSE); + length = 1; + } + } + } + } + else { - { /* 8.4.5.4.4 Extended UIUC */ - &hf_extended_uiuc_ie_uiuc, - {"Extended UIUC", "wmx.extended_uiuc_ie.uiuc", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL } - }, - { /* 8.4.5.4.4 Extended UIUC */ - &hf_extended_uiuc_ie_uiuc_1, - {"Extended UIUC", "wmx.extended_uiuc_ie.uiuc", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL } - }, - { /* 8.4.5.4.4 IE Length */ - &hf_extended_uiuc_ie_length, - {"Length", "wmx.extended_uiuc_ie.length", FT_UINT8, BASE_DEC, NULL, MSB_NIBBLE_MASK, NULL, HFILL } - }, - { /* 8.4.5.4.4 IE Length */ - &hf_extended_uiuc_ie_length_1, - {"Length", "wmx.extended_uiuc_ie.length", FT_UINT24, BASE_DEC, NULL, LSB_NIBBLE_MASK, NULL, HFILL } - }, - { /* 8.4.5.4.5 Power Control IE */ - &hf_extended_uiuc_ie_power_control, - {"Power Control", "wmx.extended_uiuc_ie.power_control", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } - }, - { /* 8.4.5.4.5 Power Control IE */ - &hf_extended_uiuc_ie_power_control_24, - {"Power Control", "wmx.extended_uiuc_ie.power_control", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL } - }, - { - &hf_extended_uiuc_ie_power_measurement_frame, - {"Power Measurement Frame", "wmx.extended_uiuc_ie.power_measurement_frame", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } - }, - { - &hf_extended_uiuc_ie_power_measurement_frame_24, - {"Power Measurement Frame", "wmx.extended_uiuc_ie.power_measurement_frame", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL } - }, - { /* 8.4.5.4.8 Mini Subchannel Allocation IE */ - &hf_extended_uiuc_ie_mini_subchannel_alloc_ctype, - {"C Type", "wmx.extended_uiuc_ie.mini_subchannel_alloc.ctype", FT_UINT8, BASE_HEX, VALS(vals_ctypes), MINI_SUBCHANNEL_CTYPE_MASK, NULL, HFILL } - }, - { - &hf_extended_uiuc_ie_mini_subchannel_alloc_ctype_16, - {"C Type", "wmx.extended_uiuc_ie.mini_subchannel_alloc.ctype", FT_UINT16, BASE_HEX, VALS(vals_ctypes), MINI_SUBCHANNEL_CTYPE_MASK_16, NULL, HFILL } - }, - { - &hf_extended_uiuc_ie_mini_subchannel_alloc_duration, - {"Duration", "wmx.extended_uiuc_ie.mini_subchannel_alloc.duration", FT_UINT8, BASE_DEC, NULL, MINI_SUBCHANNEL_DURATION_MASK, NULL, HFILL } - }, - { - &hf_extended_uiuc_ie_mini_subchannel_alloc_duration_16, - {"Duration", "wmx.extended_uiuc_ie.mini_subchannel_alloc.duration", FT_UINT16, BASE_DEC, NULL, MINI_SUBCHANNEL_DURATION_MASK_16, NULL, HFILL } - }, - { - &hf_extended_uiuc_ie_mini_subchannel_alloc_cid, - {"CID", "wmx.extended_uiuc_ie.mini_subchannel_alloc.cid", FT_UINT24, BASE_HEX, NULL, MINI_SUBCHANNEL_CID_MASK, NULL, HFILL } - }, - { - &hf_extended_uiuc_ie_mini_subchannel_alloc_uiuc, - {"UIUC", "wmx.extended_uiuc_ie.mini_subchannel_alloc.uiuc", FT_UINT24, BASE_HEX, NULL, MINI_SUBCHANNEL_UIUC_MASK, NULL, HFILL } - }, - { - &hf_extended_uiuc_ie_mini_subchannel_alloc_repetition, - {"Repetition", "wmx.extended_uiuc_ie.mini_subchannel_alloc.repetition", FT_UINT24, BASE_HEX, VALS(vals_repetitions), MINI_SUBCHANNEL_REPETITION_MASK, NULL, HFILL } - }, - { - &hf_extended_uiuc_ie_mini_subchannel_alloc_cid_1, - {"CID", "wmx.extended_uiuc_ie.mini_subchannel_alloc.cid", FT_UINT24, BASE_HEX, NULL, MINI_SUBCHANNEL_CID_MASK_1, NULL, HFILL } - }, - { - &hf_extended_uiuc_ie_mini_subchannel_alloc_uiuc_1, - {"UIUC", "wmx.extended_uiuc_ie.mini_subchannel_alloc.uiuc", FT_UINT24, BASE_HEX, NULL, MINI_SUBCHANNEL_UIUC_MASK_1, NULL, HFILL } - }, - { - &hf_extended_uiuc_ie_mini_subchannel_alloc_repetition_1, - {"Repetition", "wmx.extended_uiuc_ie.mini_subchannel_alloc.repetition", FT_UINT24, BASE_HEX, VALS(vals_repetitions), MINI_SUBCHANNEL_REPETITION_MASK_1, NULL, HFILL } - }, - { - &hf_extended_uiuc_ie_mini_subchannel_alloc_cid_2, - {"CID", "wmx.extended_uiuc_ie.mini_subchannel_alloc.cid", FT_UINT24, BASE_HEX, NULL, MINI_SUBCHANNEL_CID_MASK_2, NULL, HFILL } - }, - { - &hf_extended_uiuc_ie_mini_subchannel_alloc_uiuc_2, - {"UIUC", "wmx.extended_uiuc_ie.mini_subchannel_alloc.uiuc", FT_UINT24, BASE_HEX, NULL, MINI_SUBCHANNEL_UIUC_MASK_2, NULL, HFILL } - }, - { - &hf_extended_uiuc_ie_mini_subchannel_alloc_repetition_2, - {"Repetition", "wmx.extended_uiuc_ie.mini_subchannel_alloc.repetition", FT_UINT24, BASE_HEX, VALS(vals_repetitions), MINI_SUBCHANNEL_REPETITION_MASK_2, NULL, HFILL } - }, - { - &hf_extended_uiuc_ie_mini_subchannel_alloc_cid_3, - {"CID", "wmx.extended_uiuc_ie.mini_subchannel_alloc.cid", FT_UINT24, BASE_HEX, NULL, MINI_SUBCHANNEL_CID_MASK_3, NULL, HFILL } - }, - { - &hf_extended_uiuc_ie_mini_subchannel_alloc_uiuc_3, - {"UIUC", "wmx.extended_uiuc_ie.mini_subchannel_alloc.uiuc", FT_UINT24, BASE_HEX, NULL, MINI_SUBCHANNEL_UIUC_MASK_2, NULL, HFILL } - }, - { - &hf_extended_uiuc_ie_mini_subchannel_alloc_repetition_3, - {"Repetition", "wmx.extended_uiuc_ie.mini_subchannel_alloc.repetition", FT_UINT24, BASE_HEX, VALS(vals_repetitions), MINI_SUBCHANNEL_REPETITION_MASK_3, NULL, HFILL } - }, + if(cid_type == CID_TYPE_NORMAL) + { /* display the normal CID */ + proto_tree_add_item(tree, hf_rcid_ie_normal_cid, tvb, offset, 2, FALSE); + length = 4; + } + else + { /* Get the prefix bit */ + prefix = (tvb_get_guint8(tvb, offset) & 0x08); + /* display the prefix */ + proto_tree_add_item(tree, hf_rcid_ie_prefix, tvb, offset, 2, FALSE); + if(prefix || (cid_type == CID_TYPE_RCID11)) + { /* display the CID11 */ + proto_tree_add_item(tree, hf_rcid_ie_cid11_2, tvb, offset, 2, FALSE); + length = 3; + } + else + { + if(cid_type == CID_TYPE_RCID11) + { /* display the CID11 */ + proto_tree_add_item(tree, hf_rcid_ie_cid11, tvb, offset, 2, FALSE); + length = 3; + } + else if(cid_type == CID_TYPE_RCID7) + { /* display the CID7 */ + proto_tree_add_item(tree, hf_rcid_ie_cid7, tvb, offset, 2, FALSE); + length = 2; + } + else if(cid_type == CID_TYPE_RCID3) + { /* display the CID3 */ + proto_tree_add_item(tree, hf_rcid_ie_cid3, tvb, offset, 2, FALSE); + length = 1; + } + } + } + } + /* return the IE length in nibbles */ + return length; +} + +/* Compact UL-MAP HARQ Control IE (6.3.2.3.43.4) decoder */ +static guint wimax_compact_ulmap_harq_control_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset) +{ + guint byte, prefix, length = 0; + +#ifdef DEBUG + /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "HARQ Control IE"); + } +#endif + /* Get the first byte */ + byte = tvb_get_guint8(tvb, offset); + if(nibble_offset & 1) + { /* Get the prefix bit */ + prefix = (byte & 0x08); + /* display the prefix */ + proto_tree_add_item(tree, hf_harq_control_ie_prefix_1, tvb, offset, 2, FALSE); + if(prefix) + { /* display the ai_sn */ + proto_tree_add_item(tree, hf_harq_control_ie_ai_sn_1, tvb, offset, 2, FALSE); + /* display the spid */ + proto_tree_add_item(tree, hf_harq_control_ie_spid_1, tvb, offset, 2, FALSE); + /* display the acid */ + proto_tree_add_item(tree, hf_harq_control_ie_acid_1, tvb, offset, 2, FALSE); + length = 2; + } + else + { /* display the reserved bits */ + proto_tree_add_item(tree, hf_harq_control_ie_reserved_1, tvb, offset, 2, FALSE); + length = 1; + } + } + else + { /* Get the prefix bit */ + prefix = (byte & 0x80); + /* display the prefix */ + proto_tree_add_item(tree, hf_harq_control_ie_prefix, tvb, offset, 1, FALSE); + if(prefix) + { /* display the ai_sn */ + proto_tree_add_item(tree, hf_harq_control_ie_ai_sn, tvb, offset, 1, FALSE); + /* display the spid */ + proto_tree_add_item(tree, hf_harq_control_ie_spid, tvb, offset, 1, FALSE); + /* display the acid */ + proto_tree_add_item(tree, hf_harq_control_ie_acid, tvb, offset, 1, FALSE); + length = 2; + } + else + { /* display the reserved bits */ + proto_tree_add_item(tree, hf_harq_control_ie_reserved, tvb, offset, 1, FALSE); + length = 1; + } + } + /* return the IE length in nibbles */ + return length; +} + +/* UL-MAP Extension IE sub-types */ +#define HARQ_MODE_SWITCH 0 +#define EXTENSION_TYPE_SHIFT 13 +#define EXTENSION_TYPE_SHIFT_1 9 +#define EXTENSION_SUBTYPE_SHIFT 8 +#define EXTENSION_SUBTYPE_SHIFT_1 4 +#define EXTENSION_LENGTH_SHIFT 4 + +/* Compact UL-MAP Extension IE (6.3.2.3.43.7.7) decoder */ +static guint wimax_culmap_extension_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset) +{ + guint tvb_value, ul_map_type, sub_type, length; + +#ifdef DEBUG + /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "UL-MAP Extension IE"); + } +#endif + /* Get the first 16-bit word */ + tvb_value = tvb_get_ntohs(tvb, offset); + if(nibble_offset & 1) + { /* Get the ul-map type */ + ul_map_type = ((tvb_value & EXTENSION_TYPE_MASK_1) >> EXTENSION_TYPE_SHIFT_1); + if(ul_map_type != COMPACT_UL_MAP_TYPE_EXTENSION) + return 0; + /* Get the sub-type */ + sub_type = ((tvb_value & EXTENSION_SUBTYPE_MASK_1) >> EXTENSION_SUBTYPE_SHIFT_1); + /* Get the IE length */ + length = (tvb_value & EXTENSION_LENGTH_MASK_1); + /* display the UL-MAP type */ + proto_tree_add_item(tree, hf_culmap_extension_type_1, tvb, offset, 2, FALSE); + /* display the UL-MAP extension subtype */ + proto_tree_add_item(tree, hf_culmap_extension_subtype_1, tvb, offset, 2, FALSE); + /* display the IE length */ + proto_tree_add_item(tree, hf_culmap_extension_length_1, tvb, offset, 2, FALSE); + offset += 2; + switch (sub_type) { - &hf_extended_uiuc_ie_mini_subchannel_alloc_padding, - {"Padding", "wmx.extended_uiuc_ie.mini_subchannel_alloc.padding", FT_UINT8, BASE_HEX, NULL, MINI_SUBCHANNEL_PADDING_MASK, NULL, HFILL } - }, + case HARQ_MODE_SWITCH: + /* display the HARQ mode */ + proto_tree_add_item(tree, hf_culmap_extension_harq_mode, tvb, offset, 1, FALSE); + /* Get the next byte */ + tvb_value = tvb_get_guint8(tvb, offset); + /* get the HARQ mode */ + harq_mode = ((tvb_value & MSB_NIBBLE_MASK) >> 4); + break; + default: + /* display the unknown sub-type in HEX */ + proto_tree_add_item(tree, hf_culmap_extension_unknown_sub_type_1, tvb, offset, (length - 2), FALSE); + break; + } + } + else + { /* Get the UL-MAp type */ + ul_map_type = ((tvb_value & EXTENSION_TYPE_MASK) >> EXTENSION_TYPE_SHIFT); + if(ul_map_type != COMPACT_UL_MAP_TYPE_EXTENSION) + return 0; + /* Get the sub-type */ + sub_type = ((tvb_value & EXTENSION_SUBTYPE_MASK) >> EXTENSION_SUBTYPE_SHIFT); + /* Get the IE length */ + length = ((tvb_value & EXTENSION_LENGTH_MASK) >> EXTENSION_LENGTH_SHIFT); + /* display the UL-MAP type */ + proto_tree_add_item(tree, hf_culmap_extension_type, tvb, offset, 2, FALSE); + /* display the UL-MAP extension subtype */ + proto_tree_add_item(tree, hf_culmap_extension_subtype, tvb, offset, 2, FALSE); + /* display the IE length */ + proto_tree_add_item(tree, hf_culmap_extension_length, tvb, offset, 2, FALSE); + switch (sub_type) { - &hf_extended_uiuc_ie_mini_subchannel_alloc_padding_1, - {"Padding", "wmx.extended_uiuc_ie.mini_subchannel_alloc.padding", FT_UINT24, BASE_HEX, NULL, MINI_SUBCHANNEL_PADDING_MASK_1, NULL, HFILL } - }, - { /* 8.4.5.4.6 AAS_UL_IE */ - &hf_extended_uiuc_ie_aas_ul, - {"AAS_UL_IE (not implemented)", "wmx.extended_uiuc_ie.aas_ul", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } - }, - { /* 8.4.5.4.12 CQICH Allocation IE */ - &hf_extended_uiuc_ie_cqich_alloc, - {"CQICH Allocation IE (not implemented)", "wmx.extended_uiuc_ie.cqich_alloc", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } - }, - { /* 8.4.5.4.7 UL Zone IE */ - &hf_extended_uiuc_ie_ul_zone, - {"UL Zone IE (not implemented)", "wmx.extended_uiuc_ie.ul_zone", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } - }, - - { /* 8.4.5.4.14 MIMO_UL_Basic_IE */ - &hf_extended_uiuc_ie_mimo_ul_basic, - {"MIMO UL Basic IE (not implemented)", "wmx.extended_uiuc_ie.mimo_ul_basic", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } - }, - { /* 8.4.5.4.22 UL-MAP Fast Tracking IE */ - &hf_extended_uiuc_ie_fast_tracking, - {"UL-MAP Fast Tracking IE (not implemented)", "wmx.extended_uiuc_ie.fast_tracking", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } - }, - { /* 8.4.5.4.21 Fast Ranging IE */ - &hf_extended_uiuc_ie_fast_ranging, - {"Fast Ranging IE (not implemented)", "wmx.extended_uiuc_ie.fast_ranging", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } - }, - { /* 8.4.5.4.14 UL-MAP Physical Modifier IE */ - &hf_extended_uiuc_ie_phymod_ul, - {"UL-MAP Physical Modifier IE (not implemented)", "wmx.extended_uiuc_ie.phymod_ul", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } - }, - { /* 8.4.5.4.17 UL PUSC Burst Allocation in Other Segment IE */ - &hf_extended_uiuc_ie_ul_pusc_burst_allocation, - {"UL_PUSC_Burst_Allocation_in_Other_Segment_IE (not implemented)", "wmx.extended_uiuc_ie.ul_pusc_burst_allocation", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } - }, - { /* 8.4.5.4.15 UL Allocation Start IE */ - &hf_extended_uiuc_ie_ul_allocation_start, - {"UL Allocation Start IE (not implemented)", "wmx.extended_uiuc_ie.ul_allocation_start", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } - }, - { /* unknown UIUC */ - &hf_extended_uiuc_ie_unknown_uiuc, - {"Unknown Extended UIUC", "wmx.extended_uiuc.unknown_uiuc", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } + case HARQ_MODE_SWITCH: + /* display the HARQ mode */ + proto_tree_add_item(tree, hf_culmap_extension_harq_mode_1, tvb, offset, 2, FALSE); + /* get the HARQ mode */ + harq_mode = (tvb_value & LSB_NIBBLE_MASK); + break; + default: + /* display the unknown sub-type in HEX */ + proto_tree_add_item(tree, hf_culmap_extension_unknown_sub_type, tvb, (offset + 1), (length - 1), FALSE); + break; } - }; + } + /* return the IE length in nibbles */ + return (length * 2); +} + +/* 8.4.5.4.3 (table 290) */ +guint wimax_cdma_allocation_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset) +{ + guint byte; - if (proto_wimax_compact_ulmap_ie_decoder == -1) +#ifdef DEBUG + /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) { - proto_wimax_compact_ulmap_ie_decoder = proto_wimax; - - proto_register_subtree_array(ett, array_length(ett)); - proto_register_field_array(proto_wimax_compact_ulmap_ie_decoder, hf_compact_ulmap, array_length(hf_compact_ulmap)); - proto_register_field_array(proto_wimax_compact_ulmap_ie_decoder, hf_rcid, array_length(hf_rcid)); - proto_register_field_array(proto_wimax_compact_ulmap_ie_decoder, hf_harq_control, array_length(hf_harq_control)); - proto_register_field_array(proto_wimax_compact_ulmap_ie_decoder, hf_extension_type, array_length(hf_extension_type)); - proto_register_field_array(proto_wimax_compact_ulmap_ie_decoder, hf_cdma_allocation, array_length(hf_cdma_allocation)); - proto_register_field_array(proto_wimax_compact_ulmap_ie_decoder, hf_extended_uiuc, array_length(hf_extended_uiuc)); + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "CDMA Allocation IE"); + } +#endif + /* Get the first byte */ + byte = tvb_get_guint8(tvb, offset); + if(nibble_offset & 1) + { /* display the Duration */ + proto_tree_add_item(tree, hf_cdma_allocation_duration_1, tvb, offset, 2, FALSE); + /* display the UIUC */ + proto_tree_add_item(tree, hf_cdma_allocation_uiuc_1, tvb, offset, 2, FALSE); + /* display the Repetition Coding Indication */ + proto_tree_add_item(tree, hf_cdma_allocation_repetition_1, tvb, offset, 2, FALSE); + /* display the frame number index */ + proto_tree_add_item(tree, hf_cdma_allocation_frame_number_index_1, tvb, offset, 4, FALSE); + /* display the Ranging Code */ + proto_tree_add_item(tree, hf_cdma_allocation_ranging_code_1, tvb, offset, 4, FALSE); + /* display the Ranging Symbol */ + proto_tree_add_item(tree, hf_cdma_allocation_ranging_symbol_1, tvb, offset, 4, FALSE); + /* display the Ranging Subchannel */ + proto_tree_add_item(tree, hf_cdma_allocation_ranging_subchannel_1, tvb, offset, 4, FALSE); + /* display the BW Request Mandatory */ + proto_tree_add_item(tree, hf_cdma_allocation_bw_req_1, tvb, offset, 4, FALSE); + } + else + { /* display the Duration */ + proto_tree_add_item(tree, hf_cdma_allocation_duration, tvb, offset, 2, FALSE); + /* display the UIUC */ + proto_tree_add_item(tree, hf_cdma_allocation_uiuc, tvb, offset, 2, FALSE); + /* display the Repetition Coding Indication */ + proto_tree_add_item(tree, hf_cdma_allocation_repetition, tvb, offset, 2, FALSE); + /* display the frame number index */ + proto_tree_add_item(tree, hf_cdma_allocation_frame_number_index, tvb, offset, 2, FALSE); + /* display the Ranging Code */ + proto_tree_add_item(tree, hf_cdma_allocation_ranging_code, tvb, offset, 1, FALSE); + /* display the Ranging Symbol */ + proto_tree_add_item(tree, hf_cdma_allocation_ranging_symbol, tvb, offset, 1, FALSE); + /* display the Ranging Subchannel */ + proto_tree_add_item(tree, hf_cdma_allocation_ranging_subchannel, tvb, offset, 1, FALSE); + /* display the BW Request Mandatory */ + proto_tree_add_item(tree, hf_cdma_allocation_bw_req, tvb, offset, 1, FALSE); } + /* return the IE length in nibbles */ + return 8; } -/* Compact UL-MAP IE Types (table 90) */ -#define COMPACT_UL_MAP_TYPE_NORMAL_SUBCHANNEL 0 -#define COMPACT_UL_MAP_TYPE_BAND_AMC 1 -#define COMPACT_UL_MAP_TYPE_SAFETY 2 -#define COMPACT_UL_MAP_TYPE_UIUC 3 -#define COMPACT_UL_MAP_TYPE_HARQ_REGION_IE 4 -#define COMPACT_UL_MAP_TYPE_CQICH_REGION_IE 5 -#define COMPACT_UL_MAP_TYPE_RESERVED 6 -#define COMPACT_UL_MAP_TYPE_EXTENSION 7 +/* Extended UIUCs (table 290a) */ +#define POWER_CONTROL_IE 0 +#define MINI_SUBCHANNEL_ALLOCATION_IE 1 +#define AAS_UL_IE 2 +#define CQICH_ALLOC_IE 3 +#define UL_ZONE_IE 4 +#define PHYMOD_UL_IE 5 +#define MIMO_UL_BASIC_IE 6 +#define UL_MAP_FAST_TRACKING_IE 7 +#define UL_PUSC_BURST_ALLOCATION_IN_OTHER_SEGMENT_IE 8 +#define FAST_RANGING_IE 9 +#define UL_ALLOCATION_START_IE 10 -/* Compact UL-MAP IE decoder */ -guint wimax_compact_ulmap_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset) +/* 8.4.5.4.4.1 (table 290b) */ +guint wimax_extended_uiuc_dependent_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset) { - guint uiuc, byte, length = 0; - guint ul_map_type; - guint harq_region_change_indication; - guint cqi_region_change_indication; - guint ul_map_offset, nibble_length; - guint nband, band_count, i, allocation_mode; + guint ext_uiuc, length, m, i; + guint8 byte; #ifdef DEBUG /* update the info column */ if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Compact UL-MAP IEs"); + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Extended UIUC IE"); } #endif - /* set the local offset */ - ul_map_offset = offset; - /* Get the first byte */ - byte = tvb_get_guint8(tvb, ul_map_offset); - /* get the ul-map type */ + + /* get the first byte */ + byte = tvb_get_guint8(tvb, offset); if(nibble_offset & 1) - { - ul_map_type = ((byte & UL_MAP_TYPE_MASK_1) >> 1); + { /* get the extended UIUC */ + ext_uiuc = (byte & LSB_NIBBLE_MASK); + /* display extended UIUC */ + proto_tree_add_item(tree, hf_extended_uiuc_ie_uiuc_1, tvb, offset, 1, FALSE); + /* move to next byte */ + offset++; + /* get the 2nd byte */ + byte = tvb_get_guint8(tvb, offset); + /* get the length */ + length = ((byte & MSB_NIBBLE_MASK) >> 4); + /* display extended UIUC length */ + proto_tree_add_item(tree, hf_extended_uiuc_ie_length_1, tvb, offset, 1, FALSE); } else - { - ul_map_type = ((byte & UL_MAP_TYPE_MASK) >> 5); + { /* get the extended UIUC */ + ext_uiuc = ((byte & MSB_NIBBLE_MASK) >> 4); + /* get the length */ + length = (byte & LSB_NIBBLE_MASK); + /* display extended UIUC */ + proto_tree_add_item(tree, hf_extended_uiuc_ie_uiuc, tvb, offset, 1, FALSE); + /* display extended UIUC length */ + proto_tree_add_item(tree, hf_extended_uiuc_ie_length, tvb, offset, 1, FALSE); + /* move to next byte */ + offset++; } - /* process the Compact UL-MAP IE (table 90) */ - switch (ul_map_type) + /* 8.4.5.4.4.1 (table 290b) */ + switch (ext_uiuc) { - case COMPACT_UL_MAP_TYPE_NORMAL_SUBCHANNEL:/* 6.3.2.3.43.7.1 */ - /* display the UL-MAP type and reserved bit */ + case POWER_CONTROL_IE: + /* 8.4.5.4.5 Power Control IE */ if(nibble_offset & 1) - { - proto_tree_add_item(tree, hf_culmap_ul_map_type_1, tvb, ul_map_offset, 1, FALSE); - /* display the reserved */ - proto_tree_add_item(tree, hf_culmap_reserved_1, tvb, ul_map_offset, 1, FALSE); - /* move to next byte */ - ul_map_offset++; - nibble_offset = 0; + { /* display power control value */ + proto_tree_add_item(tree, hf_extended_uiuc_ie_power_control_24, tvb, offset, 3, FALSE); + /* display power measurement frame value */ + proto_tree_add_item(tree, hf_extended_uiuc_ie_power_measurement_frame_24, tvb, offset, 3, FALSE); } else - { - proto_tree_add_item(tree, hf_culmap_ul_map_type, tvb, ul_map_offset, 1, FALSE); - /* display the reserved */ - proto_tree_add_item(tree, hf_culmap_reserved, tvb, ul_map_offset, 1, FALSE); - nibble_offset = 1; - } - length = 1; - /* decode RCID IE */ - nibble_length = wimax_compact_ulmap_rcid_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset); - length += nibble_length; - ul_map_offset += (nibble_length >> 1); - nibble_offset = (nibble_length & 1); - /* check harq mode */ - if(!harq_mode) - { /* display the Nep and Nsch Code */ - if(nibble_offset & 1) - { - proto_tree_add_item(tree, hf_culmap_nep_code_1, tvb, ul_map_offset, 1, FALSE); - /* move to next byte */ - ul_map_offset++; - proto_tree_add_item(tree, hf_culmap_nsch_code, tvb, ul_map_offset, 1, FALSE); - } - else - { - proto_tree_add_item(tree, hf_culmap_nep_code, tvb, ul_map_offset, 1, FALSE); - proto_tree_add_item(tree, hf_culmap_nsch_code_1, tvb, ul_map_offset, 1, FALSE); - /* move to next byte */ - ul_map_offset++; - } - length += 2; - } - else if(harq_mode == 1) - { /* display the Shortened UIUC and Companded SC */ - if(nibble_offset & 1) - { - proto_tree_add_item(tree, hf_culmap_shortened_uiuc_1, tvb, ul_map_offset, 2, FALSE); - proto_tree_add_item(tree, hf_culmap_companded_sc_1, tvb, ul_map_offset, 2, FALSE); - } - else - { - proto_tree_add_item(tree, hf_culmap_shortened_uiuc, tvb, ul_map_offset, 1, FALSE); - proto_tree_add_item(tree, hf_culmap_companded_sc, tvb, ul_map_offset, 1, FALSE); - } - /* move to next byte */ - ul_map_offset++; - length += 2; + { /* display power control value */ + proto_tree_add_item(tree, hf_extended_uiuc_ie_power_control, tvb, offset, 1, FALSE); + /* display power measurement frame value */ + proto_tree_add_item(tree, hf_extended_uiuc_ie_power_measurement_frame, tvb, (offset + 1), 1, FALSE); } - /* decode HARQ Control IE */ - nibble_length = wimax_compact_ulmap_harq_control_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset); - length += nibble_length; break; - case COMPACT_UL_MAP_TYPE_BAND_AMC:/* 6.3.2.3.43.7.2 */ - /* display the UL-MAP type and reserved bit */ - if(nibble_offset & 1) - { - proto_tree_add_item(tree, hf_culmap_ul_map_type_1, tvb, ul_map_offset, 1, FALSE); - /* display the reserved */ - proto_tree_add_item(tree, hf_culmap_reserved_1, tvb, ul_map_offset, 1, FALSE); - /* move to next byte */ - ul_map_offset++; - nibble_offset = 0; - } - else - { - proto_tree_add_item(tree, hf_culmap_ul_map_type, tvb, ul_map_offset, 1, FALSE); - /* display the reserved */ - proto_tree_add_item(tree, hf_culmap_reserved, tvb, ul_map_offset, 1, FALSE); - nibble_offset = 1; - } - length = 1; - /* decode RCID IE */ - nibble_length = wimax_compact_ulmap_rcid_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset); - length += nibble_length; - ul_map_offset += (nibble_length >> 1); - nibble_offset = (nibble_length & 1); - /* check harq mode */ - if(!harq_mode) - { /* display the Nep and Nsch Code */ - if(nibble_offset & 1) - { - proto_tree_add_item(tree, hf_culmap_nep_code_1, tvb, ul_map_offset, 1, FALSE); - /* move to next byte */ - ul_map_offset++; - proto_tree_add_item(tree, hf_culmap_nsch_code, tvb, ul_map_offset, 1, FALSE); - } - else - { - proto_tree_add_item(tree, hf_culmap_nep_code, tvb, ul_map_offset, 1, FALSE); - proto_tree_add_item(tree, hf_culmap_nsch_code_1, tvb, ul_map_offset, 1, FALSE); - /* move to next byte */ - ul_map_offset++; - } - length += 2; - } - else if(harq_mode == 1) - { /* display the Shortened UIUC and Companded SC */ - if(nibble_offset & 1) - { - proto_tree_add_item(tree, hf_culmap_shortened_uiuc_1, tvb, ul_map_offset, 2, FALSE); - proto_tree_add_item(tree, hf_culmap_companded_sc_1, tvb, ul_map_offset, 2, FALSE); - } - else - { - proto_tree_add_item(tree, hf_culmap_shortened_uiuc, tvb, ul_map_offset, 1, FALSE); - proto_tree_add_item(tree, hf_culmap_companded_sc, tvb, ul_map_offset, 1, FALSE); - } - /* move to next byte */ - ul_map_offset++; - length += 2; - } - /* get the Nband */ - if(max_logical_bands) - { /* get and display the Nband */ - nband = tvb_get_guint8(tvb, ul_map_offset); - length++; - if(nibble_offset & 1) - { - nband = (nband & LSB_NIBBLE_MASK); - /* display the Nband */ - proto_tree_add_item(tree, hf_culmap_num_bands_1, tvb, ul_map_offset, 1, FALSE); - /* move to next byte */ - ul_map_offset++; - nibble_offset = 0; - if(max_logical_bands == 3) - { - proto_tree_add_item(tree, hf_culmap_band_index, tvb, ul_map_offset, nband, FALSE); - length += (nband * 2); - /* update offset */ - ul_map_offset += nband; - } - else - { - nibble_offset = (nband & 1); - proto_tree_add_item(tree, hf_culmap_band_index, tvb, ul_map_offset, ((nband >> 1) + nibble_offset), FALSE); - length += nband; - /* update offset */ - ul_map_offset += (nband >> 1); - } - } - else - { - nband = ((nband & MSB_NIBBLE_MASK) >> 4); - /* display the Nband */ - proto_tree_add_item(tree, hf_culmap_num_bands, tvb, ul_map_offset, 1, FALSE); - nibble_offset = 1; - if(max_logical_bands == 3) - { - proto_tree_add_item(tree, hf_culmap_band_index, tvb, ul_map_offset, (nband + nibble_offset), FALSE); - length += (nband * 2); - /* update offset */ - ul_map_offset += nband; - } - else - { - proto_tree_add_item(tree, hf_culmap_band_index, tvb, ul_map_offset, ((nband >> 1) + nibble_offset), FALSE); - length += nband; - /* update offset */ - ul_map_offset += ((nband + nibble_offset) >> 1); - if(nband & 1) - nibble_offset = 0; - } - } - band_count = nband; - } - else + case MINI_SUBCHANNEL_ALLOCATION_IE: + /* 8.4.5.4.8 Mini Subchannel Allocation IE */ + /* set the M value */ + switch (length) { - nband = 0; - band_count = 1; - /* display the Nb-BITMAP */ - if(nibble_offset & 1) - { - proto_tree_add_item(tree, hf_culmap_nb_bitmap_1, tvb, ul_map_offset, 1, FALSE); - /* move to next byte */ - ul_map_offset++; - nibble_offset = 0; - } - else - { - proto_tree_add_item(tree, hf_culmap_nb_bitmap, tvb, ul_map_offset, 1, FALSE); - nibble_offset = 1; - } - length++; + case 15: + m = 6; + break; + case 9: + m = 3; + break; + case 7: + default: + m = 2; + break; } - /* Get the Allocation Mode */ - byte = tvb_get_guint8(tvb, ul_map_offset); if(nibble_offset & 1) { - allocation_mode = ((byte & ALLOCATION_MODE_MASK_1) >> 2); - proto_tree_add_item(tree, hf_culmap_allocation_mode_1, tvb, ul_map_offset, 1, FALSE); - proto_tree_add_item(tree, hf_culmap_allocation_mode_rsvd_1, tvb, ul_map_offset, 1, FALSE); - nibble_offset = 0; - ul_map_offset++; + /* display MINI Subchannel Allocation CType value */ + proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_ctype_16, tvb, offset, 2, FALSE); + /* display MINI Subchannel Allocation Duration value */ + proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_duration_16, tvb, offset, 2, FALSE); } else - { - allocation_mode = ((byte & ALLOCATION_MODE_MASK) >> 6); - proto_tree_add_item(tree, hf_culmap_allocation_mode, tvb, ul_map_offset, 1, FALSE); - proto_tree_add_item(tree, hf_culmap_allocation_mode_rsvd, tvb, ul_map_offset, 1, FALSE); - nibble_offset = 1; + { /* display MINI Subchannel Allocation CType value */ + proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_ctype, tvb, offset, 1, FALSE); + /* display MINI Subchannel Allocation Duration value */ + proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_duration, tvb, offset, 1, FALSE); } - length++; - /* Decode Allocation Mode - need to be done */ - if(!allocation_mode) + offset++; + /* decode and display CIDs, UIUCs, and Repetitions */ + for(i=0; i> 1); - nibble_offset = (nibble_length & 1); - /* check harq mode */ - if(!harq_mode) - { /* display the Nep and Nsch Code */ - if(nibble_offset & 1) - { - proto_tree_add_item(tree, hf_culmap_nep_code_1, tvb, ul_map_offset, 1, FALSE); - /* move to next byte */ - ul_map_offset++; - proto_tree_add_item(tree, hf_culmap_nsch_code, tvb, ul_map_offset, 1, FALSE); - } - else - { - proto_tree_add_item(tree, hf_culmap_nep_code, tvb, ul_map_offset, 1, FALSE); - proto_tree_add_item(tree, hf_culmap_nsch_code_1, tvb, ul_map_offset, 1, FALSE); - /* move to next byte */ - ul_map_offset++; - } - length += 2; - } - else if(harq_mode == 1) - { /* display the Shortened UIUC and Companded SC */ - if(nibble_offset & 1) - { - proto_tree_add_item(tree, hf_culmap_shortened_uiuc_1, tvb, ul_map_offset, 2, FALSE); - proto_tree_add_item(tree, hf_culmap_companded_sc_1, tvb, ul_map_offset, 2, FALSE); - } - else - { - proto_tree_add_item(tree, hf_culmap_shortened_uiuc, tvb, ul_map_offset, 1, FALSE); - proto_tree_add_item(tree, hf_culmap_companded_sc, tvb, ul_map_offset, 1, FALSE); - } - /* move to next byte */ - ul_map_offset++; - length += 2; + proto_tree_add_item(tree, hf_extended_uiuc_ie_aas_ul, tvb, offset, length, FALSE); } - /* display BIN offset */ + break; + case CQICH_ALLOC_IE: + /* 8.4.5.4.12 CQICH_ALLOC_IE */ if(nibble_offset & 1) { - proto_tree_add_item(tree, hf_culmap_bin_offset_1, tvb, ul_map_offset, 2, FALSE); - /* move to next byte */ - ul_map_offset++; + proto_tree_add_item(tree, hf_extended_uiuc_ie_cqich_alloc, tvb, offset, (length + 1), FALSE); } else { - proto_tree_add_item(tree, hf_culmap_bin_offset, tvb, ul_map_offset, 1, FALSE); - /* move to next byte */ - ul_map_offset++; + proto_tree_add_item(tree, hf_extended_uiuc_ie_cqich_alloc, tvb, offset, length, FALSE); } - length += 2; - /* decode HARQ Control IE */ - nibble_length = wimax_compact_ulmap_harq_control_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset); - length += nibble_length; break; - case COMPACT_UL_MAP_TYPE_UIUC:/* 6.3.2.3.43.7.4 */ - /* display the UL-MAP type and reserved bit */ + case UL_ZONE_IE: + /* 8.4.5.4.7 UL Zone Switch IE */ if(nibble_offset & 1) { - proto_tree_add_item(tree, hf_culmap_ul_map_type_1, tvb, ul_map_offset, 1, FALSE); - /* display the reserved */ - proto_tree_add_item(tree, hf_culmap_reserved_1, tvb, ul_map_offset, 1, FALSE); - /* move to next byte */ - ul_map_offset++; - /* get the new byte */ - byte = tvb_get_guint8(tvb, ul_map_offset); - /* get the UIUC */ - uiuc = ((byte & MSB_NIBBLE_MASK) >> 4); - /* display the UIUC */ - proto_tree_add_item(tree, hf_culmap_uiuc, tvb, ul_map_offset, 1, FALSE); + proto_tree_add_item(tree, hf_extended_uiuc_ie_ul_zone, tvb, offset, (length + 1), FALSE); } else { - /* display the UL-MAP type */ - proto_tree_add_item(tree, hf_culmap_ul_map_type, tvb, ul_map_offset, 1, FALSE); - /* display the reserved */ - proto_tree_add_item(tree, hf_culmap_reserved, tvb, ul_map_offset, 1, FALSE); - /* get the UIUC */ - uiuc = (byte & LSB_NIBBLE_MASK); - /* display the UIUC */ - proto_tree_add_item(tree, hf_culmap_uiuc_1, tvb, ul_map_offset, 1, FALSE); - } - length = 2; - /* decode RCID IE */ - nibble_length = wimax_compact_ulmap_rcid_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset); - length += nibble_length; - ul_map_offset += (nibble_length >> 1); - nibble_offset = (nibble_length & 1); - if(uiuc == 15) - { /* Extended UIUC dependent IE */ - nibble_length = wimax_extended_uiuc_dependent_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset); - length += nibble_length; - ul_map_offset += (nibble_length >> 1); - nibble_offset = (nibble_length & 1); - } - else if(uiuc == 14) - { /* CDMA Allocation IE */ - nibble_length = wimax_cdma_allocation_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset); - length += nibble_length; - ul_map_offset += (nibble_length >> 1); - nibble_offset = (nibble_length & 1); - } - else if(uiuc == 12) - { - if(nibble_offset & 1) - { - /* display the OFDMA symbol offset */ - proto_tree_add_item(tree, hf_culmap_uiuc_ofdma_symbol_offset_1, tvb, ul_map_offset, 2, FALSE); - ul_map_offset++; - /* display the subchannel offset */ - proto_tree_add_item(tree, hf_culmap_uiuc_subchannel_offset_7_1, tvb, ul_map_offset, 4, FALSE); - /* display the number of OFDMA symbols */ - proto_tree_add_item(tree, hf_culmap_uiuc_num_of_ofdma_symbols_7_1, tvb, ul_map_offset, 4, FALSE); - /* display the number of subchannels */ - proto_tree_add_item(tree, hf_culmap_uiuc_num_of_subchannels_7_1, tvb, ul_map_offset, 4, FALSE); - /* display the ranging method */ - proto_tree_add_item(tree, hf_culmap_uiuc_ranging_method_1, tvb, ul_map_offset, 4, FALSE); - /* display the reserved */ - proto_tree_add_item(tree, hf_culmap_uiuc_reserved_1, tvb, ul_map_offset, 4, FALSE); - ul_map_offset += 3; - } - else - { /* display the OFDMA symbol offset */ - proto_tree_add_item(tree, hf_culmap_uiuc_ofdma_symbol_offset, tvb, ul_map_offset, 1, FALSE); - ul_map_offset++; - /* display the subchannel offset */ - proto_tree_add_item(tree, hf_culmap_uiuc_subchannel_offset_7, tvb, ul_map_offset, 3, FALSE); - /* display the number of OFDMA symbols */ - proto_tree_add_item(tree, hf_culmap_uiuc_num_of_ofdma_symbols_7, tvb, ul_map_offset, 3, FALSE); - /* display the number of subchannels */ - proto_tree_add_item(tree, hf_culmap_uiuc_num_of_subchannels_7, tvb, ul_map_offset, 3, FALSE); - /* display the ranging method */ - proto_tree_add_item(tree, hf_culmap_uiuc_ranging_method, tvb, ul_map_offset, 3, FALSE); - /* display the reserved */ - proto_tree_add_item(tree, hf_culmap_uiuc_reserved, tvb, ul_map_offset, 3, FALSE); - ul_map_offset += 3; - } - length += 8; + proto_tree_add_item(tree, hf_extended_uiuc_ie_ul_zone, tvb, offset, length, FALSE); } - else - { /* display Number of subchannels */ - if(nibble_offset & 1) - proto_tree_add_item(tree, hf_culmap_uiuc_num_of_subchannels_1, tvb, ul_map_offset, 2, FALSE); - else - proto_tree_add_item(tree, hf_culmap_uiuc_num_of_subchannels, tvb, ul_map_offset, 1, FALSE); - length += 2; - /* display the repetition coding indication and reserved bits */ - if(nibble_offset & 1) - { - proto_tree_add_item(tree, hf_culmap_uiuc_repetition_coding_indication_1, tvb, ul_map_offset, 1, FALSE); - proto_tree_add_item(tree, hf_culmap_uiuc_reserved_1, tvb, ul_map_offset, 1, FALSE); - nibble_offset = 0; - } - else - { - proto_tree_add_item(tree, hf_culmap_uiuc_repetition_coding_indication, tvb, ul_map_offset, 1, FALSE); - proto_tree_add_item(tree, hf_culmap_uiuc_reserved, tvb, ul_map_offset, 1, FALSE); - nibble_offset = 1; - } - length += 1; + break; + case PHYMOD_UL_IE: + /* 8.4.5.4.14 PHYMOD_UL_IE */ + if(nibble_offset & 1) + { + proto_tree_add_item(tree, hf_extended_uiuc_ie_phymod_ul, tvb, offset, (length + 1), FALSE); + } + else + { + proto_tree_add_item(tree, hf_extended_uiuc_ie_phymod_ul, tvb, offset, length, FALSE); } - /* decode HARQ Control IE */ - nibble_length = wimax_compact_ulmap_harq_control_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset); - length += nibble_length; break; - case COMPACT_UL_MAP_TYPE_HARQ_REGION_IE:/* 6.3.2.3.43.7.5 */ + case MIMO_UL_BASIC_IE: + /* 8.4.5.4.11 MIMO_UL_BASIC_IE */ if(nibble_offset & 1) - { /* display the UL-MAP type */ - proto_tree_add_item(tree, hf_culmap_ul_map_type_1, tvb, ul_map_offset, 1, FALSE); - /* display the HARQ Region Change Indication */ - proto_tree_add_item(tree, hf_culmap_harq_region_change_indication_1, tvb, ul_map_offset, 1, FALSE); - /* get the HARQ Region Change Indication */ - harq_region_change_indication = (byte & 0x01); - /* move to next byte */ - ul_map_offset++; - nibble_offset = 0; + { + proto_tree_add_item(tree, hf_extended_uiuc_ie_mimo_ul_basic, tvb, offset, (length + 1), FALSE); } else - { /* display the UL-MAP type */ - proto_tree_add_item(tree, hf_culmap_ul_map_type, tvb, ul_map_offset, 1, FALSE); - /* display the HARQ Region Change Indication */ - proto_tree_add_item(tree, hf_culmap_harq_region_change_indication, tvb, ul_map_offset, 1, FALSE); - /* get the HARQ Region Change Indication */ - harq_region_change_indication = (byte & 0x10); - nibble_offset = 1; + { + proto_tree_add_item(tree, hf_extended_uiuc_ie_mimo_ul_basic, tvb, offset, length, FALSE); } - length = 1; - if(harq_region_change_indication == 1) + break; + case UL_MAP_FAST_TRACKING_IE: + /* 8.4.5.4.22 UL_MAP_FAST_TRACKING_IE */ + if(nibble_offset & 1) { - if(nibble_offset & 1) - { - /* display the OFDMA symbol offset */ - proto_tree_add_item(tree, hf_culmap_uiuc_ofdma_symbol_offset_1, tvb, ul_map_offset, 2, FALSE); - ul_map_offset++; - /* display the subchannel offset */ - proto_tree_add_item(tree, hf_culmap_uiuc_subchannel_offset_1, tvb, ul_map_offset, 2, FALSE); - ul_map_offset++; - /* display the number of OFDMA symbols */ - proto_tree_add_item(tree, hf_culmap_uiuc_num_of_ofdma_symbols_1, tvb, ul_map_offset, 2, FALSE); - ul_map_offset++; - /* display the number of subchannels */ - proto_tree_add_item(tree, hf_culmap_uiuc_num_of_subchannels_1, tvb, ul_map_offset, 2, FALSE); - ul_map_offset++; - } - else - { /* display the OFDMA symbol offset */ - proto_tree_add_item(tree, hf_culmap_uiuc_ofdma_symbol_offset, tvb, ul_map_offset, 1, FALSE); - ul_map_offset++; - /* display the subchannel offset */ - proto_tree_add_item(tree, hf_culmap_uiuc_subchannel_offset, tvb, ul_map_offset, 1, FALSE); - ul_map_offset++; - /* display the number of OFDMA symbols */ - proto_tree_add_item(tree, hf_culmap_uiuc_num_of_ofdma_symbols, tvb, ul_map_offset, 1, FALSE); - ul_map_offset++; - /* display the number of subchannels */ - proto_tree_add_item(tree, hf_culmap_uiuc_num_of_subchannels, tvb, ul_map_offset, 1, FALSE); - ul_map_offset++; - } - length += 8; + proto_tree_add_item(tree, hf_extended_uiuc_ie_fast_tracking, tvb, offset, (length + 1), FALSE); + } + else + { + proto_tree_add_item(tree, hf_extended_uiuc_ie_fast_tracking, tvb, offset, length, FALSE); } break; - case COMPACT_UL_MAP_TYPE_CQICH_REGION_IE:/* 6.3.2.3.43.7.6 */ + case UL_PUSC_BURST_ALLOCATION_IN_OTHER_SEGMENT_IE: + /* 8.4.5.4.17 UL PUSC Burst Allocation in Other Segment IE */ if(nibble_offset & 1) - { /* display the UL-MAP type */ - proto_tree_add_item(tree, hf_culmap_ul_map_type_1, tvb, ul_map_offset, 1, FALSE); - /* display the CQI Region Change Indication */ - proto_tree_add_item(tree, hf_culmap_cqi_region_change_indication_1, tvb, ul_map_offset, 1, FALSE); - /* get the CQI Region Change Indication */ - cqi_region_change_indication = (byte & 0x01); - /* move to next byte */ - ul_map_offset++; - nibble_offset = 0; + { + proto_tree_add_item(tree, hf_extended_uiuc_ie_ul_pusc_burst_allocation, tvb, offset, (length + 1), FALSE); } else - { /* display the UL-MAP type */ - proto_tree_add_item(tree, hf_culmap_ul_map_type, tvb, ul_map_offset, 1, FALSE); - /* display the CQI Region Change Indication */ - proto_tree_add_item(tree, hf_culmap_cqi_region_change_indication, tvb, ul_map_offset, 1, FALSE); - /* get the CQI Region Change Indication */ - cqi_region_change_indication = (byte & 0x10); - nibble_offset = 1; + { + proto_tree_add_item(tree, hf_extended_uiuc_ie_ul_pusc_burst_allocation, tvb, offset, length, FALSE); } - length = 1; - if(cqi_region_change_indication == 1) + break; + case FAST_RANGING_IE: + /* 8.4.5.4.21 FAST_RANGING_IE */ + if(nibble_offset & 1) { - if(nibble_offset & 1) - { - /* display the OFDMA symbol offset */ - proto_tree_add_item(tree, hf_culmap_uiuc_ofdma_symbol_offset_1, tvb, ul_map_offset, 2, FALSE); - ul_map_offset++; - /* display the subchannel offset */ - proto_tree_add_item(tree, hf_culmap_uiuc_subchannel_offset_1, tvb, ul_map_offset, 2, FALSE); - ul_map_offset++; - /* display the number of OFDMA symbols */ - proto_tree_add_item(tree, hf_culmap_uiuc_num_of_ofdma_symbols_1, tvb, ul_map_offset, 2, FALSE); - ul_map_offset++; - /* display the number of subchannels */ - proto_tree_add_item(tree, hf_culmap_uiuc_num_of_subchannels_1, tvb, ul_map_offset, 2, FALSE); - ul_map_offset++; - } - else - { /* display the OFDMA symbol offset */ - proto_tree_add_item(tree, hf_culmap_uiuc_ofdma_symbol_offset, tvb, ul_map_offset, 1, FALSE); - ul_map_offset++; - /* display the subchannel offset */ - proto_tree_add_item(tree, hf_culmap_uiuc_subchannel_offset, tvb, ul_map_offset, 1, FALSE); - ul_map_offset++; - /* display the number of OFDMA symbols */ - proto_tree_add_item(tree, hf_culmap_uiuc_num_of_ofdma_symbols, tvb, ul_map_offset, 1, FALSE); - ul_map_offset++; - /* display the number of subchannels */ - proto_tree_add_item(tree, hf_culmap_uiuc_num_of_subchannels, tvb, ul_map_offset, 1, FALSE); - ul_map_offset++; - } - length += 8; + proto_tree_add_item(tree, hf_extended_uiuc_ie_fast_ranging, tvb, offset, (length + 1), FALSE); + } + else + { + proto_tree_add_item(tree, hf_extended_uiuc_ie_fast_ranging, tvb, offset, length, FALSE); } break; - case COMPACT_UL_MAP_TYPE_EXTENSION:/* 6.3.2.3.43.7.7 */ - /* decode the Compact UL-MAP externsion IE */ - nibble_length = wimax_culmap_extension_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset);/*, cqich_indicator);*/ - length = nibble_length; + case UL_ALLOCATION_START_IE: + /* 8.4.5.4.15`UL_ALLOCATION_START_IE */ + if(nibble_offset & 1) + { + proto_tree_add_item(tree, hf_extended_uiuc_ie_ul_allocation_start, tvb, offset, (length + 1), FALSE); + } + else + { + proto_tree_add_item(tree, hf_extended_uiuc_ie_ul_allocation_start, tvb, offset, length, FALSE); + } break; - default:/* Reserved Type */ - /* display the reserved type */ - proto_tree_add_item(tree, hf_culmap_reserved_type_1, tvb, ul_map_offset, 1, FALSE); - length = 1; + default: + if(nibble_offset & 1) + { + proto_tree_add_item(tree, hf_extended_uiuc_ie_unknown_uiuc, tvb, offset, (length + 1), FALSE); + } + else + { + proto_tree_add_item(tree, hf_extended_uiuc_ie_unknown_uiuc, tvb, offset, length, FALSE); + } break; } - /* Update the nibble_offset and length */ - return length; + return ((length + 1) * 2 ); /* length in nibbles */ } -/* Compact UL-MAP Reduced CID IE (6.3.2.3.43.3) decoder */ -static guint wimax_compact_ulmap_rcid_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset) +/* Register Wimax Compact UL-MAP IE Protocol */ +void proto_register_wimax_compact_ulmap_ie(void) { - guint length = 0; - guint prefix; + /* Compact UL-MAP IE display */ + static hf_register_info hf_compact_ulmap[] = + { + { + &hf_culmap_ul_map_type, + {"UL-MAP Type", "wmx.compact_ulmap.ul_map_type", FT_UINT8, BASE_DEC, NULL, UL_MAP_TYPE_MASK, NULL, HFILL} + }, + { + &hf_culmap_ul_map_type_1, + {"UL-MAP Type", "wmx.compact_ulmap.ul_map_type", FT_UINT8, BASE_DEC, NULL, UL_MAP_TYPE_MASK_1, NULL, HFILL} + }, + { + &hf_culmap_reserved, + {"Reserved", "wmx.compact_ulmap.reserved", FT_UINT8, BASE_HEX, NULL, UL_MAP_RESERVED_MASK, NULL, HFILL} + }, + { + &hf_culmap_reserved_1, + {"Reserved", "wmx.compact_ulmap.reserved", FT_UINT8, BASE_HEX, NULL, UL_MAP_RESERVED_MASK_1, NULL, HFILL} + }, + { + &hf_culmap_nep_code, + {"Nep Code", "wmx.compact_ulmap.nep_code", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL} + }, + { + &hf_culmap_nep_code_1, + {"Nep Code", "wmx.compact_ulmap.nep_code", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL} + }, + { + &hf_culmap_nsch_code, + {"Nsch Code", "wmx.compact_ulmap.nsch_code", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL} + }, + { + &hf_culmap_nsch_code_1, + {"Nsch Code", "wmx.compact_ulmap.nsch_code", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL} + }, + { + &hf_culmap_shortened_uiuc, + {"Shortened UIUC", "wmx.compact_ulmap.shortened_uiuc", FT_UINT8, BASE_HEX, NULL, SHORTENED_UIUC_MASK, NULL, HFILL} + }, + { + &hf_culmap_companded_sc, + {"Companded SC", "wmx.compact_ulmap.companded_sc", FT_UINT8, BASE_HEX, NULL, COMPANDED_SC_MASK, NULL, HFILL} + }, + { + &hf_culmap_shortened_uiuc_1, + {"Shortened UIUC", "wmx.compact_ulmap.shortened_uiuc", FT_UINT16, BASE_HEX, NULL, SHORTENED_UIUC_MASK_1, NULL, HFILL} + }, + { + &hf_culmap_companded_sc_1, + {"Companded SC", "wmx.compact_ulmap.companded_sc", FT_UINT16, BASE_HEX, NULL, COMPANDED_SC_MASK_1, NULL, HFILL} + }, + { + &hf_culmap_num_bands, + {"Number Of Bands", "wmx.compact_ulmap.num_bands", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL} + }, + { + &hf_culmap_num_bands_1, + {"Number Of Bands", "wmx.compact_ulmap.num_bands", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL} + }, + { + &hf_culmap_band_index, + {"Band Index", "wmx.compact_ulmap.band_index", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} + }, + { + &hf_culmap_nb_bitmap, + {"Number Of Bits For Band BITMAP", "wmx.compact_ulmap.nb_bitmap", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL} + }, + { + &hf_culmap_nb_bitmap_1, + {"Number Of Bits For Band BITMAP", "wmx.compact_ulmap.nb_bitmap", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL} + }, + { + &hf_culmap_allocation_mode, + {"Allocation Mode", "wmx.compact_ulmap.allocation_mode", FT_UINT8, BASE_DEC, VALS(vals_allocation_modes), ALLOCATION_MODE_MASK, NULL, HFILL} + }, + { + &hf_culmap_allocation_mode_1, + {"Allocation Mode", "wmx.compact_ulmap.allocation_mode", FT_UINT8, BASE_DEC, VALS(vals_allocation_modes), ALLOCATION_MODE_MASK_1, NULL, HFILL} + }, + { + &hf_culmap_allocation_mode_rsvd, + {"Reserved", "wmx.compact_ulmap.allocation_mode_rsvd", FT_UINT8, BASE_DEC, NULL, 0x30, NULL, HFILL} + }, + { + &hf_culmap_allocation_mode_rsvd_1, + {"Reserved", "wmx.compact_ulmap.allocation_mode_rsvd", FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL} + }, + { + &hf_culmap_num_subchannels, + {"Number Of Subchannels", "wmx.compact_ulmap.num_subchannels", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} + }, + { + &hf_culmap_num_subchannels_1, + {"Number Of Subchannels", "wmx.compact_ulmap.num_subchannels", FT_UINT16, BASE_DEC, NULL, MIDDLE_BYTE_MASK, NULL, HFILL} + }, + { + &hf_culmap_bin_offset, + {"BIN Offset", "wmx.compact_ulmap.bin_offset", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} + }, + { + &hf_culmap_bin_offset_1, + {"BIN Offset", "wmx.compact_ulmap.bin_offset", FT_UINT16, BASE_HEX, NULL, MIDDLE_BYTE_MASK, NULL, HFILL} + }, + { + &hf_culmap_uiuc, + {"UIUC", "wmx.compact_ulmap.uiuc", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL} + }, + { + &hf_culmap_uiuc_1, + {"UIUC", "wmx.compact_ulmap.uiuc", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL} + }, + { + &hf_culmap_uiuc_ofdma_symbol_offset, + {"OFDMA Symbol Offset", "wmx.compact_ulmap.uiuc_ofdma_symbol_offset", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} + }, + { + &hf_culmap_uiuc_ofdma_symbol_offset_1, + {"OFDMA Symbol Offset", "wmx.compact_ulmap.uiuc_ofdma_symbol_offset", FT_UINT16, BASE_DEC, NULL, MIDDLE_BYTE_MASK, NULL, HFILL} + }, + { + &hf_culmap_uiuc_subchannel_offset_7, + {"Subchannel Offset", "wmx.compact_ulmap.uiuc_subchannel_offset", FT_UINT24, BASE_DEC, NULL, 0xFE0000, NULL, HFILL} + }, + { + &hf_culmap_uiuc_num_of_ofdma_symbols_7, + {"Number Of OFDMA Symbols", "wmx.compact_ulmap.uiuc_num_of_ofdma_symbols", FT_UINT24, BASE_DEC, NULL, 0x01FC00, NULL, HFILL} + }, + { + &hf_culmap_uiuc_num_of_subchannels_7, + {"Number Of Subchannels", "wmx.compact_ulmap.uiuc_num_of_subchannels", FT_UINT24, BASE_DEC, NULL, 0x0003F8, NULL, HFILL} + }, + { + &hf_culmap_uiuc_ranging_method, + {"Ranging Method", "wmx.compact_ulmap.uiuc_ranging_method", FT_UINT24, BASE_DEC, NULL, 0x000006, NULL, HFILL} + }, + { + &hf_culmap_uiuc_reserved, + {"Reserved", "wmx.compact_ulmap.uiuc_reserved", FT_UINT24, BASE_HEX, NULL, 0x000001, NULL, HFILL} + }, + { + &hf_culmap_uiuc_subchannel_offset_7_1, + {"Subchannel Offset", "wmx.compact_ulmap.uiuc_subchannel_offset", FT_UINT32, BASE_DEC, NULL, 0x00FE0000, NULL, HFILL} + }, + { + &hf_culmap_uiuc_num_of_ofdma_symbols_7_1, + {"Number Of OFDMA Symbols", "wmx.compact_ulmap.uiuc_num_of_ofdma_symbols", FT_UINT32, BASE_DEC, NULL, 0x0001FC00, NULL, HFILL} + }, + { + &hf_culmap_uiuc_num_of_subchannels_7_1, + {"Number Of Subchannels", "wmx.compact_ulmap.uiuc_num_of_subchannels", FT_UINT32, BASE_DEC, NULL, 0x000003F80, NULL, HFILL} + }, + { + &hf_culmap_uiuc_ranging_method_1, + {"Ranging Method", "wmx.compact_ulmap.uiuc_ranging_method", FT_UINT32, BASE_DEC, NULL, 0x00000006, NULL, HFILL} + }, + { + &hf_culmap_uiuc_reserved_1, + {"Reserved", "wmx.compact_ulmap.uiuc_reserved", FT_UINT32, BASE_HEX, NULL, 0x00000001, NULL, HFILL} + }, + { + &hf_culmap_uiuc_repetition_coding_indication, + {"Repetition Coding Indication", "wmx.compact_ulmap.uiuc_repetition_coding_indication", FT_UINT8, BASE_DEC, VALS(vals_repetitions), ALLOCATION_MODE_MASK, NULL, HFILL} + }, + { + &hf_culmap_uiuc_repetition_coding_indication_1, + {"Repetition Coding Indication", "wmx.compact_ulmap.uiuc_repetition_coding_indication", FT_UINT8, BASE_DEC, VALS(vals_repetitions), ALLOCATION_MODE_MASK_1, NULL, HFILL} + }, + { + &hf_culmap_uiuc_reserved1, + {"Reserved", "wmx.compact_ulmap.uiuc_reserved1", FT_UINT8, BASE_HEX, NULL, 0x30, NULL, HFILL} + }, + { + &hf_culmap_uiuc_reserved11_1, + {"Reserved", "wmx.compact_ulmap.uiuc_reserved1", FT_UINT8, BASE_HEX, NULL, 0x03, NULL, HFILL} + }, -#ifdef DEBUG - /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "RCID IE"); - } -#endif - if(nibble_offset & 1) - { - if(cid_type == CID_TYPE_NORMAL) - { /* display the normal CID */ - proto_tree_add_item(tree, hf_rcid_ie_normal_cid_1, tvb, offset, 3, FALSE); - length = 4; - } - else - { /* Get the prefix bit */ - prefix = (tvb_get_guint8(tvb, offset) & 0x08); - /* display the prefix */ - proto_tree_add_item(tree, hf_rcid_ie_prefix_1, tvb, offset, 2, FALSE); - if(prefix) - { /* display the CID11 */ - proto_tree_add_item(tree, hf_rcid_ie_cid11_3, tvb, offset, 2, FALSE); - length = 3; - } - else - { - if(cid_type == CID_TYPE_RCID11) - { /* display the CID11 */ - proto_tree_add_item(tree, hf_rcid_ie_cid11_1, tvb, offset, 2, FALSE); - length = 3; - } - else if(cid_type == CID_TYPE_RCID7) - { /* display the normal CID7 */ - proto_tree_add_item(tree, hf_rcid_ie_cid7_1, tvb, offset, 2, FALSE); - length = 2; - } - else if(cid_type == CID_TYPE_RCID3) - { /* display the CID3 */ - proto_tree_add_item(tree, hf_rcid_ie_cid3_1, tvb, offset, 2, FALSE); - length = 1; - } - } + { + &hf_culmap_uiuc_subchannel_offset, + {"Subchannel Offset", "wmx.compact_ulmap.uiuc_subchannel_offset", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} + }, + { + &hf_culmap_uiuc_subchannel_offset_1, + {"Subchannel Offset", "wmx.compact_ulmap.uiuc_subchannel_offset", FT_UINT16, BASE_DEC, NULL, MIDDLE_BYTE_MASK, NULL, HFILL} + }, + { + &hf_culmap_uiuc_num_of_ofdma_symbols, + {"Number Of OFDMA Symbols", "wmx.compact_ulmap.uiuc_num_of_ofdma_symbols", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} + }, + { + &hf_culmap_uiuc_num_of_ofdma_symbols_1, + {"Number Of OFDMA Symbols", "wmx.compact_ulmap.uiuc_num_of_ofdma_symbols", FT_UINT16, BASE_DEC, NULL, MIDDLE_BYTE_MASK, NULL, HFILL} + }, + { + &hf_culmap_uiuc_num_of_subchannels, + {"Number Of Subchannels", "wmx.compact_ulmap.uiuc_num_of_subchannels", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} + }, + { + &hf_culmap_uiuc_num_of_subchannels_1, + {"Number Of Subchannels", "wmx.compact_ulmap.uiuc_num_of_subchannels", FT_UINT16, BASE_DEC, NULL, MIDDLE_BYTE_MASK, NULL, HFILL} + }, + { + &hf_culmap_harq_region_change_indication, + {"HARQ Region Change Indication", "wmx.compact_ulmap.harq_region_change_indication", FT_BOOLEAN, 8, TFS(&tfs_region_change), 0x10, NULL, HFILL} + }, + { + &hf_culmap_harq_region_change_indication_1, + {"HARQ Region Change Indication", "wmx.compact_ulmap.harq_region_change_indication", FT_BOOLEAN, 8, TFS(&tfs_region_change), 0x01, NULL, HFILL} + }, + { + &hf_culmap_cqi_region_change_indication, + {"CQI Region Change Indication", "wmx.compact_ulmap.cqi_region_change_indication", FT_BOOLEAN, 8, TFS(&tfs_region_change), 0x10, NULL, HFILL} + }, + { + &hf_culmap_cqi_region_change_indication_1, + {"CQI Region Change Indication", "wmx.compact_ulmap.cqi_region_change_indication", FT_BOOLEAN, 8, TFS(&tfs_region_change), 0x01, NULL, HFILL} + }, + { + &hf_culmap_reserved_type, + {"UL-MAP Reserved Type", "wmx.compact_ulmap.reserved_type", FT_UINT8, BASE_DEC, NULL, UL_MAP_TYPE_MASK, NULL, HFILL} + }, + { + &hf_culmap_reserved_type_1, + {"UL-MAP Reserved Type", "wmx.compact_ulmap.reserved_type", FT_UINT8, BASE_DEC, NULL, UL_MAP_TYPE_MASK_1, NULL, HFILL} } - } - else + }; + + /* HARQ MAP Reduced CID IE display */ + static hf_register_info hf_rcid[] = { - if(cid_type == CID_TYPE_NORMAL) - { /* display the normal CID */ - proto_tree_add_item(tree, hf_rcid_ie_normal_cid, tvb, offset, 2, FALSE); - length = 4; - } - else - { /* Get the prefix bit */ - prefix = (tvb_get_guint8(tvb, offset) & 0x08); - /* display the prefix */ - proto_tree_add_item(tree, hf_rcid_ie_prefix, tvb, offset, 2, FALSE); - if(prefix || (cid_type == CID_TYPE_RCID11)) - { /* display the CID11 */ - proto_tree_add_item(tree, hf_rcid_ie_cid11_2, tvb, offset, 2, FALSE); - length = 3; - } - else - { - if(cid_type == CID_TYPE_RCID11) - { /* display the CID11 */ - proto_tree_add_item(tree, hf_rcid_ie_cid11, tvb, offset, 2, FALSE); - length = 3; - } - else if(cid_type == CID_TYPE_RCID7) - { /* display the CID7 */ - proto_tree_add_item(tree, hf_rcid_ie_cid7, tvb, offset, 2, FALSE); - length = 2; - } - else if(cid_type == CID_TYPE_RCID3) - { /* display the CID3 */ - proto_tree_add_item(tree, hf_rcid_ie_cid3, tvb, offset, 2, FALSE); - length = 1; - } - } + { + &hf_rcid_ie_normal_cid, + {"Normal CID", "wmx.harq_map.rcid_ie.normal_cid", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL} + }, + { + &hf_rcid_ie_normal_cid_1, + {"Normal CID", "wmx.harq_map.rcid_ie.normal_cid", FT_UINT24, BASE_HEX, NULL, WIMAX_RCID_IE_NORMAL_CID_MASK_1, NULL, HFILL} + }, + { + &hf_rcid_ie_prefix, + {"Prefix", "wmx.harq_map.rcid_ie.prefix", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_PREFIX_MASK, NULL, HFILL} + }, + { + &hf_rcid_ie_prefix_1, + {"Prefix", "wmx.harq_map.rcid_ie.prefix", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_PREFIX_MASK_1, NULL, HFILL} + }, + { + &hf_rcid_ie_cid3, + {"3 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid3", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID3_MASK, NULL, HFILL} + }, + { + &hf_rcid_ie_cid3_1, + {"3 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid3", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID3_MASK_1, NULL, HFILL} + }, + { + &hf_rcid_ie_cid7, + {"7 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid7", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID7_MASK, NULL, HFILL} + }, + { + &hf_rcid_ie_cid7_1, + {"7 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid7", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID7_MASK_1, NULL, HFILL} + }, + { + &hf_rcid_ie_cid11, + {"11 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid11", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID11_MASK, NULL, HFILL} + }, + { + &hf_rcid_ie_cid11_1, + {"11 LSB Of Basic CID", "wmx.harq_map.rcid_ie.cid11", FT_UINT16, BASE_HEX, NULL, WIMAX_RCID_IE_CID11_MASK_1, NULL, HFILL} + }, + { + &hf_rcid_ie_cid11_2, + {"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} + }, + { + &hf_rcid_ie_cid11_3, + {"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} } - } - /* return the IE length in nibbles */ - return length; -} - -/* Compact UL-MAP HARQ Control IE (6.3.2.3.43.4) decoder */ -static guint wimax_compact_ulmap_harq_control_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset) -{ - guint byte, prefix, length = 0; + }; -#ifdef DEBUG - /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) + /* HARQ MAP HARQ Control IE display */ + static hf_register_info hf_harq_control[] = { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "HARQ Control IE"); - } -#endif - /* Get the first byte */ - byte = tvb_get_guint8(tvb, offset); - if(nibble_offset & 1) - { /* Get the prefix bit */ - prefix = (byte & 0x08); - /* display the prefix */ - proto_tree_add_item(tree, hf_harq_control_ie_prefix_1, tvb, offset, 2, FALSE); - if(prefix) - { /* display the ai_sn */ - proto_tree_add_item(tree, hf_harq_control_ie_ai_sn_1, tvb, offset, 2, FALSE); - /* display the spid */ - proto_tree_add_item(tree, hf_harq_control_ie_spid_1, tvb, offset, 2, FALSE); - /* display the acid */ - proto_tree_add_item(tree, hf_harq_control_ie_acid_1, tvb, offset, 2, FALSE); - length = 2; - } - else - { /* display the reserved bits */ - proto_tree_add_item(tree, hf_harq_control_ie_reserved_1, tvb, offset, 2, FALSE); - length = 1; - } - } - else - { /* Get the prefix bit */ - prefix = (byte & 0x80); - /* display the prefix */ - proto_tree_add_item(tree, hf_harq_control_ie_prefix, tvb, offset, 1, FALSE); - if(prefix) - { /* display the ai_sn */ - proto_tree_add_item(tree, hf_harq_control_ie_ai_sn, tvb, offset, 1, FALSE); - /* display the spid */ - proto_tree_add_item(tree, hf_harq_control_ie_spid, tvb, offset, 1, FALSE); - /* display the acid */ - proto_tree_add_item(tree, hf_harq_control_ie_acid, tvb, offset, 1, FALSE); - length = 2; - } - else - { /* display the reserved bits */ - proto_tree_add_item(tree, hf_harq_control_ie_reserved, tvb, offset, 1, FALSE); - length = 1; + { + &hf_harq_control_ie_prefix, + {"Prefix", "wmx.harq_map.harq_control_ie.prefix", FT_BOOLEAN, 8, TFS(&tfs_prefix), WIMAX_HARQ_CONTROL_IE_PREFIX_MASK, NULL, HFILL} + }, + { + &hf_harq_control_ie_ai_sn, + {"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} + }, + { + &hf_harq_control_ie_spid, + {"Subpacket ID (SPID)", "wmx.harq_map.harq_control_ie.spid", FT_UINT8, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_SPID_MASK, NULL, HFILL} + }, + { + &hf_harq_control_ie_acid, + {"HARQ CH ID (ACID)", "wmx.harq_map.harq_control_ie.acid", FT_UINT8, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_ACID_MASK, NULL, HFILL} + }, + { + &hf_harq_control_ie_reserved, + {"Reserved", "wmx.harq_map.harq_control_ie.reserved", FT_UINT8, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_RESERVED_MASK, NULL, HFILL} + }, + { + &hf_harq_control_ie_prefix_1, + {"Prefix", "wmx.harq_map.harq_control_ie.prefix", FT_BOOLEAN, 16, TFS(&tfs_prefix), WIMAX_HARQ_CONTROL_IE_PREFIX_MASK_1, NULL, HFILL} + }, + { + &hf_harq_control_ie_ai_sn_1, + {"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} + }, + { + &hf_harq_control_ie_spid_1, + {"Subpacket ID (SPID)", "wmx.harq_map.harq_control_ie.spid", FT_UINT16, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_SPID_MASK_1, NULL, HFILL} + }, + { + &hf_harq_control_ie_acid_1, + {"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} + }, + { + &hf_harq_control_ie_reserved_1, + {"Reserved", "wmx.harq_map.harq_control_ie.reserved", FT_UINT16, BASE_HEX, NULL, WIMAX_HARQ_CONTROL_IE_RESERVED_MASK_1, NULL, HFILL} } - } - /* return the IE length in nibbles */ - return length; -} - -/* UL-MAP Extension IE sub-types */ -#define HARQ_MODE_SWITCH 0 -#define EXTENSION_TYPE_SHIFT 13 -#define EXTENSION_TYPE_SHIFT_1 9 -#define EXTENSION_SUBTYPE_SHIFT 8 -#define EXTENSION_SUBTYPE_SHIFT_1 4 -#define EXTENSION_LENGTH_SHIFT 4 - -/* Compact UL-MAP Extension IE (6.3.2.3.43.7.7) decoder */ -static guint wimax_culmap_extension_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset) -{ - guint tvb_value, ul_map_type, sub_type, length; + }; -#ifdef DEBUG - /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) + static hf_register_info hf_extension_type[] = { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "UL-MAP Extension IE"); - } -#endif - /* Get the first 16-bit word */ - tvb_value = tvb_get_ntohs(tvb, offset); - if(nibble_offset & 1) - { /* Get the ul-map type */ - ul_map_type = ((tvb_value & EXTENSION_TYPE_MASK_1) >> EXTENSION_TYPE_SHIFT_1); - if(ul_map_type != COMPACT_UL_MAP_TYPE_EXTENSION) - return 0; - /* Get the sub-type */ - sub_type = ((tvb_value & EXTENSION_SUBTYPE_MASK_1) >> EXTENSION_SUBTYPE_SHIFT_1); - /* Get the IE length */ - length = (tvb_value & EXTENSION_LENGTH_MASK_1); - /* display the UL-MAP type */ - proto_tree_add_item(tree, hf_culmap_extension_type_1, tvb, offset, 2, FALSE); - /* display the UL-MAP extension subtype */ - proto_tree_add_item(tree, hf_culmap_extension_subtype_1, tvb, offset, 2, FALSE); - /* display the IE length */ - proto_tree_add_item(tree, hf_culmap_extension_length_1, tvb, offset, 2, FALSE); - offset += 2; - switch (sub_type) { - case HARQ_MODE_SWITCH: - /* display the HARQ mode */ - proto_tree_add_item(tree, hf_culmap_extension_harq_mode, tvb, offset, 1, FALSE); - /* Get the next byte */ - tvb_value = tvb_get_guint8(tvb, offset); - /* get the HARQ mode */ - harq_mode = ((tvb_value & MSB_NIBBLE_MASK) >> 4); - break; - default: - /* display the unknown sub-type in HEX */ - proto_tree_add_item(tree, hf_culmap_extension_unknown_sub_type_1, tvb, offset, (length - 2), FALSE); - break; - } - } - else - { /* Get the UL-MAp type */ - ul_map_type = ((tvb_value & EXTENSION_TYPE_MASK) >> EXTENSION_TYPE_SHIFT); - if(ul_map_type != COMPACT_UL_MAP_TYPE_EXTENSION) - return 0; - /* Get the sub-type */ - sub_type = ((tvb_value & EXTENSION_SUBTYPE_MASK) >> EXTENSION_SUBTYPE_SHIFT); - /* Get the IE length */ - length = ((tvb_value & EXTENSION_LENGTH_MASK) >> EXTENSION_LENGTH_SHIFT); - /* display the UL-MAP type */ - proto_tree_add_item(tree, hf_culmap_extension_type, tvb, offset, 2, FALSE); - /* display the UL-MAP extension subtype */ - proto_tree_add_item(tree, hf_culmap_extension_subtype, tvb, offset, 2, FALSE); - /* display the IE length */ - proto_tree_add_item(tree, hf_culmap_extension_length, tvb, offset, 2, FALSE); - switch (sub_type) + &hf_culmap_extension_type, + {"UL-MAP Type", "wmx.extension_type.ul_map_type", FT_UINT16, BASE_DEC, NULL, EXTENSION_TYPE_MASK, NULL, HFILL} + }, { - case HARQ_MODE_SWITCH: - /* display the HARQ mode */ - proto_tree_add_item(tree, hf_culmap_extension_harq_mode_1, tvb, offset, 2, FALSE); - /* get the HARQ mode */ - harq_mode = (tvb_value & LSB_NIBBLE_MASK); - break; - default: - /* display the unknown sub-type in HEX */ - proto_tree_add_item(tree, hf_culmap_extension_unknown_sub_type, tvb, (offset + 1), (length - 1), FALSE); - break; + &hf_culmap_extension_type_1, + {"UL-MAP Type", "wmx.extension_type.ul_map_type", FT_UINT16, BASE_DEC, NULL, EXTENSION_TYPE_MASK_1, NULL, HFILL} + }, + { + &hf_culmap_extension_subtype, + {"Extension Subtype", "wmx.extension_type.subtype", FT_UINT16, BASE_DEC, NULL, EXTENSION_SUBTYPE_MASK, NULL, HFILL} + }, + { + &hf_culmap_extension_subtype_1, + {"Extension Subtype", "wmx.extension_type.subtype", FT_UINT16, BASE_DEC, NULL, EXTENSION_SUBTYPE_MASK_1, NULL, HFILL} + }, + { + &hf_culmap_extension_length, + {"Extension Length", "wmx.extension_type.length", FT_UINT16, BASE_DEC, NULL, EXTENSION_LENGTH_MASK, NULL, HFILL} + }, + { + &hf_culmap_extension_length_1, + {"Extension Length", "wmx.extension_type.length", FT_UINT16, BASE_DEC, NULL, EXTENSION_LENGTH_MASK_1, NULL, HFILL} + }, + { + &hf_culmap_extension_time_diversity_mbs, + {"Time Diversity MBS", "wmx.extension_type.time_diversity_mbs", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} + }, + { + &hf_culmap_extension_time_diversity_mbs_1, + {"Time Diversity MBS", "wmx.extension_type.time_diversity_mbs", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} + }, + { + &hf_culmap_extension_harq_mode_1, + {"HARQ Mode Switch", "wmx.extension_type.harq_mode", FT_UINT16, BASE_HEX, NULL, 0x000F, NULL, HFILL} + }, + { + &hf_culmap_extension_harq_mode, + {"HARQ Mode Switch", "wmx.extension_type.harq_mode", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL} + }, + { + &hf_culmap_extension_unknown_sub_type, + {"Unknown Extension Subtype", "wmx.extension_type.unknown_sub_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} + }, + { + &hf_culmap_extension_unknown_sub_type_1, + {"Unknown Extension Subtype", "wmx.extension_type.unknown_sub_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} + } + }; + + static hf_register_info hf_cdma_allocation[] = + { + { /* display the Duration */ + &hf_cdma_allocation_duration, + {"Duration", "wmx.cdma_allocation.duration", FT_UINT16, BASE_DEC, NULL, CDMA_ALLOCATION_DURATION_MASK, NULL, HFILL} + }, + { /* display the UIUC */ + &hf_cdma_allocation_uiuc, + {"UIUC For Transmission", "wmx.cdma_allocation.uiuc", FT_UINT16, BASE_DEC, NULL, CDMA_ALLOCATION_UIUC_MASK, NULL, HFILL} + }, + { /* display the Repetition Coding Indication */ + &hf_cdma_allocation_repetition, + {"Repetition Coding Indication", "wmx.cdma_allocation.allocation_repetition", FT_UINT16, BASE_DEC, VALS(vals_repetitions), CDMA_ALLOCATION_REPETITION_CODE_MASK, NULL, HFILL} + }, + { /* display the Frame Number Index */ + &hf_cdma_allocation_frame_number_index, + {"Frame Number Index (LSBs of relevant frame number)", "wmx.cdma_allocation.frame_number_index", FT_UINT16, BASE_DEC, NULL, CDMA_ALLOCATION_FRAME_NUMBER_INDEX_MASK, NULL, HFILL} + }, + { /* display the Ranging Code */ + &hf_cdma_allocation_ranging_code, + {"Ranging Code", "wmx.cdma_allocation.ranging_code", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} + }, + { /* display the Ranging Symbol */ + &hf_cdma_allocation_ranging_symbol, + {"Ranging Symbol", "wmx.cdma_allocation.ranging_symbol", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} + }, + { /* display the Ranging Subchannel */ + &hf_cdma_allocation_ranging_subchannel, + {"Ranging Subchannel", "wmx.cdma_allocation.ranging_subchannel", FT_UINT8, BASE_DEC, NULL, CDMA_ALLOCATION_RANGING_SUBCHANNEL_MASK, NULL, HFILL} + }, + { /* display the BW Request Mandatory */ + &hf_cdma_allocation_bw_req, + {"BW Request Mandatory", "wmx.cdma_allocation.bw_req", FT_BOOLEAN, 8, TFS(&tfs_yes_no_ie), CDMA_ALLOCATION_BW_REQUEST_MANDATORY_MASK, NULL, HFILL} + }, + { /* display the Duration */ + &hf_cdma_allocation_duration_1, + {"Duration", "wmx.cdma_allocation.duration", FT_UINT16, BASE_DEC, NULL, CDMA_ALLOCATION_DURATION_MASK_1, NULL, HFILL} + }, + { /* display the UIUC */ + &hf_cdma_allocation_uiuc_1, + {"UIUC For Transmission", "wmx.cdma_allocation.uiuc", FT_UINT16, BASE_DEC, NULL, CDMA_ALLOCATION_UIUC_MASK_1, NULL, HFILL} + }, + { /* display the Repetition Coding Indication */ + &hf_cdma_allocation_repetition_1, + {"Repetition Coding Indication", "wmx.cdma_allocation.allocation_repetition", FT_UINT16, BASE_DEC, VALS(vals_repetitions), CDMA_ALLOCATION_REPETITION_CODE_MASK_1, NULL, HFILL} + }, + { /* display the Frame Number Index */ + &hf_cdma_allocation_frame_number_index_1, + {"Frame Number Index (LSBs of relevant frame number)", "wmx.cdma_allocation.frame_number_index", FT_UINT32, BASE_DEC, NULL, CDMA_ALLOCATION_FRAME_NUMBER_INDEX_MASK_1, NULL, HFILL} + }, + { /* display the Ranging Code */ + &hf_cdma_allocation_ranging_code_1, + {"Ranging Code", "wmx.cdma_allocation.ranging_code", FT_UINT32, BASE_DEC, NULL, CDMA_ALLOCATION_RANGING_CODE_MASK_1, NULL, HFILL} + }, + { /* display the Ranging Symbol */ + &hf_cdma_allocation_ranging_symbol_1, + {"Ranging Symbol", "wmx.cdma_allocation.ranging_symbol", FT_UINT32, BASE_DEC, NULL, CDMA_ALLOCATION_RANGING_SYMBOL_MASK_1, NULL, HFILL} + }, + { /* display the Ranging Subchannel */ + &hf_cdma_allocation_ranging_subchannel_1, + {"Ranging Subchannel", "wmx.cdma_allocation.ranging_subchannel", FT_UINT32, BASE_DEC, NULL, CDMA_ALLOCATION_RANGING_SUBCHANNEL_MASK_1, NULL, HFILL} + }, + { /* display the BW Request Mandatory */ + &hf_cdma_allocation_bw_req_1, + {"BW Request Mandatory", "wmx.cdma_allocation.bw_req", FT_BOOLEAN, 32, TFS(&tfs_yes_no_ie), CDMA_ALLOCATION_BW_REQUEST_MANDATORY_MASK_1, NULL, HFILL} } - } - /* return the IE length in nibbles */ - return (length * 2); -} - -/* 8.4.5.4.3 (table 290) */ -guint wimax_cdma_allocation_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset) -{ - guint byte; + }; -#ifdef DEBUG - /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) + static hf_register_info hf_extended_uiuc[] = { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "CDMA Allocation IE"); - } -#endif - /* Get the first byte */ - byte = tvb_get_guint8(tvb, offset); - if(nibble_offset & 1) - { /* display the Duration */ - proto_tree_add_item(tree, hf_cdma_allocation_duration_1, tvb, offset, 2, FALSE); - /* display the UIUC */ - proto_tree_add_item(tree, hf_cdma_allocation_uiuc_1, tvb, offset, 2, FALSE); - /* display the Repetition Coding Indication */ - proto_tree_add_item(tree, hf_cdma_allocation_repetition_1, tvb, offset, 2, FALSE); - /* display the frame number index */ - proto_tree_add_item(tree, hf_cdma_allocation_frame_number_index_1, tvb, offset, 4, FALSE); - /* display the Ranging Code */ - proto_tree_add_item(tree, hf_cdma_allocation_ranging_code_1, tvb, offset, 4, FALSE); - /* display the Ranging Symbol */ - proto_tree_add_item(tree, hf_cdma_allocation_ranging_symbol_1, tvb, offset, 4, FALSE); - /* display the Ranging Subchannel */ - proto_tree_add_item(tree, hf_cdma_allocation_ranging_subchannel_1, tvb, offset, 4, FALSE); - /* display the BW Request Mandatory */ - proto_tree_add_item(tree, hf_cdma_allocation_bw_req_1, tvb, offset, 4, FALSE); - } - else - { /* display the Duration */ - proto_tree_add_item(tree, hf_cdma_allocation_duration, tvb, offset, 2, FALSE); - /* display the UIUC */ - proto_tree_add_item(tree, hf_cdma_allocation_uiuc, tvb, offset, 2, FALSE); - /* display the Repetition Coding Indication */ - proto_tree_add_item(tree, hf_cdma_allocation_repetition, tvb, offset, 2, FALSE); - /* display the frame number index */ - proto_tree_add_item(tree, hf_cdma_allocation_frame_number_index, tvb, offset, 2, FALSE); - /* display the Ranging Code */ - proto_tree_add_item(tree, hf_cdma_allocation_ranging_code, tvb, offset, 1, FALSE); - /* display the Ranging Symbol */ - proto_tree_add_item(tree, hf_cdma_allocation_ranging_symbol, tvb, offset, 1, FALSE); - /* display the Ranging Subchannel */ - proto_tree_add_item(tree, hf_cdma_allocation_ranging_subchannel, tvb, offset, 1, FALSE); - /* display the BW Request Mandatory */ - proto_tree_add_item(tree, hf_cdma_allocation_bw_req, tvb, offset, 1, FALSE); - } - /* return the IE length in nibbles */ - return 8; -} - -/* Extended UIUCs (table 290a) */ -#define POWER_CONTROL_IE 0 -#define MINI_SUBCHANNEL_ALLOCATION_IE 1 -#define AAS_UL_IE 2 -#define CQICH_ALLOC_IE 3 -#define UL_ZONE_IE 4 -#define PHYMOD_UL_IE 5 -#define MIMO_UL_BASIC_IE 6 -#define UL_MAP_FAST_TRACKING_IE 7 -#define UL_PUSC_BURST_ALLOCATION_IN_OTHER_SEGMENT_IE 8 -#define FAST_RANGING_IE 9 -#define UL_ALLOCATION_START_IE 10 + { /* 8.4.5.4.4 Extended UIUC */ + &hf_extended_uiuc_ie_uiuc, + {"Extended UIUC", "wmx.extended_uiuc_ie.uiuc", FT_UINT8, BASE_HEX, NULL, MSB_NIBBLE_MASK, NULL, HFILL } + }, + { /* 8.4.5.4.4 Extended UIUC */ + &hf_extended_uiuc_ie_uiuc_1, + {"Extended UIUC", "wmx.extended_uiuc_ie.uiuc", FT_UINT8, BASE_HEX, NULL, LSB_NIBBLE_MASK, NULL, HFILL } + }, + { /* 8.4.5.4.4 IE Length */ + &hf_extended_uiuc_ie_length, + {"Length", "wmx.extended_uiuc_ie.length", FT_UINT8, BASE_DEC, NULL, MSB_NIBBLE_MASK, NULL, HFILL } + }, + { /* 8.4.5.4.4 IE Length */ + &hf_extended_uiuc_ie_length_1, + {"Length", "wmx.extended_uiuc_ie.length", FT_UINT24, BASE_DEC, NULL, LSB_NIBBLE_MASK, NULL, HFILL } + }, + { /* 8.4.5.4.5 Power Control IE */ + &hf_extended_uiuc_ie_power_control, + {"Power Control", "wmx.extended_uiuc_ie.power_control", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } + }, + { /* 8.4.5.4.5 Power Control IE */ + &hf_extended_uiuc_ie_power_control_24, + {"Power Control", "wmx.extended_uiuc_ie.power_control", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL } + }, + { + &hf_extended_uiuc_ie_power_measurement_frame, + {"Power Measurement Frame", "wmx.extended_uiuc_ie.power_measurement_frame", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } + }, + { + &hf_extended_uiuc_ie_power_measurement_frame_24, + {"Power Measurement Frame", "wmx.extended_uiuc_ie.power_measurement_frame", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL } + }, + { /* 8.4.5.4.8 Mini Subchannel Allocation IE */ + &hf_extended_uiuc_ie_mini_subchannel_alloc_ctype, + {"C Type", "wmx.extended_uiuc_ie.mini_subchannel_alloc.ctype", FT_UINT8, BASE_HEX, VALS(vals_ctypes), MINI_SUBCHANNEL_CTYPE_MASK, NULL, HFILL } + }, + { + &hf_extended_uiuc_ie_mini_subchannel_alloc_ctype_16, + {"C Type", "wmx.extended_uiuc_ie.mini_subchannel_alloc.ctype", FT_UINT16, BASE_HEX, VALS(vals_ctypes), MINI_SUBCHANNEL_CTYPE_MASK_16, NULL, HFILL } + }, + { + &hf_extended_uiuc_ie_mini_subchannel_alloc_duration, + {"Duration", "wmx.extended_uiuc_ie.mini_subchannel_alloc.duration", FT_UINT8, BASE_DEC, NULL, MINI_SUBCHANNEL_DURATION_MASK, NULL, HFILL } + }, + { + &hf_extended_uiuc_ie_mini_subchannel_alloc_duration_16, + {"Duration", "wmx.extended_uiuc_ie.mini_subchannel_alloc.duration", FT_UINT16, BASE_DEC, NULL, MINI_SUBCHANNEL_DURATION_MASK_16, NULL, HFILL } + }, + { + &hf_extended_uiuc_ie_mini_subchannel_alloc_cid, + {"CID", "wmx.extended_uiuc_ie.mini_subchannel_alloc.cid", FT_UINT24, BASE_HEX, NULL, MINI_SUBCHANNEL_CID_MASK, NULL, HFILL } + }, + { + &hf_extended_uiuc_ie_mini_subchannel_alloc_uiuc, + {"UIUC", "wmx.extended_uiuc_ie.mini_subchannel_alloc.uiuc", FT_UINT24, BASE_HEX, NULL, MINI_SUBCHANNEL_UIUC_MASK, NULL, HFILL } + }, + { + &hf_extended_uiuc_ie_mini_subchannel_alloc_repetition, + {"Repetition", "wmx.extended_uiuc_ie.mini_subchannel_alloc.repetition", FT_UINT24, BASE_HEX, VALS(vals_repetitions), MINI_SUBCHANNEL_REPETITION_MASK, NULL, HFILL } + }, + { + &hf_extended_uiuc_ie_mini_subchannel_alloc_cid_1, + {"CID", "wmx.extended_uiuc_ie.mini_subchannel_alloc.cid", FT_UINT24, BASE_HEX, NULL, MINI_SUBCHANNEL_CID_MASK_1, NULL, HFILL } + }, + { + &hf_extended_uiuc_ie_mini_subchannel_alloc_uiuc_1, + {"UIUC", "wmx.extended_uiuc_ie.mini_subchannel_alloc.uiuc", FT_UINT24, BASE_HEX, NULL, MINI_SUBCHANNEL_UIUC_MASK_1, NULL, HFILL } + }, + { + &hf_extended_uiuc_ie_mini_subchannel_alloc_repetition_1, + {"Repetition", "wmx.extended_uiuc_ie.mini_subchannel_alloc.repetition", FT_UINT24, BASE_HEX, VALS(vals_repetitions), MINI_SUBCHANNEL_REPETITION_MASK_1, NULL, HFILL } + }, + { + &hf_extended_uiuc_ie_mini_subchannel_alloc_cid_2, + {"CID", "wmx.extended_uiuc_ie.mini_subchannel_alloc.cid", FT_UINT24, BASE_HEX, NULL, MINI_SUBCHANNEL_CID_MASK_2, NULL, HFILL } + }, + { + &hf_extended_uiuc_ie_mini_subchannel_alloc_uiuc_2, + {"UIUC", "wmx.extended_uiuc_ie.mini_subchannel_alloc.uiuc", FT_UINT24, BASE_HEX, NULL, MINI_SUBCHANNEL_UIUC_MASK_2, NULL, HFILL } + }, + { + &hf_extended_uiuc_ie_mini_subchannel_alloc_repetition_2, + {"Repetition", "wmx.extended_uiuc_ie.mini_subchannel_alloc.repetition", FT_UINT24, BASE_HEX, VALS(vals_repetitions), MINI_SUBCHANNEL_REPETITION_MASK_2, NULL, HFILL } + }, + { + &hf_extended_uiuc_ie_mini_subchannel_alloc_cid_3, + {"CID", "wmx.extended_uiuc_ie.mini_subchannel_alloc.cid", FT_UINT24, BASE_HEX, NULL, MINI_SUBCHANNEL_CID_MASK_3, NULL, HFILL } + }, + { + &hf_extended_uiuc_ie_mini_subchannel_alloc_uiuc_3, + {"UIUC", "wmx.extended_uiuc_ie.mini_subchannel_alloc.uiuc", FT_UINT24, BASE_HEX, NULL, MINI_SUBCHANNEL_UIUC_MASK_2, NULL, HFILL } + }, + { + &hf_extended_uiuc_ie_mini_subchannel_alloc_repetition_3, + {"Repetition", "wmx.extended_uiuc_ie.mini_subchannel_alloc.repetition", FT_UINT24, BASE_HEX, VALS(vals_repetitions), MINI_SUBCHANNEL_REPETITION_MASK_3, NULL, HFILL } + }, + { + &hf_extended_uiuc_ie_mini_subchannel_alloc_padding, + {"Padding", "wmx.extended_uiuc_ie.mini_subchannel_alloc.padding", FT_UINT8, BASE_HEX, NULL, MINI_SUBCHANNEL_PADDING_MASK, NULL, HFILL } + }, + { + &hf_extended_uiuc_ie_mini_subchannel_alloc_padding_1, + {"Padding", "wmx.extended_uiuc_ie.mini_subchannel_alloc.padding", FT_UINT24, BASE_HEX, NULL, MINI_SUBCHANNEL_PADDING_MASK_1, NULL, HFILL } + }, + { /* 8.4.5.4.6 AAS_UL_IE */ + &hf_extended_uiuc_ie_aas_ul, + {"AAS_UL_IE (not implemented)", "wmx.extended_uiuc_ie.aas_ul", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } + }, + { /* 8.4.5.4.12 CQICH Allocation IE */ + &hf_extended_uiuc_ie_cqich_alloc, + {"CQICH Allocation IE (not implemented)", "wmx.extended_uiuc_ie.cqich_alloc", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } + }, + { /* 8.4.5.4.7 UL Zone IE */ + &hf_extended_uiuc_ie_ul_zone, + {"UL Zone IE (not implemented)", "wmx.extended_uiuc_ie.ul_zone", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } + }, -/* 8.4.5.4.4.1 (table 290b) */ -guint wimax_extended_uiuc_dependent_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset) -{ - guint ext_uiuc, length, m, i; - guint8 byte; + { /* 8.4.5.4.14 MIMO_UL_Basic_IE */ + &hf_extended_uiuc_ie_mimo_ul_basic, + {"MIMO UL Basic IE (not implemented)", "wmx.extended_uiuc_ie.mimo_ul_basic", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } + }, + { /* 8.4.5.4.22 UL-MAP Fast Tracking IE */ + &hf_extended_uiuc_ie_fast_tracking, + {"UL-MAP Fast Tracking IE (not implemented)", "wmx.extended_uiuc_ie.fast_tracking", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } + }, + { /* 8.4.5.4.21 Fast Ranging IE */ + &hf_extended_uiuc_ie_fast_ranging, + {"Fast Ranging IE (not implemented)", "wmx.extended_uiuc_ie.fast_ranging", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } + }, + { /* 8.4.5.4.14 UL-MAP Physical Modifier IE */ + &hf_extended_uiuc_ie_phymod_ul, + {"UL-MAP Physical Modifier IE (not implemented)", "wmx.extended_uiuc_ie.phymod_ul", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } + }, + { /* 8.4.5.4.17 UL PUSC Burst Allocation in Other Segment IE */ + &hf_extended_uiuc_ie_ul_pusc_burst_allocation, + {"UL_PUSC_Burst_Allocation_in_Other_Segment_IE (not implemented)", "wmx.extended_uiuc_ie.ul_pusc_burst_allocation", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } + }, + { /* 8.4.5.4.15 UL Allocation Start IE */ + &hf_extended_uiuc_ie_ul_allocation_start, + {"UL Allocation Start IE (not implemented)", "wmx.extended_uiuc_ie.ul_allocation_start", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } + }, + { /* unknown UIUC */ + &hf_extended_uiuc_ie_unknown_uiuc, + {"Unknown Extended UIUC", "wmx.extended_uiuc.unknown_uiuc", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } + } + }; -#ifdef DEBUG - /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Extended UIUC IE"); - } +#if 0 /* not used ?? */ + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_wimax_compact_ulmap_ie_decoder, + &ett_wimax_rcid_ie_decoder, + &ett_wimax_harq_control_ie_decoder, + &ett_wimax_extended_uiuc_dependent_ie_decoder, + &ett_wimax_extension_type_ie_decoder, + }; + proto_register_subtree_array(ett, array_length(ett)); #endif - /* get the first byte */ - byte = tvb_get_guint8(tvb, offset); - if(nibble_offset & 1) - { /* get the extended UIUC */ - ext_uiuc = (byte & LSB_NIBBLE_MASK); - /* display extended UIUC */ - proto_tree_add_item(tree, hf_extended_uiuc_ie_uiuc_1, tvb, offset, 1, FALSE); - /* move to next byte */ - offset++; - /* get the 2nd byte */ - byte = tvb_get_guint8(tvb, offset); - /* get the length */ - length = ((byte & MSB_NIBBLE_MASK) >> 4); - /* display extended UIUC length */ - proto_tree_add_item(tree, hf_extended_uiuc_ie_length_1, tvb, offset, 1, FALSE); - } - else - { /* get the extended UIUC */ - ext_uiuc = ((byte & MSB_NIBBLE_MASK) >> 4); - /* get the length */ - length = (byte & LSB_NIBBLE_MASK); - /* display extended UIUC */ - proto_tree_add_item(tree, hf_extended_uiuc_ie_uiuc, tvb, offset, 1, FALSE); - /* display extended UIUC length */ - proto_tree_add_item(tree, hf_extended_uiuc_ie_length, tvb, offset, 1, FALSE); - /* move to next byte */ - offset++; - } - /* 8.4.5.4.4.1 (table 290b) */ - switch (ext_uiuc) - { - case POWER_CONTROL_IE: - /* 8.4.5.4.5 Power Control IE */ - if(nibble_offset & 1) - { /* display power control value */ - proto_tree_add_item(tree, hf_extended_uiuc_ie_power_control_24, tvb, offset, 3, FALSE); - /* display power measurement frame value */ - proto_tree_add_item(tree, hf_extended_uiuc_ie_power_measurement_frame_24, tvb, offset, 3, FALSE); - } - else - { /* display power control value */ - proto_tree_add_item(tree, hf_extended_uiuc_ie_power_control, tvb, offset, 1, FALSE); - /* display power measurement frame value */ - proto_tree_add_item(tree, hf_extended_uiuc_ie_power_measurement_frame, tvb, (offset + 1), 1, FALSE); - } - break; - case MINI_SUBCHANNEL_ALLOCATION_IE: - /* 8.4.5.4.8 Mini Subchannel Allocation IE */ - /* set the M value */ - switch (length) - { - case 15: - m = 6; - break; - case 9: - m = 3; - break; - case 7: - default: - m = 2; - break; - } - if(nibble_offset & 1) - { - /* display MINI Subchannel Allocation CType value */ - proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_ctype_16, tvb, offset, 2, FALSE); - /* display MINI Subchannel Allocation Duration value */ - proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_duration_16, tvb, offset, 2, FALSE); - } - else - { /* display MINI Subchannel Allocation CType value */ - proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_ctype, tvb, offset, 1, FALSE); - /* display MINI Subchannel Allocation Duration value */ - proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_duration, tvb, offset, 1, FALSE); - } - offset++; - /* decode and display CIDs, UIUCs, and Repetitions */ - for(i=0; isrc)); + /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "FCH"); + } + if (tree) + { /* we are being asked for details */ + /* display FCH dissector info */ + fch_item = proto_tree_add_protocol_format(tree, proto_wimax_fch_decoder, tvb, offset, 3, "DL Frame Prefix (24 bits)"); + /* add FCH subtree */ + fch_tree = proto_item_add_subtree(fch_item, ett_wimax_fch_decoder); + /* Decode and display the used sub-channel groups */ + proto_tree_add_item(fch_tree, hf_fch_used_subchannel_group0, tvb, offset, FCH_BURST_LENGTH, FALSE); + proto_tree_add_item(fch_tree, hf_fch_used_subchannel_group1, tvb, offset, FCH_BURST_LENGTH, FALSE); + proto_tree_add_item(fch_tree, hf_fch_used_subchannel_group2, tvb, offset, FCH_BURST_LENGTH, FALSE); + proto_tree_add_item(fch_tree, hf_fch_used_subchannel_group3, tvb, offset, FCH_BURST_LENGTH, FALSE); + proto_tree_add_item(fch_tree, hf_fch_used_subchannel_group4, tvb, offset, FCH_BURST_LENGTH, FALSE); + proto_tree_add_item(fch_tree, hf_fch_used_subchannel_group5, tvb, offset, FCH_BURST_LENGTH, FALSE); + proto_tree_add_item(fch_tree, hf_fch_reserved_1, tvb, offset, FCH_BURST_LENGTH, FALSE); + /* Decode and display the repetition coding indication */ + proto_tree_add_item(fch_tree, hf_fch_repetition_coding_indication, tvb, offset, FCH_BURST_LENGTH, FALSE); + /* Decode and display the coding indication */ + proto_tree_add_item(fch_tree, hf_fch_coding_indication, tvb, offset, FCH_BURST_LENGTH, FALSE); + /* Decode and display the DL MAP length */ + proto_tree_add_item(fch_tree, hf_fch_dlmap_length, tvb, offset, FCH_BURST_LENGTH, FALSE); + proto_tree_add_item(fch_tree, hf_fch_reserved_2, tvb, offset, FCH_BURST_LENGTH, FALSE); + } +} /* Register Wimax FCH Protocol */ void proto_register_wimax_fch(void) @@ -206,51 +234,17 @@ void proto_register_wimax_fch(void) } }; - if (proto_wimax_fch_decoder == -1) - { - proto_wimax_fch_decoder = proto_wimax; + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_wimax_fch_decoder, + }; - /* register the field display messages */ - proto_register_field_array(proto_wimax_fch_decoder, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - } - register_dissector("wimax_fch_burst_handler", dissect_wimax_fch_decoder, -1); -} + proto_wimax_fch_decoder = proto_wimax; -static void dissect_wimax_fch_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ - gint offset = 0; - proto_item *fch_item = NULL; - proto_tree *fch_tree = NULL; + /* register the field display messages */ + proto_register_field_array(proto_wimax_fch_decoder, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); - /* save the base station address (once) */ - if(!bs_address.len) - COPY_ADDRESS(&bs_address, &(pinfo->src)); - /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "FCH"); - } - if (tree) - { /* we are being asked for details */ - /* display FCH dissector info */ - fch_item = proto_tree_add_protocol_format(tree, proto_wimax_fch_decoder, tvb, offset, 3, "DL Frame Prefix (24 bits)"); - /* add FCH subtree */ - fch_tree = proto_item_add_subtree(fch_item, ett_wimax_fch_decoder); - /* Decode and display the used sub-channel groups */ - proto_tree_add_item(fch_tree, hf_fch_used_subchannel_group0, tvb, offset, FCH_BURST_LENGTH, FALSE); - proto_tree_add_item(fch_tree, hf_fch_used_subchannel_group1, tvb, offset, FCH_BURST_LENGTH, FALSE); - proto_tree_add_item(fch_tree, hf_fch_used_subchannel_group2, tvb, offset, FCH_BURST_LENGTH, FALSE); - proto_tree_add_item(fch_tree, hf_fch_used_subchannel_group3, tvb, offset, FCH_BURST_LENGTH, FALSE); - proto_tree_add_item(fch_tree, hf_fch_used_subchannel_group4, tvb, offset, FCH_BURST_LENGTH, FALSE); - proto_tree_add_item(fch_tree, hf_fch_used_subchannel_group5, tvb, offset, FCH_BURST_LENGTH, FALSE); - proto_tree_add_item(fch_tree, hf_fch_reserved_1, tvb, offset, FCH_BURST_LENGTH, FALSE); - /* Decode and display the repetition coding indication */ - proto_tree_add_item(fch_tree, hf_fch_repetition_coding_indication, tvb, offset, FCH_BURST_LENGTH, FALSE); - /* Decode and display the coding indication */ - proto_tree_add_item(fch_tree, hf_fch_coding_indication, tvb, offset, FCH_BURST_LENGTH, FALSE); - /* Decode and display the DL MAP length */ - proto_tree_add_item(fch_tree, hf_fch_dlmap_length, tvb, offset, FCH_BURST_LENGTH, FALSE); - proto_tree_add_item(fch_tree, hf_fch_reserved_2, tvb, offset, FCH_BURST_LENGTH, FALSE); - } + register_dissector("wimax_fch_burst_handler", dissect_wimax_fch_decoder, -1); } diff --git a/plugins/wimax/wimax_ffb_decoder.c b/plugins/wimax/wimax_ffb_decoder.c index e21fb63883..9e1713be0e 100644 --- a/plugins/wimax/wimax_ffb_decoder.c +++ b/plugins/wimax/wimax_ffb_decoder.c @@ -37,18 +37,9 @@ extern gint proto_wimax; -/* forward reference */ -static void dissect_wimax_ffb_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - static gint proto_wimax_ffb_decoder = -1; static gint ett_wimax_ffb_decoder = -1; -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_wimax_ffb_decoder, -}; - static gint hf_ffb_burst = -1; static gint hf_ffb_num_of_ffbs = -1; static gint hf_ffb_type = -1; @@ -56,48 +47,6 @@ static gint hf_ffb_subchannel = -1; static gint hf_ffb_symboloffset = -1; static gint hf_ffb_value = -1; -/* Register Wimax FFB Protocol */ -void proto_register_wimax_ffb(void) -{ - /* FFB display */ - static hf_register_info hf[] = - { - { - &hf_ffb_burst, - {"Fast Feedback Burst", "wmx.ffb.burst", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} - }, - { - &hf_ffb_num_of_ffbs, - {"Number Of Fast Feedback", "wmx.ffb.num_of_ffbs", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} - }, - { - &hf_ffb_type, - {"Fast Feedback Type", "wmx.ffb.ffb_type", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} - }, - { - &hf_ffb_subchannel, - {"Physical Subchannel", "wmx.ffb.subchannel", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} - }, - { - &hf_ffb_symboloffset, - {"Symbol Offset", "wmx.ffb.symbol_offset", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} - }, - { - &hf_ffb_value, - {"Fast Feedback Value", "wmx.ffb.ffb_value", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} - } - }; - - if (proto_wimax_ffb_decoder == -1) - { - proto_wimax_ffb_decoder = proto_wimax; - - /* register the field display messages */ - proto_register_field_array(proto_wimax_ffb_decoder, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - } - register_dissector("wimax_ffb_burst_handler", dissect_wimax_ffb_decoder, -1); -} static void dissect_wimax_ffb_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { @@ -134,3 +83,50 @@ static void dissect_wimax_ffb_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_t } } } + +/* Register Wimax FFB Protocol */ +void proto_register_wimax_ffb(void) +{ + /* FFB display */ + static hf_register_info hf[] = + { + { + &hf_ffb_burst, + {"Fast Feedback Burst", "wmx.ffb.burst", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} + }, + { + &hf_ffb_num_of_ffbs, + {"Number Of Fast Feedback", "wmx.ffb.num_of_ffbs", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} + }, + { + &hf_ffb_type, + {"Fast Feedback Type", "wmx.ffb.ffb_type", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} + }, + { + &hf_ffb_subchannel, + {"Physical Subchannel", "wmx.ffb.subchannel", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} + }, + { + &hf_ffb_symboloffset, + {"Symbol Offset", "wmx.ffb.symbol_offset", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} + }, + { + &hf_ffb_value, + {"Fast Feedback Value", "wmx.ffb.ffb_value", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} + } + }; + + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_wimax_ffb_decoder, + }; + + proto_wimax_ffb_decoder = proto_wimax; + + /* register the field display messages */ + proto_register_field_array(proto_wimax_ffb_decoder, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + + register_dissector("wimax_ffb_burst_handler", dissect_wimax_ffb_decoder, -1); +} diff --git a/plugins/wimax/wimax_hack_decoder.c b/plugins/wimax/wimax_hack_decoder.c index 88f77260b5..0e991e0427 100644 --- a/plugins/wimax/wimax_hack_decoder.c +++ b/plugins/wimax/wimax_hack_decoder.c @@ -37,18 +37,9 @@ extern gint proto_wimax; -/* forward reference */ -static void dissect_wimax_hack_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - static gint proto_wimax_hack_decoder = -1; static gint ett_wimax_hack_decoder = -1; -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_wimax_hack_decoder, -}; - static const value_string vals_flags[] = { {0, "Even Half-Slot (tiles 0,2,4)"}, @@ -70,6 +61,42 @@ static gint hf_hack_subchannel = -1; static gint hf_hack_symboloffset = -1; static gint hf_hack_value = -1; + +static void dissect_wimax_hack_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + gint offset = 0; + guint length, num_of_hacks, i; + proto_item *hack_item = NULL; + proto_tree *hack_tree = NULL; + + /* update the info column */ + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "HARQ ACK Burst:"); + } + if (tree) + { /* we are being asked for details */ + /* get the tvb reported length */ + length = tvb_reported_length(tvb); + /* display HARQ ACK Burst dissector info */ + hack_item = proto_tree_add_protocol_format(tree, proto_wimax_hack_decoder, tvb, offset, length, "HARQ ACK Burst (%u bytes)", length); + /* add HARQ ACK Burst subtree */ + hack_tree = proto_item_add_subtree(hack_item, ett_wimax_hack_decoder); + /* get the number of HARQ ACKs */ + num_of_hacks = tvb_get_guint8(tvb, offset); + /* display the number of HARQ ACKs */ + proto_tree_add_item(hack_tree, hf_hack_num_of_hacks, tvb, offset++, 1, FALSE); + /* display the HARQ ACKs */ + for(i = 0; i < num_of_hacks; i++) + { + proto_tree_add_item(hack_tree, hf_hack_subchannel, tvb, offset++, 1, FALSE); + proto_tree_add_item(hack_tree, hf_hack_symboloffset, tvb, offset++, 1, FALSE); + proto_tree_add_item(hack_tree, hf_hack_half_slot_flag, tvb, offset++, 1, FALSE); + proto_tree_add_item(hack_tree, hf_hack_value, tvb, offset++, 1, FALSE); + } + } +} + /* Register Wimax HARQ ACK Protocol */ void proto_register_wimax_hack(void) { @@ -102,47 +129,16 @@ void proto_register_wimax_hack(void) } }; - if (proto_wimax_hack_decoder == -1) - { - proto_wimax_hack_decoder = proto_wimax; + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_wimax_hack_decoder, + }; - register_dissector("wimax_hack_burst_handler", dissect_wimax_hack_decoder, -1); - proto_register_field_array(proto_wimax_hack_decoder, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - } -} + proto_wimax_hack_decoder = proto_wimax; -static void dissect_wimax_hack_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ - gint offset = 0; - guint length, num_of_hacks, i; - proto_item *hack_item = NULL; - proto_tree *hack_tree = NULL; + register_dissector("wimax_hack_burst_handler", dissect_wimax_hack_decoder, -1); + proto_register_field_array(proto_wimax_hack_decoder, hf, array_length(hf)); - /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "HARQ ACK Burst:"); - } - if (tree) - { /* we are being asked for details */ - /* get the tvb reported length */ - length = tvb_reported_length(tvb); - /* display HARQ ACK Burst dissector info */ - hack_item = proto_tree_add_protocol_format(tree, proto_wimax_hack_decoder, tvb, offset, length, "HARQ ACK Burst (%u bytes)", length); - /* add HARQ ACK Burst subtree */ - hack_tree = proto_item_add_subtree(hack_item, ett_wimax_hack_decoder); - /* get the number of HARQ ACKs */ - num_of_hacks = tvb_get_guint8(tvb, offset); - /* display the number of HARQ ACKs */ - proto_tree_add_item(hack_tree, hf_hack_num_of_hacks, tvb, offset++, 1, FALSE); - /* display the HARQ ACKs */ - for(i = 0; i < num_of_hacks; i++) - { - proto_tree_add_item(hack_tree, hf_hack_subchannel, tvb, offset++, 1, FALSE); - proto_tree_add_item(hack_tree, hf_hack_symboloffset, tvb, offset++, 1, FALSE); - proto_tree_add_item(hack_tree, hf_hack_half_slot_flag, tvb, offset++, 1, FALSE); - proto_tree_add_item(hack_tree, hf_hack_value, tvb, offset++, 1, FALSE); - } - } + proto_register_subtree_array(ett, array_length(ett)); } diff --git a/plugins/wimax/wimax_harq_map_decoder.c b/plugins/wimax/wimax_harq_map_decoder.c index 627b05a5f6..75e5c29d6c 100644 --- a/plugins/wimax/wimax_harq_map_decoder.c +++ b/plugins/wimax/wimax_harq_map_decoder.c @@ -48,12 +48,6 @@ void dissector_wimax_harq_map_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_t static gint proto_wimax_harq_map_decoder = -1; static gint ett_wimax_harq_map_decoder = -1; -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_wimax_harq_map_decoder, -}; - /* MASKs */ #define LSB_NIBBLE_MASK 0x0F @@ -74,46 +68,6 @@ static gint hf_harq_map_msg_length = -1; static gint hf_harq_dl_ie_count = -1; static gint hf_harq_map_msg_crc = -1; -/* Register Wimax HARQ MAP Protocol */ -void proto_register_wimax_harq_map(void) -{ - /* HARQ MAP display */ - static hf_register_info hf_harq_map[] = - { - { - &hf_harq_map_indicator, - {"HARQ MAP Indicator", "wmx.harq_map.indicator", FT_UINT24, BASE_HEX, NULL, WIMAX_HARQ_MAP_INDICATOR_MASK, NULL, HFILL} - }, - { - &hf_harq_ul_map_appended, - {"HARQ UL-MAP Appended", "wmx.harq_map.ul_map_appended", FT_UINT24, BASE_HEX, NULL, WIMAX_HARQ_UL_MAP_APPENDED_MASK, NULL, HFILL} - }, - { - &hf_harq_map_reserved, - {"Reserved", "wmx.harq_map.reserved", FT_UINT24, BASE_HEX, NULL, WIMAX_HARQ_MAP_RESERVED_MASK, NULL, HFILL} - }, - { - &hf_harq_map_msg_length, - {"Map Message Length", "wmx.harq_map.msg_length", FT_UINT24, BASE_DEC, NULL, WIMAX_HARQ_MAP_MSG_LENGTH_MASK, NULL, HFILL} - }, - { - &hf_harq_dl_ie_count, - {"DL IE Count", "wmx.harq_map.dl_ie_count", FT_UINT24, BASE_DEC, NULL, WIMAX_HARQ_MAP_DL_IE_COUNT_MASK, NULL, HFILL} - }, - { - &hf_harq_map_msg_crc, - {"HARQ MAP Message CRC", "wmx.harq_map.msg_crc", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL} - } - }; - - if (proto_wimax_harq_map_decoder == -1) - { - proto_wimax_harq_map_decoder = proto_wimax; - - proto_register_subtree_array(ett, array_length(ett)); - proto_register_field_array(proto_wimax_harq_map_decoder, hf_harq_map, array_length(hf_harq_map)); - } -} /* HARQ MAP message decoder */ void dissector_wimax_harq_map_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) @@ -223,3 +177,47 @@ void dissector_wimax_harq_map_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_t } } } + +/* Register Wimax HARQ MAP Protocol */ +void proto_register_wimax_harq_map(void) +{ + /* HARQ MAP display */ + static hf_register_info hf_harq_map[] = + { + { + &hf_harq_map_indicator, + {"HARQ MAP Indicator", "wmx.harq_map.indicator", FT_UINT24, BASE_HEX, NULL, WIMAX_HARQ_MAP_INDICATOR_MASK, NULL, HFILL} + }, + { + &hf_harq_ul_map_appended, + {"HARQ UL-MAP Appended", "wmx.harq_map.ul_map_appended", FT_UINT24, BASE_HEX, NULL, WIMAX_HARQ_UL_MAP_APPENDED_MASK, NULL, HFILL} + }, + { + &hf_harq_map_reserved, + {"Reserved", "wmx.harq_map.reserved", FT_UINT24, BASE_HEX, NULL, WIMAX_HARQ_MAP_RESERVED_MASK, NULL, HFILL} + }, + { + &hf_harq_map_msg_length, + {"Map Message Length", "wmx.harq_map.msg_length", FT_UINT24, BASE_DEC, NULL, WIMAX_HARQ_MAP_MSG_LENGTH_MASK, NULL, HFILL} + }, + { + &hf_harq_dl_ie_count, + {"DL IE Count", "wmx.harq_map.dl_ie_count", FT_UINT24, BASE_DEC, NULL, WIMAX_HARQ_MAP_DL_IE_COUNT_MASK, NULL, HFILL} + }, + { + &hf_harq_map_msg_crc, + {"HARQ MAP Message CRC", "wmx.harq_map.msg_crc", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL} + } + }; + + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_wimax_harq_map_decoder, + }; + + proto_wimax_harq_map_decoder = proto_wimax; + + proto_register_subtree_array(ett, array_length(ett)); + proto_register_field_array(proto_wimax_harq_map_decoder, hf_harq_map, array_length(hf_harq_map)); +} diff --git a/plugins/wimax/wimax_pdu_decoder.c b/plugins/wimax/wimax_pdu_decoder.c index 1f98d0b028..f04e0fc9af 100644 --- a/plugins/wimax/wimax_pdu_decoder.c +++ b/plugins/wimax/wimax_pdu_decoder.c @@ -69,50 +69,11 @@ extern gint wimax_decode_dlmapc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *p /* Global Variables. */ gboolean first_gmh; -/* forward reference */ -static void dissect_wimax_pdu_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - static gint proto_wimax_pdu_decoder = -1; static gint ett_wimax_pdu_decoder = -1; static int hf_wimax_value_bytes = -1; -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_wimax_pdu_decoder, -}; - -/* Register Wimax PDU Burst Protocol */ -void proto_register_wimax_pdu(void) -{ - /* PDU display */ - static hf_register_info hf[] = - { - { - &hf_wimax_value_bytes, - { - "Values", "wmx.pdu.value", - FT_BYTES, BASE_NONE, NULL, 0x0, - NULL, HFILL - } - }, - }; - - if (proto_wimax_pdu_decoder == -1) - { - proto_wimax_pdu_decoder = proto_wimax; - - register_dissector("wimax_pdu_burst_handler", dissect_wimax_pdu_decoder, -1); - proto_register_field_array(proto_wimax_pdu_decoder, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - - proto_register_mac_header_generic(); - proto_register_mac_header_type_1(); - proto_register_mac_header_type_2(); - } -} - static void dissect_wimax_pdu_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { guint offset; @@ -268,3 +229,36 @@ static void dissect_wimax_pdu_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_t offset += length; } } + +/* Register Wimax PDU Burst Protocol */ +void proto_register_wimax_pdu(void) +{ + /* PDU display */ + static hf_register_info hf[] = + { + { + &hf_wimax_value_bytes, + { + "Values", "wmx.pdu.value", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL + } + }, + }; + + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_wimax_pdu_decoder, + }; + + proto_wimax_pdu_decoder = proto_wimax; + + register_dissector("wimax_pdu_burst_handler", dissect_wimax_pdu_decoder, -1); + proto_register_field_array(proto_wimax_pdu_decoder, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + + proto_register_mac_header_generic(); + proto_register_mac_header_type_1(); + proto_register_mac_header_type_2(); +} diff --git a/plugins/wimax/wimax_phy_attributes_decoder.c b/plugins/wimax/wimax_phy_attributes_decoder.c index 982df92472..d36866bbb8 100644 --- a/plugins/wimax/wimax_phy_attributes_decoder.c +++ b/plugins/wimax/wimax_phy_attributes_decoder.c @@ -37,18 +37,9 @@ extern gint proto_wimax; -/* forward reference */ -static void dissect_wimax_phy_attributes_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - static gint proto_wimax_phy_attributes_decoder = -1; static gint ett_wimax_phy_attributes_decoder = -1; -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_wimax_phy_attributes_decoder -}; - static const value_string vals_subchannel_types[] = { {0, "DL PUSC"}, @@ -87,56 +78,6 @@ static gint hf_phy_attributes_symbol_offset = -1; static gint hf_phy_attributes_num_of_slots = -1; static gint hf_phy_attributes_subchannel = -1; -/* Register Wimax PDU Burst Physical Attributes Protocol */ -void proto_register_wimax_phy_attributes(void) -{ - /* Physical Attributes display */ - static hf_register_info hf[] = - { - { - &hf_phy_attributes_subchannelization_type, - {"Subchannelization Type", "wmx.phy_attributes.subchannelization_type", FT_UINT8, BASE_DEC, VALS(vals_subchannel_types), 0x0, NULL, HFILL} - }, - { - &hf_phy_attributes_permbase, - {"Permbase", "wmx.phy_attributes.permbase", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} - }, - { - &hf_phy_attributes_modulation_rate, - {"Modulation Rate", "wmx.phy_attributes.modulation_rate", FT_UINT8, BASE_DEC, VALS(vals_modulation_rates), 0x0, NULL, HFILL} - }, - { - &hf_phy_attributes_encoding_type, - {"Encoding Type", "wmx.phy_attributes.encoding_type", FT_UINT8, BASE_DEC, VALS(vals_encoding_types), 0x0, NULL, HFILL} - }, - { - &hf_phy_attributes_num_repeat, - {"numRepeat", "wmx.phy_attributes.num_repeat", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} - }, - { - &hf_phy_attributes_symbol_offset, - {"Symbol Offset", "wmx.phy_attributes.symbol_offset", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} - }, - { - &hf_phy_attributes_num_of_slots, - {"Number Of Slots", "wmx.phy_attributes.num_of_slots", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL} - }, - { - &hf_phy_attributes_subchannel, - {"Subchannel", "wmx.phy_attributes.subchannel", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} - } - }; - - if (proto_wimax_phy_attributes_decoder == -1) - { - proto_wimax_phy_attributes_decoder = proto_wimax; - - register_dissector("wimax_phy_attributes_burst_handler", dissect_wimax_phy_attributes_decoder, -1); - - proto_register_field_array(proto_wimax_phy_attributes_decoder, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - } -} static void dissect_wimax_phy_attributes_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) @@ -186,3 +127,57 @@ static void dissect_wimax_phy_attributes_decoder(tvbuff_t *tvb, packet_info *pin } } } + +/* Register Wimax PDU Burst Physical Attributes Protocol */ +void proto_register_wimax_phy_attributes(void) +{ + /* Physical Attributes display */ + static hf_register_info hf[] = + { + { + &hf_phy_attributes_subchannelization_type, + {"Subchannelization Type", "wmx.phy_attributes.subchannelization_type", FT_UINT8, BASE_DEC, VALS(vals_subchannel_types), 0x0, NULL, HFILL} + }, + { + &hf_phy_attributes_permbase, + {"Permbase", "wmx.phy_attributes.permbase", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} + }, + { + &hf_phy_attributes_modulation_rate, + {"Modulation Rate", "wmx.phy_attributes.modulation_rate", FT_UINT8, BASE_DEC, VALS(vals_modulation_rates), 0x0, NULL, HFILL} + }, + { + &hf_phy_attributes_encoding_type, + {"Encoding Type", "wmx.phy_attributes.encoding_type", FT_UINT8, BASE_DEC, VALS(vals_encoding_types), 0x0, NULL, HFILL} + }, + { + &hf_phy_attributes_num_repeat, + {"numRepeat", "wmx.phy_attributes.num_repeat", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} + }, + { + &hf_phy_attributes_symbol_offset, + {"Symbol Offset", "wmx.phy_attributes.symbol_offset", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} + }, + { + &hf_phy_attributes_num_of_slots, + {"Number Of Slots", "wmx.phy_attributes.num_of_slots", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL} + }, + { + &hf_phy_attributes_subchannel, + {"Subchannel", "wmx.phy_attributes.subchannel", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} + } + }; + + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_wimax_phy_attributes_decoder + }; + + proto_wimax_phy_attributes_decoder = proto_wimax; + + register_dissector("wimax_phy_attributes_burst_handler", dissect_wimax_phy_attributes_decoder, -1); + + proto_register_field_array(proto_wimax_phy_attributes_decoder, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); +} -- cgit v1.2.3