📄 plugins-wimax-msg_sbc.c
字号:
plugins/wimax/msg_sbc.c - Google Code Search这是 Google 取自
http://anonsvn.wireshark.org/wireshark/trunk 的 plugins/wimax/msg_sbc.c
缓存副本
Google 和网页作者无关,不对网页的内容负责。
http://anonsvn.wireshark.org/wireshark/trunk/plugins/wimax/
AUTHORS
COPYING
ChangeLog
Makefile.am
Makefile.common
Makefile.nmake
README.wimax
crc.c
crc.h
crc_data.c
mac_hd_generic_decoder.c
mac_hd_type1_decoder.c
mac_hd_type2_decoder.c
mac_mgmt_msg_decoder.c
moduleinfo.h
moduleinfo.nmake
msg_aas_beam.c
msg_aas_fbck.c
msg_arq.c
msg_clk_cmp.c
msg_dcd.c
msg_dlmap.c
msg_dreg.c
msg_dsa.c
msg_dsc.c
msg_dsd.c
msg_dsx_rvd.c
msg_fpc.c
msg_pkm.c
msg_pmc.c
msg_prc_lt_ctrl.c
msg_reg_req.c
msg_reg_rsp.c
msg_rep.c
msg_res_cmd.c
msg_rng_req.c
msg_rng_rsp.c
msg_sbc.c
msg_ucd.c
msg_ulmap.c
packet-wmx.c
plugin.rc.in
wimax_bits.h
wimax_cdma_code_decoder.c
wimax_compact_dlmap_ie_decoder.c
wimax_compact_ulmap_ie_decoder.c
wimax_fch_decoder.c
wimax_ffb_decoder.c
wimax_hack_decoder.c
wimax_harq_map_decoder.c
wimax_mac.h
wimax_pdu_decoder.c
wimax_phy_attributes_decoder.c
wimax_tlv.c
wimax_tlv.h
wimax_utils.c
wimax_utils.h
r_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 (pinfo->cinfo)
{
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 (pinfo->cinfo)
{
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 */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -