diff options
author | Bill Meier <wmeier@newsguy.com> | 2009-08-04 19:01:34 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2009-08-04 19:01:34 +0000 |
commit | 8589c2f11bb81dddd09d8bd2adcfb5e8a5b33dff (patch) | |
tree | b8c8ee79da5947a5d0667ec76143c0440f2a95bb /plugins | |
parent | cb7dac7100ba7e3f9208dbee243b1a0160254f02 (diff) |
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 <moduleinfo.h> not req'd;
- Remove unneeded forward declarations.
svn path=/trunk/; revision=29296
Diffstat (limited to 'plugins')
35 files changed, 7858 insertions, 8064 deletions
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 <string.h> #include <glib.h> #include <epan/packet.h> @@ -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,770 +701,6 @@ 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) -{ - /* 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 - } - }, - { - &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 - } - }, - { - &hf_mac_header_generic_type_3, - { - "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_type_4, - { - "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_type_5, - { - "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_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 - } - } - }; - - /* 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 - } - }, - { - &hf_mac_header_generic_ext_subheader_type_ul, - { - "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_ext_subheader_sdu_sn, - { - "SDU Sequence Number", "wmx.genericExtSubhd.SduSn", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_ext_subheader_dl_sleep_control_pscid, - { - "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_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 - } - }, - { - &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 - } - }, - { - &hf_mac_header_generic_ext_subheader_dl_sleep_control_fswb, - { - "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_ext_subheader_dl_sleep_control_rsv, - { - "Reserved", "wmx.genericExtSubhd.DlSleepCtrlRsv", - FT_UINT24, BASE_DEC, NULL, DL_SLEEP_CONTROL_RESERVED_MASK, - NULL, HFILL - } - }, - { - &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 - } - }, - { - &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 - } - }, - { - &hf_mac_header_generic_ext_subheader_mini_fb_content, - { - "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 - } - } - }; - - /* Mesh Subheader display */ - static hf_register_info hf_mesh[] = - { - { - &hf_mac_header_generic_mesh_subheader, - { - "Xmt Node Id", "wmx.genericMeshSubhd", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL - } - } - }; - - /* 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 - } - }, - { - &hf_mac_header_generic_frag_subhd_fc_ext, - { - "Fragment Type", "wmx.genericFragSubhd.FcExt", - FT_UINT16, BASE_DEC, VALS(frag_types), FRAGMENTATION_SUBHEADER_FC_MASK, - NULL, HFILL - } - }, - { - &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 - } - }, - { - &hf_mac_header_generic_frag_subhd_fsn, - { - "Fragment Sequence Number (FSN)", "wmx.genericFragSubhd.Fsn", - FT_UINT8, BASE_DEC, NULL, FRAGMENTATION_SUBHEADER_FSN_MASK, - NULL, HFILL - } - }, - { - &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 - } - } - }; - - /* Packing Subheader display */ - static hf_register_info hf_pack[] = - { - { - &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 - } - }, - { - &hf_mac_header_generic_packing_subhd_fc_ext, - { - "Fragment Type", "wmx.genericPackSubhd.FcExt", - FT_UINT24, BASE_HEX, VALS(frag_types), PACKING_SUBHEADER_FC_MASK, - NULL, HFILL - } - }, - { - &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 - } - }, - { - &hf_mac_header_generic_packing_subhd_fsn, - { - "Fragment Number", "wmx.genericPackSubhd.Fsn", - FT_UINT16, BASE_DEC, NULL, PACKING_SUBHEADER_FSN_MASK, - NULL, HFILL - } - }, - { - &hf_mac_header_generic_packing_subhd_fsn_ext, - { - "Fragment Number", "wmx.genericPackSubhd.FsnExt", - FT_UINT24, BASE_DEC, NULL, PACKING_SUBHEADER_BSN_MASK, - NULL, HFILL - } - }, - { - &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 - } - } - }; - - /* Fast-feedback Allocation Subheader display */ - static hf_register_info hf_fast[] = - { - { - &hf_mac_header_generic_fast_fb_subhd_alloc_offset, - { - "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 - } - } - }; - - /* Grant Management Subheader display */ - static hf_register_info hf_grant[] = - { - { - &hf_mac_header_generic_grant_mgmt_ext_pbr_tree, - { - "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 - } - } - }; - - /* ARQ Feedback Payload display */ - static hf_register_info hf_arq[] = - { - { - &hf_mac_header_generic_arq_fb_ie_cid, - { - "CID", "wmx.genericArq.FbIeCid", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL - } - }, - { - &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 - } - } - }; - - 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) { @@ -2295,3 +1511,784 @@ static gint arq_feedback_payload_decoder(tvbuff_t *tvb, packet_info *pinfo, prot /* return the offset */ return offset; } + +/* 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_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 + } + }, + { + &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 + } + }, + { + &hf_mac_header_generic_type_3, + { + "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_type_4, + { + "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_type_5, + { + "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_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 + } + } + }; + + /* 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 + } + }, + { + &hf_mac_header_generic_ext_subheader_type_ul, + { + "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_ext_subheader_sdu_sn, + { + "SDU Sequence Number", "wmx.genericExtSubhd.SduSn", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_ext_subheader_dl_sleep_control_pscid, + { + "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_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 + } + }, + { + &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 + } + }, + { + &hf_mac_header_generic_ext_subheader_dl_sleep_control_fswb, + { + "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_ext_subheader_dl_sleep_control_rsv, + { + "Reserved", "wmx.genericExtSubhd.DlSleepCtrlRsv", + FT_UINT24, BASE_DEC, NULL, DL_SLEEP_CONTROL_RESERVED_MASK, + NULL, HFILL + } + }, + { + &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 + } + }, + { + &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 + } + }, + { + &hf_mac_header_generic_ext_subheader_mini_fb_content, + { + "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 + } + } + }; + + /* Mesh Subheader display */ + static hf_register_info hf_mesh[] = + { + { + &hf_mac_header_generic_mesh_subheader, + { + "Xmt Node Id", "wmx.genericMeshSubhd", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL + } + } + }; + + /* 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 + } + }, + { + &hf_mac_header_generic_frag_subhd_fc_ext, + { + "Fragment Type", "wmx.genericFragSubhd.FcExt", + FT_UINT16, BASE_DEC, VALS(frag_types), FRAGMENTATION_SUBHEADER_FC_MASK, + NULL, HFILL + } + }, + { + &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 + } + }, + { + &hf_mac_header_generic_frag_subhd_fsn, + { + "Fragment Sequence Number (FSN)", "wmx.genericFragSubhd.Fsn", + FT_UINT8, BASE_DEC, NULL, FRAGMENTATION_SUBHEADER_FSN_MASK, + NULL, HFILL + } + }, + { + &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 + } + } + }; + + /* Packing Subheader display */ + static hf_register_info hf_pack[] = + { + { + &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 + } + }, + { + &hf_mac_header_generic_packing_subhd_fc_ext, + { + "Fragment Type", "wmx.genericPackSubhd.FcExt", + FT_UINT24, BASE_HEX, VALS(frag_types), PACKING_SUBHEADER_FC_MASK, + NULL, HFILL + } + }, + { + &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 + } + }, + { + &hf_mac_header_generic_packing_subhd_fsn, + { + "Fragment Number", "wmx.genericPackSubhd.Fsn", + FT_UINT16, BASE_DEC, NULL, PACKING_SUBHEADER_FSN_MASK, + NULL, HFILL + } + }, + { + &hf_mac_header_generic_packing_subhd_fsn_ext, + { + "Fragment Number", "wmx.genericPackSubhd.FsnExt", + FT_UINT24, BASE_DEC, NULL, PACKING_SUBHEADER_BSN_MASK, + NULL, HFILL + } + }, + { + &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 + } + } + }; + + /* Fast-feedback Allocation Subheader display */ + static hf_register_info hf_fast[] = + { + { + &hf_mac_header_generic_fast_fb_subhd_alloc_offset, + { + "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 + } + } + }; + + /* Grant Management Subheader display */ + static hf_register_info hf_grant[] = + { + { + &hf_mac_header_generic_grant_mgmt_ext_pbr_tree, + { + "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 + } + } + }; + + /* ARQ Feedback Payload display */ + static hf_register_info hf_arq[] = + { + { + &hf_mac_header_generic_arq_fb_ie_cid, + { + "CID", "wmx.genericArq.FbIeCid", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL + } + }, + { + &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 + } + } + }; + + /* 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 <glib.h> #include <epan/packet.h> extern gint proto_mac_header_generic_decoder; -/* forward reference */ -void proto_register_mac_header_type_1(void); -void dissect_mac_header_type_1_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - static gint proto_mac_header_type_1_decoder = -1; static gint ett_mac_header_type_1_decoder = -1; static gint hf_mac_header_type_1_value_bytes = -1; @@ -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 <glib.h> #include <epan/packet.h> extern gint proto_mac_header_generic_decoder; -/* forward reference */ -void proto_register_mac_header_type_2(void); -void dissect_mac_header_type_2_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - static gint proto_mac_header_type_2_decoder = -1; static gint ett_mac_header_type_2_decoder = -1; static gint hf_mac_header_type_2_value_bytes = -1; -/* Setup protocol subtree array */ -static gint *ett[] = -{ - &ett_mac_header_type_2_decoder, -}; - #define WIMAX_MAC_HEADER_SIZE 6 /* WiMax MAC Header Type II Feedback Types */ @@ -393,6 +381,424 @@ static const value_string ai_msgs[] = { 0, NULL} }; + +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) + { + case CQI_MIMO_FB: + /* Decode and display the CQI and MIMO feedback */ + /* CQI feedback type */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cqi_fb_type, tvb, offset, 2, FALSE); + /* CQI payload */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cqi_payload, tvb, offset, 2, FALSE); + /* reserved */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cqi_rsv, tvb, offset, 2, FALSE); + /* check the CII field */ + if(cii_bit) + { /* with CID */ + /* CID */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); + } + else + { /* without CID */ + /* reserved */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); + } + break; + case DL_AVG_CINR: + /* Decode and display the DL average CINR feedback */ + /* DL average CINR payload */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_dl_ave_cinr, tvb, offset, 2, FALSE); + /* reserved */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_dl_ave_rsv, tvb, offset, 2, FALSE); + /* check the CII field */ + if(cii_bit) + { /* with CID */ + /* CID */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); + } + else + { /* without CID */ + /* reserved */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); + } + break; + case MIMO_COEF_FB: + /* Decode and display the MIMO coefficients feedback */ + /* number of index */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_coef_ni, tvb, offset, 2, FALSE); + /* occurrences of antenna index */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_coef_ai, tvb, offset, 2, FALSE); + /* MIMO coefficients */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_coef, tvb, offset, 2, FALSE); + /* reserved */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_coef_rsv, tvb, offset, 2, FALSE); + /* check the CII field */ + if(cii_bit) + { /* with CID */ + /* Decode and display the CID */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); + } + else + { /* without CID */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); + } + break; + case PREF_DL_CHAN_DIUC_FB: + /* Decode and display the Preffed DL Channel DIUC feedback */ + /* Preferred DIUC */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_dl_chan_diuc, tvb, offset, 2, FALSE); + /* DCD Change Count */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_dl_chan_dcd, tvb, offset, 2, FALSE); + /* reserved */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_dl_chan_rsv, tvb, offset, 2, FALSE); + /* check the CII field */ + if(cii_bit) + { /* with CID */ + /* CID */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); + } + else + { /* without CID */ + /* reserved */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); + } + break; + case UL_TX_PWR: + /* Decode and display the UL TX Power feedback */ + /* UL TX Power */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_ul_tx_pwr, tvb, offset, 2, FALSE); + /* reserved */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_ul_tx_pwr_rsv, tvb, offset, 2, FALSE); + /* check the CII field */ + if(cii_bit) + { /* with CID */ + /* CID */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); + } + else + { /* without CID */ + /* reserved */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); + } + break; + case PHY_CHAN_FB: + /* Decode and display the PHY Channel feedback */ + /* Preffed DIUC */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_phy_diuc, tvb, offset, 2, FALSE); + /* UL TX Power */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_phy_ul_tx_pwr, tvb, offset, 2, FALSE); + /* UL Headroom */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_phy_ul_hdrm, tvb, offset, 2, FALSE); + /* reserved */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_phy_rsv, tvb, offset, 2, FALSE); + /* check the CII field */ + if(cii_bit) + { /* with CID */ + /* CID */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); + } + else + { /* without CID */ + /* reserved */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); + } + break; + case AMC_BAND_BITMAP: + /* Decode and display the AMC Band CQIs feedback */ + /* AMC Band Indication Bitmap */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_amc_bitmap, tvb, offset, 2, FALSE); + /* AMC CQI 1 */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_amc_cqi_1, tvb, offset, 2, FALSE); + /* AMC CQI 2 */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_amc_cqi_2, tvb, offset, 2, FALSE); + /* AMC CQI 3 */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_amc_cqi_3, tvb, offset, 2, FALSE); + /* AMC CQI 4 */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_amc_cqi_4, tvb, offset, 2, FALSE); +#if 0 + /* check the CII field */ + if(cii_bit) + { /* with CID */ + /* CID */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); + } + else + { /* without CID */ + /* reserved */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); + } +#endif + break; + case SHORT_PRECODE_FB: + /* Decode and display the Life Span of Short-term precoding feedback */ + /* Life Span */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_life_span, tvb, offset, 2, FALSE); + /* reserved */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_life_span_rsv, tvb, offset, 2, FALSE); + /* check the CII field */ + if(cii_bit) + { /* with CID */ + /* CID */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); + } + else + { /* without CID */ + /* reserved */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); + } + break; + case MULTI_TYPES_FB: + /* Decode and display the Multi types of feedback */ + /* Number of feedback types */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_mt_num_fb_types, tvb, offset, 4, FALSE); + /* Occurrences of feedback type */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_mt_occu_fb_type, tvb, offset, 4, FALSE); + /* feedback contents */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_mt_fb_contents, tvb, offset, 4, FALSE); +#if 0 + /* check the CII field */ + if(cii_bit) + { /* with CID */ + /* CID */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); + } + else + { /* without CID */ + /* reserved */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); + } +#endif + break; + case LONG_PRECODE_FB: + /* Decode and display the Long-term precoding feedback */ + /* Feedback of index */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_lt_id_fb, tvb, offset, 2, FALSE); + /* rank of prrecoding codebook */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_lt_rank, tvb, offset, 2, FALSE); + /* EFC and QAM feedback */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_lt_fec_qam, tvb, offset, 2, FALSE); + /* reserved */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_lt_rsv, tvb, offset, 2, FALSE); + /* check the CII field */ + if(cii_bit) + { /* with CID */ + /* CID */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); + } + else + { /* without CID */ + /* reserved */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); + } + break; + case COMB_DL_AVG_CINR: + /* Decode and display the Combined DL Average CINR feedback */ + /* Combined DL average CINR of Active BSs */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_comb_dl_ave, tvb, offset, 2, FALSE); + /* reserved */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_comb_dl_rsv, tvb, offset, 2, FALSE); + /* check the CII field */ + if(cii_bit) + { /* with CID */ + /* CID */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); + } + else + { /* without CID */ + /* reserved */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); + } + break; + case MIMO_CHAN_FB: + /* Decode and display the second byte of the header */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_diuc, tvb, (offset+1), 1, FALSE); + proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_pbwi, tvb, (offset+1), 1, FALSE); + /* Decode and display the 3rd to 5th bytes of the header */ + /* Decode and display the SLPB */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_slpb, tvb, offset, 3, FALSE); + /* check the CII field */ + if(cii_bit) + { /* with CID */ + /* Decode and display the BPRI */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_bpri_cid, tvb, offset, 3, FALSE); + /* Decode and display the CID */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_cid, tvb, offset, 3, FALSE); + } + else + { /* without CID */ + /* Decode and display the BPRI */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_bpri, tvb, offset, 3, FALSE); + /* Decode and display the CTI */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_cti, tvb, offset, 3, FALSE); + /* Decode and display the AI */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_ai_0, tvb, offset, 3, FALSE); + proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_ai_1, tvb, offset, 3, FALSE); + proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_ai_2, tvb, offset, 3, FALSE); + proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_ai_3, tvb, offset, 3, FALSE); + /* Decode and display the MI */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_mi, tvb, offset, 3, FALSE); + /* Decode and display the CT */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_ct, tvb, offset, 3, FALSE); + /* Decode and display the CQI */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_cqi, tvb, offset, 3, FALSE); + } + break; + case CINR_FB: + /* Decode and display the CINRC feedback */ + /* CINR Mean */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cinr_mean, tvb, offset, 2, FALSE); + /* CINR Standard Deviation */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cinr_devi, tvb, offset, 2, FALSE); + /* check the CII field */ + if(cii_bit) + { /* with CID */ + /* Decode and display the CID */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); + } + else + { /* without CID */ + /* reserved */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); + } + break; + case CL_MIMO_FB: + /* Get the MIMO type */ + mimo_type = ((tvb_get_guint8(tvb, offset) & 0xC0) >> 6); + /* Decode and display the MIMO type */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_type, tvb, offset, 2, FALSE); + if(mimo_type == 1) + { + /* Decode and display the umber of streams */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_streams, tvb, offset, 2, FALSE); + /* Decode and display the antenna selection option index */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_ant_sel, tvb, offset, 2, FALSE); + /* Decode and display the average CQI */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_cqi_1, tvb, offset, 2, FALSE); + /* reserved */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_rsv_1, tvb, offset, 2, FALSE); + } + else if(mimo_type == 2) + { + /* Decode and display the umber of streams */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_streams, tvb, offset, 2, FALSE); + /* Decode and display the antenna selection option index */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_codebook_id, tvb, offset, 2, FALSE); + /* Decode and display the average CQI */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_cqi_2, tvb, offset, 2, FALSE); + /* reserved */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_rsv_2, tvb, offset, 2, FALSE); + } + else + { + /* Decode and display the antenna grouping index */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_ant_id, tvb, offset, 2, FALSE); + /* Decode and display the average CQI */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_cqi, tvb, offset, 2, FALSE); + /* reserved */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_rsv, tvb, offset, 2, FALSE); + } + /* check the CII field */ + if(cii_bit) + { /* with CID */ + /* Decode and display the CID */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); + } + else + { /* without CID */ + /* reserved */ + proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); + } + break; + 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 + { + /* 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) { @@ -960,430 +1366,16 @@ void proto_register_mac_header_type_2(void) } }; - 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); -} + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_mac_header_type_2_decoder, + }; + proto_mac_header_type_2_decoder = proto_mac_header_generic_decoder; -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; + proto_register_field_array(proto_mac_header_type_2_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 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) - { - case CQI_MIMO_FB: - /* Decode and display the CQI and MIMO feedback */ - /* CQI feedback type */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cqi_fb_type, tvb, offset, 2, FALSE); - /* CQI payload */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cqi_payload, tvb, offset, 2, FALSE); - /* reserved */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cqi_rsv, tvb, offset, 2, FALSE); - /* check the CII field */ - if(cii_bit) - { /* with CID */ - /* CID */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); - } - else - { /* without CID */ - /* reserved */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); - } - break; - case DL_AVG_CINR: - /* Decode and display the DL average CINR feedback */ - /* DL average CINR payload */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_dl_ave_cinr, tvb, offset, 2, FALSE); - /* reserved */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_dl_ave_rsv, tvb, offset, 2, FALSE); - /* check the CII field */ - if(cii_bit) - { /* with CID */ - /* CID */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); - } - else - { /* without CID */ - /* reserved */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); - } - break; - case MIMO_COEF_FB: - /* Decode and display the MIMO coefficients feedback */ - /* number of index */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_coef_ni, tvb, offset, 2, FALSE); - /* occurrences of antenna index */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_coef_ai, tvb, offset, 2, FALSE); - /* MIMO coefficients */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_coef, tvb, offset, 2, FALSE); - /* reserved */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_coef_rsv, tvb, offset, 2, FALSE); - /* check the CII field */ - if(cii_bit) - { /* with CID */ - /* Decode and display the CID */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); - } - else - { /* without CID */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); - } - break; - case PREF_DL_CHAN_DIUC_FB: - /* Decode and display the Preffed DL Channel DIUC feedback */ - /* Preferred DIUC */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_dl_chan_diuc, tvb, offset, 2, FALSE); - /* DCD Change Count */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_dl_chan_dcd, tvb, offset, 2, FALSE); - /* reserved */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_dl_chan_rsv, tvb, offset, 2, FALSE); - /* check the CII field */ - if(cii_bit) - { /* with CID */ - /* CID */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); - } - else - { /* without CID */ - /* reserved */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); - } - break; - case UL_TX_PWR: - /* Decode and display the UL TX Power feedback */ - /* UL TX Power */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_ul_tx_pwr, tvb, offset, 2, FALSE); - /* reserved */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_ul_tx_pwr_rsv, tvb, offset, 2, FALSE); - /* check the CII field */ - if(cii_bit) - { /* with CID */ - /* CID */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); - } - else - { /* without CID */ - /* reserved */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); - } - break; - case PHY_CHAN_FB: - /* Decode and display the PHY Channel feedback */ - /* Preffed DIUC */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_phy_diuc, tvb, offset, 2, FALSE); - /* UL TX Power */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_phy_ul_tx_pwr, tvb, offset, 2, FALSE); - /* UL Headroom */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_phy_ul_hdrm, tvb, offset, 2, FALSE); - /* reserved */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_phy_rsv, tvb, offset, 2, FALSE); - /* check the CII field */ - if(cii_bit) - { /* with CID */ - /* CID */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); - } - else - { /* without CID */ - /* reserved */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); - } - break; - case AMC_BAND_BITMAP: - /* Decode and display the AMC Band CQIs feedback */ - /* AMC Band Indication Bitmap */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_amc_bitmap, tvb, offset, 2, FALSE); - /* AMC CQI 1 */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_amc_cqi_1, tvb, offset, 2, FALSE); - /* AMC CQI 2 */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_amc_cqi_2, tvb, offset, 2, FALSE); - /* AMC CQI 3 */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_amc_cqi_3, tvb, offset, 2, FALSE); - /* AMC CQI 4 */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_amc_cqi_4, tvb, offset, 2, FALSE); -#if 0 - /* check the CII field */ - if(cii_bit) - { /* with CID */ - /* CID */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); - } - else - { /* without CID */ - /* reserved */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); - } -#endif - break; - case SHORT_PRECODE_FB: - /* Decode and display the Life Span of Short-term precoding feedback */ - /* Life Span */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_life_span, tvb, offset, 2, FALSE); - /* reserved */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_life_span_rsv, tvb, offset, 2, FALSE); - /* check the CII field */ - if(cii_bit) - { /* with CID */ - /* CID */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); - } - else - { /* without CID */ - /* reserved */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); - } - break; - case MULTI_TYPES_FB: - /* Decode and display the Multi types of feedback */ - /* Number of feedback types */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_mt_num_fb_types, tvb, offset, 4, FALSE); - /* Occurrences of feedback type */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_mt_occu_fb_type, tvb, offset, 4, FALSE); - /* feedback contents */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_mt_fb_contents, tvb, offset, 4, FALSE); -#if 0 - /* check the CII field */ - if(cii_bit) - { /* with CID */ - /* CID */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); - } - else - { /* without CID */ - /* reserved */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); - } -#endif - break; - case LONG_PRECODE_FB: - /* Decode and display the Long-term precoding feedback */ - /* Feedback of index */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_lt_id_fb, tvb, offset, 2, FALSE); - /* rank of prrecoding codebook */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_lt_rank, tvb, offset, 2, FALSE); - /* EFC and QAM feedback */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_lt_fec_qam, tvb, offset, 2, FALSE); - /* reserved */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_lt_rsv, tvb, offset, 2, FALSE); - /* check the CII field */ - if(cii_bit) - { /* with CID */ - /* CID */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); - } - else - { /* without CID */ - /* reserved */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); - } - break; - case COMB_DL_AVG_CINR: - /* Decode and display the Combined DL Average CINR feedback */ - /* Combined DL average CINR of Active BSs */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_comb_dl_ave, tvb, offset, 2, FALSE); - /* reserved */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_comb_dl_rsv, tvb, offset, 2, FALSE); - /* check the CII field */ - if(cii_bit) - { /* with CID */ - /* CID */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); - } - else - { /* without CID */ - /* reserved */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); - } - break; - case MIMO_CHAN_FB: - /* Decode and display the second byte of the header */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_diuc, tvb, (offset+1), 1, FALSE); - proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_pbwi, tvb, (offset+1), 1, FALSE); - /* Decode and display the 3rd to 5th bytes of the header */ - /* Decode and display the SLPB */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_slpb, tvb, offset, 3, FALSE); - /* check the CII field */ - if(cii_bit) - { /* with CID */ - /* Decode and display the BPRI */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_bpri_cid, tvb, offset, 3, FALSE); - /* Decode and display the CID */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_cid, tvb, offset, 3, FALSE); - } - else - { /* without CID */ - /* Decode and display the BPRI */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_bpri, tvb, offset, 3, FALSE); - /* Decode and display the CTI */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_cti, tvb, offset, 3, FALSE); - /* Decode and display the AI */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_ai_0, tvb, offset, 3, FALSE); - proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_ai_1, tvb, offset, 3, FALSE); - proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_ai_2, tvb, offset, 3, FALSE); - proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_ai_3, tvb, offset, 3, FALSE); - /* Decode and display the MI */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_mi, tvb, offset, 3, FALSE); - /* Decode and display the CT */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_ct, tvb, offset, 3, FALSE); - /* Decode and display the CQI */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_cqi, tvb, offset, 3, FALSE); - } - break; - case CINR_FB: - /* Decode and display the CINRC feedback */ - /* CINR Mean */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cinr_mean, tvb, offset, 2, FALSE); - /* CINR Standard Deviation */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cinr_devi, tvb, offset, 2, FALSE); - /* check the CII field */ - if(cii_bit) - { /* with CID */ - /* Decode and display the CID */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); - } - else - { /* without CID */ - /* reserved */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); - } - break; - case CL_MIMO_FB: - /* Get the MIMO type */ - mimo_type = ((tvb_get_guint8(tvb, offset) & 0xC0) >> 6); - /* Decode and display the MIMO type */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_type, tvb, offset, 2, FALSE); - if(mimo_type == 1) - { - /* Decode and display the umber of streams */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_streams, tvb, offset, 2, FALSE); - /* Decode and display the antenna selection option index */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_ant_sel, tvb, offset, 2, FALSE); - /* Decode and display the average CQI */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_cqi_1, tvb, offset, 2, FALSE); - /* reserved */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_rsv_1, tvb, offset, 2, FALSE); - } - else if(mimo_type == 2) - { - /* Decode and display the umber of streams */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_streams, tvb, offset, 2, FALSE); - /* Decode and display the antenna selection option index */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_codebook_id, tvb, offset, 2, FALSE); - /* Decode and display the average CQI */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_cqi_2, tvb, offset, 2, FALSE); - /* reserved */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_rsv_2, tvb, offset, 2, FALSE); - } - else - { - /* Decode and display the antenna grouping index */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_ant_id, tvb, offset, 2, FALSE); - /* Decode and display the average CQI */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_cqi, tvb, offset, 2, FALSE); - /* reserved */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_rsv, tvb, offset, 2, FALSE); - } - /* check the CII field */ - if(cii_bit) - { /* with CID */ - /* Decode and display the CID */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_cid, tvb, (offset+2), 2, FALSE); - } - else - { /* without CID */ - /* reserved */ - proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, FALSE); - } - break; - 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 - { - /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Error - Undefined Type"); - } - } - } + 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 <glib.h> #include <epan/packet.h> #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 <epan/packet.h> #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 <glib.h> #include <epan/packet.h> #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,6 +329,462 @@ static const value_string tfs_support[] = {0, NULL} }; + +/* 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; + } +#endif + case DCD_H_ARQ_ACK_DELAY: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_h_arq_ack_delay, tvb, offset, tlv_len, FALSE); + tlv_item = proto_tree_add_item(tlv_tree, hf_dcd_h_arq_ack_delay, tvb, offset, tlv_len, FALSE); + proto_item_append_text(tlv_item, " frame offset"); + break; + } + case DCD_MAC_VERSION: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_mac_version, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_mac_version, tvb, offset, tlv_len, FALSE); + break; + } + case DCD_TLV_T_19_PERMUTATION_TYPE_FOR_BROADCAST_REGION_IN_HARQ_ZONE: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_19_permutation_type_for_broadcast_regions_in_harq_zone, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_19_permutation_type_for_broadcast_regions_in_harq_zone, tvb, offset, tlv_len, FALSE); + break; + } + case DCD_TLV_T_20_MAXIMUM_RETRANSMISSION: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_20_maximum_retransmission, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_20_maximum_retransmission, tvb, offset, tlv_len, FALSE); + break; + } + case DCD_TLV_T_21_DEFAULT_RSSI_AND_CINR_AVERAGING_PARAMETER: + { + tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, proto_mac_mgmt_msg_dcd_decoder, tvb, offset, 1, "Default RSSI and CINR averaging parameter (%u byte(s))", tlv_len); + proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter_physical_cinr_measurements, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter_rssi_measurements, tvb, offset, 1, FALSE); + break; + } + case DCD_TLV_T_22_DL_AMC_ALLOCATED_PHYSICAL_BANDS_BITMAP: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_22_dl_amc_allocated_physical_bands_bitmap, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_22_dl_amc_allocated_physical_bands_bitmap, tvb, offset, tlv_len, FALSE); + break; + } + case DCD_TLV_T_34_DL_REGION_DEFINITION: + { + 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, "DL region definition (%u byte(s))", tlv_len); + proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_34_dl_region_definition, tvb, offset, tlv_len, FALSE); + dl_num_regions = tvb_get_guint8(tvb, offset); + proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_34_dl_region_definition_num_region, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_34_dl_region_definition_reserved, tvb, offset, 1, FALSE); + tlv_offset = offset; + for(length = 0; length < dl_num_regions; length++) + { + proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_34_dl_region_definition_symbol_offset, tvb, tlv_offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_34_dl_region_definition_subchannel_offset, tvb, (tlv_offset+1), 1, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_34_dl_region_definition_num_symbols, tvb, (tlv_offset+2), 1, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_34_dl_region_definition_num_subchannels, tvb, (tlv_offset+3), 1, FALSE); + tlv_offset += 4; + } + break; + } + case DCD_TLV_T_50_HO_TYPE_SUPPORT: + { + 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, "HO type support (%u byte(s))", tlv_len); + proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_50_ho_type_support, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_50_ho_type_support_ho, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_50_ho_type_support_mdho, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_50_ho_type_support_fbss_ho, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_50_ho_type_support_reserved, tvb, offset, 1, FALSE); + break; + } + case DCD_TLV_T_31_H_ADD_THRESHOLD: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_31_h_add_threshold, tvb, offset, 1, FALSE); + tlv_item = proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_31_h_add_threshold, tvb, offset, tlv_len, FALSE); + proto_item_append_text(tlv_item, " dB"); + break; + } + case DCD_TLV_T_32_H_DELETE_THRESHOLD: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_32_h_delete_threshold, tvb, offset, tlv_len, FALSE); + tlv_item = proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_32_h_delete_threshold, tvb, offset, tlv_len, FALSE); + proto_item_append_text(tlv_item, " dB"); + break; + } + case DCD_TLV_T_33_ASR: + { + 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, "ASR Slot Length (M) and Switching Period (L) (%u byte(s))", tlv_len); + proto_tree_add_item(dcd_tree, hf_dcd_tlv_t_33_asr, tvb, offset, 1, FALSE); + tlv_item = proto_tree_add_item(dcd_tree, hf_dcd_tlv_t_33_asr_m, tvb, offset, 1, FALSE); + proto_item_append_text(tlv_item, " frames"); + tlv_item = proto_tree_add_item(dcd_tree, hf_dcd_tlv_t_33_asr_l, tvb, offset, 1, FALSE); + proto_item_append_text(tlv_item, " frames"); + break; + } + case DCD_TLV_T_35_PAGING_GROUP_ID: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_35_paging_group_id, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_35_paging_group_id, tvb, offset, tlv_len, FALSE); + break; + } + case DCD_TLV_T_36_TUSC1_PERMUTATION_ACTIVE_SUBCHANNELS_BITMAP: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_36_tusc1_permutation_active_subchannels_bitmap, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_36_tusc1_permutation_active_subchannels_bitmap, tvb, offset, tlv_len, FALSE); + break; + } + case DCD_TLV_T_37_TUSC2_PERMUTATION_ACTIVE_SUBCHANNELS_BITMAP: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_37_tusc2_permutation_active_subchannels_bitmap, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_37_tusc2_permutation_active_subchannels_bitmap, tvb, offset, tlv_len, FALSE); + break; + } + case DCD_TLV_T_51_HYSTERSIS_MARGIN: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_51_hysteresis_margin, tvb, offset, tlv_len, FALSE); + tlv_item = proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_51_hysteresis_margin, tvb, offset, tlv_len, FALSE); + proto_item_append_text(tlv_item, " dB"); + break; + } + case DCD_TLV_T_52_TIME_TO_TRIGGER_DURATION: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_52_time_to_trigger_duration, tvb, offset, tlv_len, FALSE); + tlv_item = proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_52_time_to_trigger_duration, tvb, offset, tlv_len, FALSE); + proto_item_append_text(tlv_item, " ms"); + break; + } + case DCD_TLV_T_54_TRIGGER: + { /* Trigger TLV (table 358a & 358b) */ + /* 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, "DCD Trigger (%u bytes)", tlv_len); + 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, "Trigger 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); + /* table 358a */ + switch (tlv_type) + { + case DCD_TLV_T_541_TYPE_FUNCTION_ACTION: + { /* table 358b */ + sub_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, tlv_tree, proto_mac_mgmt_msg_dcd_decoder, tvb, (offset + tlv_offset), length, "Trigger; Type/function/action description (%u byte(s))", tlv_len); + proto_tree_add_item(sub_tree, hf_dcd_tlv_t_541_type, tvb, (offset + tlv_offset), 1, FALSE); + proto_tree_add_item(sub_tree, hf_dcd_tlv_t_541_function, tvb, (offset + tlv_offset), 1, FALSE); + proto_tree_add_item(sub_tree, hf_dcd_tlv_t_541_action, tvb, (offset + tlv_offset), 1, FALSE); + } + break; + case DCD_TLV_T542_TRIGGER_VALUE: + sub_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, tlv_tree, hf_dcd_tlv_t_542_trigger_value, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(sub_tree, hf_dcd_tlv_t_542_trigger_value, tvb, (offset + tlv_offset), length, FALSE); + break; + case DCD_TLV_T_543_TRIGGER_AVERAGING_DURATION: + sub_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, tlv_tree, hf_dcd_tlv_t_543_trigger_averaging_duration, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(sub_tree, hf_dcd_tlv_t_543_trigger_averaging_duration, tvb, (offset + tlv_offset), length, FALSE); + break; + } + tlv_offset += length; + } + break; + } + case DCD_TLV_T_60_NOISE_AND_INTERFERENCE: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_60_noise_interference, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_60_noise_interference, tvb, offset, tlv_len, FALSE); + break; + } + case DCD_TLV_T_153_DOWNLINK_BURST_PROFILE_FOR_MULTIPLE_FEC_TYPES: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_153_downlink_burst_profile_for_mutiple_fec_types, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_153_downlink_burst_profile_for_mutiple_fec_types, tvb, offset, tlv_len, FALSE); + break; + } + case DCD_RESTART_COUNT: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_restart_count, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_restart_count, tvb, offset, tlv_len, FALSE); + break; + } + case DCD_TLV_T_45_PAGING_INTERVAL_LENGTH: + { + if (include_cor2_changes) { + 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, "Reserved (%u byte(s))", tlv_len); + proto_tree_add_text(tlv_tree, tvb, offset, tlv_len, "Reserved"); + } else { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_45_paging_interval_length, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_45_paging_interval_length, tvb, offset, tlv_len, FALSE); + } + break; + } + default: + { + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_unknown_type, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_dcd_unknown_type, tvb, offset, tlv_len, FALSE); + break; + } + } + offset += tlv_len; + } /* end of TLV process while loop */ + } +} + /* Register Wimax Mac Payload Protocol and Dissector */ void proto_register_mac_mgmt_msg_dcd(void) { @@ -848,470 +1292,18 @@ void proto_register_mac_mgmt_msg_dcd(void) } }; - 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; + /* Setup protocol subtree array */ + static gint *ett[] = + { + &ett_mac_mgmt_msg_dcd_decoder, + }; - /* Ensure the right payload type */ - payload_type = tvb_get_guint8(tvb, offset); - if(payload_type != MAC_MGMT_MSG_DCD) - { - return; - } + proto_mac_mgmt_msg_dcd_decoder = proto_register_protocol ( + "WiMax DCD/UCD Messages", /* name */ + "WiMax DCD/UCD (cd)", /* short name */ + "wmx.cd" /* abbrev */ + ); - 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; - } -#endif - case DCD_H_ARQ_ACK_DELAY: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_h_arq_ack_delay, tvb, offset, tlv_len, FALSE); - tlv_item = proto_tree_add_item(tlv_tree, hf_dcd_h_arq_ack_delay, tvb, offset, tlv_len, FALSE); - proto_item_append_text(tlv_item, " frame offset"); - break; - } - case DCD_MAC_VERSION: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_mac_version, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_mac_version, tvb, offset, tlv_len, FALSE); - break; - } - case DCD_TLV_T_19_PERMUTATION_TYPE_FOR_BROADCAST_REGION_IN_HARQ_ZONE: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_19_permutation_type_for_broadcast_regions_in_harq_zone, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_19_permutation_type_for_broadcast_regions_in_harq_zone, tvb, offset, tlv_len, FALSE); - break; - } - case DCD_TLV_T_20_MAXIMUM_RETRANSMISSION: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_20_maximum_retransmission, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_20_maximum_retransmission, tvb, offset, tlv_len, FALSE); - break; - } - case DCD_TLV_T_21_DEFAULT_RSSI_AND_CINR_AVERAGING_PARAMETER: - { - tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, proto_mac_mgmt_msg_dcd_decoder, tvb, offset, 1, "Default RSSI and CINR averaging parameter (%u byte(s))", tlv_len); - proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter_physical_cinr_measurements, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter_rssi_measurements, tvb, offset, 1, FALSE); - break; - } - case DCD_TLV_T_22_DL_AMC_ALLOCATED_PHYSICAL_BANDS_BITMAP: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_22_dl_amc_allocated_physical_bands_bitmap, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_22_dl_amc_allocated_physical_bands_bitmap, tvb, offset, tlv_len, FALSE); - break; - } - case DCD_TLV_T_34_DL_REGION_DEFINITION: - { - 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, "DL region definition (%u byte(s))", tlv_len); - proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_34_dl_region_definition, tvb, offset, tlv_len, FALSE); - dl_num_regions = tvb_get_guint8(tvb, offset); - proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_34_dl_region_definition_num_region, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_34_dl_region_definition_reserved, tvb, offset, 1, FALSE); - tlv_offset = offset; - for(length = 0; length < dl_num_regions; length++) - { - proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_34_dl_region_definition_symbol_offset, tvb, tlv_offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_34_dl_region_definition_subchannel_offset, tvb, (tlv_offset+1), 1, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_34_dl_region_definition_num_symbols, tvb, (tlv_offset+2), 1, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_34_dl_region_definition_num_subchannels, tvb, (tlv_offset+3), 1, FALSE); - tlv_offset += 4; - } - break; - } - case DCD_TLV_T_50_HO_TYPE_SUPPORT: - { - 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, "HO type support (%u byte(s))", tlv_len); - proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_50_ho_type_support, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_50_ho_type_support_ho, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_50_ho_type_support_mdho, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_50_ho_type_support_fbss_ho, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_50_ho_type_support_reserved, tvb, offset, 1, FALSE); - break; - } - case DCD_TLV_T_31_H_ADD_THRESHOLD: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_31_h_add_threshold, tvb, offset, 1, FALSE); - tlv_item = proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_31_h_add_threshold, tvb, offset, tlv_len, FALSE); - proto_item_append_text(tlv_item, " dB"); - break; - } - case DCD_TLV_T_32_H_DELETE_THRESHOLD: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_32_h_delete_threshold, tvb, offset, tlv_len, FALSE); - tlv_item = proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_32_h_delete_threshold, tvb, offset, tlv_len, FALSE); - proto_item_append_text(tlv_item, " dB"); - break; - } - case DCD_TLV_T_33_ASR: - { - 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, "ASR Slot Length (M) and Switching Period (L) (%u byte(s))", tlv_len); - proto_tree_add_item(dcd_tree, hf_dcd_tlv_t_33_asr, tvb, offset, 1, FALSE); - tlv_item = proto_tree_add_item(dcd_tree, hf_dcd_tlv_t_33_asr_m, tvb, offset, 1, FALSE); - proto_item_append_text(tlv_item, " frames"); - tlv_item = proto_tree_add_item(dcd_tree, hf_dcd_tlv_t_33_asr_l, tvb, offset, 1, FALSE); - proto_item_append_text(tlv_item, " frames"); - break; - } - case DCD_TLV_T_35_PAGING_GROUP_ID: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_35_paging_group_id, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_35_paging_group_id, tvb, offset, tlv_len, FALSE); - break; - } - case DCD_TLV_T_36_TUSC1_PERMUTATION_ACTIVE_SUBCHANNELS_BITMAP: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_36_tusc1_permutation_active_subchannels_bitmap, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_36_tusc1_permutation_active_subchannels_bitmap, tvb, offset, tlv_len, FALSE); - break; - } - case DCD_TLV_T_37_TUSC2_PERMUTATION_ACTIVE_SUBCHANNELS_BITMAP: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_37_tusc2_permutation_active_subchannels_bitmap, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_37_tusc2_permutation_active_subchannels_bitmap, tvb, offset, tlv_len, FALSE); - break; - } - case DCD_TLV_T_51_HYSTERSIS_MARGIN: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_51_hysteresis_margin, tvb, offset, tlv_len, FALSE); - tlv_item = proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_51_hysteresis_margin, tvb, offset, tlv_len, FALSE); - proto_item_append_text(tlv_item, " dB"); - break; - } - case DCD_TLV_T_52_TIME_TO_TRIGGER_DURATION: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_52_time_to_trigger_duration, tvb, offset, tlv_len, FALSE); - tlv_item = proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_52_time_to_trigger_duration, tvb, offset, tlv_len, FALSE); - proto_item_append_text(tlv_item, " ms"); - break; - } - case DCD_TLV_T_54_TRIGGER: - { /* Trigger TLV (table 358a & 358b) */ - /* 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, "DCD Trigger (%u bytes)", tlv_len); - 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, "Trigger 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); - /* table 358a */ - switch (tlv_type) - { - case DCD_TLV_T_541_TYPE_FUNCTION_ACTION: - { /* table 358b */ - sub_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, tlv_tree, proto_mac_mgmt_msg_dcd_decoder, tvb, (offset + tlv_offset), length, "Trigger; Type/function/action description (%u byte(s))", tlv_len); - proto_tree_add_item(sub_tree, hf_dcd_tlv_t_541_type, tvb, (offset + tlv_offset), 1, FALSE); - proto_tree_add_item(sub_tree, hf_dcd_tlv_t_541_function, tvb, (offset + tlv_offset), 1, FALSE); - proto_tree_add_item(sub_tree, hf_dcd_tlv_t_541_action, tvb, (offset + tlv_offset), 1, FALSE); - } - break; - case DCD_TLV_T542_TRIGGER_VALUE: - sub_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, tlv_tree, hf_dcd_tlv_t_542_trigger_value, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(sub_tree, hf_dcd_tlv_t_542_trigger_value, tvb, (offset + tlv_offset), length, FALSE); - break; - case DCD_TLV_T_543_TRIGGER_AVERAGING_DURATION: - sub_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, tlv_tree, hf_dcd_tlv_t_543_trigger_averaging_duration, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(sub_tree, hf_dcd_tlv_t_543_trigger_averaging_duration, tvb, (offset + tlv_offset), length, FALSE); - break; - } - tlv_offset += length; - } - break; - } - case DCD_TLV_T_60_NOISE_AND_INTERFERENCE: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_60_noise_interference, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_60_noise_interference, tvb, offset, tlv_len, FALSE); - break; - } - case DCD_TLV_T_153_DOWNLINK_BURST_PROFILE_FOR_MULTIPLE_FEC_TYPES: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_153_downlink_burst_profile_for_mutiple_fec_types, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_153_downlink_burst_profile_for_mutiple_fec_types, tvb, offset, tlv_len, FALSE); - break; - } - case DCD_RESTART_COUNT: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_restart_count, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_restart_count, tvb, offset, tlv_len, FALSE); - break; - } - case DCD_TLV_T_45_PAGING_INTERVAL_LENGTH: - { - if (include_cor2_changes) { - 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, "Reserved (%u byte(s))", tlv_len); - proto_tree_add_text(tlv_tree, tvb, offset, tlv_len, "Reserved"); - } else { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_tlv_t_45_paging_interval_length, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_45_paging_interval_length, tvb, offset, tlv_len, FALSE); - } - break; - } - default: - { - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, hf_dcd_unknown_type, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_dcd_unknown_type, tvb, offset, tlv_len, FALSE); - break; - } - } - offset += tlv_len; - } /* end of TLV process while loop */ - } + 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 <glib.h> #include <epan/packet.h> #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,372 +1788,6 @@ 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) { @@ -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 <epan/packet.h> #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 <glib.h> #include <epan/packet.h> #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 <glib.h> #include <epan/packet.h> #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 <glib.h> #include <epan/packet.h> #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 <glib.h> #include <epan/packet.h> #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 <glib.h> #include <epan/packet.h> #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 <glib.h> #include <epan/packet.h> #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,6 +255,638 @@ 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 + +/* 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) + { + case REP_RSP_REPORT_TYPE: + /* decode and display the Report type */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, rep_tree, hf_rep_rsp_report_type, 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-RSP report subtype TLV error"); + } + proto_tree_add_item(tlv_tree, hf_rep_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 REP_RSP_REPORT_CHANNEL_NUMBER: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_report_type_channel_number, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_channel_number, tvb, (offset + tlv_offset), length, FALSE); + break; + case REP_RSP_REPORT_START_FRAME: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_report_type_frame_number, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_frame_number, tvb, (offset + tlv_offset), length, FALSE); + break; + case REP_RSP_REPORT_DURATION: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_report_type_duration, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_duration, tvb, (offset + tlv_offset), length, FALSE); + break; + case REP_RSP_REPORT_BASIC_REPORT: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_report_type_basic_report, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_basic_report_bit0, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_basic_report_bit1, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_basic_report_bit2, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_basic_report_bit3, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_basic_report_reserved, tvb, (offset + tlv_offset), length, FALSE); + break; + case REP_RSP_REPORT_CINR_REPORT: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_report_type_cinr_report, tvb, (offset + tlv_offset), length, FALSE); + ti = proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_cinr_report_mean, tvb, (offset + tlv_offset), 1, FALSE); + db_val = tvb_get_guint8(tvb, offset + tlv_offset) - 20; + if (db_val > 37) + db_val = 37; + proto_item_append_text(ti, " (%d dBm)", db_val); + ti = proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_cinr_report_deviation, tvb, (offset + tlv_offset +1), 1, FALSE); + db_val = tvb_get_guint8(tvb, offset + tlv_offset + 1) - 20; + if (db_val > 37) + db_val = 37; + proto_item_append_text(ti, " (%d dBm)", db_val); + break; + case REP_RSP_REPORT_RSSI_REPORT: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_report_type_rssi_report, tvb, (offset + tlv_offset), length, FALSE); + ti = proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_rssi_report_mean, tvb, (offset + tlv_offset), 1, FALSE); + db_val = tvb_get_guint8(tvb, offset + tlv_offset) - 123; + if (db_val > -40) + db_val = -40; + proto_item_append_text(ti, " (%d dBm)", db_val); + ti = proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_rssi_report_deviation, tvb, (offset + tlv_offset +1), 1, FALSE); + db_val = tvb_get_guint8(tvb, offset + tlv_offset + 1) - 123; + if (db_val > -40) + db_val = -40; + proto_item_append_text(ti, " (%d dBm)", db_val); + break; + default: + /* display the unknown tlv in hex */ + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_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; + } + break; + case REP_RSP_CHANNEL_TYPE: + /* decode and display the Channel Type */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, rep_tree, hf_rep_rsp_channel_type_report, 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-RSP channel subtype TLV error"); + } + proto_tree_add_item(tlv_tree, hf_rep_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 REP_RSP_CHANNEL_TYPE_SUBCHANNEL: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_channel_type_subchannel, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_channel_type_subchannel, tvb, (offset + tlv_offset), length, FALSE); + break; + case REP_RSP_CHANNEL_TYPE_BAND_AMC: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_channel_type_band_amc, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_channel_type_band_amc, tvb, (offset + tlv_offset), length, FALSE); + break; + case REP_RSP_CHANNEL_TYPE_SAFETY_CHANNEL: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_channel_type_safety_channel, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_channel_type_safety_channel, tvb, (offset + tlv_offset), length, FALSE); + break; + case REP_RSP_CHANNEL_TYPE_ENHANCED_BAND_AMC: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_channel_type_enhanced_band_amc, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_channel_type_enhanced_band_amc, tvb, (offset + tlv_offset), length, FALSE); + break; + case REP_RSP_CHANNEL_TYPE_SOUNDING: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_channel_type_sounding, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_channel_type_sounding, 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_rsp_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; + } + break; + case REP_RSP_ZONE_SPECIFIC_PHY_CINR: + /* decode and display the zone-specific physical CINR report type */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, rep_tree, hf_rep_rsp_zone_spec_phy_cinr_report, 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-RSP zone-specific phy CINR report subtype TLV error"); + } + proto_tree_add_item(tlv_tree, hf_rep_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 REP_RSP_ZONE_SPECIFIC_PHY_CINR_PUSC_SC0: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_pusc_sc0, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_mean, tvb, (offset + tlv_offset), 1, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_report_type, tvb, (offset + tlv_offset), 1, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved1, tvb, (offset + tlv_offset), 1, FALSE); + if (length == 2) + { + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_deviation, tvb, (offset + tlv_offset + 1), 1, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved2, tvb, (offset + tlv_offset + 1), 1, FALSE); + } + break; + case REP_RSP_ZONE_SPECIFIC_PHY_CINR_PUSC_SC1: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_pusc_sc1, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_mean, tvb, (offset + tlv_offset), 1, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_report_type, tvb, (offset + tlv_offset), 1, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved1, tvb, (offset + tlv_offset), 1, FALSE); + if (length == 2) + { + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_deviation, tvb, (offset + tlv_offset + 1), 1, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved2, tvb, (offset + tlv_offset + 1), 1, FALSE); + } + break; + case REP_RSP_ZONE_SPECIFIC_PHY_CINR_FUSC: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_fusc, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_mean, tvb, (offset + tlv_offset), 1, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_report_type, tvb, (offset + tlv_offset), 1, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved1, tvb, (offset + tlv_offset), 1, FALSE); + if (length == 2) + { + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_deviation, tvb, (offset + tlv_offset + 1), 1, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved2, tvb, (offset + tlv_offset + 1), 1, FALSE); + } + break; + case REP_RSP_ZONE_SPECIFIC_PHY_CINR_OPTIONAL_FUSC: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_optional_fusc, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_mean, tvb, (offset + tlv_offset), 1, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_report_type, tvb, (offset + tlv_offset), 1, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved1, tvb, (offset + tlv_offset), 1, FALSE); + if (length == 2) + { + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_deviation, tvb, (offset + tlv_offset + 1), 1, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved2, tvb, (offset + tlv_offset + 1), 1, FALSE); + } + break; + case REP_RSP_ZONE_SPECIFIC_PHY_CINR_SAFETY_CHANNEL: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_safety_channel, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_safety_channel, tvb, (offset + tlv_offset), length, FALSE); + break; + case REP_RSP_ZONE_SPECIFIC_PHY_CINR_AMC: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_amc, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_mean, tvb, (offset + tlv_offset), 1, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_report_type, tvb, (offset + tlv_offset), 1, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved1, tvb, (offset + tlv_offset), 1, FALSE); + if (length == 2) + { + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_deviation, tvb, (offset + tlv_offset + 1), 1, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved2, tvb, (offset + tlv_offset + 1), 1, FALSE); + } + break; + default: + /* display the unknown tlv in hex */ + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_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; + } + break; + case REP_RSP_PREAMBLE_PHY_CINR: + /* decode and display the preamble physical CINR report type */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, rep_tree, hf_rep_rsp_preamble_phy_cinr_report, 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-RSP preamble physical CINR report subtype TLV error"); + } + proto_tree_add_item(tlv_tree, hf_rep_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 REP_RSP_PREAMBLE_PHY_CINR_CONFIGURATION1: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_preamble_phy_cinr_rep_configuration_1, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_mean, tvb, (offset + tlv_offset), 1, FALSE); + if (length == 2) + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_deviation, tvb, (offset + tlv_offset + 1), 1, FALSE); + break; + case REP_RSP_PREAMBLE_PHY_CINR_CONFIGURATION3: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_preamble_phy_cinr_rep_configuration_3, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_mean, tvb, (offset + tlv_offset), 1, FALSE); + if (length == 2) + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_deviation, tvb, (offset + tlv_offset + 1), 1, FALSE); + break; + case REP_RSP_PREAMBLE_PHY_CINR_BAND_AMC: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_preamble_phy_cinr_rep_band_amc_zone, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_preamble_phy_cinr_rep_band_amc_zone, 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_rsp_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; + } + break; + case REP_RSP_ZONE_SPECIFIC_EFFECTIVE_CINR: + /* decode and display the zone-specific effective CINR report type */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, rep_tree, hf_rep_rsp_zone_spec_effective_cinr_report, 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-RSP zone-specific effective CINR report subtype TLV error"); + } + proto_tree_add_item(tlv_tree, hf_rep_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 REP_RSP_ZONE_SPECIFIC_EFFECTIVE_CINR_PUSC_SC0: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_pusc_sc0, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_report_type, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_cqich_id, tvb, (offset + tlv_offset), length, FALSE); + break; + case REP_RSP_ZONE_SPECIFIC_EFFECTIVE_CINR_PUSC_SC1: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_pusc_sc1, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_report_type, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_cqich_id, tvb, (offset + tlv_offset), length, FALSE); + break; + case REP_RSP_ZONE_SPECIFIC_EFFECTIVE_CINR_FUSC: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_fusc, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_report_type, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_cqich_id, tvb, (offset + tlv_offset), length, FALSE); + break; + case REP_RSP_ZONE_SPECIFIC_EFFECTIVE_CINR_OPTIONAL_FUSC: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_optional_fusc, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_report_type, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_cqich_id, tvb, (offset + tlv_offset), length, FALSE); + break; + case REP_RSP_ZONE_SPECIFIC_EFFECTIVE_CINR_AMC_AAS: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_amc_aas, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_report_type, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_cqich_id, 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_rsp_decoder, tlv_tree, hf_rep_unknown_type, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(tlv_tree, hf_rep_unknown_type, tvb, (offset + tlv_offset), length, FALSE); + break; + } + tlv_offset += length; + } + break; + case REP_RSP_PREAMBLE_EFFECTIVE_CINR: + /* decode and display the preamble effective CINR report type */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, rep_tree, hf_rep_rsp_preamble_effective_cinr_report, 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-RSP preamble effective CINR report subtype TLV error"); + } + proto_tree_add_item(tlv_tree, hf_rep_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 REP_RSP_PREAMBLE_EFFECTIVE_CINR_CONFIGURATION1: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_preamble_effective_cinr_rep_configuration_1, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_preamble_effective_cinr_rep_cqich_id, tvb, (offset + tlv_offset), length, FALSE); + break; + case REP_RSP_PREAMBLE_EFFECTIVE_CINR_CONFIGURATION3: + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_preamble_effective_cinr_rep_configuration_3, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(ti_tree, hf_rep_rsp_preamble_effective_cinr_rep_cqich_id, tvb, (offset + tlv_offset), length, FALSE); + break; + case REP_RSP_CHANNEL_SELECTIVITY: + /* decode and display the channel selectivity report type */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, rep_tree, hf_rep_rsp_channel_selectivity_report, tvb, offset, tlv_len, FALSE); + proto_tree_add_item(tlv_tree, hf_rep_rsp_channel_selectivity_rep_frequency_a, tvb, (offset + tlv_offset + 2), 1, FALSE); + proto_tree_add_item(tlv_tree, hf_rep_rsp_channel_selectivity_rep_frequency_b, tvb, (offset + tlv_offset + 1), 1, FALSE); + proto_tree_add_item(tlv_tree, hf_rep_rsp_channel_selectivity_rep_frequency_c, tvb, (offset + tlv_offset), 1, FALSE); + break; + default: + /* display the unknown tlv in hex */ + ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_unknown_type, tvb, (offset + tlv_offset), length, FALSE); + proto_tree_add_item(tlv_tree, hf_rep_unknown_type, tvb, (offset + tlv_offset), length, FALSE); + break; + } + tlv_offset += length; + } + break; + case CURRENT_TX_POWER: + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, rep_tree, hf_rep_unknown_type, tvb, offset, tlv_len, FALSE); + value = tvb_get_guint8(tvb, offset); + current_power = ((gfloat)value - 128) / 2; + ti = proto_tree_add_item(tlv_tree, hf_rep_rsp_current_transmitted_power, tvb, offset, tlv_len, FALSE); + proto_item_append_text(ti, " (%.1f dBm)", current_power); + break; + default: + /* display the unknown tlv in hex */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_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 */ + } +} + /* Register Wimax Mac REP-REQ Messages Dissectors */ void proto_register_mac_mgmt_msg_rep(void) { @@ -971,646 +1589,19 @@ void proto_register_mac_mgmt_msg_rep(void) } }; - 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; + /* Setup protocol subtree array */ + static gint *ett_rep[] = + { + &ett_mac_mgmt_msg_rep_req_decoder, + &ett_mac_mgmt_msg_rep_rsp_decoder, + }; - /* Ensure the right payload type */ - payload_type = tvb_get_guint8(tvb, offset); - if(payload_type != MAC_MGMT_MSG_REP_RSP) - { - return; - } + 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 */ + ); - 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) - { - case REP_RSP_REPORT_TYPE: - /* decode and display the Report type */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, rep_tree, hf_rep_rsp_report_type, 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-RSP report subtype TLV error"); - } - proto_tree_add_item(tlv_tree, hf_rep_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 REP_RSP_REPORT_CHANNEL_NUMBER: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_report_type_channel_number, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_channel_number, tvb, (offset + tlv_offset), length, FALSE); - break; - case REP_RSP_REPORT_START_FRAME: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_report_type_frame_number, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_frame_number, tvb, (offset + tlv_offset), length, FALSE); - break; - case REP_RSP_REPORT_DURATION: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_report_type_duration, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_duration, tvb, (offset + tlv_offset), length, FALSE); - break; - case REP_RSP_REPORT_BASIC_REPORT: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_report_type_basic_report, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_basic_report_bit0, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_basic_report_bit1, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_basic_report_bit2, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_basic_report_bit3, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_basic_report_reserved, tvb, (offset + tlv_offset), length, FALSE); - break; - case REP_RSP_REPORT_CINR_REPORT: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_report_type_cinr_report, tvb, (offset + tlv_offset), length, FALSE); - ti = proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_cinr_report_mean, tvb, (offset + tlv_offset), 1, FALSE); - db_val = tvb_get_guint8(tvb, offset + tlv_offset) - 20; - if (db_val > 37) - db_val = 37; - proto_item_append_text(ti, " (%d dBm)", db_val); - ti = proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_cinr_report_deviation, tvb, (offset + tlv_offset +1), 1, FALSE); - db_val = tvb_get_guint8(tvb, offset + tlv_offset + 1) - 20; - if (db_val > 37) - db_val = 37; - proto_item_append_text(ti, " (%d dBm)", db_val); - break; - case REP_RSP_REPORT_RSSI_REPORT: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_report_type_rssi_report, tvb, (offset + tlv_offset), length, FALSE); - ti = proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_rssi_report_mean, tvb, (offset + tlv_offset), 1, FALSE); - db_val = tvb_get_guint8(tvb, offset + tlv_offset) - 123; - if (db_val > -40) - db_val = -40; - proto_item_append_text(ti, " (%d dBm)", db_val); - ti = proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_rssi_report_deviation, tvb, (offset + tlv_offset +1), 1, FALSE); - db_val = tvb_get_guint8(tvb, offset + tlv_offset + 1) - 123; - if (db_val > -40) - db_val = -40; - proto_item_append_text(ti, " (%d dBm)", db_val); - break; - default: - /* display the unknown tlv in hex */ - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_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; - } - break; - case REP_RSP_CHANNEL_TYPE: - /* decode and display the Channel Type */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, rep_tree, hf_rep_rsp_channel_type_report, 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-RSP channel subtype TLV error"); - } - proto_tree_add_item(tlv_tree, hf_rep_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 REP_RSP_CHANNEL_TYPE_SUBCHANNEL: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_channel_type_subchannel, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_channel_type_subchannel, tvb, (offset + tlv_offset), length, FALSE); - break; - case REP_RSP_CHANNEL_TYPE_BAND_AMC: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_channel_type_band_amc, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_channel_type_band_amc, tvb, (offset + tlv_offset), length, FALSE); - break; - case REP_RSP_CHANNEL_TYPE_SAFETY_CHANNEL: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_channel_type_safety_channel, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_channel_type_safety_channel, tvb, (offset + tlv_offset), length, FALSE); - break; - case REP_RSP_CHANNEL_TYPE_ENHANCED_BAND_AMC: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_channel_type_enhanced_band_amc, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_channel_type_enhanced_band_amc, tvb, (offset + tlv_offset), length, FALSE); - break; - case REP_RSP_CHANNEL_TYPE_SOUNDING: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_channel_type_sounding, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_channel_type_sounding, 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_rsp_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; - } - break; - case REP_RSP_ZONE_SPECIFIC_PHY_CINR: - /* decode and display the zone-specific physical CINR report type */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, rep_tree, hf_rep_rsp_zone_spec_phy_cinr_report, 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-RSP zone-specific phy CINR report subtype TLV error"); - } - proto_tree_add_item(tlv_tree, hf_rep_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 REP_RSP_ZONE_SPECIFIC_PHY_CINR_PUSC_SC0: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_pusc_sc0, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_mean, tvb, (offset + tlv_offset), 1, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_report_type, tvb, (offset + tlv_offset), 1, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved1, tvb, (offset + tlv_offset), 1, FALSE); - if (length == 2) - { - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_deviation, tvb, (offset + tlv_offset + 1), 1, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved2, tvb, (offset + tlv_offset + 1), 1, FALSE); - } - break; - case REP_RSP_ZONE_SPECIFIC_PHY_CINR_PUSC_SC1: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_pusc_sc1, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_mean, tvb, (offset + tlv_offset), 1, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_report_type, tvb, (offset + tlv_offset), 1, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved1, tvb, (offset + tlv_offset), 1, FALSE); - if (length == 2) - { - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_deviation, tvb, (offset + tlv_offset + 1), 1, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved2, tvb, (offset + tlv_offset + 1), 1, FALSE); - } - break; - case REP_RSP_ZONE_SPECIFIC_PHY_CINR_FUSC: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_fusc, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_mean, tvb, (offset + tlv_offset), 1, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_report_type, tvb, (offset + tlv_offset), 1, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved1, tvb, (offset + tlv_offset), 1, FALSE); - if (length == 2) - { - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_deviation, tvb, (offset + tlv_offset + 1), 1, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved2, tvb, (offset + tlv_offset + 1), 1, FALSE); - } - break; - case REP_RSP_ZONE_SPECIFIC_PHY_CINR_OPTIONAL_FUSC: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_optional_fusc, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_mean, tvb, (offset + tlv_offset), 1, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_report_type, tvb, (offset + tlv_offset), 1, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved1, tvb, (offset + tlv_offset), 1, FALSE); - if (length == 2) - { - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_deviation, tvb, (offset + tlv_offset + 1), 1, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved2, tvb, (offset + tlv_offset + 1), 1, FALSE); - } - break; - case REP_RSP_ZONE_SPECIFIC_PHY_CINR_SAFETY_CHANNEL: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_safety_channel, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_safety_channel, tvb, (offset + tlv_offset), length, FALSE); - break; - case REP_RSP_ZONE_SPECIFIC_PHY_CINR_AMC: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_amc, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_mean, tvb, (offset + tlv_offset), 1, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_report_type, tvb, (offset + tlv_offset), 1, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved1, tvb, (offset + tlv_offset), 1, FALSE); - if (length == 2) - { - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_deviation, tvb, (offset + tlv_offset + 1), 1, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved2, tvb, (offset + tlv_offset + 1), 1, FALSE); - } - break; - default: - /* display the unknown tlv in hex */ - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_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; - } - break; - case REP_RSP_PREAMBLE_PHY_CINR: - /* decode and display the preamble physical CINR report type */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, rep_tree, hf_rep_rsp_preamble_phy_cinr_report, 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-RSP preamble physical CINR report subtype TLV error"); - } - proto_tree_add_item(tlv_tree, hf_rep_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 REP_RSP_PREAMBLE_PHY_CINR_CONFIGURATION1: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_preamble_phy_cinr_rep_configuration_1, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_mean, tvb, (offset + tlv_offset), 1, FALSE); - if (length == 2) - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_deviation, tvb, (offset + tlv_offset + 1), 1, FALSE); - break; - case REP_RSP_PREAMBLE_PHY_CINR_CONFIGURATION3: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_preamble_phy_cinr_rep_configuration_3, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_mean, tvb, (offset + tlv_offset), 1, FALSE); - if (length == 2) - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_deviation, tvb, (offset + tlv_offset + 1), 1, FALSE); - break; - case REP_RSP_PREAMBLE_PHY_CINR_BAND_AMC: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_preamble_phy_cinr_rep_band_amc_zone, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_preamble_phy_cinr_rep_band_amc_zone, 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_rsp_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; - } - break; - case REP_RSP_ZONE_SPECIFIC_EFFECTIVE_CINR: - /* decode and display the zone-specific effective CINR report type */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, rep_tree, hf_rep_rsp_zone_spec_effective_cinr_report, 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-RSP zone-specific effective CINR report subtype TLV error"); - } - proto_tree_add_item(tlv_tree, hf_rep_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 REP_RSP_ZONE_SPECIFIC_EFFECTIVE_CINR_PUSC_SC0: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_pusc_sc0, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_report_type, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_cqich_id, tvb, (offset + tlv_offset), length, FALSE); - break; - case REP_RSP_ZONE_SPECIFIC_EFFECTIVE_CINR_PUSC_SC1: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_pusc_sc1, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_report_type, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_cqich_id, tvb, (offset + tlv_offset), length, FALSE); - break; - case REP_RSP_ZONE_SPECIFIC_EFFECTIVE_CINR_FUSC: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_fusc, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_report_type, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_cqich_id, tvb, (offset + tlv_offset), length, FALSE); - break; - case REP_RSP_ZONE_SPECIFIC_EFFECTIVE_CINR_OPTIONAL_FUSC: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_optional_fusc, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_report_type, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_cqich_id, tvb, (offset + tlv_offset), length, FALSE); - break; - case REP_RSP_ZONE_SPECIFIC_EFFECTIVE_CINR_AMC_AAS: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_amc_aas, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_report_type, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_cqich_id, 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_rsp_decoder, tlv_tree, hf_rep_unknown_type, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(tlv_tree, hf_rep_unknown_type, tvb, (offset + tlv_offset), length, FALSE); - break; - } - tlv_offset += length; - } - break; - case REP_RSP_PREAMBLE_EFFECTIVE_CINR: - /* decode and display the preamble effective CINR report type */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, rep_tree, hf_rep_rsp_preamble_effective_cinr_report, 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-RSP preamble effective CINR report subtype TLV error"); - } - proto_tree_add_item(tlv_tree, hf_rep_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 REP_RSP_PREAMBLE_EFFECTIVE_CINR_CONFIGURATION1: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_preamble_effective_cinr_rep_configuration_1, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_preamble_effective_cinr_rep_cqich_id, tvb, (offset + tlv_offset), length, FALSE); - break; - case REP_RSP_PREAMBLE_EFFECTIVE_CINR_CONFIGURATION3: - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_rsp_preamble_effective_cinr_rep_configuration_3, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(ti_tree, hf_rep_rsp_preamble_effective_cinr_rep_cqich_id, tvb, (offset + tlv_offset), length, FALSE); - break; - case REP_RSP_CHANNEL_SELECTIVITY: - /* decode and display the channel selectivity report type */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, rep_tree, hf_rep_rsp_channel_selectivity_report, tvb, offset, tlv_len, FALSE); - proto_tree_add_item(tlv_tree, hf_rep_rsp_channel_selectivity_rep_frequency_a, tvb, (offset + tlv_offset + 2), 1, FALSE); - proto_tree_add_item(tlv_tree, hf_rep_rsp_channel_selectivity_rep_frequency_b, tvb, (offset + tlv_offset + 1), 1, FALSE); - proto_tree_add_item(tlv_tree, hf_rep_rsp_channel_selectivity_rep_frequency_c, tvb, (offset + tlv_offset), 1, FALSE); - break; - default: - /* display the unknown tlv in hex */ - ti_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, tlv_tree, hf_rep_unknown_type, tvb, (offset + tlv_offset), length, FALSE); - proto_tree_add_item(tlv_tree, hf_rep_unknown_type, tvb, (offset + tlv_offset), length, FALSE); - break; - } - tlv_offset += length; - } - break; - case CURRENT_TX_POWER: - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_decoder, rep_tree, hf_rep_unknown_type, tvb, offset, tlv_len, FALSE); - value = tvb_get_guint8(tvb, offset); - current_power = ((gfloat)value - 128) / 2; - ti = proto_tree_add_item(tlv_tree, hf_rep_rsp_current_transmitted_power, tvb, offset, tlv_len, FALSE); - proto_item_append_text(ti, " (%.1f dBm)", current_power); - break; - default: - /* display the unknown tlv in hex */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_mac_mgmt_msg_rep_rsp_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 */ - } + 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 <glib.h> #include <epan/packet.h> #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 <glib.h> #include <epan/packet.h> #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 <glib.h> #include <epan/packet.h> #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,6 +267,310 @@ static const value_string vals_rng_rsp_location_update_response[] = { {0, NULL} }; + +/* 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) + { + /* 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); + + 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) { @@ -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 <glib.h> #include <epan/packet.h> #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,6 +534,1082 @@ static const value_string vals_sbc_sdma_str[ ] = {0, NULL} }; + +/* 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) + { + case SBC_BW_ALLOC_SUPPORT: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_bw_alloc_support, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_bw_alloc_support_rsvd0, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_bw_alloc_support_duplex, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_bw_alloc_support_rsvd1, tvb, offset, 1, FALSE); + break; + case SBC_TRANSITION_GAPS: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_transition_gaps, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + ti = proto_tree_add_item(tlv_tree, hf_sbc_ssttg, tvb, offset, 1, FALSE); + proto_item_append_text(ti, " us (ranges: TDD 0-50; H-FDD 0-100)"); + ti = proto_tree_add_item(tlv_tree, hf_sbc_ssrtg, tvb, (offset + 1), 1, FALSE); + proto_item_append_text(ti, " us (ranges: TDD 0-50; H-FDD 0-100)"); + break; + case SBC_MAC_PDU: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_mac_pdu, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_mac_pdu_piggybacked, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_mac_pdu_fsn, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_mac_pdu_rsvd, tvb, offset, 1, FALSE); + break; + case SBC_REQ_MAX_TRANSMIT_POWER: /* TODO: This TLV comes up as INVALID in wireshark... why? */ + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_max_transmit_power, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + power_bpsk = (gfloat)(tvb_get_guint8(tvb, offset) - 128) / 2; + power_qpsk = (gfloat)(tvb_get_guint8(tvb, (offset + 1)) - 128) / 2; + power_qam16 = (gfloat)(tvb_get_guint8(tvb, (offset + 2)) - 128) / 2; + power_qam64 = (gfloat)(tvb_get_guint8(tvb, (offset + 3)) - 128) / 2; + proto_tree_add_text(tlv_tree, tvb, offset, 1, "BPSK: %.2f dBm", (gdouble)power_bpsk); + proto_tree_add_text(tlv_tree, tvb, (offset + 1), 1, "QPSK: %.2f dBm", (gdouble)power_qpsk); + proto_tree_add_text(tlv_tree, tvb, (offset + 2), 1, "QAM16: %.2f dBm", (gdouble)power_qam16); + proto_tree_add_text(tlv_tree, tvb, (offset + 3), 1, "QAM64: %.2f dBm", (gdouble)power_qam64); + break; + case SBC_REQ_CURR_TRANSMITTED_POWER: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_curr_transmit_power, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + value = tvb_get_guint8(tvb, offset); + current_power = (gfloat)(value - 128) / 2; + proto_tree_add_text(tlv_tree, tvb, offset, 1, "Current Transmitted Power: %.2f dBm (Value: 0x%x)", (gdouble)current_power, value); + break; + case SBC_SS_FFT_SIZES: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_ss_fft_sizes, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + if (include_cor2_changes) + { + proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_rsvd1, tvb, offset, 1, FALSE); + } else { + proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_256, tvb, offset, 1, FALSE); + } + proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_2048, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_128, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_512, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_1024, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_rsvd2, tvb, offset, 1, FALSE); + break; + case SBC_SS_DEMODULATOR: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_ss_demodulator, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + if (tlv_len == 1) /* && (num_dl_harq_chans < 8)) */ + { + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_64qam, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_btc, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_ctc, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_stc, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_cc_with_optional_interleaver, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_chase, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_ctc_ir, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_reserved, tvb, offset, 1, FALSE); + } + else + { + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_64qam_2, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_btc_2, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_ctc_2, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_stc_2, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_cc_with_optional_interleaver_2, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_chase_2, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_ctc_ir_2, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_reserved_2, tvb, offset, 2, FALSE); +#if 0 + if (tlv_len == 1) + { + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_reserved1, tvb, offset, 2, FALSE); + } + else +#endif + { + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_cc_ir_2, tvb, offset , 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_ldpc_2, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_dedicated_pilots_2, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_reserved1_2, tvb, offset, 2, FALSE); + } + } + break; + case SBC_SS_MODULATOR: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_ss_modulator, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_64qam, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_btc, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_ctc, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_stc, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_harq_chase, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_ctc_ir, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_cc_ir, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_ldpc, tvb, offset, 1, FALSE); + break; + case SBC_SS_NUM_UL_ARQ_ACK_CHANNEL: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_number_ul_arq_ack_channel, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_number_ul_arq_ack_channel, tvb, offset, tlv_len, FALSE); + break; + case SBC_SS_NUM_DL_ARQ_ACK_CHANNEL: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_number_dl_arq_ack_channel, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + /* get and save the value */ + num_dl_harq_chans = tvb_get_guint8(tvb, offset); + proto_tree_add_item(tlv_tree, hf_sbc_number_dl_arq_ack_channel, tvb, offset, tlv_len, FALSE); + break; + case SBC_SS_PERMUTATION_SUPPORT: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_ss_permutation_support, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_ss_optimal_pusc, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_optimal_fusc, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_amc_1x6, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_amc_2x3, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_amc_3x2, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_amc_with_harq_map, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_tusc1_support, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_tusc2_support, tvb, offset, 1, FALSE); + break; + case SBC_SS_DEMODULATOR_MIMO_SUPPORT: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_ss_demodulator_mimo_support, tvb, offset, 2, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_a, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_b_vertical, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_b_horizontal, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_a, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_b_vertical, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_b_horizontal, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_c_vertical, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_c_horizontal, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_rsvd, tvb, offset, 2, FALSE); + break; + case SBC_SS_MIMO_UPLINK_SUPPORT: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_ss_mimo_uplink_support, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_ss_mimo_uplink_support_2_ann_sttd, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_mimo_uplink_support_2_ann_sm_vertical, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_mimo_uplink_support_1_ann_coop_sm, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_mimo_uplink_support_rsvd, tvb, offset, 1, FALSE); + break; + case SBC_SS_OFDMA_AAS_PRIVATE_MAP_SUPPORT: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_ss_ofdma_aas_private, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_harq_map_capability, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_map_support, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_reduced_private_map_support, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_chain_enable, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_map_dl_frame_offset, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_ul_frame_offset, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_map_concurrency, tvb, offset, 1, FALSE); + break; + case SBC_SS_OFDMA_AAS_CAPABILITIES: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_ofdma_aas_capabilities, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_aas_zone, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_aas_diversity_map_scan, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_aas_fbck_rsp_support, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_downlink_aas_preamble, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_uplink_aas_preamble, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_aas_capabilities_rsvd, tvb, offset, 2, FALSE); + break; + case SBC_SS_CINR_MEASUREMENT_CAPABILITY: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_ss_cinr_measure_capability, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_ss_phy_cinr_measurement_preamble, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_phy_cinr_measurement_permutation_zone_from_pilot_subcarriers, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_phy_cinr_measurement_permutation_zone_from_data_subcarriers, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_effective_cinr_measurement_preamble, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_effective_cinr_measurement_permutation_zone_from_pilot_subcarriers, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_effective_cinr_measurement_permutation_zone_from_data_subcarriers, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_support_2_concurrent_cqi_channels,tvb,offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_frequency_selectivity_characterization_report,tvb,offset, 1, FALSE); + break; + case SBC_PKM_FLOW_CONTROL: + if (!include_cor2_changes) + { + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_pkm_flow_control, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + tlv_item = proto_tree_add_item(tlv_tree, hf_sbc_pkm_flow_control, tvb, offset, tlv_len, FALSE); + if(tvb_get_guint8(tvb, offset) == 0) + proto_item_append_text(tlv_item, " (default - no limit)"); + } + else + { + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_power_save_class_types_capability, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_unknown_type, tvb, offset, tlv_len, FALSE); + } + break; + case SBC_AUTH_POLICY_SUPPORT: + /* display the TLV name and display the value in hex */ + tlv_item = proto_tree_add_item(sbc_tree, hf_sbc_auth_policy, tvb, offset, tlv_len, FALSE); + /* add TLV subtree */ + tlv_tree = proto_item_add_subtree(tlv_item, ett_sbc_req_tlv_subtree); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_privacy_802_16, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_privacy_rsvd, tvb, offset, 1, FALSE); + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_auth_policy, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_privacy_802_16, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_privacy_rsvd, tvb, offset, 1, FALSE); + if (!include_cor2_changes) + { + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_auth_policy, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_privacy_802_16, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_privacy_rsvd, tvb, offset, 1, FALSE); + } + else + { + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_power_save_class_types_capability, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_unknown_type, tvb, offset, tlv_len, FALSE); + } + break; + case SBC_MAX_SECURITY_ASSOCIATIONS: + if (!include_cor2_changes) + { + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_max_security_associations, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_max_security_associations, tvb, offset, tlv_len, FALSE); + } + else + { + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_power_save_class_types_capability, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_unknown_type, tvb, offset, tlv_len, FALSE); + } + break; + case SBC_TLV_T_27_EXTENSION_CAPABILITY: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_27_extension_capability, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_27_extension_capability_bit0, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_27_extension_capability_reserved, tvb, offset, 1, FALSE); + break; + case SBC_TLV_T_28_HO_TRIGGER_METRIC_SUPPORT: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support_bit0, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support_bit1, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support_bit2, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support_bit3, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support_reserved, tvb, offset, 1, FALSE); + break; + case SBC_TLV_T_167_ASSOCIATION_SUPPORT: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_167_association_type_support, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_bit0, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_bit1, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_bit2, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_bit3, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_bit4, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_reserved, tvb, offset, 1, FALSE); + break; + case SBC_TLV_T_170_UPLINK_POWER_CONTROL_SUPPORT: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_ofdma_ss_uplink_power_control_support, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_ofdma_ss_uplink_power_control_support_open_loop, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ofdma_ss_uplink_power_control_support_aas_preamble, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ofdma_ss_uplink_power_control_support_rsvd, tvb, offset, 1, FALSE); + break; + case SBC_TLV_T_171_MINIMUM_NUM_OF_FRAMES: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_171_minimum_num_of_frames, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_171_minimum_num_of_frames, tvb, offset, tlv_len, FALSE); + break; + case SBC_TLV_T_172: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_172, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_harq_map_capability, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_extended_harq_ie_capability, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_sub_map_capability_first_zone, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_sub_map_capability_other_zones, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_dl_region_definition_support, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_reserved, tvb, offset, 1, FALSE); + break; + case SBC_TLV_T_173_UL_CONTROL_CHANNEL_SUPPORT: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_173_ul_ctl_channel_support, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_3_bit_mimo_fast_feedback, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_enhanced_fast_feedback, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_ul_ack, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_reserved, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_uep_fast_feedback, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_measurement_report, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_primary_secondary_fast_feedback, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_diuc_cqi_fast_feedback, tvb, offset, 1, FALSE); + break; + case SBC_TLV_T_174_OFDMA_MS_CSIT_CAPABILITY: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_174_ofdma_ms_csit_capability, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_csit_compatibility_type_a, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_csit_compatibility_type_b, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_power_assignment_capability, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_sounding_rsp_time_capability, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_max_num_simultanous_sounding_instructions, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_ss_csit_type_a_support, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_ss_csit_reserved, tvb, offset, 2, FALSE); + break; + case SBC_TLV_T_175_MAX_NUM_BST_PER_FRM_CAPABILITY_HARQ: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_175_max_num_bst_per_frm_capability_harq, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_175_max_num_ul_harq_bst, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_175_max_num_ul_harq_per_frm_include_one_non_harq_bst, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_175_max_num_dl_harq_bst_per_harq_per_frm, tvb, offset, 1, FALSE); + break; + case SBC_TLV_T_176: /* TODO: Get an invalid TLV whenever this TLV is used. Could it be + that lengths above 2 cause this problem? */ + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_176, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit0, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit1, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit2, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit3, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit4, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit5, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit6, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit7, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit8, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit9, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit10, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit11, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit12, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit13, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit14, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit15, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit16, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit17, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit18, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit19, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_reserved, tvb, offset, 3, FALSE); + break; + case SBC_TLV_T_177_OFDMA_SS_MODULATOR_FOR_MIMO_SUPPORT: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_177_ofdma_ss_modulator_for_mimo_support, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + if (include_cor2_changes) + { + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_stc_matrix_a, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_stc_matrix_b_vertical, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_stc_matrix_b_horizontal, tvb, offset, 1, FALSE); + } else { + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_two_transmit_antennas, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_capable_of_transmit_diversity, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_capable_of_spacial_multiplexing, tvb, offset, 1, FALSE); + } + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_beamforming, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_adaptive_rate_ctl, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_single_antenna, tvb, offset, 1, FALSE); + if (include_cor2_changes) + { + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_collaborative_sm_with_one_antenna, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_collaborative_sm_with_two_antennas, tvb, offset, 1, FALSE); + } else { + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_capable_of_two_antenna, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_rsvd, tvb, offset, 1, FALSE); + } + break; + case SBC_TLV_T_178_SDMA_PILOT_CAPABILITY: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_178_sdma_pilot_capability, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_178_sdma_pilot_pattern_support_for_amc_zone, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_178_reserved, tvb, offset, 1, FALSE); + break; + case SBC_TLV_T_179_OFDMA_MULTIPLE_DL_BURST_PROFILE_CAPABILITY: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_179_ofdma_multiple_dl_burst_profile_support, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_179_dl_bst_profile_for_multiple_fec, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_179_ul_bst_profile_for_multiple_fec, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_179_reserved, tvb, offset, 1, FALSE); + break; + case SBC_TLV_T_204_OFDMA_PARAMETERS_SETS: + if (include_cor2_changes) + { + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_phy_set_a, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_phy_set_b, tvb, offset, 1, FALSE); + tlv_item = proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_harq_parameters_set, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_mac_set_a, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_mac_set_b, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_reserved, tvb, offset, 1, FALSE); + } + break; + case SBC_TLV_T_162_HARQ_INCREMENTAL_REDUNDANCY_BUFFER_CAPABILITY: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_NEP, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_aggregation_flag_for_dl, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_reserved1, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_ul_harq_incremental_redundancy_buffer_capability_NEP, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_aggregation_flag_for_ul, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_reserved2, tvb, offset, 2, FALSE); + break; + case SBC_TLV_T_163_HARQ_CHASE_COMBINING_AND_CC_IR_BUFFER_CAPABILITY: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_dl_harq_buffering_capability_for_chase_combining, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_aggregation_flag_dl, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_reserved1, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_ul_harq_buffering_capability_for_chase_combining, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_aggregation_flag_ul, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_reserved2, tvb, offset, 2, FALSE); + break; + case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETERS: + /* display Security Negotiation Parameters Title */ + /* add Security Negotiation Parameters subtree */ + tlv_tree = add_protocol_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, proto_mac_mgmt_msg_sbc_decoder, tvb, offset, tlv_len, "Security Negotiation Parameters (%u bytes)", tlv_len); + /* call the Security Negotiation Parameters decoder */ + wimax_security_negotiation_parameters_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree); + break; + case SBC_TLV_T_26_POWER_SAVE_CLASS_TYPES_CAPABILITY: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_power_save_class_types_capability, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_power_save_class_types_capability_bit0, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_power_save_class_types_capability_bit1, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_power_save_class_types_capability_bit2, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_power_save_class_types_capability_bits34, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_power_save_class_types_capability_bits567, tvb, offset, 1, FALSE); + break; + default: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_power_save_class_types_capability, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + 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 */ + } +} + +/* Wimax Mac SBC-RSP Message Dissector */ +void dissect_mac_mgmt_msg_sbc_rsp_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 ssttg, ssrtg;*/ + guint num_dl_harq_chans; /*, num_ul_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_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 SBC-RSP */ + sbc_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_sbc_decoder, tvb, offset, tvb_len, "SS Basic Capability Response (SBC-RSP) (%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 Response (SBC-RSP) */ + /* display the Message Type */ + proto_tree_add_item(sbc_tree, hf_sbc_rsp_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-RSP 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-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 SBC TLV Encoded information */ + switch (tlv_type) + { + case SBC_BW_ALLOC_SUPPORT: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_bw_alloc_support, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_bw_alloc_support_rsvd0, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_bw_alloc_support_duplex, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_bw_alloc_support_rsvd1, tvb, offset, 1, FALSE); + break; + case SBC_TRANSITION_GAPS: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_transition_gaps, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + ti = proto_tree_add_item(tlv_tree, hf_sbc_ssttg, tvb, offset, 1, FALSE); + proto_item_append_text(ti, " us (ranges: TDD 0-50; H-FDD 0-100)"); + ti = proto_tree_add_item(tlv_tree, hf_sbc_ssrtg, tvb, (offset + 1), 1, FALSE); + proto_item_append_text(ti, " us (ranges: TDD 0-50; H-FDD 0-100)"); + break; + case SBC_MAC_PDU: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_mac_pdu, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_mac_pdu_piggybacked, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_mac_pdu_fsn, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_mac_pdu_rsvd, tvb, offset, 1, FALSE); + break; + case SBC_REQ_MAX_TRANSMIT_POWER: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_max_transmit_power, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + power_bpsk = (gfloat)(tvb_get_guint8(tvb, offset) - 128) / 2; + power_qpsk = (gfloat)(tvb_get_guint8(tvb, (offset + 1)) - 128) / 2; + power_qam16 = (gfloat)(tvb_get_guint8(tvb, (offset + 2)) - 128) / 2; + power_qam64 = (gfloat)(tvb_get_guint8(tvb, (offset + 3)) - 128) / 2; + proto_tree_add_text(tlv_tree, tvb, offset, 1, "BPSK: %.2f dBm", (gdouble)power_bpsk); + proto_tree_add_text(tlv_tree, tvb, (offset + 1), 1, "QPSK: %.2f dBm", (gdouble)power_qpsk); + proto_tree_add_text(tlv_tree, tvb, (offset + 2), 1, "QAM16: %.2f dBm", (gdouble)power_qam16); + proto_tree_add_text(tlv_tree, tvb, (offset + 3), 1, "QAM64: %.2f dBm", (gdouble)power_qam64); + break; + case SBC_REQ_CURR_TRANSMITTED_POWER: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_curr_transmit_power, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + value = tvb_get_guint8(tvb, offset); + current_power = (gfloat)(value - 128) / 2; + proto_tree_add_text(tlv_tree, tvb, offset, 1, "Current Transmitted Power: %.2f dBm (Value: 0x%x)", (gdouble)current_power, value); + break; + case SBC_SS_FFT_SIZES: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_ss_fft_sizes, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + if (include_cor2_changes) + { + proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_rsvd1, tvb, offset, 1, FALSE); + } else { + proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_256, tvb, offset, 1, FALSE); + } + proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_2048, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_128, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_512, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_1024, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_rsvd2, tvb, offset, 1, FALSE); + break; + case SBC_SS_DEMODULATOR: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_ss_demodulator, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + if (tlv_len == 1) /* && (num_dl_harq_chans < 8)) */ + { + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_64qam, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_btc, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_ctc, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_stc, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_cc_with_optional_interleaver, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_chase, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_ctc_ir, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_reserved, tvb, offset, 1, FALSE); + } + else + { + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_64qam_2, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_btc_2, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_ctc_2, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_stc_2, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_cc_with_optional_interleaver_2, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_chase_2, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_ctc_ir_2, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_reserved_2, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_cc_ir_2, tvb, offset , 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_ldpc_2, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_dedicated_pilots_2, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_reserved1_2, tvb, offset, 2, FALSE); + } + break; + case SBC_SS_MODULATOR: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_ss_modulator, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_64qam, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_btc, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_ctc, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_stc, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_harq_chase, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_ctc_ir, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_cc_ir, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_ldpc, tvb, offset, 1, FALSE); + break; + case SBC_SS_NUM_UL_ARQ_ACK_CHANNEL: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_number_ul_arq_ack_channel, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_number_ul_arq_ack_channel, tvb, offset, tlv_len, FALSE); + break; + case SBC_SS_NUM_DL_ARQ_ACK_CHANNEL: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_number_dl_arq_ack_channel, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + /* get and save the value */ + num_dl_harq_chans = tvb_get_guint8(tvb, offset); + proto_tree_add_item(tlv_tree, hf_sbc_number_dl_arq_ack_channel, tvb, offset, tlv_len, FALSE); + break; + case SBC_SS_PERMUTATION_SUPPORT: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_ss_permutation_support, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_ss_optimal_pusc, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_optimal_fusc, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_amc_1x6, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_amc_2x3, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_amc_3x2, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_amc_with_harq_map, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_tusc1_support, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_tusc2_support, tvb, offset, 1, FALSE); + break; + case SBC_SS_DEMODULATOR_MIMO_SUPPORT: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_ss_demodulator_mimo_support, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_a, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_b_vertical, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_b_horizontal, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_a, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_b_vertical, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_b_horizontal, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_c_vertical, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_c_horizontal, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_rsvd, tvb, offset, 2, FALSE); + break; + case SBC_SS_MIMO_UPLINK_SUPPORT: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_ss_mimo_uplink_support, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_ss_mimo_uplink_support_2_ann_sttd, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_mimo_uplink_support_2_ann_sm_vertical, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_mimo_uplink_support_1_ann_coop_sm, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_mimo_uplink_support_rsvd, tvb, offset, 1, FALSE); + break; + case SBC_SS_OFDMA_AAS_PRIVATE_MAP_SUPPORT: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_ss_ofdma_aas_private, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_harq_map_capability, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_map_support, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_reduced_private_map_support, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_chain_enable, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_map_dl_frame_offset, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_ul_frame_offset, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_map_concurrency, tvb, offset, 1, FALSE); + break; + case SBC_SS_OFDMA_AAS_CAPABILITIES: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_ofdma_aas_capabilities, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_aas_zone, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_aas_diversity_map_scan, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_aas_fbck_rsp_support, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_downlink_aas_preamble, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_uplink_aas_preamble, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_aas_capabilities_rsvd, tvb, offset, 2, FALSE); + break; + case SBC_SS_CINR_MEASUREMENT_CAPABILITY: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_ss_cinr_measure_capability, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_ss_phy_cinr_measurement_preamble, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_phy_cinr_measurement_permutation_zone_from_pilot_subcarriers, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_phy_cinr_measurement_permutation_zone_from_data_subcarriers, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_effective_cinr_measurement_preamble, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_effective_cinr_measurement_permutation_zone_from_pilot_subcarriers, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_effective_cinr_measurement_permutation_zone_from_data_subcarriers, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_support_2_concurrent_cqi_channels,tvb,offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ss_frequency_selectivity_characterization_report,tvb,offset, 1, FALSE); + break; + case SBC_PKM_FLOW_CONTROL: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_pkm_flow_control, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + tlv_item = proto_tree_add_item(tlv_tree, hf_sbc_pkm_flow_control, tvb, offset, tlv_len, FALSE); + if (tvb_get_guint8(tvb, offset) == 0) + { + proto_item_append_text(tlv_item, " (default - no limit)"); + } + break; + case SBC_AUTH_POLICY_SUPPORT: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_auth_policy, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_privacy_802_16, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_privacy_rsvd, tvb, offset, 1, FALSE); + break; + case SBC_MAX_SECURITY_ASSOCIATIONS: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_max_security_associations, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_max_security_associations, tvb, offset, tlv_len, FALSE); + break; + case SBC_TLV_T_27_EXTENSION_CAPABILITY: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_27_extension_capability, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_27_extension_capability_bit0, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_27_extension_capability_reserved, tvb, offset, 1, FALSE); + break; + case SBC_TLV_T_28_HO_TRIGGER_METRIC_SUPPORT: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support_bit0, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support_bit1, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support_bit2, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support_bit3, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support_reserved, tvb, offset, 1, FALSE); + break; + case SBC_TLV_T_167_ASSOCIATION_SUPPORT: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_167_association_type_support, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_bit0, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_bit1, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_bit2, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_bit3, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_bit4, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_reserved, tvb, offset, 1, FALSE); + break; + case SBC_TLV_T_170_UPLINK_POWER_CONTROL_SUPPORT: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_ofdma_ss_uplink_power_control_support, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_ofdma_ss_uplink_power_control_support_open_loop, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ofdma_ss_uplink_power_control_support_aas_preamble, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_ofdma_ss_uplink_power_control_support_rsvd, tvb, offset, 1, FALSE); + break; + case SBC_TLV_T_171_MINIMUM_NUM_OF_FRAMES: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_171_minimum_num_of_frames, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_171_minimum_num_of_frames, tvb, offset, tlv_len, FALSE); + break; + case SBC_TLV_T_172: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_172, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_harq_map_capability, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_extended_harq_ie_capability, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_sub_map_capability_first_zone, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_sub_map_capability_other_zones, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_dl_region_definition_support, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_reserved, tvb, offset, 1, FALSE); + break; + case SBC_TLV_T_173_UL_CONTROL_CHANNEL_SUPPORT: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_173_ul_ctl_channel_support, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_3_bit_mimo_fast_feedback, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_enhanced_fast_feedback, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_ul_ack, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_reserved, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_uep_fast_feedback, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_measurement_report, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_primary_secondary_fast_feedback, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_diuc_cqi_fast_feedback, tvb, offset, 1, FALSE); + break; + case SBC_TLV_T_174_OFDMA_MS_CSIT_CAPABILITY: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_174_ofdma_ms_csit_capability, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_csit_compatibility_type_a, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_csit_compatibility_type_b, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_power_assignment_capability, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_sounding_rsp_time_capability, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_max_num_simultanous_sounding_instructions, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_ss_csit_type_a_support, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_ss_csit_reserved, tvb, offset, 2, FALSE); + break; + case SBC_TLV_T_175_MAX_NUM_BST_PER_FRM_CAPABILITY_HARQ: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_175_max_num_bst_per_frm_capability_harq, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_175_max_num_ul_harq_bst, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_175_max_num_ul_harq_per_frm_include_one_non_harq_bst, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_175_max_num_dl_harq_bst_per_harq_per_frm, tvb, offset, 1, FALSE); + break; + case SBC_TLV_T_176: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_176, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit0, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit1, tvb, offset, 3, FALSE); + if (include_cor2_changes) + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit2_cor2, tvb, offset, 3, FALSE); + else + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit2, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit3, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit4, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit5, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit6, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit7, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit8, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit9, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit10, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit11, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit12, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit13, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit14, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit15, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit16, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit17, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit18, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit19, tvb, offset, 3, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_reserved, tvb, offset, 3, FALSE); + break; + case SBC_TLV_T_177_OFDMA_SS_MODULATOR_FOR_MIMO_SUPPORT: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_177_ofdma_ss_modulator_for_mimo_support, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + if (include_cor2_changes) + { + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_stc_matrix_a, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_stc_matrix_b_vertical, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_stc_matrix_b_horizontal, tvb, offset, 1, FALSE); + } else { + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_two_transmit_antennas, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_capable_of_transmit_diversity, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_capable_of_spacial_multiplexing, tvb, offset, 1, FALSE); + } + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_beamforming, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_adaptive_rate_ctl, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_single_antenna, tvb, offset, 1, FALSE); + if (include_cor2_changes) + { + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_collaborative_sm_with_one_antenna, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_collaborative_sm_with_two_antennas, tvb, offset, 1, FALSE); + } else { + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_capable_of_two_antenna, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_rsvd, tvb, offset, 1, FALSE); + } + break; + case SBC_TLV_T_178_SDMA_PILOT_CAPABILITY: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_178_sdma_pilot_capability, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_178_sdma_pilot_pattern_support_for_amc_zone, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_178_reserved, tvb, offset, 1, FALSE); + break; + case SBC_TLV_T_179_OFDMA_MULTIPLE_DL_BURST_PROFILE_CAPABILITY: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_179_ofdma_multiple_dl_burst_profile_support, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_179_dl_bst_profile_for_multiple_fec, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_179_ul_bst_profile_for_multiple_fec, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_179_reserved, tvb, offset, 1, FALSE); + break; + case SBC_TLV_T_204_OFDMA_PARAMETERS_SETS: + if (include_cor2_changes) + { + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_phy_set_a, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_phy_set_b, tvb, offset, 1, FALSE); + tlv_item = proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_harq_parameters_set, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_mac_set_a, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_mac_set_b, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_reserved, tvb, offset, 1, FALSE); + } + break; + case SBC_TLV_T_162_HARQ_INCREMENTAL_REDUNDANCY_BUFFER_CAPABILITY: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_NEP, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_aggregation_flag_for_dl, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_reserved1, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_ul_harq_incremental_redundancy_buffer_capability_NEP, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_aggregation_flag_for_ul, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_reserved2, tvb, offset, 2, FALSE); + break; + case SBC_TLV_T_163_HARQ_CHASE_COMBINING_AND_CC_IR_BUFFER_CAPABILITY: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_dl_harq_buffering_capability_for_chase_combining, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_aggregation_flag_dl, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_reserved1, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_ul_harq_buffering_capability_for_chase_combining, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_aggregation_flag_ul, tvb, offset, 2, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_reserved2, tvb, offset, 2, FALSE); + break; + case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETERS: + /* display Security Negotiation Parameters Title */ + tlv_item = proto_tree_add_protocol_format(sbc_tree, proto_mac_mgmt_msg_sbc_decoder, tvb, offset, tvb_len, "Security Negotiation Parameters (%u bytes)", tvb_len); + /* add Security Negotiation Parameters subtree */ + tlv_tree = proto_item_add_subtree(tlv_item, ett_sbc_rsp_tlv_subtree); + /* call the Security Negotiation Parameters decoder */ + wimax_security_negotiation_parameters_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree); + break; + case SBC_TLV_T_26_POWER_SAVE_CLASS_TYPES_CAPABILITY: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_power_save_class_types_capability, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + proto_tree_add_item(tlv_tree, hf_sbc_power_save_class_types_capability_bit0, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_power_save_class_types_capability_bit1, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_power_save_class_types_capability_bit2, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_power_save_class_types_capability_bits34, tvb, offset, 1, FALSE); + proto_tree_add_item(tlv_tree, hf_sbc_power_save_class_types_capability_bits567, tvb, offset, 1, FALSE); + break; + default: + /* add TLV subtree */ + tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_unknown_type, tvb, offset, tlv_len, FALSE); + /* display the detail meanings of the TLV value */ + 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 */ + } +} + /* Register Wimax Mac SBC-REQ/RSP Messages Dissectors */ void proto_register_mac_mgmt_msg_sbc(void) { @@ -2185,1090 +3246,20 @@ void proto_register_mac_mgmt_msg_sbc(void) } }; - 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) + /* Setup protocol subtree array */ + static gint *ett_sbc[] = { - /* 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) - { - case SBC_BW_ALLOC_SUPPORT: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_bw_alloc_support, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_bw_alloc_support_rsvd0, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_bw_alloc_support_duplex, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_bw_alloc_support_rsvd1, tvb, offset, 1, FALSE); - break; - case SBC_TRANSITION_GAPS: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_transition_gaps, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - ti = proto_tree_add_item(tlv_tree, hf_sbc_ssttg, tvb, offset, 1, FALSE); - proto_item_append_text(ti, " us (ranges: TDD 0-50; H-FDD 0-100)"); - ti = proto_tree_add_item(tlv_tree, hf_sbc_ssrtg, tvb, (offset + 1), 1, FALSE); - proto_item_append_text(ti, " us (ranges: TDD 0-50; H-FDD 0-100)"); - break; - case SBC_MAC_PDU: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_mac_pdu, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_mac_pdu_piggybacked, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_mac_pdu_fsn, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_mac_pdu_rsvd, tvb, offset, 1, FALSE); - break; - case SBC_REQ_MAX_TRANSMIT_POWER: /* TODO: This TLV comes up as INVALID in wireshark... why? */ - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_max_transmit_power, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - power_bpsk = (gfloat)(tvb_get_guint8(tvb, offset) - 128) / 2; - power_qpsk = (gfloat)(tvb_get_guint8(tvb, (offset + 1)) - 128) / 2; - power_qam16 = (gfloat)(tvb_get_guint8(tvb, (offset + 2)) - 128) / 2; - power_qam64 = (gfloat)(tvb_get_guint8(tvb, (offset + 3)) - 128) / 2; - proto_tree_add_text(tlv_tree, tvb, offset, 1, "BPSK: %.2f dBm", (gdouble)power_bpsk); - proto_tree_add_text(tlv_tree, tvb, (offset + 1), 1, "QPSK: %.2f dBm", (gdouble)power_qpsk); - proto_tree_add_text(tlv_tree, tvb, (offset + 2), 1, "QAM16: %.2f dBm", (gdouble)power_qam16); - proto_tree_add_text(tlv_tree, tvb, (offset + 3), 1, "QAM64: %.2f dBm", (gdouble)power_qam64); - break; - case SBC_REQ_CURR_TRANSMITTED_POWER: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_curr_transmit_power, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - value = tvb_get_guint8(tvb, offset); - current_power = (gfloat)(value - 128) / 2; - proto_tree_add_text(tlv_tree, tvb, offset, 1, "Current Transmitted Power: %.2f dBm (Value: 0x%x)", (gdouble)current_power, value); - break; - case SBC_SS_FFT_SIZES: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_ss_fft_sizes, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - if (include_cor2_changes) - { - proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_rsvd1, tvb, offset, 1, FALSE); - } else { - proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_256, tvb, offset, 1, FALSE); - } - proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_2048, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_128, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_512, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_1024, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_rsvd2, tvb, offset, 1, FALSE); - break; - case SBC_SS_DEMODULATOR: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_ss_demodulator, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - if (tlv_len == 1) /* && (num_dl_harq_chans < 8)) */ - { - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_64qam, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_btc, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_ctc, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_stc, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_cc_with_optional_interleaver, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_chase, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_ctc_ir, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_reserved, tvb, offset, 1, FALSE); - } - else - { - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_64qam_2, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_btc_2, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_ctc_2, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_stc_2, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_cc_with_optional_interleaver_2, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_chase_2, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_ctc_ir_2, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_reserved_2, tvb, offset, 2, FALSE); -#if 0 - if (tlv_len == 1) - { - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_reserved1, tvb, offset, 2, FALSE); - } - else -#endif - { - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_cc_ir_2, tvb, offset , 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_ldpc_2, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_dedicated_pilots_2, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_reserved1_2, tvb, offset, 2, FALSE); - } - } - break; - case SBC_SS_MODULATOR: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_ss_modulator, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_64qam, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_btc, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_ctc, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_stc, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_harq_chase, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_ctc_ir, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_cc_ir, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_ldpc, tvb, offset, 1, FALSE); - break; - case SBC_SS_NUM_UL_ARQ_ACK_CHANNEL: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_number_ul_arq_ack_channel, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_number_ul_arq_ack_channel, tvb, offset, tlv_len, FALSE); - break; - case SBC_SS_NUM_DL_ARQ_ACK_CHANNEL: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_number_dl_arq_ack_channel, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - /* get and save the value */ - num_dl_harq_chans = tvb_get_guint8(tvb, offset); - proto_tree_add_item(tlv_tree, hf_sbc_number_dl_arq_ack_channel, tvb, offset, tlv_len, FALSE); - break; - case SBC_SS_PERMUTATION_SUPPORT: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_ss_permutation_support, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_ss_optimal_pusc, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_optimal_fusc, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_amc_1x6, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_amc_2x3, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_amc_3x2, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_amc_with_harq_map, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_tusc1_support, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_tusc2_support, tvb, offset, 1, FALSE); - break; - case SBC_SS_DEMODULATOR_MIMO_SUPPORT: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_ss_demodulator_mimo_support, tvb, offset, 2, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_a, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_b_vertical, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_b_horizontal, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_a, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_b_vertical, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_b_horizontal, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_c_vertical, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_c_horizontal, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_rsvd, tvb, offset, 2, FALSE); - break; - case SBC_SS_MIMO_UPLINK_SUPPORT: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_ss_mimo_uplink_support, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_ss_mimo_uplink_support_2_ann_sttd, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_mimo_uplink_support_2_ann_sm_vertical, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_mimo_uplink_support_1_ann_coop_sm, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_mimo_uplink_support_rsvd, tvb, offset, 1, FALSE); - break; - case SBC_SS_OFDMA_AAS_PRIVATE_MAP_SUPPORT: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_ss_ofdma_aas_private, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_harq_map_capability, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_map_support, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_reduced_private_map_support, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_chain_enable, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_map_dl_frame_offset, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_ul_frame_offset, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_map_concurrency, tvb, offset, 1, FALSE); - break; - case SBC_SS_OFDMA_AAS_CAPABILITIES: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_ofdma_aas_capabilities, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_aas_zone, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_aas_diversity_map_scan, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_aas_fbck_rsp_support, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_downlink_aas_preamble, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_uplink_aas_preamble, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_aas_capabilities_rsvd, tvb, offset, 2, FALSE); - break; - case SBC_SS_CINR_MEASUREMENT_CAPABILITY: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_ss_cinr_measure_capability, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_ss_phy_cinr_measurement_preamble, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_phy_cinr_measurement_permutation_zone_from_pilot_subcarriers, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_phy_cinr_measurement_permutation_zone_from_data_subcarriers, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_effective_cinr_measurement_preamble, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_effective_cinr_measurement_permutation_zone_from_pilot_subcarriers, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_effective_cinr_measurement_permutation_zone_from_data_subcarriers, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_support_2_concurrent_cqi_channels,tvb,offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_frequency_selectivity_characterization_report,tvb,offset, 1, FALSE); - break; - case SBC_PKM_FLOW_CONTROL: - if (!include_cor2_changes) - { - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_pkm_flow_control, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - tlv_item = proto_tree_add_item(tlv_tree, hf_sbc_pkm_flow_control, tvb, offset, tlv_len, FALSE); - if(tvb_get_guint8(tvb, offset) == 0) - proto_item_append_text(tlv_item, " (default - no limit)"); - } - else - { - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_power_save_class_types_capability, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_unknown_type, tvb, offset, tlv_len, FALSE); - } - break; - case SBC_AUTH_POLICY_SUPPORT: - /* display the TLV name and display the value in hex */ - tlv_item = proto_tree_add_item(sbc_tree, hf_sbc_auth_policy, tvb, offset, tlv_len, FALSE); - /* add TLV subtree */ - tlv_tree = proto_item_add_subtree(tlv_item, ett_sbc_req_tlv_subtree); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_privacy_802_16, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_privacy_rsvd, tvb, offset, 1, FALSE); - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_auth_policy, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_privacy_802_16, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_privacy_rsvd, tvb, offset, 1, FALSE); - if (!include_cor2_changes) - { - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_auth_policy, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_privacy_802_16, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_privacy_rsvd, tvb, offset, 1, FALSE); - } - else - { - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_power_save_class_types_capability, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_unknown_type, tvb, offset, tlv_len, FALSE); - } - break; - case SBC_MAX_SECURITY_ASSOCIATIONS: - if (!include_cor2_changes) - { - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_max_security_associations, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_max_security_associations, tvb, offset, tlv_len, FALSE); - } - else - { - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_power_save_class_types_capability, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_unknown_type, tvb, offset, tlv_len, FALSE); - } - break; - case SBC_TLV_T_27_EXTENSION_CAPABILITY: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_27_extension_capability, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_27_extension_capability_bit0, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_27_extension_capability_reserved, tvb, offset, 1, FALSE); - break; - case SBC_TLV_T_28_HO_TRIGGER_METRIC_SUPPORT: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support_bit0, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support_bit1, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support_bit2, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support_bit3, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support_reserved, tvb, offset, 1, FALSE); - break; - case SBC_TLV_T_167_ASSOCIATION_SUPPORT: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_167_association_type_support, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_bit0, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_bit1, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_bit2, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_bit3, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_bit4, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_reserved, tvb, offset, 1, FALSE); - break; - case SBC_TLV_T_170_UPLINK_POWER_CONTROL_SUPPORT: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_ofdma_ss_uplink_power_control_support, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_ofdma_ss_uplink_power_control_support_open_loop, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ofdma_ss_uplink_power_control_support_aas_preamble, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ofdma_ss_uplink_power_control_support_rsvd, tvb, offset, 1, FALSE); - break; - case SBC_TLV_T_171_MINIMUM_NUM_OF_FRAMES: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_171_minimum_num_of_frames, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_171_minimum_num_of_frames, tvb, offset, tlv_len, FALSE); - break; - case SBC_TLV_T_172: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_172, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_harq_map_capability, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_extended_harq_ie_capability, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_sub_map_capability_first_zone, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_sub_map_capability_other_zones, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_dl_region_definition_support, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_reserved, tvb, offset, 1, FALSE); - break; - case SBC_TLV_T_173_UL_CONTROL_CHANNEL_SUPPORT: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_173_ul_ctl_channel_support, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_3_bit_mimo_fast_feedback, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_enhanced_fast_feedback, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_ul_ack, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_reserved, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_uep_fast_feedback, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_measurement_report, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_primary_secondary_fast_feedback, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_diuc_cqi_fast_feedback, tvb, offset, 1, FALSE); - break; - case SBC_TLV_T_174_OFDMA_MS_CSIT_CAPABILITY: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_174_ofdma_ms_csit_capability, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_csit_compatibility_type_a, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_csit_compatibility_type_b, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_power_assignment_capability, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_sounding_rsp_time_capability, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_max_num_simultanous_sounding_instructions, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_ss_csit_type_a_support, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_ss_csit_reserved, tvb, offset, 2, FALSE); - break; - case SBC_TLV_T_175_MAX_NUM_BST_PER_FRM_CAPABILITY_HARQ: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_175_max_num_bst_per_frm_capability_harq, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_175_max_num_ul_harq_bst, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_175_max_num_ul_harq_per_frm_include_one_non_harq_bst, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_175_max_num_dl_harq_bst_per_harq_per_frm, tvb, offset, 1, FALSE); - break; - case SBC_TLV_T_176: /* TODO: Get an invalid TLV whenever this TLV is used. Could it be - that lengths above 2 cause this problem? */ - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_176, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit0, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit1, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit2, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit3, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit4, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit5, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit6, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit7, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit8, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit9, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit10, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit11, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit12, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit13, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit14, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit15, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit16, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit17, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit18, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit19, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_reserved, tvb, offset, 3, FALSE); - break; - case SBC_TLV_T_177_OFDMA_SS_MODULATOR_FOR_MIMO_SUPPORT: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_177_ofdma_ss_modulator_for_mimo_support, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - if (include_cor2_changes) - { - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_stc_matrix_a, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_stc_matrix_b_vertical, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_stc_matrix_b_horizontal, tvb, offset, 1, FALSE); - } else { - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_two_transmit_antennas, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_capable_of_transmit_diversity, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_capable_of_spacial_multiplexing, tvb, offset, 1, FALSE); - } - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_beamforming, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_adaptive_rate_ctl, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_single_antenna, tvb, offset, 1, FALSE); - if (include_cor2_changes) - { - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_collaborative_sm_with_one_antenna, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_collaborative_sm_with_two_antennas, tvb, offset, 1, FALSE); - } else { - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_capable_of_two_antenna, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_rsvd, tvb, offset, 1, FALSE); - } - break; - case SBC_TLV_T_178_SDMA_PILOT_CAPABILITY: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_178_sdma_pilot_capability, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_178_sdma_pilot_pattern_support_for_amc_zone, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_178_reserved, tvb, offset, 1, FALSE); - break; - case SBC_TLV_T_179_OFDMA_MULTIPLE_DL_BURST_PROFILE_CAPABILITY: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_179_ofdma_multiple_dl_burst_profile_support, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_179_dl_bst_profile_for_multiple_fec, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_179_ul_bst_profile_for_multiple_fec, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_179_reserved, tvb, offset, 1, FALSE); - break; - case SBC_TLV_T_204_OFDMA_PARAMETERS_SETS: - if (include_cor2_changes) - { - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_phy_set_a, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_phy_set_b, tvb, offset, 1, FALSE); - tlv_item = proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_harq_parameters_set, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_mac_set_a, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_mac_set_b, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_reserved, tvb, offset, 1, FALSE); - } - break; - case SBC_TLV_T_162_HARQ_INCREMENTAL_REDUNDANCY_BUFFER_CAPABILITY: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_NEP, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_aggregation_flag_for_dl, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_reserved1, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_ul_harq_incremental_redundancy_buffer_capability_NEP, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_aggregation_flag_for_ul, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_reserved2, tvb, offset, 2, FALSE); - break; - case SBC_TLV_T_163_HARQ_CHASE_COMBINING_AND_CC_IR_BUFFER_CAPABILITY: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_dl_harq_buffering_capability_for_chase_combining, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_aggregation_flag_dl, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_reserved1, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_ul_harq_buffering_capability_for_chase_combining, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_aggregation_flag_ul, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_reserved2, tvb, offset, 2, FALSE); - break; - case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETERS: - /* display Security Negotiation Parameters Title */ - /* add Security Negotiation Parameters subtree */ - tlv_tree = add_protocol_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, proto_mac_mgmt_msg_sbc_decoder, tvb, offset, tlv_len, "Security Negotiation Parameters (%u bytes)", tlv_len); - /* call the Security Negotiation Parameters decoder */ - wimax_security_negotiation_parameters_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree); - break; - case SBC_TLV_T_26_POWER_SAVE_CLASS_TYPES_CAPABILITY: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_power_save_class_types_capability, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_power_save_class_types_capability_bit0, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_power_save_class_types_capability_bit1, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_power_save_class_types_capability_bit2, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_power_save_class_types_capability_bits34, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_power_save_class_types_capability_bits567, tvb, offset, 1, FALSE); - break; - default: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_power_save_class_types_capability, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - 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 */ - } -} - -/* Wimax Mac SBC-RSP Message Dissector */ -void dissect_mac_mgmt_msg_sbc_rsp_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 ssttg, ssrtg;*/ - guint num_dl_harq_chans; /*, num_ul_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; + &ett_mac_mgmt_msg_sbc_decoder, + &ett_sbc_req_tlv_subtree, + &ett_sbc_rsp_tlv_subtree, + }; - /* Ensure the right payload type */ - payload_type = tvb_get_guint8(tvb, offset); - if (payload_type != MAC_MGMT_MSG_SBC_RSP) - { - return; - } + 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 */ + ); - if (tree) - { /* we are being asked for details */ - /* Get the tvb reported length */ - tvb_len = tvb_reported_length(tvb); - /* display MAC payload type SBC-RSP */ - sbc_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_sbc_decoder, tvb, offset, tvb_len, "SS Basic Capability Response (SBC-RSP) (%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 Response (SBC-RSP) */ - /* display the Message Type */ - proto_tree_add_item(sbc_tree, hf_sbc_rsp_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-RSP 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-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 SBC TLV Encoded information */ - switch (tlv_type) - { - case SBC_BW_ALLOC_SUPPORT: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_bw_alloc_support, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_bw_alloc_support_rsvd0, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_bw_alloc_support_duplex, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_bw_alloc_support_rsvd1, tvb, offset, 1, FALSE); - break; - case SBC_TRANSITION_GAPS: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_transition_gaps, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - ti = proto_tree_add_item(tlv_tree, hf_sbc_ssttg, tvb, offset, 1, FALSE); - proto_item_append_text(ti, " us (ranges: TDD 0-50; H-FDD 0-100)"); - ti = proto_tree_add_item(tlv_tree, hf_sbc_ssrtg, tvb, (offset + 1), 1, FALSE); - proto_item_append_text(ti, " us (ranges: TDD 0-50; H-FDD 0-100)"); - break; - case SBC_MAC_PDU: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_mac_pdu, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_mac_pdu_piggybacked, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_mac_pdu_fsn, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_mac_pdu_rsvd, tvb, offset, 1, FALSE); - break; - case SBC_REQ_MAX_TRANSMIT_POWER: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_max_transmit_power, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - power_bpsk = (gfloat)(tvb_get_guint8(tvb, offset) - 128) / 2; - power_qpsk = (gfloat)(tvb_get_guint8(tvb, (offset + 1)) - 128) / 2; - power_qam16 = (gfloat)(tvb_get_guint8(tvb, (offset + 2)) - 128) / 2; - power_qam64 = (gfloat)(tvb_get_guint8(tvb, (offset + 3)) - 128) / 2; - proto_tree_add_text(tlv_tree, tvb, offset, 1, "BPSK: %.2f dBm", (gdouble)power_bpsk); - proto_tree_add_text(tlv_tree, tvb, (offset + 1), 1, "QPSK: %.2f dBm", (gdouble)power_qpsk); - proto_tree_add_text(tlv_tree, tvb, (offset + 2), 1, "QAM16: %.2f dBm", (gdouble)power_qam16); - proto_tree_add_text(tlv_tree, tvb, (offset + 3), 1, "QAM64: %.2f dBm", (gdouble)power_qam64); - break; - case SBC_REQ_CURR_TRANSMITTED_POWER: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_curr_transmit_power, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - value = tvb_get_guint8(tvb, offset); - current_power = (gfloat)(value - 128) / 2; - proto_tree_add_text(tlv_tree, tvb, offset, 1, "Current Transmitted Power: %.2f dBm (Value: 0x%x)", (gdouble)current_power, value); - break; - case SBC_SS_FFT_SIZES: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_ss_fft_sizes, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - if (include_cor2_changes) - { - proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_rsvd1, tvb, offset, 1, FALSE); - } else { - proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_256, tvb, offset, 1, FALSE); - } - proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_2048, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_128, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_512, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_1024, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_rsvd2, tvb, offset, 1, FALSE); - break; - case SBC_SS_DEMODULATOR: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_ss_demodulator, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - if (tlv_len == 1) /* && (num_dl_harq_chans < 8)) */ - { - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_64qam, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_btc, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_ctc, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_stc, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_cc_with_optional_interleaver, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_chase, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_ctc_ir, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_reserved, tvb, offset, 1, FALSE); - } - else - { - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_64qam_2, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_btc_2, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_ctc_2, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_stc_2, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_cc_with_optional_interleaver_2, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_chase_2, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_ctc_ir_2, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_reserved_2, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_cc_ir_2, tvb, offset , 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_ldpc_2, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_dedicated_pilots_2, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_reserved1_2, tvb, offset, 2, FALSE); - } - break; - case SBC_SS_MODULATOR: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, hf_sbc_ss_modulator, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_64qam, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_btc, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_ctc, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_stc, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_harq_chase, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_ctc_ir, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_cc_ir, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_ldpc, tvb, offset, 1, FALSE); - break; - case SBC_SS_NUM_UL_ARQ_ACK_CHANNEL: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_number_ul_arq_ack_channel, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_number_ul_arq_ack_channel, tvb, offset, tlv_len, FALSE); - break; - case SBC_SS_NUM_DL_ARQ_ACK_CHANNEL: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_number_dl_arq_ack_channel, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - /* get and save the value */ - num_dl_harq_chans = tvb_get_guint8(tvb, offset); - proto_tree_add_item(tlv_tree, hf_sbc_number_dl_arq_ack_channel, tvb, offset, tlv_len, FALSE); - break; - case SBC_SS_PERMUTATION_SUPPORT: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_ss_permutation_support, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_ss_optimal_pusc, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_optimal_fusc, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_amc_1x6, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_amc_2x3, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_amc_3x2, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_amc_with_harq_map, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_tusc1_support, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_tusc2_support, tvb, offset, 1, FALSE); - break; - case SBC_SS_DEMODULATOR_MIMO_SUPPORT: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_ss_demodulator_mimo_support, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_a, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_b_vertical, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_b_horizontal, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_a, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_b_vertical, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_b_horizontal, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_c_vertical, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_c_horizontal, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_rsvd, tvb, offset, 2, FALSE); - break; - case SBC_SS_MIMO_UPLINK_SUPPORT: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_ss_mimo_uplink_support, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_ss_mimo_uplink_support_2_ann_sttd, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_mimo_uplink_support_2_ann_sm_vertical, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_mimo_uplink_support_1_ann_coop_sm, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_mimo_uplink_support_rsvd, tvb, offset, 1, FALSE); - break; - case SBC_SS_OFDMA_AAS_PRIVATE_MAP_SUPPORT: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_ss_ofdma_aas_private, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_harq_map_capability, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_map_support, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_reduced_private_map_support, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_chain_enable, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_map_dl_frame_offset, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_ul_frame_offset, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_map_concurrency, tvb, offset, 1, FALSE); - break; - case SBC_SS_OFDMA_AAS_CAPABILITIES: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_ofdma_aas_capabilities, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_aas_zone, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_aas_diversity_map_scan, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_aas_fbck_rsp_support, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_downlink_aas_preamble, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_uplink_aas_preamble, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_aas_capabilities_rsvd, tvb, offset, 2, FALSE); - break; - case SBC_SS_CINR_MEASUREMENT_CAPABILITY: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_ss_cinr_measure_capability, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_ss_phy_cinr_measurement_preamble, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_phy_cinr_measurement_permutation_zone_from_pilot_subcarriers, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_phy_cinr_measurement_permutation_zone_from_data_subcarriers, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_effective_cinr_measurement_preamble, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_effective_cinr_measurement_permutation_zone_from_pilot_subcarriers, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_effective_cinr_measurement_permutation_zone_from_data_subcarriers, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_support_2_concurrent_cqi_channels,tvb,offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ss_frequency_selectivity_characterization_report,tvb,offset, 1, FALSE); - break; - case SBC_PKM_FLOW_CONTROL: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_pkm_flow_control, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - tlv_item = proto_tree_add_item(tlv_tree, hf_sbc_pkm_flow_control, tvb, offset, tlv_len, FALSE); - if (tvb_get_guint8(tvb, offset) == 0) - { - proto_item_append_text(tlv_item, " (default - no limit)"); - } - break; - case SBC_AUTH_POLICY_SUPPORT: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_auth_policy, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_privacy_802_16, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_privacy_rsvd, tvb, offset, 1, FALSE); - break; - case SBC_MAX_SECURITY_ASSOCIATIONS: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_max_security_associations, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_max_security_associations, tvb, offset, tlv_len, FALSE); - break; - case SBC_TLV_T_27_EXTENSION_CAPABILITY: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_27_extension_capability, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_27_extension_capability_bit0, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_27_extension_capability_reserved, tvb, offset, 1, FALSE); - break; - case SBC_TLV_T_28_HO_TRIGGER_METRIC_SUPPORT: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support_bit0, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support_bit1, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support_bit2, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support_bit3, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support_reserved, tvb, offset, 1, FALSE); - break; - case SBC_TLV_T_167_ASSOCIATION_SUPPORT: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_167_association_type_support, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_bit0, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_bit1, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_bit2, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_bit3, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_bit4, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_reserved, tvb, offset, 1, FALSE); - break; - case SBC_TLV_T_170_UPLINK_POWER_CONTROL_SUPPORT: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_ofdma_ss_uplink_power_control_support, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_ofdma_ss_uplink_power_control_support_open_loop, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ofdma_ss_uplink_power_control_support_aas_preamble, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_ofdma_ss_uplink_power_control_support_rsvd, tvb, offset, 1, FALSE); - break; - case SBC_TLV_T_171_MINIMUM_NUM_OF_FRAMES: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_171_minimum_num_of_frames, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_171_minimum_num_of_frames, tvb, offset, tlv_len, FALSE); - break; - case SBC_TLV_T_172: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_172, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_harq_map_capability, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_extended_harq_ie_capability, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_sub_map_capability_first_zone, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_sub_map_capability_other_zones, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_dl_region_definition_support, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_reserved, tvb, offset, 1, FALSE); - break; - case SBC_TLV_T_173_UL_CONTROL_CHANNEL_SUPPORT: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_173_ul_ctl_channel_support, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_3_bit_mimo_fast_feedback, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_enhanced_fast_feedback, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_ul_ack, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_reserved, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_uep_fast_feedback, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_measurement_report, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_primary_secondary_fast_feedback, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_diuc_cqi_fast_feedback, tvb, offset, 1, FALSE); - break; - case SBC_TLV_T_174_OFDMA_MS_CSIT_CAPABILITY: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_174_ofdma_ms_csit_capability, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_csit_compatibility_type_a, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_csit_compatibility_type_b, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_power_assignment_capability, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_sounding_rsp_time_capability, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_max_num_simultanous_sounding_instructions, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_ss_csit_type_a_support, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_ss_csit_reserved, tvb, offset, 2, FALSE); - break; - case SBC_TLV_T_175_MAX_NUM_BST_PER_FRM_CAPABILITY_HARQ: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_175_max_num_bst_per_frm_capability_harq, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_175_max_num_ul_harq_bst, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_175_max_num_ul_harq_per_frm_include_one_non_harq_bst, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_175_max_num_dl_harq_bst_per_harq_per_frm, tvb, offset, 1, FALSE); - break; - case SBC_TLV_T_176: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_176, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit0, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit1, tvb, offset, 3, FALSE); - if (include_cor2_changes) - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit2_cor2, tvb, offset, 3, FALSE); - else - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit2, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit3, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit4, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit5, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit6, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit7, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit8, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit9, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit10, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit11, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit12, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit13, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit14, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit15, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit16, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit17, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit18, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit19, tvb, offset, 3, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_reserved, tvb, offset, 3, FALSE); - break; - case SBC_TLV_T_177_OFDMA_SS_MODULATOR_FOR_MIMO_SUPPORT: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_177_ofdma_ss_modulator_for_mimo_support, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - if (include_cor2_changes) - { - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_stc_matrix_a, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_stc_matrix_b_vertical, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_stc_matrix_b_horizontal, tvb, offset, 1, FALSE); - } else { - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_two_transmit_antennas, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_capable_of_transmit_diversity, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_capable_of_spacial_multiplexing, tvb, offset, 1, FALSE); - } - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_beamforming, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_adaptive_rate_ctl, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_single_antenna, tvb, offset, 1, FALSE); - if (include_cor2_changes) - { - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_collaborative_sm_with_one_antenna, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_collaborative_sm_with_two_antennas, tvb, offset, 1, FALSE); - } else { - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_capable_of_two_antenna, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_rsvd, tvb, offset, 1, FALSE); - } - break; - case SBC_TLV_T_178_SDMA_PILOT_CAPABILITY: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_178_sdma_pilot_capability, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_178_sdma_pilot_pattern_support_for_amc_zone, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_178_reserved, tvb, offset, 1, FALSE); - break; - case SBC_TLV_T_179_OFDMA_MULTIPLE_DL_BURST_PROFILE_CAPABILITY: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_179_ofdma_multiple_dl_burst_profile_support, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_179_dl_bst_profile_for_multiple_fec, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_179_ul_bst_profile_for_multiple_fec, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_179_reserved, tvb, offset, 1, FALSE); - break; - case SBC_TLV_T_204_OFDMA_PARAMETERS_SETS: - if (include_cor2_changes) - { - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_phy_set_a, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_phy_set_b, tvb, offset, 1, FALSE); - tlv_item = proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_harq_parameters_set, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_mac_set_a, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_mac_set_b, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_reserved, tvb, offset, 1, FALSE); - } - break; - case SBC_TLV_T_162_HARQ_INCREMENTAL_REDUNDANCY_BUFFER_CAPABILITY: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_NEP, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_aggregation_flag_for_dl, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_reserved1, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_ul_harq_incremental_redundancy_buffer_capability_NEP, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_aggregation_flag_for_ul, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_reserved2, tvb, offset, 2, FALSE); - break; - case SBC_TLV_T_163_HARQ_CHASE_COMBINING_AND_CC_IR_BUFFER_CAPABILITY: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_dl_harq_buffering_capability_for_chase_combining, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_aggregation_flag_dl, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_reserved1, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_ul_harq_buffering_capability_for_chase_combining, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_aggregation_flag_ul, tvb, offset, 2, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_reserved2, tvb, offset, 2, FALSE); - break; - case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETERS: - /* display Security Negotiation Parameters Title */ - tlv_item = proto_tree_add_protocol_format(sbc_tree, proto_mac_mgmt_msg_sbc_decoder, tvb, offset, tvb_len, "Security Negotiation Parameters (%u bytes)", tvb_len); - /* add Security Negotiation Parameters subtree */ - tlv_tree = proto_item_add_subtree(tlv_item, ett_sbc_rsp_tlv_subtree); - /* call the Security Negotiation Parameters decoder */ - wimax_security_negotiation_parameters_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree); - break; - case SBC_TLV_T_26_POWER_SAVE_CLASS_TYPES_CAPABILITY: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_power_save_class_types_capability, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - proto_tree_add_item(tlv_tree, hf_sbc_power_save_class_types_capability_bit0, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_power_save_class_types_capability_bit1, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_power_save_class_types_capability_bit2, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_power_save_class_types_capability_bits34, tvb, offset, 1, FALSE); - proto_tree_add_item(tlv_tree, hf_sbc_power_save_class_types_capability_bits567, tvb, offset, 1, FALSE); - break; - default: - /* add TLV subtree */ - tlv_tree = add_tlv_subtree(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, hf_sbc_unknown_type, tvb, offset, tlv_len, FALSE); - /* display the detail meanings of the TLV value */ - 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 */ - } + 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,466 +204,6 @@ 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 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 - } - } - }; - - 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) @@ -1215,3 +745,467 @@ void dissect_mac_mgmt_msg_ucd_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_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, + }; + + 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 <glib.h> #include <epan/packet.h> #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,323 +1599,6 @@ 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) @@ -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 <string.h> #include <glib.h> #include <epan/packet.h> @@ -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,560 +368,6 @@ 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 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} - } - }; - - /* 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 @@ -2139,3 +1576,569 @@ guint wimax_extended_diuc_dependent_ie_decoder(proto_tree *tree, packet_info *pi 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} + } + }; + + /* 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 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,615 +365,6 @@ 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} - } - }; - - /* HARQ MAP Reduced CID IE display */ - static hf_register_info hf_rcid[] = - { - { - &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[] = - { - { - &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[] = - { - { - &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} - } - }; - - 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} - } - }; - - static hf_register_info hf_extended_uiuc[] = - { - { /* 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.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 } - } - }; - - if (proto_wimax_compact_ulmap_ie_decoder == -1) - { - 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)); - } -} /* Compact UL-MAP IE Types (table 90) */ #define COMPACT_UL_MAP_TYPE_NORMAL_SUBCHANNEL 0 @@ -2136,3 +1520,622 @@ guint wimax_extended_uiuc_dependent_ie_decoder(proto_tree *tree, packet_info *pi } return ((length + 1) * 2 ); /* length in nibbles */ } + +/* 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} + } + }; + + /* HARQ MAP Reduced CID IE display */ + static hf_register_info hf_rcid[] = + { + { + &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[] = + { + { + &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[] = + { + { + &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} + } + }; + + 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} + } + }; + + static hf_register_info hf_extended_uiuc[] = + { + { /* 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.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 } + } + }; + +#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 + + proto_wimax_compact_ulmap_ie_decoder = proto_wimax; + + 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)); +} diff --git a/plugins/wimax/wimax_fch_decoder.c b/plugins/wimax/wimax_fch_decoder.c index d4a9298520..33b8004f3c 100644 --- a/plugins/wimax/wimax_fch_decoder.c +++ b/plugins/wimax/wimax_fch_decoder.c @@ -40,10 +40,6 @@ extern gint proto_wimax; extern address bs_address; /* declared in packet-wmx.c */ -/* forward reference */ -void proto_register_wimax_fch(void); -static void dissect_wimax_fch_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - static int proto_wimax_fch_decoder = -1; static gint ett_wimax_fch_decoder = -1; @@ -104,11 +100,43 @@ static const value_string coding_indications[] = { 0, NULL } }; -/* Setup protocol subtree array */ -static gint *ett[] = +static void dissect_wimax_fch_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - &ett_wimax_fch_decoder, -}; + gint offset = 0; + proto_item *fch_item = NULL; + proto_tree *fch_tree = NULL; + + /* 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 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)); +} |